From 6aa3157c180864615ac1f9fe29b861cfc7af05d8 Mon Sep 17 00:00:00 2001 From: zyronon Date: Sun, 24 Aug 2025 01:41:32 +0800 Subject: [PATCH] feat:add home page --- README.md | 6 +- components.d.ts | 1 + docs/README.en.md | 3 +- {docs => public}/article.png | Bin {docs => public}/word.png | Bin src/config/ENV.ts | 1 + src/pages/pc/components/Book.vue | 2 +- src/pages/pc/components/CollectNotice.vue | 3 +- src/pages/pc/home/HomeIndex.vue | 27 ----- src/pages/pc/home/index.vue | 122 ++++++++++++++++++++++ src/pages/pc/index.vue | 4 + src/router.ts | 5 +- 12 files changed, 139 insertions(+), 35 deletions(-) rename {docs => public}/article.png (100%) rename {docs => public}/word.png (100%) delete mode 100644 src/pages/pc/home/HomeIndex.vue create mode 100644 src/pages/pc/home/index.vue diff --git a/README.md b/README.md index b3398d77..abd39835 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@

- 练习英语,一次敲击,一点进步;一个可以在网页上背单词、背文章的网站, + 学习英语,一次敲击,一点进步;记忆不再盲目,学习更高效,开源单词与文章练习工具

@@ -21,8 +21,8 @@ TypeWords | Trendshift -![image](/docs/word.png) -![image](/docs/article.png) +![image](/public/word.png) +![image](/public/article.png) ## 在线访问 diff --git a/components.d.ts b/components.d.ts index fcd2cbec..32d5fcee 100644 --- a/components.d.ts +++ b/components.d.ts @@ -46,6 +46,7 @@ declare module 'vue' { IconFluentEye16Regular: typeof import('~icons/fluent/eye16-regular')['default'] IconFluentEyeOff16Regular: typeof import('~icons/fluent/eye-off16-regular')['default'] IconFluentHeadphones20Regular: typeof import('~icons/fluent/headphones20-regular')['default'] + IconFluentHome20Regular: typeof import('~icons/fluent/home20-regular')['default'] IconFluentKeyboardLayoutFloat20Regular: typeof import('~icons/fluent/keyboard-layout-float20-regular')['default'] IconFluentMailEdit20Regular: typeof import('~icons/fluent/mail-edit20-regular')['default'] IconFluentMyLocation20Regular: typeof import('~icons/fluent/my-location20-regular')['default'] diff --git a/docs/README.en.md b/docs/README.en.md index 4193469c..ed33e1fc 100644 --- a/docs/README.en.md +++ b/docs/README.en.md @@ -24,7 +24,8 @@ Practice English, one strike, one step forward TypeWords | Trendshift -![image](/docs/word.png)![image](/docs/article.png) +![image](/public/word.png) +![image](/public/article.png) ## Online visit diff --git a/docs/article.png b/public/article.png similarity index 100% rename from docs/article.png rename to public/article.png diff --git a/docs/word.png b/public/word.png similarity index 100% rename from docs/word.png rename to public/word.png diff --git a/src/config/ENV.ts b/src/config/ENV.ts index e40c01b6..0335c573 100644 --- a/src/config/ENV.ts +++ b/src/config/ENV.ts @@ -1,4 +1,5 @@ export const GITHUB = 'https://github.com/zyronon/TypeWords' +export const ProjectName = 'Type Words' const common = { word_dict_list_version: 1 diff --git a/src/pages/pc/components/Book.vue b/src/pages/pc/components/Book.vue index 2438d52c..73ece426 100644 --- a/src/pages/pc/components/Book.vue +++ b/src/pages/pc/components/Book.vue @@ -33,7 +33,7 @@ const studyProgress = $computed(() => {

{{ item?.name }}
{{ item?.description }}
-
+
{{ studyProgress }}{{ item?.length }}{{ quantifier }}
diff --git a/src/pages/pc/components/CollectNotice.vue b/src/pages/pc/components/CollectNotice.vue index 5b5d500a..2c1ffe98 100644 --- a/src/pages/pc/components/CollectNotice.vue +++ b/src/pages/pc/components/CollectNotice.vue @@ -6,6 +6,7 @@ import {watch} from "vue"; import {useSettingStore} from "@/stores/setting.ts"; import {isMobile} from "@/utils"; +import {ProjectName} from "@/config/ENV.ts"; let settingStore = useSettingStore() let showNotice = $ref(false) @@ -44,7 +45,7 @@ watch(() => settingStore.load, (n) => { v-if="show">
坚持练习,提高外语能力。将 - 「Type Words」 + 「{{ ProjectName}}」 保存为书签,永不迷失!
diff --git a/src/pages/pc/home/HomeIndex.vue b/src/pages/pc/home/HomeIndex.vue deleted file mode 100644 index 9d5c3d8b..00000000 --- a/src/pages/pc/home/HomeIndex.vue +++ /dev/null @@ -1,27 +0,0 @@ - - - diff --git a/src/pages/pc/home/index.vue b/src/pages/pc/home/index.vue new file mode 100644 index 00000000..f0ee4c94 --- /dev/null +++ b/src/pages/pc/home/index.vue @@ -0,0 +1,122 @@ + + + + diff --git a/src/pages/pc/index.vue b/src/pages/pc/index.vue index 338b0fe1..b1c3f876 100644 --- a/src/pages/pc/index.vue +++ b/src/pages/pc/index.vue @@ -22,6 +22,10 @@ const {toggleTheme} = useTheme()
+
+ + 主页 +
单词 diff --git a/src/router.ts b/src/router.ts index c1a43644..13769c6a 100644 --- a/src/router.ts +++ b/src/router.ts @@ -11,14 +11,15 @@ import BookDetail from "@/pages/pc/article/BookDetail.vue"; import DictList from "@/pages/pc/word/DictList.vue"; import BookList from "@/pages/pc/article/BookList.vue"; import Setting from "@/pages/pc/setting/Setting.vue"; +import Home from "@/pages/pc/home/index.vue"; export const routes: RouteRecordRaw[] = [ { path: '/', component: PC, - redirect: '/word', + redirect: '/', children: [ - // {path: 'home', component: HomeIndex}, + {path: '/', component: Home}, {path: 'words', component: WordHomePage}, {path: 'word', redirect: '/words'}, {path: 'dict-list', component: DictList},