精修 WebUI v31:运行状态指示 / tab burst / 截图入场 / 数字千分隔符

logHeader 状态 pill
- logTitle ::before 圆点改 6px 渐变(粉→青)+ 6px primary halo
- ::after 加状态 chip:默认 "PAUSED" muted;body.is-running 时切 "● LIVE"(success 色 + glow border)

侧边导航 burst 反馈
- tab 切换时 sideNav 加 isBurst 类 380ms,触发 ::before 横/纵向 scaleY 1.3 / scaleX 1.6 的脉冲 + 光晕加强(10→18px)
- 同 tab 二次点击不触发;prefers-reduced-motion 下不动

截图入场动画
- preview img 从 opacity 0 + scale(0.985) → opacity 1 + scale(1),280ms 缓出
- 删除一处旧的重复规则

数字千分隔符
- 新增 fmtNum() 工具函数(toLocaleString en-US 千分隔,PID/Trace 不走)
- statLogLen / 9 个福袋统计 / 跳过 / 切换直播间 / 粉丝团等字段全部 fmt 化
- 大数字现在显示 "12,345" 风格,配合 JetBrains Mono tabular-nums 更易读

cache-bust v30 → v31
This commit is contained in:
Codex committed 2026-05-21 12:11:09 +08:00
1 parent 0d01dabb69
commit 9c3cf86f41
3 files changed
+87 -26

No files matched your search

+31 -14
View File
@@ -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")}`,
+2 -2
View File
@@ -19,7 +19,7 @@
} catch (e) {}
})();
</script>
<link rel="stylesheet" href="styles.css?v=console-20260520-theme-v30" />
<link rel="stylesheet" href="styles.css?v=console-20260520-theme-v31" />
</head>
<body>
<div class="app">
@@ -1274,6 +1274,6 @@
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="m18 15-6-6-6 6"/></svg>
</button>
<script src="app.js?v=console-20260520-theme-v30"></script>
<script src="app.js?v=console-20260520-theme-v31"></script>
</body>
</html>
+54 -10
View File
@@ -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 {