diff --git a/webui/app.js b/webui/app.js index 57bf1bb..6debab4 100644 --- a/webui/app.js +++ b/webui/app.js @@ -746,7 +746,17 @@ function initTabs() { }; for (const btn of tabButtons) { - btn.addEventListener("click", () => setActive(btn.dataset.target)); + btn.addEventListener("click", () => { + const wasActive = btn.classList.contains("active"); + setActive(btn.dataset.target); + // Trigger burst pulse on the indicator only when actually switching + if (!wasActive && sideNav) { + sideNav.classList.remove("isBurst"); + void sideNav.offsetWidth; + sideNav.classList.add("isBurst"); + setTimeout(() => sideNav.classList.remove("isBurst"), 380); + } + }); } const defaultTarget = tabButtons.find(b => b.classList.contains("active"))?.dataset.target || tabButtons[0].dataset.target; @@ -974,6 +984,13 @@ function fmtTime(ts) { } } +function fmtNum(v) { + if (v === null || typeof v === "undefined") return "-"; + const n = Number(v); + if (!Number.isFinite(n)) return String(v); + return n.toLocaleString("en-US"); +} + function fmtDuration(seconds) { const s = Math.max(0, parseInt(seconds || 0, 10)); const h = Math.floor(s / 3600); @@ -2271,7 +2288,7 @@ async function pollStats() { } setTextIfExists("statPid", s.pid ?? "-"); setTextIfExists("statUptime", fmtDuration(s.uptime_seconds)); - setTextIfExists("statLogLen", s.log_len ?? "-"); + setTextIfExists("statLogLen", fmtNum(s.log_len)); if ($("statLogCap")) { const cap = s.log_capacity ?? 2000; const len = s.log_len ?? 0; @@ -2297,12 +2314,12 @@ async function pollStats() { setTextIfExists("topLogState", UI_COPY.overview.logLines(s.log_len)); setTextIfExists("topLogMeta", UI_COPY.overview.lastLog(s.last_log_ts)); - setTextIfExists("statFudaiSeen", getC("fudai_seen")); - setTextIfExists("statFudaiOpen", getC("fudai_open_detail")); - setTextIfExists("statFudaiAttendOk", getC("fudai_attend_ok")); - setTextIfExists("statFudaiAttendFail", getC("fudai_attend_fail")); - setTextIfExists("statFudaiNoWin", getC("fudai_result_no_win")); - setTextIfExists("statFudaiWin", getC("fudai_result_win")); + setTextIfExists("statFudaiSeen", fmtNum(getC("fudai_seen"))); + setTextIfExists("statFudaiOpen", fmtNum(getC("fudai_open_detail"))); + setTextIfExists("statFudaiAttendOk", fmtNum(getC("fudai_attend_ok"))); + setTextIfExists("statFudaiAttendFail", fmtNum(getC("fudai_attend_fail"))); + setTextIfExists("statFudaiNoWin", fmtNum(getC("fudai_result_no_win"))); + setTextIfExists("statFudaiWin", fmtNum(getC("fudai_result_win"))); // 福袋统计语义着色 const colorize = (id, kind, n) => { const el = document.getElementById(id); @@ -2319,20 +2336,20 @@ async function pollStats() { setTextIfExists("topFudaiState", UI_COPY.overview.fudaiState(getC("fudai_open_detail"), getC("fudai_attend_ok"))); setTextIfExists("topFudaiMeta", UI_COPY.overview.fudaiMeta(getC("fudai_seen"), getC("fudai_result_win"))); - setTextIfExists("statSkipValueLow", getC("fudai_skip_value_low")); + setTextIfExists("statSkipValueLow", fmtNum(getC("fudai_skip_value_low"))); const pLow = getC("fudai_skip_participants_low"); const pHigh = getC("fudai_skip_participants_high"); - setTextIfExists("statSkipParticipants", pLow + pHigh); + setTextIfExists("statSkipParticipants", fmtNum(pLow + pHigh)); if ($("statSkipParticipantsHint")) { $("statSkipParticipantsHint").textContent = `低:${pLow} / 高:${pHigh}`; } - setTextIfExists("statSkipContent", getC("fudai_skip_content")); + setTextIfExists("statSkipContent", fmtNum(getC("fudai_skip_content"))); const cdShort = getC("fudai_skip_countdown_short"); const cdLong = getC("fudai_skip_countdown_long"); - setTextIfExists("statSkipCountdown", cdShort + cdLong); + setTextIfExists("statSkipCountdown", fmtNum(cdShort + cdLong)); if ($("statSkipCountdownHint")) { $("statSkipCountdownHint").textContent = `短:${cdShort} / 长:${cdLong}`; } @@ -2340,13 +2357,13 @@ async function pollStats() { const fcReq = getC("fansclub_required"); const fcManual = getC("fansclub_manual_needed"); const fcUn = getC("fansclub_unresolved"); - setTextIfExists("statFansclub", fcReq); + setTextIfExists("statFansclub", fmtNum(fcReq)); if ($("statFansclubHint")) { $("statFansclubHint").textContent = `需手动:${fcManual} / 未解决:${fcUn}`; } const sw = getC("switch_room"); - setTextIfExists("statSwitchRoom", sw); + setTextIfExists("statSwitchRoom", fmtNum(sw)); if ($("statSwitchRoomHint")) { const parts = [ `无福袋:${getC("switch_room_no_fudai")}`, diff --git a/webui/index.html b/webui/index.html index d246e7e..cf35be4 100644 --- a/webui/index.html +++ b/webui/index.html @@ -19,7 +19,7 @@ } catch (e) {} })(); - +
@@ -1274,6 +1274,6 @@ - + diff --git a/webui/styles.css b/webui/styles.css index eeb2e9b..3e4374b 100644 --- a/webui/styles.css +++ b/webui/styles.css @@ -1453,12 +1453,26 @@ body.is-running .cardTitle::after { height 220ms cubic-bezier(0.2, 0.7, 0.2, 1), opacity var(--motion-fast); pointer-events: none; + transform-origin: center; +} + +.sideNav.isBurst::before { + animation: tabBurst 360ms cubic-bezier(0.2, 0.7, 0.2, 1); +} + +@keyframes tabBurst { + 0% { transform: scaleY(1) scaleX(1); box-shadow: 0 0 10px color-mix(in oklab, var(--primary) 70%, transparent); } + 35% { transform: scaleY(1.3) scaleX(1.6); box-shadow: 0 0 18px color-mix(in oklab, var(--primary) 90%, transparent); } + 100% { transform: scaleY(1) scaleX(1); box-shadow: 0 0 10px color-mix(in oklab, var(--primary) 70%, transparent); } } @media (prefers-reduced-motion: reduce) { .sideNav::before { transition: opacity var(--motion-fast); } + .sideNav.isBurst::before { + animation: none; + } } .tabBtn { @@ -2785,9 +2799,15 @@ body.is-running .previewRec { height: 100%; object-fit: contain; opacity: 0; + transform: scale(0.985); color: transparent; font-size: 0; - transition: opacity var(--motion-slow); + transition: opacity 280ms ease, transform 280ms cubic-bezier(0.2, 0.7, 0.2, 1); +} + +.preview img[src*="screenshot.png"][data-loading="false"] { + opacity: 1; + transform: scale(1); } .previewTs { @@ -2841,10 +2861,6 @@ body.is-running .previewRec { background: var(--surface); } -.preview img[src*="screenshot.png"][data-loading="false"] { - opacity: 1; -} - .preview.isShotEmpty img { display: none; } @@ -3139,13 +3155,41 @@ details[open] > summary.sectionTitle::before { } .logTitle::before { - width: 4px; - height: 4px; - flex: 0 0 4px; + width: 6px; + height: 6px; + flex: 0 0 6px; border-radius: 50%; - background: var(--primary); + background: linear-gradient(135deg, var(--primary), var(--secondary)); + box-shadow: 0 0 6px color-mix(in oklab, var(--primary) 50%, transparent); content: ""; - opacity: 0.7; + opacity: 0.85; +} + +/* Live status pill following the title */ +.logTitle::after { + display: inline-flex; + align-items: center; + gap: 5px; + margin-left: 8px; + padding: 0 7px; + height: 17px; + border: 1px solid color-mix(in oklab, var(--muted) 35%, transparent); + border-radius: 99px; + background: color-mix(in oklab, var(--muted) 10%, transparent); + color: var(--muted); + font-family: "JetBrains Mono", ui-monospace, monospace; + font-size: 9px; + font-weight: 700; + letter-spacing: 0.16em; + content: "PAUSED"; + transition: color var(--motion-fast), background var(--motion-fast), border-color var(--motion-fast); +} + +body.is-running .logTitle::after { + border-color: color-mix(in oklab, var(--success) 50%, transparent); + background: color-mix(in oklab, var(--success) 18%, transparent); + color: var(--success); + content: "● LIVE"; } .logHeaderActions {