From 16042d7fd2102ade19c57cb5f78349a822728be8 Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 21 May 2026 01:09:31 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=BE=E4=BF=AE=20WebUI=20=E7=AC=AC=E5=8D=81?= =?UTF-8?q?=E5=9B=9B=E8=BD=AE=EF=BC=9A=E8=BF=87=E6=B8=A1=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E4=B8=8E=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=94=B6=E6=95=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 主题切换平滑:body 加 200ms color/background 过渡;切换时给 :root 临时加 isThemeSwitching,对所有 chrome 表面(header / card / panel / btn 等 18 类)启用 200ms 过渡;260ms 后移除避免长期影响 - 首屏 .app 容器淡入:220ms fadeIn + 微移 - 移动端 (<640) 收敛:subtitle 隐藏(保留 brandMark + title);footer appConnText 隐藏只留状态点 - cache-bust v16 → v17 --- webui/app.js | 2 ++ webui/index.html | 4 ++-- webui/styles.css | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 2 deletions(-) diff --git a/webui/app.js b/webui/app.js index 5634299..45d15a9 100644 --- a/webui/app.js +++ b/webui/app.js @@ -240,7 +240,9 @@ function initTheme() { btn.addEventListener("click", () => { const next = root.getAttribute("data-theme") === "dark" ? "light" : "dark"; try { localStorage.setItem("ui-theme", next); } catch (_) {} + root.classList.add("isThemeSwitching"); apply(next); + setTimeout(() => root.classList.remove("isThemeSwitching"), 260); }); } diff --git a/webui/index.html b/webui/index.html index 0857616..92d02a8 100644 --- a/webui/index.html +++ b/webui/index.html @@ -15,7 +15,7 @@ } catch (e) {} })(); - +
@@ -1252,6 +1252,6 @@
- + diff --git a/webui/styles.css b/webui/styles.css index 2f5104b..389a540 100644 --- a/webui/styles.css +++ b/webui/styles.css @@ -172,6 +172,31 @@ body { letter-spacing: -0.005em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; + transition: color 200ms ease, background-color 200ms ease; +} + +/* When toggling theme, briefly enable transitions on common chrome surfaces. + The .isThemeSwitching class is added by JS for ~250ms during the toggle. */ +:root.isThemeSwitching .header, +:root.isThemeSwitching .card, +:root.isThemeSwitching .panel, +:root.isThemeSwitching .overviewCard, +:root.isThemeSwitching .stat, +:root.isThemeSwitching .btn, +:root.isThemeSwitching .input, +:root.isThemeSwitching .check, +:root.isThemeSwitching .tabBtn, +:root.isThemeSwitching .table, +:root.isThemeSwitching .tableRow, +:root.isThemeSwitching .logSection, +:root.isThemeSwitching .log, +:root.isThemeSwitching .preview, +:root.isThemeSwitching .reservationItem, +:root.isThemeSwitching .chartBlock, +:root.isThemeSwitching .toast, +:root.isThemeSwitching .appFooter, +:root.isThemeSwitching .workspaceHeader { + transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 200ms ease !important; } @keyframes surfaceIn { @@ -214,6 +239,16 @@ svg { width: min(var(--page-max), 100%); margin: 0 auto; padding: var(--page-pad); + animation: appFadeIn 220ms ease both; +} + +@keyframes appFadeIn { + from { opacity: 0; transform: translateY(2px); } + to { opacity: 1; transform: translateY(0); } +} + +@media (prefers-reduced-motion: reduce) { + .app { animation: none; } } .header { @@ -2841,6 +2876,14 @@ details[open] > summary.sectionTitle::before { --overview-gap: 8px; } + .subtitle { + display: none; + } + + .appConnText { + display: none; + } + .app { padding: var(--page-pad); }