diff --git a/webui/app.js b/webui/app.js index a12beda..8296dfa 100644 --- a/webui/app.js +++ b/webui/app.js @@ -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() { diff --git a/webui/index.html b/webui/index.html index 76b96f1..4875a9f 100644 --- a/webui/index.html +++ b/webui/index.html @@ -19,7 +19,7 @@ } catch (e) {} })(); - +
@@ -1255,8 +1255,14 @@
就绪 + + SYS_OK
+ PING —ms + + FPS — + v— — @@ -1268,6 +1274,6 @@ - + diff --git a/webui/styles.css b/webui/styles.css index 4970aab..32a6c4c 100644 --- a/webui/styles.css +++ b/webui/styles.css @@ -1061,11 +1061,13 @@ svg { } .cardTitle { + position: relative; display: flex; align-items: center; - gap: 10px; + gap: 12px; min-width: 0; - padding-bottom: 12px; + padding-bottom: 14px; + margin-bottom: 4px; border-bottom: 1px solid var(--border); color: var(--text-strong); font-size: 15px; @@ -1074,17 +1076,48 @@ svg { letter-spacing: var(--tracking-tight); } +/* Status chip on the right of card titles, shows up when body.is-running */ +.cardTitle::after { + margin-left: auto; + padding: 0 8px; + height: 19px; + display: inline-flex; + align-items: center; + gap: 5px; + border: 1px solid color-mix(in oklab, var(--muted) 40%, transparent); + border-radius: 99px; + background: color-mix(in oklab, var(--muted) 12%, transparent); + color: var(--muted); + font-family: "JetBrains Mono", ui-monospace, monospace; + font-size: 9px; + font-weight: 700; + letter-spacing: 0.14em; + content: "READY"; + flex-shrink: 0; + transition: color var(--motion-fast), background var(--motion-fast), border-color var(--motion-fast); +} + +body.is-running .cardTitle::after { + border-color: color-mix(in oklab, var(--success) 50%, transparent); + background: color-mix(in oklab, var(--success) 16%, transparent); + color: var(--success); + content: "● LIVE"; +} + .cardTitle .sectionIcon { display: inline-flex; align-items: center; justify-content: center; - flex: 0 0 26px; - width: 26px; - height: 26px; + flex: 0 0 28px; + width: 28px; + height: 28px; border: 1px solid var(--primary-border); border-radius: var(--radius-sm); - background: var(--primary-soft); + background: + linear-gradient(135deg, color-mix(in oklab, var(--primary) 18%, transparent), color-mix(in oklab, var(--secondary) 18%, transparent)), + var(--primary-soft); color: var(--primary); + box-shadow: 0 0 12px -4px color-mix(in oklab, var(--primary) 40%, transparent); } .cardTitle .sectionIcon svg { @@ -1294,24 +1327,20 @@ svg { } .sideNav { - position: static; + position: relative; display: flex; flex-direction: column; - gap: 4px; + gap: 2px; min-width: 0; margin-top: 14px; - padding: 6px; + padding: 8px; border: 1px solid var(--border); - border-radius: var(--radius); - background: var(--surface-soft); + border-radius: var(--radius-lg); + background: + linear-gradient(180deg, color-mix(in oklab, var(--primary-soft) 50%, transparent), transparent 60%), + var(--surface-soft); box-shadow: 0 1px 0 var(--hairline) inset; -} - -/* Floating active indicator: a thin vertical bar that slides between tabs. - Position is driven by --tab-indicator-y / --tab-indicator-h CSS vars - updated from JS whenever the active tab changes. */ -.sideNav { - position: relative; + counter-reset: tabIdx; --tab-indicator-y: 6px; --tab-indicator-h: 14px; --tab-indicator-opacity: 0; @@ -1319,14 +1348,15 @@ svg { .sideNav::before { position: absolute; - left: 4px; + left: 6px; top: var(--tab-indicator-y); - width: 2px; + width: 3px; height: var(--tab-indicator-h); content: ""; - border-radius: 2px; - background: var(--primary); + border-radius: 3px; + background: linear-gradient(180deg, var(--primary), var(--secondary)); opacity: var(--tab-indicator-opacity); + box-shadow: 0 0 10px color-mix(in oklab, var(--primary) 70%, transparent); transition: top 220ms cubic-bezier(0.2, 0.7, 0.2, 1), height 220ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity var(--motion-fast); @@ -1347,8 +1377,8 @@ svg { gap: 10px; width: 100%; min-width: 0; - min-height: 36px; - padding: 0 12px 0 14px; + min-height: 38px; + padding: 0 12px 0 18px; border: 1px solid transparent; border-radius: var(--radius-md); color: var(--muted); @@ -1358,27 +1388,73 @@ svg { text-align: left; white-space: nowrap; letter-spacing: var(--tracking-tight); - transition: color var(--motion-fast), background var(--motion-fast), border-color var(--motion-fast); + counter-increment: tabIdx; + transition: color var(--motion-fast), background var(--motion-fast), border-color var(--motion-fast), padding var(--motion-fast); } +/* Channel slot ID — small mono number prefix */ .tabBtn::before { - /* Disabled: sideNav now owns the floating active indicator. */ - display: none; + font-family: "JetBrains Mono", ui-monospace, monospace; + font-size: 9px; + font-weight: 600; + letter-spacing: 0.06em; + color: var(--muted-soft); + content: counter(tabIdx, decimal-leading-zero); + margin-right: 2px; + display: inline-block; + opacity: 0.7; + transition: color var(--motion-fast), opacity var(--motion-fast); +} + +/* Right-side mini cyan dot on hover */ +.tabBtn::after { + position: absolute; + right: 10px; + top: 50%; + transform: translateY(-50%) scale(0.4); + width: 5px; + height: 5px; + border-radius: 50%; + background: var(--secondary); + box-shadow: 0 0 6px var(--secondary); + content: ""; + opacity: 0; + transition: opacity var(--motion-fast), transform var(--motion-fast); } .tabBtn:hover { color: var(--text); - background: color-mix(in oklab, var(--surface-muted) 80%, var(--primary-soft) 20%); + background: color-mix(in oklab, var(--surface-muted) 70%, var(--primary-soft) 30%); +} + +.tabBtn:hover::before { + color: var(--primary); + opacity: 1; +} + +.tabBtn:hover::after { + opacity: 0.7; + transform: translateY(-50%) scale(1); } .tabBtn.active { color: var(--text-strong); - background: color-mix(in oklab, var(--surface-muted) 60%, var(--primary-soft) 40%); - box-shadow: none; + background: + linear-gradient(90deg, color-mix(in oklab, var(--primary) 14%, transparent), transparent 70%), + color-mix(in oklab, var(--surface-muted) 50%, var(--primary-soft) 50%); + box-shadow: 0 0 0 1px color-mix(in oklab, var(--primary) 25%, transparent); } .tabBtn.active::before { - display: none; + color: var(--primary); + opacity: 1; +} + +.tabBtn.active::after { + opacity: 1; + transform: translateY(-50%) scale(1); + background: var(--primary); + box-shadow: 0 0 8px var(--primary); } .tabIcon { @@ -1387,11 +1463,12 @@ svg { width: 16px; height: 16px; color: var(--muted-soft); + transition: color var(--motion-fast); } .tabBtn.active .tabIcon, .tabBtn:hover .tabIcon { - color: currentColor; + color: var(--primary); } .tabIcon svg { @@ -1462,14 +1539,15 @@ svg { .sectionTitle { display: flex; align-items: center; - gap: 8px; + gap: 10px; min-width: 0; margin: 22px 0 12px; padding: 6px 0 8px; color: var(--muted); - font-size: 11px; + font-family: "JetBrains Mono", ui-monospace, monospace; + font-size: 10px; font-weight: 600; - letter-spacing: 0.06em; + letter-spacing: 0.12em; text-transform: uppercase; line-height: 1.3; border-bottom: 1px solid var(--border); @@ -1479,11 +1557,15 @@ svg { background: linear-gradient(180deg, var(--surface) 70%, color-mix(in oklab, var(--surface) 0%, transparent)); backdrop-filter: blur(6px); transition: box-shadow var(--motion-fast); + counter-increment: sectionIdx; +} + +.panels { + counter-reset: sectionIdx; } /* When sticky-pinned (top:64px is reached), elevate with a subtle shadow */ .sectionTitle:not(.cardTitle):not(summary) { - /* Use scroll-aware shadow via @supports trick: sticky elements show shadow when stuck */ box-shadow: 0 0 0 0 transparent; } @@ -1504,18 +1586,39 @@ summary.sectionTitle { backdrop-filter: none; } +/* Section number (mono leading-zero) replaces the dot */ .sectionTitle::before { - width: 4px; - height: 4px; - flex: 0 0 4px; - border-radius: 50%; - background: var(--primary); + display: inline-flex; + align-items: center; + justify-content: center; + min-width: 22px; + height: 16px; + padding: 0 5px; + border: 1px solid color-mix(in oklab, var(--primary) 35%, var(--border)); + border-radius: 4px; + background: color-mix(in oklab, var(--primary) 8%, transparent); + color: var(--primary); + font-family: "JetBrains Mono", ui-monospace, monospace; + font-size: 9px; + font-weight: 700; + letter-spacing: 0.04em; + flex: 0 0 auto; + content: "§ " counter(sectionIdx, decimal-leading-zero); +} + +/* Trailing line that extends to the right edge */ +.sectionTitle::after { + flex: 1 1 auto; + height: 1px; + margin-left: 4px; content: ""; - opacity: 0.7; + background: linear-gradient(90deg, color-mix(in oklab, var(--primary) 20%, transparent), transparent); } .cardTitle.sectionTitle::before, -summary.sectionTitle::before { +summary.sectionTitle::before, +.cardTitle.sectionTitle::after, +summary.sectionTitle::after { display: none; } @@ -2230,16 +2333,35 @@ input[type="number"]::-webkit-outer-spin-button { } .tableRow { + position: relative; display: grid; grid-template-columns: minmax(92px, 0.65fr) minmax(0, 1.7fr) minmax(54px, 0.45fr); gap: 12px; min-width: 0; - padding: 10px 14px; + padding: 11px 14px 11px 18px; border-top: 1px solid var(--border); color: var(--text); font-size: var(--text-sm); line-height: var(--leading-snug); - transition: background var(--motion-fast); + transition: background var(--motion-fast), padding var(--motion-fast); +} + +/* Left-side hover accent stripe */ +.tableRow:not(.tableHead)::before { + position: absolute; + left: 0; + top: 8px; + bottom: 8px; + width: 2px; + content: ""; + border-radius: 0 2px 2px 0; + background: linear-gradient(180deg, var(--primary), var(--secondary)); + opacity: 0; + transition: opacity var(--motion-fast); +} + +.tableRow:not(.tableHead):hover::before { + opacity: 1; } .tableRow:not(.tableHead) > div:not(:last-child) { @@ -2254,7 +2376,7 @@ input[type="number"]::-webkit-outer-spin-button { } .tableRow:not(.tableHead):hover { - background: var(--surface-soft); + background: color-mix(in oklab, var(--primary-soft) 35%, var(--surface-soft)); } .tableRow:nth-child(odd):not(.tableHead) { @@ -2262,7 +2384,7 @@ input[type="number"]::-webkit-outer-spin-button { } .tableRow:nth-child(odd):not(.tableHead):hover { - background: var(--surface-soft); + background: color-mix(in oklab, var(--primary-soft) 35%, var(--surface-soft)); } .tableRow:first-child { @@ -2275,7 +2397,9 @@ input[type="number"]::-webkit-outer-spin-button { } .tableRow .mono { + font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; + font-feature-settings: "ss01"; color: var(--muted); } @@ -2283,16 +2407,21 @@ input[type="number"]::-webkit-outer-spin-button { position: sticky; top: 0; z-index: 1; - color: var(--muted); - background: var(--surface-muted); - font-size: var(--text-xs); - font-weight: 600; - letter-spacing: var(--tracking-wide); + color: var(--primary); + background: + linear-gradient(90deg, color-mix(in oklab, var(--primary) 8%, transparent), transparent 60%), + var(--surface-muted); + font-family: "JetBrains Mono", ui-monospace, monospace; + font-size: 10px; + font-weight: 700; + letter-spacing: 0.14em; text-transform: uppercase; + border-bottom: 1px solid color-mix(in oklab, var(--primary) 25%, var(--border)); } .mono { - font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; + font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; + font-feature-settings: "ss01", "tnum"; } .preview { @@ -2528,8 +2657,10 @@ body.is-running .previewRec { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-md); - background: var(--surface); - transition: border-color var(--motion-fast), box-shadow var(--motion-fast); + background: + radial-gradient(at 100% 0%, color-mix(in oklab, var(--primary) 8%, transparent), transparent 50%), + var(--surface); + transition: border-color var(--motion-fast), box-shadow var(--motion-fast), transform var(--motion-fast); } .reservationItem::before { @@ -2537,21 +2668,22 @@ body.is-running .previewRec { left: 0; top: 10px; bottom: 10px; - width: 2px; + width: 3px; content: ""; - border-radius: 0 2px 2px 0; - background: var(--primary); + border-radius: 0 3px 3px 0; + background: linear-gradient(180deg, var(--primary), var(--secondary)); opacity: 0; transition: opacity var(--motion-fast); } .reservationItem:hover { - border-color: var(--hover-border); - box-shadow: var(--shadow-soft); + border-color: var(--primary-border); + transform: translateY(-1px); + box-shadow: var(--shadow-soft), 0 0 0 1px color-mix(in oklab, var(--primary) 22%, transparent), 0 12px 28px -10px color-mix(in oklab, var(--primary) 28%, transparent); } .reservationItem:hover::before { - opacity: 0.65; + opacity: 1; } .reservationItem.isImminent::before, @@ -2561,7 +2693,9 @@ body.is-running .previewRec { .reservationItem.isImminent { border-color: var(--warning); - background: color-mix(in oklab, var(--warning-soft) 60%, var(--surface)); + background: + radial-gradient(at 100% 0%, color-mix(in oklab, var(--warning) 18%, transparent), transparent 50%), + color-mix(in oklab, var(--warning-soft) 60%, var(--surface)); animation: imminentPulse 1.6s ease-in-out infinite; } @@ -2573,7 +2707,9 @@ body.is-running .previewRec { .reservationItem.isDue { border-color: var(--danger); - background: color-mix(in oklab, var(--danger-soft) 50%, var(--surface)); + background: + radial-gradient(at 100% 0%, color-mix(in oklab, var(--danger) 22%, transparent), transparent 50%), + color-mix(in oklab, var(--danger-soft) 50%, var(--surface)); } .reservationItem.isDue .reservationValue { @@ -2583,8 +2719,8 @@ body.is-running .previewRec { } @keyframes imminentPulse { - 0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--warning) 35%, transparent); } - 50% { box-shadow: 0 0 0 6px transparent; } + 0%, 100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--warning) 45%, transparent); } + 50% { box-shadow: 0 0 0 8px transparent; } } @media (prefers-reduced-motion: reduce) { @@ -2601,7 +2737,7 @@ body.is-running .previewRec { min-width: 0; padding: 10px 12px; border-bottom: 1px solid var(--border); - background: var(--surface-soft); + background: linear-gradient(180deg, var(--surface-soft), transparent); } .reservationHeader.isClickable { @@ -2611,33 +2747,36 @@ body.is-running .previewRec { .reservationIndex { display: inline-flex; align-items: center; - gap: 6px; - color: var(--text); - font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; + gap: 8px; + color: var(--text-strong); + font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: var(--text-sm); - font-weight: 600; + font-weight: 700; + letter-spacing: 0.04em; } .reservationIndex::before { display: inline-block; - width: 6px; - height: 6px; + width: 7px; + height: 7px; border-radius: 50%; - background: var(--primary); + background: radial-gradient(circle at 30% 30%, #fbcfe8, var(--primary)); + box-shadow: 0 0 8px var(--primary); content: ""; } .reservationValue { max-width: 68%; - padding: 3px 9px; + padding: 3px 10px; overflow: hidden; border: 1px solid var(--warning-border); border-radius: 99px; color: var(--warning); background: var(--warning-soft); - font-size: var(--text-xs); - font-weight: 600; - letter-spacing: var(--tracking-wide); + font-family: "JetBrains Mono", ui-monospace, monospace; + font-size: 10px; + font-weight: 700; + letter-spacing: 0.12em; text-transform: uppercase; text-overflow: ellipsis; white-space: nowrap; @@ -2793,17 +2932,21 @@ details[open] > summary.sectionTitle::before { } .log { + position: relative; min-width: 0; min-height: clamp(250px, 32vh, 390px); max-height: clamp(250px, 32vh, 390px); margin: 0; - padding: 12px 14px; + padding: 14px 16px 14px 18px; overflow: auto; border-top: 1px solid var(--log-border); color: var(--log-text); - background: var(--log-bg); - font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; + background: + linear-gradient(180deg, transparent, transparent 50%, color-mix(in oklab, var(--secondary) 4%, transparent) 50%) 0 0 / 100% 4px, + var(--log-bg); + font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: var(--text-sm); + font-feature-settings: "ss01"; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; @@ -2811,6 +2954,41 @@ details[open] > summary.sectionTitle::before { scrollbar-color: var(--border-strong) transparent; } +/* CRT-style soft scanline overlay */ +.log::before { + position: sticky; + top: 0; + left: 0; + right: 0; + height: 0; + z-index: 0; + content: ""; + display: block; +} + +/* Subtle prompt indicator on the first line — purely decorative */ +.log::after { + position: absolute; + left: 6px; + top: 14px; + width: 6px; + height: 13px; + content: ""; + background: var(--primary); + box-shadow: 0 0 6px var(--primary); + opacity: 0.7; + animation: cursorBlink 1.2s ease-in-out infinite; +} + +@keyframes cursorBlink { + 0%, 49% { opacity: 0.85; } + 50%, 100% { opacity: 0.18; } +} + +@media (prefers-reduced-motion: reduce) { + .log::after { animation: none; } +} + .log::-webkit-scrollbar { width: 10px; height: 10px; @@ -3252,33 +3430,35 @@ details[open] > summary.sectionTitle::before { justify-content: space-between; gap: 12px; margin-top: 18px; - padding: 10px 14px; - border-top: 1px solid var(--border); + padding: 12px 16px; + border-top: 1px solid color-mix(in oklab, var(--primary) 22%, var(--border)); color: var(--muted); - font-size: var(--text-xs); - letter-spacing: var(--tracking-wide); + font-family: "JetBrains Mono", ui-monospace, monospace; + font-size: 10px; + letter-spacing: 0.12em; text-transform: uppercase; + background: linear-gradient(180deg, transparent, color-mix(in oklab, var(--primary) 4%, transparent)); } .appFooterLeft, .appFooterRight { display: inline-flex; align-items: center; - gap: 8px; + gap: 10px; } .appConnDot { position: relative; - width: 6px; - height: 6px; + width: 7px; + height: 7px; border-radius: 50%; background: var(--muted-soft); box-shadow: 0 0 0 3px color-mix(in oklab, var(--muted-soft) 16%, transparent); } .appConnDot[data-state="ok"] { - background: var(--success); - box-shadow: 0 0 0 3px color-mix(in oklab, var(--success) 16%, transparent); + background: radial-gradient(circle at 30% 30%, #5eead4, var(--success)); + box-shadow: 0 0 0 3px color-mix(in oklab, var(--success) 18%, transparent), 0 0 8px color-mix(in oklab, var(--success) 50%, transparent); } .appConnDot[data-state="ok"]::after { @@ -3293,7 +3473,7 @@ details[open] > summary.sectionTitle::before { .appConnDot[data-state="error"] { background: var(--danger); - box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 16%, transparent); + box-shadow: 0 0 0 3px color-mix(in oklab, var(--danger) 18%, transparent), 0 0 8px color-mix(in oklab, var(--danger) 60%, transparent); animation: statusPulse 2s ease-in-out infinite; } @@ -3309,10 +3489,22 @@ details[open] > summary.sectionTitle::before { .appConnText, .appFooterMeta { font-variant-numeric: tabular-nums; + font-feature-settings: "ss01", "tnum"; } +.appFooterMeta em { + font-style: normal; + color: var(--text-strong); + letter-spacing: 0; + margin: 0 2px; +} + +.hudPing em { color: var(--secondary); } +.hudFps em { color: var(--primary); } + .appFooterDivider { color: var(--muted-soft); + opacity: 0.6; } @media (max-width: 640px) { @@ -3320,6 +3512,10 @@ details[open] > summary.sectionTitle::before { flex-direction: column; align-items: flex-start; } + .appFooter .hudPing, + .appFooter .hudFps { + display: none; + } } /* ==================== Toast ==================== */