Skip to content

Commit 688a949

Browse files
authored
Merge pull request #40 from PysioHub/main
feat: 完成火神80HUB
2 parents 06fcf7c + 066217a commit 688a949

File tree

5 files changed

+113
-1
lines changed

5 files changed

+113
-1
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "Vue-blog-API"]
2+
path = Vue-blog-API
3+
url = git@github.com:pysio2007/Vue-blog-API.git

Vue-blog-API

Submodule Vue-blog-API added at 8b14d51

src/.vuepress/client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import AsciinemaPlayer from './components/AsciinemaPlayer.vue';
55
import Fastfetch from "./components/Fastfetch.vue";
66
import OnlineOrDead from "./components/OnlineOrDead.vue";
77
import SteamStatus from "./components/SteamStatus.vue";
8+
import HuoShen80Hub from "./components/HuoShen80Hub.vue";
89

910

1011
export default defineClientConfig({
@@ -15,5 +16,6 @@ export default defineClientConfig({
1516
app.component('Fastfetch',Fastfetch);
1617
app.component('OnlineOrDead',OnlineOrDead);
1718
app.component("SteamStatus", SteamStatus);
19+
app.component("HuoShen80Hub", HuoShen80Hub);
1820
},
1921
});
Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,76 @@
1-
<!-- 展示Github项目 https://github.com/pysio2007/HuoShen80Hub 中的图片 -->
1+
<!-- 展示Github项目 https://github.com/pysio2007/HuoShen80Hub 中的图片 -->
2+
3+
<template>
4+
<div class="image-gallery">
5+
<div v-for="(url, index) in sortedUrls" :key="index">
6+
<h3>{{ getFileName(url) }}</h3>
7+
<div v-if="info[getFileName(url)]" class="hint-container info">
8+
<p class="hint-container-title">相关信息</p>
9+
<p>{{ info[getFileName(url)] }}</p>
10+
</div>
11+
<img :src="url" :alt="getFileName(url)">
12+
</div>
13+
</div>
14+
</template>
15+
16+
<script>
17+
import { ref, onMounted, computed } from 'vue'
18+
19+
export default {
20+
name: 'HuoShen80Hub',
21+
setup() {
22+
const urls = ref([])
23+
const info = ref({})
24+
25+
const fetchUrls = async () => {
26+
try {
27+
const response = await fetch('https://cdn.akaere.online/raw.githubusercontent.com/pysio2007/HuoShen80Hub/refs/heads/master/url.csv')
28+
const text = await response.text()
29+
urls.value = text.split('\n').filter(url => url.trim() !== '')
30+
} catch (error) {
31+
console.error('Error fetching URLs:', error)
32+
}
33+
}
34+
35+
const fetchInfo = async () => {
36+
try {
37+
const response = await fetch('https://cdn.akaere.online/raw.githubusercontent.com/pysio2007/HuoShen80Hub/refs/heads/master/info.json')
38+
info.value = await response.json()
39+
} catch (error) {
40+
console.error('Error fetching info:', error)
41+
}
42+
}
43+
44+
const getFileName = (url) => {
45+
return url.split('/').pop()
46+
}
47+
48+
const sortedUrls = computed(() => {
49+
return [...urls.value].sort((a, b) => {
50+
const fileNameA = getFileName(a).toLowerCase()
51+
const fileNameB = getFileName(b).toLowerCase()
52+
return fileNameA.localeCompare(fileNameB)
53+
})
54+
})
55+
56+
onMounted(() => {
57+
fetchUrls()
58+
fetchInfo()
59+
})
60+
61+
return {
62+
sortedUrls,
63+
info,
64+
getFileName
65+
}
66+
}
67+
}
68+
</script>
69+
70+
<style scoped>
71+
.image-gallery img {
72+
max-width: 100%;
73+
height: auto;
74+
}
75+
76+
</style>

src/posts/daily/HuoShen80Hub.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: 火神80群里的梗图
3+
date: 2024-10-11
4+
icon: fa-regular fa-image
5+
category: daily
6+
tag:
7+
- 火神
8+
- 日常
9+
---
10+
11+
<!-- markdownlint-disable MD028 -->
12+
13+
> [!info]
14+
> 这里会随机展示一些火神80群里的梗图
15+
16+
<!-- markdownlint-enable MD028 -->
17+
18+
<!-- more -->
19+
20+
## 图片展示
21+
22+
<HuoShen80Hub />
23+
24+
## 特别鸣谢
25+
<VPCard
26+
title="huoshen80"
27+
desc="梗图来源群的群主(x"
28+
logo="https://cdn.akaere.online/https://avatars.githubusercontent.com/u/61808984"
29+
link="https://github.com/huoshen80"
30+
background="rgba(236, 244, 250)"
31+
/>

0 commit comments

Comments
 (0)