From 63407a921678bed1c9f50133cbfc8a903ac4fee3 Mon Sep 17 00:00:00 2001 From: hehh Date: Mon, 24 Nov 2025 23:46:47 +0800 Subject: [PATCH] =?UTF-8?q?feat(css):=20=E4=BC=98=E5=8C=96=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E5=88=87=E6=8D=A2=E5=9B=BE=E6=A0=87=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 调整图标显示规则,确保日夜模式下图标正确隐藏 - 移除重复的图标隐藏样式定义 - 删除已弃用的MBTI标签渐变色样式 - 保持样式代码结构清晰一致 --- css/about.css | 51 ++++++++------------------------------------------- js/about.js | 4 ++-- 2 files changed, 10 insertions(+), 45 deletions(-) diff --git a/css/about.css b/css/about.css index 8d78db2..5bedd0f 100644 --- a/css/about.css +++ b/css/about.css @@ -147,6 +147,14 @@ body { text-shadow: 0 0 10px var(--accent); } +[data-theme="day"] .icon-sun { + display: none; +} + +[data-theme="night"] .icon-moon { + display: none; +} + /* ========================================= 3. Navigation @@ -250,14 +258,6 @@ body { .action-btn:active { transform: translateY(0); } - - [data-theme="day"] .icon-sun { - display: none; - } - - [data-theme="night"] .icon-moon { - display: none; - } } /* ========================================= @@ -646,33 +646,6 @@ body { max-width: 100%; } -.mbti-tags .tag.tag-color-1 { - background: var(--gradient-1); - -webkit-background-clip: text; - background-clip: text; - color: transparent; -} - -.mbti-tags .tag.tag-color-2 { - background: var(--gradient-2); - -webkit-background-clip: text; - background-clip: text; - color: transparent; -} - -.mbti-tags .tag.tag-color-3 { - background: var(--gradient-3); - -webkit-background-clip: text; - background-clip: text; - color: transparent; -} - -.mbti-tags .tag.tag-color-4 { - background: var(--gradient-4); - -webkit-background-clip: text; - background-clip: text; - color: transparent; -} /* --- Tech Stack (PC) --- */ .area-tech { @@ -1479,14 +1452,6 @@ body { .action-btn:active { transform: translateY(0); } - - [data-theme="day"] .icon-sun { - display: none; - } - - [data-theme="night"] .icon-moon { - display: none; - } } /* ========================================= diff --git a/js/about.js b/js/about.js index 2a81531..69ca1ee 100644 --- a/js/about.js +++ b/js/about.js @@ -182,7 +182,7 @@ class ThemeManager { init() { let theme = getStoredTheme(); - if (theme === 'night') this.root.setAttribute('data-theme', 'night'); + if (theme) this.root.setAttribute('data-theme', theme); $('#theme-btn').toggleClass('is-active', theme === 'night'); const langForTitle = getStoredLanguage(); const titleText = theme === 'night' ? (langForTitle === 'zh' ? '白天模式' : 'Day') : (langForTitle === 'zh' ? '黑夜模式' : 'Night'); @@ -191,7 +191,7 @@ class ThemeManager { $('#theme-btn').on('click', () => { const curr = this.root.getAttribute('data-theme'); const next = curr === 'night' ? 'day' : 'night'; - if (next === 'night') this.root.setAttribute('data-theme', 'night'); + if (next) this.root.setAttribute('data-theme', next); else this.root.removeAttribute('data-theme'); setStoredTheme(next) $('#theme-btn').toggleClass('is-active', next === 'night');