From 632951d00419787eecbb05e7c9a43aeaa7add09a Mon Sep 17 00:00:00 2001 From: Codex Date: Thu, 21 May 2026 08:52:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=B2=BE=E4=BF=AE=20WebUI=20=E7=AC=AC=E5=8D=81?= =?UTF-8?q?=E4=B8=83=E8=BD=AE=EF=BC=9Asticky=20=E7=AB=A0=E8=8A=82=20/=20?= =?UTF-8?q?=E8=AF=AD=E4=B9=89=E7=9D=80=E8=89=B2=20/=20=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E8=AE=A1=E6=95=B0=20/=20=E7=A9=BA=E7=8A=B6=E6=80=81=E5=8D=87?= =?UTF-8?q?=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - sectionTitle 改 sticky 在长 panel 内吸附顶部,背景渐变 + 6px 模糊;cardTitle/summary 不变 - 福袋统计语义着色:参与成功/中奖 → success;失败 → error;未中奖 → muted;通过 .stateOk/.stateError/.stateWarn/.stateMuted 类切换 - 配置搜索右侧加实时匹配计数徽章("X 项");搜索清空时隐藏 - 空状态占位升级:从单色边框圆点 → 28px 聊天泡 SVG icon (currentColor mask) + 双行布局,更显设计 - cache-bust v19 → v20 --- webui/app.js | 19 +++++++++++++++++ webui/index.html | 5 +++-- webui/styles.css | 53 ++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 67 insertions(+), 10 deletions(-) diff --git a/webui/app.js b/webui/app.js index a7ea931..af6a12d 100644 --- a/webui/app.js +++ b/webui/app.js @@ -334,6 +334,7 @@ function initConfigSearch() { const apply = (q) => { const query = q.trim().toLowerCase(); if (clear) clear.toggleAttribute("hidden", !query); + const countBadge = document.getElementById("configSearchCount"); if (!query) { // Restore all @@ -341,6 +342,7 @@ function initConfigSearch() { allSectionTitles.forEach((s) => s.classList.remove("isSearchHidden")); document.querySelectorAll(".panel").forEach((p) => p.classList.remove("isSearchAllHidden")); if (empty) empty.hidden = true; + if (countBadge) countBadge.hidden = true; // Re-apply normal tab visibility (panels may have been forced visible) const activeTab = document.querySelector(".tabBtn.active[data-target]"); if (activeTab) { @@ -389,6 +391,10 @@ function initConfigSearch() { }); if (empty) empty.hidden = totalVisible > 0; + if (countBadge) { + countBadge.hidden = false; + countBadge.textContent = `${totalVisible} 项`; + } }; let debounceTimer; @@ -2130,6 +2136,19 @@ async function pollStats() { setTextIfExists("statFudaiAttendFail", getC("fudai_attend_fail")); setTextIfExists("statFudaiNoWin", getC("fudai_result_no_win")); setTextIfExists("statFudaiWin", getC("fudai_result_win")); + // 福袋统计语义着色 + const colorize = (id, kind, n) => { + const el = document.getElementById(id); + if (!el) return; + el.classList.toggle("stateOk", kind === "ok" && n > 0); + el.classList.toggle("stateError", kind === "error" && n > 0); + el.classList.toggle("stateWarn", kind === "warn" && n > 0); + el.classList.toggle("stateMuted", kind === "muted" && n > 0); + }; + colorize("statFudaiAttendOk", "ok", getC("fudai_attend_ok")); + colorize("statFudaiWin", "ok", getC("fudai_result_win")); + colorize("statFudaiAttendFail", "error", getC("fudai_attend_fail")); + colorize("statFudaiNoWin", "muted", getC("fudai_result_no_win")); 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"))); diff --git a/webui/index.html b/webui/index.html index da42991..cae8912 100644 --- a/webui/index.html +++ b/webui/index.html @@ -15,7 +15,7 @@ } catch (e) {} })(); - +
@@ -193,6 +193,7 @@ + - + diff --git a/webui/styles.css b/webui/styles.css index 29c5749..402b389 100644 --- a/webui/styles.css +++ b/webui/styles.css @@ -1019,6 +1019,25 @@ svg { transition: opacity var(--motion-fast); } +.workspaceSearchCount { + position: absolute; + right: 30px; + top: 50%; + transform: translateY(-50%); + padding: 1px 7px; + border-radius: 99px; + background: var(--primary-soft); + color: var(--primary-accent-text); + font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; + font-size: 10px; + font-variant-numeric: tabular-nums; + pointer-events: none; +} + +.workspaceSearchCount[hidden] { + display: none; +} + .workspaceSearch:focus-within .workspaceSearchKbd, .workspaceSearch input:not(:placeholder-shown) ~ .workspaceSearchKbd { opacity: 0; @@ -1224,6 +1243,18 @@ svg { text-transform: uppercase; line-height: 1.3; border-bottom: 1px solid var(--border); + position: sticky; + top: 64px; + z-index: 4; + background: linear-gradient(180deg, var(--surface) 70%, color-mix(in oklab, var(--surface) 0%, transparent)); + backdrop-filter: blur(6px); +} + +.cardTitle.sectionTitle, +summary.sectionTitle { + position: static; + background: transparent; + backdrop-filter: none; } .sectionTitle::before { @@ -1462,11 +1493,12 @@ input[type="number"]::-webkit-outer-spin-button { .chart > .hint:only-child, .reservationsContent > .hint:only-child { display: flex; + flex-direction: column; align-items: center; justify-content: center; gap: 8px; - min-height: 60px; - padding: 16px; + min-height: 80px; + padding: 24px 16px; border: 1px dashed var(--border); border-radius: var(--radius-md); background: color-mix(in oklab, var(--surface-soft) 60%, transparent); @@ -1479,12 +1511,13 @@ input[type="number"]::-webkit-outer-spin-button { .chart > .hint:only-child::before, .reservationsContent > .hint:only-child::before { content: ""; - width: 14px; - height: 14px; - border: 1.5px dashed currentColor; - border-radius: 50%; - opacity: 0.6; - flex: 0 0 14px; + width: 28px; + height: 28px; + flex: 0 0 28px; + background-color: currentColor; + -webkit-mask: url("data:image/svg+xml;utf8,") no-repeat center / contain; + mask: url("data:image/svg+xml;utf8,") no-repeat center / contain; + opacity: 0.55; } .divider { @@ -1568,6 +1601,10 @@ input[type="number"]::-webkit-outer-spin-button { color: var(--danger); } +.statValue.stateWarn { + color: var(--warning); +} + .statValue.hasCopy { position: relative; padding-right: 28px;