精修 WebUI 第十四轮:过渡动画与移动端收敛

- 主题切换平滑: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
This commit is contained in:
Codex committed 2026-05-21 09:29:38 +08:00
1 parent a40ddc3083
commit 16042d7fd2
3 files changed
+47 -2

No files matched your search

+2
View File
@@ -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);
});
}
+2 -2
View File
@@ -15,7 +15,7 @@
} catch (e) {}
})();
</script>
<link rel="stylesheet" href="styles.css?v=console-20260520-theme-v16" />
<link rel="stylesheet" href="styles.css?v=console-20260520-theme-v17" />
</head>
<body>
<div class="app">
@@ -1252,6 +1252,6 @@
</footer>
</div>
<script src="app.js?v=console-20260520-theme-v16"></script>
<script src="app.js?v=console-20260520-theme-v17"></script>
</body>
</html>
+43
View File
@@ -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);
}