Skip to content

Commit 5c2bf42

Browse files
committed
better ui
1 parent 430623d commit 5c2bf42

7 files changed

Lines changed: 92 additions & 15 deletions

File tree

app/app.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,10 @@ useSeoMeta({
5858
</template>
5959

6060
<template #right>
61-
<UButton
62-
to="https://github.com/alephpi/Texo-web"
63-
target="_blank"
64-
icon="i-simple-icons-github"
65-
aria-label="GitHub"
66-
color="neutral"
67-
variant="ghost"
61+
<VVersion
62+
url="https://github.com/alephpi/Texo-web"
63+
commit="__COMMIT__"
64+
date="__BUILD_DATE__"
6865
/>
6966
</template>
7067
</UFooter>

app/components/AppHeader.vue

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,28 @@ const items = computed<NavigationMenuItem[]>(() => [{
4747
target="_blank"
4848
icon="i-simple-icons-github"
4949
aria-label="GitHub"
50-
color="neutral"
50+
color="info"
51+
variant="ghost"
52+
/>
53+
<UButton
54+
to="https://github.com/alephpi/Texo-web"
55+
target="_blank"
56+
icon="i-simple-icons-github"
57+
aria-label="GitHub"
58+
color="primary"
59+
variant="ghost"
60+
/>
61+
<UButton
62+
to="https://www.bilibili.com/video/BV1qX1TBFEee/"
63+
target="_blank"
64+
icon="i-simple-icons-bilibili"
65+
aria-label="GitHub"
66+
class="text-[#ff6699] hover:text-[#ff8cb0] hover:bg-color-[#ff8cb0]"
5167
variant="ghost"
5268
/>
5369
<img
5470
alt="GitHub Repo stars"
55-
src="https://img.shields.io/github/stars/alephpi/Texo"
71+
src="https://img.shields.io/github/stars/alephpi/texo?style=plastic"
5672
>
5773
</template>
5874
</UHeader>

app/components/VVersion.vue

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<template>
2+
<UFieldGroup>
3+
<UBadge
4+
variant="soft"
5+
color="neutral"
6+
>
7+
Commit
8+
</UBadge>
9+
<UBadge
10+
variant="soft"
11+
color="info"
12+
>
13+
<a :href=" props.url + '/commit/' + props.commit ">
14+
{{ props.commit.slice(0, 7) }}
15+
</a>
16+
</UBadge>
17+
</UFieldGroup>
18+
<UFieldGroup>
19+
<UBadge
20+
variant="soft"
21+
color="neutral"
22+
>
23+
Build
24+
</UBadge>
25+
<UBadge
26+
variant="soft"
27+
color="info"
28+
>
29+
{{ date }}
30+
</UBadge>
31+
</UFieldGroup>
32+
</template>
33+
34+
<script lang="ts" setup>
35+
const props = defineProps<{
36+
url: string
37+
commit: string
38+
date: string
39+
}>()
40+
</script>

app/pages/index.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ const links = computed<ButtonProps[]>(() => [
1818
size: 'xl',
1919
color: 'neutral',
2020
variant: 'subtle'
21+
}, {
22+
label: 'Bilibili',
23+
to: 'https://www.bilibili.com/video/BV1qX1TBFEee/',
24+
target: '_blank',
25+
icon: 'i-simple-icons-bilibili',
26+
size: 'xl',
27+
class: 'bg-[#ff6699] hover:bg-[#ff8cb0]'
2128
}
2229
])
2330
</script>

nuxt.config.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// https://nuxt.com/docs/api/configuration/nuxt-config
22
import copyKatexFonts from './utils/copy-katex-font'
3+
import replace from '@rollup/plugin-replace'
4+
import { execSync } from 'child_process'
35

46
export default defineNuxtConfig({
57
modules: [
@@ -8,6 +10,7 @@ export default defineNuxtConfig({
810
'@nuxtjs/i18n',
911
'@vite-pwa/nuxt'
1012
],
13+
1114
ssr: true,
1215
components: true,
1316

@@ -22,6 +25,17 @@ export default defineNuxtConfig({
2225
}
2326
},
2427
compatibilityDate: '2025-01-15',
28+
vite: {
29+
plugins: [
30+
replace({
31+
preventAssignment: true,
32+
values: {
33+
__COMMIT__: execSync('git rev-parse HEAD').toString().trim(),
34+
__BUILD_DATE__: new Date().toLocaleString()
35+
}
36+
})
37+
]
38+
},
2539
hooks: {
2640
ready: (nuxt) => {
2741
copyKatexFonts(nuxt.options.rootDir)
@@ -35,7 +49,6 @@ export default defineNuxtConfig({
3549
}
3650
}
3751
},
38-
3952
i18n: {
4053
locales: [
4154
{ code: 'zh-CN', name: '中文', file: 'zh-CN.json' },

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
},
2828
"devDependencies": {
2929
"@nuxt/eslint": "^1.9.0",
30+
"@rollup/plugin-replace": "^6.0.3",
3031
"eslint": "^9.37.0",
3132
"sass": "^1.94.2",
3233
"typescript": "^5.9.3",

pnpm-lock.yaml

Lines changed: 8 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)