From aaf326ed1fcef10d78c80b35b32bb6da553721fe Mon Sep 17 00:00:00 2001 From: qingfeng1121 Date: Mon, 29 Sep 2025 18:39:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=A0=B7=E5=BC=8F=E5=92=8C?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=9A=E6=B7=BB=E5=8A=A0=E8=83=8C=E6=99=AF?= =?UTF-8?q?=E5=9B=BE=E3=80=81=E6=89=93=E5=AD=97=E6=9C=BA=E6=95=88=E6=9E=9C?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E7=95=99=E8=A8=80=E6=9D=BF=E5=92=8C?= =?UTF-8?q?=E5=90=90=E6=A7=BD=E5=8C=BA=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/index.css | 21 +- src/index.vue | 410 ++++++++++++------------------------- src/main.js | 1 - src/views/aericle.vue | 5 - src/views/home.vue | 100 ++++----- src/views/leftmodlue.vue | 115 +++++++---- src/views/messageboard.vue | 176 ++++++++++++---- src/views/nonsense.vue | 113 +++++++++- 8 files changed, 519 insertions(+), 422 deletions(-) diff --git a/src/assets/index.css b/src/assets/index.css index c0b9ea2..c096faa 100644 --- a/src/assets/index.css +++ b/src/assets/index.css @@ -72,6 +72,7 @@ /* 页面背景设置 */ body { + background-image: url('../img/8.21.1.jpg'); background-size: 120% 120%; /* 背景图片缩放比例 */ background-repeat: no-repeat; @@ -179,7 +180,11 @@ p { display: flex; border-right: 0; } - +/* 内容通用背景区样式 */ +#allstyle { + background-color: rgba(255, 255, 255, 0.85); + border-radius: 10px; +} /* 内容区样式 */ #content-section { min-height: 100vh; @@ -231,6 +236,19 @@ p { height: var(--hero-height-small); } +/* 打字机效果 */ +.typewriter { + white-space: pre; + min-height: 2.5em; + font-size: var(--title-font-size, 2rem); +} + +@keyframes blink { + 50% { + border-color: transparent; + } +} + /* hero 主标题样式 */ .hero h1 { font-size: var(--title-font-size); @@ -282,6 +300,7 @@ p { --content-margin: 0; --leftmodlue-width: 100%; --nonsense-title-width: 95%; + --nav-padding-small: 0 8px; } .elrow-top { diff --git a/src/index.vue b/src/index.vue index a81b7db..dc338f9 100644 --- a/src/index.vue +++ b/src/index.vue @@ -3,14 +3,12 @@
-
清疯不颠
- + 首页 @@ -35,7 +33,7 @@
-

如果感到累了撸一管就好了

+

{{ heroText }}

@@ -54,309 +52,161 @@
- - \ No newline at end of file + \ No newline at end of file diff --git a/src/main.js b/src/main.js index 1441449..a64334a 100644 --- a/src/main.js +++ b/src/main.js @@ -2,7 +2,6 @@ import { createApp } from 'vue' import App from './App.vue' import Router from './router/Router' import './assets/index.css' - const app = createApp(App) app.use(Router) app.mount('#app') \ No newline at end of file diff --git a/src/views/aericle.vue b/src/views/aericle.vue index 29a3de6..9261b7f 100644 --- a/src/views/aericle.vue +++ b/src/views/aericle.vue @@ -89,11 +89,6 @@ const datas = [ ] diff --git a/src/views/leftmodlue.vue b/src/views/leftmodlue.vue index bfcbc69..f2db8bb 100644 --- a/src/views/leftmodlue.vue +++ b/src/views/leftmodlue.vue @@ -14,7 +14,7 @@

左眼右右眼左,四十五度成就美

- + @@ -52,127 +52,158 @@ import { reactive, ref, onMounted, onUnmounted } from 'vue' import { useRouter } from 'vue-router' +// 当前激活菜单 +const activeIndex = ref('/:type') const router = useRouter() const activeName = ref('first') const state = reactive({ - circleUrl: - 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png', - squareUrl: - 'https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png', + circleUrl: 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png', + squareUrl: 'https://cube.elemecdn.com/9/c2/f0ee8a3c7c9638a54940382568c9dpng.png', sizeList: ['small', '', 'large'] as const, }) -const handleSelect = (key: string, keyPath: string[]) => { - router.push({ - path: key - }) +// 处理菜单选择跳转 +const handleSelect = (key: string) => { + router.push({ path: key }) } -// 滚动事件 -const scrollY = ref(false); -const handleScroll = () => { - const scrollYmo = window.scrollY; - scrollY.value = scrollYmo > 1100; -}; -window.addEventListener('scroll', handleScroll); +// 路由切换时同步菜单高亮 +router.beforeEach((to) => { + activeIndex.value = to.path +}) + +// 控制底部模块吸顶效果 +const scrollY = ref(false) +const handleScroll = () => { + scrollY.value = window.scrollY > 1100 +} + +// 生命周期管理事件监听,防止内存泄漏 +onMounted(() => { + window.addEventListener('scroll', handleScroll) +}) + +onUnmounted(() => { + window.removeEventListener('scroll', handleScroll) +}) \ No newline at end of file diff --git a/src/views/nonsense.vue b/src/views/nonsense.vue index 57f2e66..98a560f 100644 --- a/src/views/nonsense.vue +++ b/src/views/nonsense.vue @@ -1,7 +1,114 @@ + + + + \ No newline at end of file