精修 WebUI v26:HUD 细节 — 把 chrome 全部往"控制台"推
侧边导航 - sideNav 加渐变粉头部 + counter-reset 通道编号;浮动指示条改 3px 粉→青渐变 + 10px glow - tabBtn 左侧加 [01]–[11] mono 计数器(::before 用 counter() 生成);hover 时编号变粉 - tabBtn 右侧加可见性切换的 cyan dot(hover 0.7 / active 1) - active:左渐变背景 + 1px primary 描边 + 编号高亮 + dot glow - icon 颜色 hover/active 跟随 primary 章节标题 - sectionTitle 字体改 JetBrains Mono 10px 0.12em;圆点改"§ 01" 编号 chip(mono、leading-zero、primary 描边) - ::after 加横线延展到右侧,渐变粉→透明 - 配置面板顶层加 counter-reset,每个 panel 内部继承计数 卡片 - cardTitle 加状态 chip(::after):默认 "READY",body.is-running 时切 "● LIVE"(绿色 + glow) - cardTitle .sectionIcon 升级渐变填充 + primary glow 表格 - tableRow 加左侧 hover 渐变 accent stripe(粉→青) - hover 背景从 surface-soft 改 primary-soft 30% 混合 - tableHead 改 JetBrains Mono 10px + primary 色 + 1px primary 描边 + 渐变背景 - mono 字段全局加 ss01 + tnum 预约卡 - 头部加 radial gradient 粉光晕(右上角) - reservationItem hover 时左侧 3px 粉→青渐变 accent + 28px halo + translateY(-1) - reservationIndex dot 改 radial pink + 8px glow - reservationValue chip 改 JetBrains Mono 0.12em uppercase 粉色 pill - isImminent / isDue 状态加 radial 警告/危险光晕底 日志 - log 字体改 JetBrains Mono + ss01;padding 加左侧 18px 留出光标位 - background 加 4px 周期性扫描线(cyan 4% mix) - ::after 加 6×13 粉色光标 1.2s 闪烁(CRT 风) Footer HUD - 加 mono 12px / 0.12em 全大写;border-top 改 primary 22% mix - 左:连接点 + 文字 + "SYS_OK" chip - 右:PING <em>—</em>ms(实测 /api/version 响应时间,5s 一次)+ FPS <em>—</em>(每秒 RAF 计数)+ version + build - em 内文字用 secondary/primary 色,mono 数字突出 - 移动端隐藏 PING/FPS cache-bust v25 → v26
This commit is contained in:
1 parent
6fb7707abb
commit
ac55428640
3 files changed
+334
-93
No files matched your search
+40
-1
@@ -446,13 +446,52 @@ function initFooter() {
|
||||
if (verEl && data?.version) verEl.textContent = "v" + data.version;
|
||||
if (buildEl && data?.build) buildEl.textContent = data.build;
|
||||
} catch (_) {
|
||||
// fallback:从当前 script 的 cache-bust 提取
|
||||
const tag = (document.currentScript?.src || document.querySelector('script[src*="app.js"]')?.src || "")
|
||||
.split("v=")[1] || "";
|
||||
if (verEl) verEl.textContent = tag ? tag.split("-").pop() : "—";
|
||||
if (buildEl) buildEl.textContent = "本地";
|
||||
}
|
||||
})();
|
||||
|
||||
// FPS 计数(每秒更新一次)
|
||||
const fpsEl = document.getElementById("hudFps");
|
||||
if (fpsEl && typeof requestAnimationFrame === "function") {
|
||||
let frames = 0, last = performance.now();
|
||||
const setFps = (n) => {
|
||||
const em = fpsEl.querySelector("em");
|
||||
if (em) em.textContent = String(n);
|
||||
};
|
||||
const tick = (now) => {
|
||||
frames++;
|
||||
if (now - last >= 1000) {
|
||||
setFps(Math.round((frames * 1000) / (now - last)));
|
||||
frames = 0;
|
||||
last = now;
|
||||
}
|
||||
requestAnimationFrame(tick);
|
||||
};
|
||||
requestAnimationFrame(tick);
|
||||
}
|
||||
|
||||
// PING:每 5s 测一次 /api/version 响应时间
|
||||
const pingEl = document.getElementById("hudPing");
|
||||
if (pingEl) {
|
||||
const setPing = (ms) => {
|
||||
const em = pingEl.querySelector("em");
|
||||
if (em) em.textContent = ms === null ? "—" : String(ms);
|
||||
};
|
||||
const ping = async () => {
|
||||
const t0 = performance.now();
|
||||
try {
|
||||
await fetch("/api/version", { cache: "no-store" });
|
||||
setPing(Math.max(1, Math.round(performance.now() - t0)));
|
||||
} catch (_) {
|
||||
setPing(null);
|
||||
}
|
||||
};
|
||||
ping();
|
||||
setInterval(ping, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
function attachCopyButtons() {
|
||||
|
||||
Reference in new issue
Block a user