From 160570574c648a4212e033bf7589add3a11fe5d6 Mon Sep 17 00:00:00 2001 From: smallclover <18363998103@163.com> Date: Sat, 11 Oct 2025 10:13:03 +0900 Subject: [PATCH] =?UTF-8?q?1.header=E8=8F=9C=E5=8D=95=E6=A0=8F=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E7=BB=9F=E4=B8=80=202.=E4=BF=AE=E5=A4=8D=E6=9C=AA?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=9A=84=E6=83=85=E5=86=B5=E4=B8=8B=E9=82=80?= =?UTF-8?q?=E8=AF=B7=E9=93=BE=E6=8E=A5=E7=8A=B6=E6=80=81=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend_nuxt/components/HeaderComponent.vue | 149 ++++++++++++++----- frontend_nuxt/plugins/iconpark.client.ts | 2 + 2 files changed, 110 insertions(+), 41 deletions(-) diff --git a/frontend_nuxt/components/HeaderComponent.vue b/frontend_nuxt/components/HeaderComponent.vue index 8b977c513..074eeb9b7 100644 --- a/frontend_nuxt/components/HeaderComponent.vue +++ b/frontend_nuxt/components/HeaderComponent.vue @@ -26,43 +26,59 @@
-
- -
- -
- -
- -
- - 邀请 - -
+ + +
+ + 搜索 +
+
+ + +
+ + 主题 +
+
+ + +
+ + +
+
+ -
- - {{ onlineCount }} +
+ + 在线 + {{ onlineCount }}
+ -
- +
+ + RSS
- + -
- +
+ + 发帖
+ -
- - {{ - unreadMessageCount - }} +
+ + 消息 + {{ unreadMessageCount }}
@@ -192,6 +208,7 @@ const copyInviteLink = async () => { const token = getToken() if (!token) { toast.error('请先登录') + isCopying.value = false // 🔥 修复:未登录时立即复原状态 return } try { @@ -333,7 +350,7 @@ onMounted(async () => { height: var(--header-height); background-color: var(--background-color-blur); backdrop-filter: var(--blur-10); - color: var(--header-text-color); + color: var(--primary-color); border-bottom: 1px solid var(--header-border-color); } @@ -376,6 +393,7 @@ onMounted(async () => { flex-direction: row; align-items: center; gap: 20px; + padding-right: 15px; } .micon { @@ -464,16 +482,14 @@ onMounted(async () => { cursor: pointer; } -.invite_text { - font-size: 12px; - cursor: pointer; - color: var(--primary-color); -} .invite_text:hover { + opacity: 0.8; text-decoration: underline; } +.invite_text, +.online-count, .rss-icon, .new-post-icon, .messages-icon { @@ -484,8 +500,8 @@ onMounted(async () => { .unread-badge { position: absolute; - top: -5px; - right: -10px; + top: -4px; + right: -6px; background-color: #ff4d4f; color: white; border-radius: 50%; @@ -500,8 +516,8 @@ onMounted(async () => { .unread-dot { position: absolute; - top: -2px; - right: -4px; + top: 0; + right: -1px; width: 8px; height: 8px; border-radius: 50%; @@ -513,14 +529,58 @@ onMounted(async () => { } .online-count { - font-size: 14px; - display: flex; - align-items: center; - gap: 5px; - color: var(--primary-color); cursor: default; } +/* === 统一图标按钮风格 === */ +.header-icon-item { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 4px; + font-size: 14px; + color: var(--primary-color); + cursor: pointer; + position: relative; + transition: color 0.25s ease, transform 0.15s ease, opacity 0.2s ease; +} + +.header-icon-item:hover { + opacity: 0.8; + transform: translateY(-1px); +} + +/* 点击时瞬间高亮 + 轻微缩放 */ +.header-icon-item:active { + color: var(--primary-color-hover); + transform: scale(0.92); +} + +.header-icon { + font-size: 20px; + line-height: 1; +} + +.header-label { + font-size: 12px; + line-height: 1; +} + +/* 在线人数的数字文字样式(无背景) */ +.header-badge { + position: absolute; + top: -4px; + right: -6px; + color: var(--primary-color); /* 🔹 使用主题主色 */ + background: none; /* 🔹 去掉背景 */ + font-size: 11px; /* 字体稍微大一点以便清晰 */ + font-weight: 600; /* 加一点权重让数字更醒目 */ + line-height: 1; + padding: 0; /* 去掉内边距 */ +} + + @keyframes rss-glow { 0% { text-shadow: 0 0 0px var(--primary-color); @@ -556,5 +616,12 @@ onMounted(async () => { .header-content-right { gap: 15px; } + /* 手机不显示文字 */ + .header-label { + display: none; + } + .header-badge { + display: none; + } } diff --git a/frontend_nuxt/plugins/iconpark.client.ts b/frontend_nuxt/plugins/iconpark.client.ts index 985cfa6ac..d0ab502d9 100644 --- a/frontend_nuxt/plugins/iconpark.client.ts +++ b/frontend_nuxt/plugins/iconpark.client.ts @@ -29,6 +29,7 @@ import { ApplicationMenu, Search, Copy, + CopyLink, Loading, Rss, MessageEmoji, @@ -111,6 +112,7 @@ export default defineNuxtPlugin((nuxtApp) => { nuxtApp.vueApp.component('ApplicationMenu', ApplicationMenu) nuxtApp.vueApp.component('SearchIcon', Search) nuxtApp.vueApp.component('Copy', Copy) + nuxtApp.vueApp.component('CopyLink', CopyLink) nuxtApp.vueApp.component('Loading', Loading) nuxtApp.vueApp.component('Rss', Rss) nuxtApp.vueApp.component('MessageEmoji', MessageEmoji)