From dce19e166cf25dd02be406b23f95fa155f0bc1ca Mon Sep 17 00:00:00 2001 From: Jeffrey Hsu Date: Sun, 17 Nov 2024 13:05:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90Nuxt=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E8=BF=81=E7=A7=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/card/ArticleCard.vue | 2 +- components/card/FullScreenIntroCard.vue | 9 ++++++--- components/nav/NavBar.vue | 5 ++++- composables/function.ts | 2 +- middleware/maintenance.global.ts | 5 +++++ nuxt.config.ts | 11 +++++++++++ pages/blog.vue | 13 +++++++++++++ pages/diary.vue | 13 +++++++++++++ pages/error/maintenance.vue | 13 +++++++++++++ pages/soft.vue | 13 +++++++++++++ pages/talk.vue | 13 +++++++++++++ 11 files changed, 93 insertions(+), 6 deletions(-) create mode 100644 middleware/maintenance.global.ts create mode 100644 pages/blog.vue create mode 100644 pages/diary.vue create mode 100644 pages/error/maintenance.vue create mode 100644 pages/soft.vue create mode 100644 pages/talk.vue diff --git a/components/card/ArticleCard.vue b/components/card/ArticleCard.vue index 2ea45b4..182b8a2 100644 --- a/components/card/ArticleCard.vue +++ b/components/card/ArticleCard.vue @@ -8,7 +8,7 @@ const props = defineProps<{ const thumbUrl = computed(() => { // 如果文章缩略图为空,则从本地随机获取默认缩略图 props.post.fields.thumb.value = props.post.fields.thumb.value ? props.post.fields.thumb.value : getAssetURL( - `/common/${Math.floor(Math.random() * (7 - 1 + 1)) + 1}.jpg` + `common/${Math.floor(Math.random() * (7 - 1 + 1)) + 1}.jpg` ) return props.post.fields.thumb.value }) diff --git a/components/card/FullScreenIntroCard.vue b/components/card/FullScreenIntroCard.vue index 9b16445..ce58cb9 100644 --- a/components/card/FullScreenIntroCard.vue +++ b/components/card/FullScreenIntroCard.vue @@ -4,6 +4,7 @@ import {computed, ref} from "vue"; // 使用 ref 跟踪鼠标的 x 和 y 坐标 const mouseX = ref(0) const mouseY = ref(0) +const characterUrl = ref("") const typedString = ['Hello, Welcome to this site!^1000', '欢迎访问本网站!^1000'] const littleWidget = [ @@ -29,8 +30,6 @@ const littleWidget = [ } ] -// const characterUrl = "~/assets/images/common/hoshino.png" - // 监听鼠标移动 const handleMouseMove = (event: MouseEvent) => { // 根据窗口大小计算鼠标相对于中心位置的偏移比例 @@ -44,6 +43,10 @@ const debouncedMouseMove = debounce(handleMouseMove, 5) const backgroundStyle = computed(() => ({ backgroundPosition: `${mouseX.value}px ${mouseY.value}px` })) + +onMounted(() => { + characterUrl.value = getAssetURL('common/hoshino.png') +}) \ No newline at end of file diff --git a/pages/diary.vue b/pages/diary.vue new file mode 100644 index 0000000..e44371f --- /dev/null +++ b/pages/diary.vue @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file diff --git a/pages/error/maintenance.vue b/pages/error/maintenance.vue new file mode 100644 index 0000000..bb01b33 --- /dev/null +++ b/pages/error/maintenance.vue @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file diff --git a/pages/soft.vue b/pages/soft.vue new file mode 100644 index 0000000..e44371f --- /dev/null +++ b/pages/soft.vue @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file diff --git a/pages/talk.vue b/pages/talk.vue new file mode 100644 index 0000000..e44371f --- /dev/null +++ b/pages/talk.vue @@ -0,0 +1,13 @@ + + + + + \ No newline at end of file