精修 WebUI 第二十一轮:kbd 提示 / 标题反馈 / 趋势箭头

- 关键按钮 kbd 提示:[data-kbd-mod="1"][data-kbd] 自动按平台注入 ⌘ 或 Ctrl 前缀;hover 时不透明度从 0.55 → 1;btnStart 显示 "⌘ ↵",btnSave 显示 "⌘ S";<900px 隐藏
- 页面 title 随运行状态:默认 "抖音挂机控制台",运行中前置 "● ... · 运行中"
- stat 数字趋势箭头:setTextIfExists 检测数值变化方向,向 .statValue 注入 .statTrend ▲/▼ 圆形徽章 (success/danger 色),1100ms 出现 + 淡出再自动移除
- cache-bust v23 → v24
This commit is contained in:
Codex committed 2026-05-21 09:29:38 +08:00
1 parent df96f25eba
commit 16b3bde893
3 files changed
+119 -7

No files matched your search

+74
View File
@@ -465,6 +465,40 @@ svg {
box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary);
}
/* Button kbd hint: render data-kbd badge when [data-kbd-mod] is present */
.btn[data-kbd]::after {
display: inline-flex;
align-items: center;
justify-content: center;
margin-left: 6px;
padding: 0 6px;
height: 18px;
border: 1px solid color-mix(in oklab, currentColor 28%, transparent);
border-bottom-width: 2px;
border-radius: 4px;
color: inherit;
background: color-mix(in oklab, var(--surface) 30%, transparent);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
font-size: 10px;
font-weight: 500;
letter-spacing: 0.04em;
line-height: 1;
content: attr(data-kbd-prefix) attr(data-kbd);
pointer-events: none;
opacity: 0.55;
transition: opacity var(--motion-fast);
}
.btn[data-kbd]:hover::after {
opacity: 1;
}
@media (max-width: 900px) {
.btn[data-kbd]::after {
display: none;
}
}
.btnIcon {
display: inline-flex;
flex: 0 0 16px;
@@ -1728,6 +1762,46 @@ input[type="number"]::-webkit-outer-spin-button {
color: var(--warning);
}
.statTrend {
display: inline-flex;
align-items: center;
justify-content: center;
margin-left: 6px;
width: 14px;
height: 14px;
border-radius: 50%;
font-size: 9px;
line-height: 1;
font-weight: 700;
letter-spacing: 0;
opacity: 0;
}
.statTrend.isUp {
color: var(--success);
background: color-mix(in oklab, var(--success) 14%, transparent);
}
.statTrend.isDown {
color: var(--danger);
background: color-mix(in oklab, var(--danger) 14%, transparent);
}
.statTrend.isFading {
animation: statTrendFade 1100ms ease forwards;
}
@keyframes statTrendFade {
0% { opacity: 0; transform: translateY(2px) scale(0.85); }
20% { opacity: 1; transform: translateY(0) scale(1); }
80% { opacity: 1; transform: translateY(0) scale(1); }
100% { opacity: 0; transform: translateY(-2px) scale(0.95); }
}
@media (prefers-reduced-motion: reduce) {
.statTrend.isFading { animation: none; opacity: 1; }
}
.statValue.hasCopy {
position: relative;
padding-right: 28px;