精修 WebUI:质感细节与组件统一

- 引入设计 token:space-1..8 / radius-sm..xl / text-xs..2xl
- header:替换品牌图标为 SVG(耳机+音符)+ 顶部 hairline;title 用 tabular 字体可读性更好
- 按钮 primary/danger 加 inner highlight + 渐变深浅 + 三态质感(idle/hover/active)
- 侧边导航 tabBtn:active 改为左侧 2px 垂直指示条带 scaleY 动画
- 表单:select 加自绘下拉箭头;focus 双层 ring(border + 半透明)
- check 项勾选后亮 primary-soft 背景
- 状态卡 overviewCard:左侧 2px accent 条 + tabular-nums 数字 + 标签 uppercase
- statusRunning 状态点改为外扩光环动画(更内敛)
- 图表:barFill 加细微渐变;hover 行高亮其他行半透明;tabular-nums
- 全局滚动条:10px 细圆角,仅 thumb 显示
- preview 占位:斜纹背景 + 单方向扫描线动画
- cache-bust v3 → v4
This commit is contained in:
Codex committed 2026-05-21 09:29:37 +08:00
1 parent 6e8e5d1102
commit b7d7f61a27
2 files changed
+331 -85

No files matched your search

+10 -4
View File
@@ -15,16 +15,22 @@
} catch (e) {}
})();
</script>
<link rel="stylesheet" href="styles.css?v=console-20260520-theme-v3" />
<link rel="stylesheet" href="styles.css?v=console-20260520-theme-v4" />
</head>
<body>
<div class="app">
<header class="header commandBar">
<div class="brandBlock">
<div class="brandMark" aria-hidden="true">控</div>
<div class="brandMark" aria-hidden="true">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M9 18V5l12-2v13"/>
<circle cx="6" cy="18" r="3"/>
<circle cx="18" cy="16" r="3"/>
</svg>
</div>
<div>
<div class="title">抖音挂机控制台</div>
<div class="subtitle">设备调度、运行控制与实时观察</div>
<div class="subtitle">设备调度 · 运行控制 · 实时观察</div>
</div>
</div>
<div class="header-actions">
@@ -1216,6 +1222,6 @@
</main>
</div>
<script src="app.js?v=console-20260520-theme-v3"></script>
<script src="app.js?v=console-20260520-theme-v4"></script>
</body>
</html>
+321 -81
View File
@@ -54,6 +54,33 @@
--status-muted-ring: 0 0 0 3px rgba(163, 163, 163, 0.16);
--status-success-ring: 0 0 0 3px rgba(22, 163, 74, 0.18);
--status-danger-ring: 0 0 0 3px rgba(220, 38, 38, 0.18);
/* Design tokens — spacing / radius / typography scale */
--space-1: 4px;
--space-2: 8px;
--space-3: 12px;
--space-4: 16px;
--space-5: 20px;
--space-6: 24px;
--space-8: 32px;
--radius-sm: 4px;
--radius-md: 6px;
--radius-lg: 10px;
--radius-xl: 14px;
--text-xs: 11px;
--text-sm: 12px;
--text-base: 13px;
--text-md: 14px;
--text-lg: 16px;
--text-xl: 20px;
--text-2xl: 26px;
--leading-tight: 1.2;
--leading-snug: 1.35;
--leading-normal: 1.5;
--tracking-tight: -0.01em;
--tracking-normal: 0;
--tracking-wide: 0.06em;
--radius: 6px;
--radius-lg: 8px;
--control-height: 34px;
@@ -212,16 +239,27 @@ svg {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 12px 14px;
gap: var(--space-4);
padding: 12px 16px;
border: 1px solid var(--border);
background: var(--header-bg);
border-radius: var(--radius);
box-shadow: var(--shadow-soft);
backdrop-filter: blur(12px) saturate(1.1);
border-radius: var(--radius-lg);
box-shadow: var(--shadow);
backdrop-filter: blur(14px) saturate(1.1);
animation: surfaceIn var(--motion-slow) both;
}
.header::before {
position: absolute;
inset: 0 0 auto;
height: 1px;
content: "";
pointer-events: none;
border-radius: var(--radius-lg) var(--radius-lg) 0 0;
background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
opacity: 0.6;
}
.brandBlock {
display: flex;
align-items: center;
@@ -234,29 +272,33 @@ svg {
overflow: hidden;
display: grid;
place-items: center;
flex: 0 0 36px;
width: 36px;
height: 36px;
flex: 0 0 38px;
width: 38px;
height: 38px;
color: var(--on-primary);
background: var(--primary);
border-radius: var(--radius);
font-size: 15px;
font-weight: 700;
background: linear-gradient(135deg, var(--primary), color-mix(in oklab, var(--primary) 70%, #000 30%));
border-radius: var(--radius-md);
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) inset, 0 1px 2px rgba(94, 106, 210, 0.3);
}
.brandMark svg {
width: 18px;
height: 18px;
}
.title {
color: var(--text-strong);
font-size: 16px;
font-size: var(--text-lg);
font-weight: 600;
line-height: 1.25;
letter-spacing: -0.01em;
line-height: var(--leading-tight);
letter-spacing: var(--tracking-tight);
}
.subtitle {
margin-top: 4px;
margin-top: 3px;
color: var(--muted);
font-size: 12px;
line-height: 1.35;
font-size: var(--text-sm);
line-height: var(--leading-snug);
}
.header-actions {
@@ -337,13 +379,20 @@ svg {
.btnPrimary {
color: var(--on-primary);
border-color: var(--primary);
background: var(--primary);
background: linear-gradient(180deg, color-mix(in oklab, var(--primary) 88%, #fff 12%), var(--primary));
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 1px 2px rgba(94, 106, 210, 0.25);
}
.btnPrimary:hover {
color: var(--on-primary);
border-color: var(--primary-hover);
background: var(--primary-hover);
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 2px 6px rgba(94, 106, 210, 0.32);
}
.btnPrimary:active {
background: color-mix(in oklab, var(--primary-hover) 90%, #000 10%);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15) inset;
}
.btnSoft {
@@ -373,13 +422,20 @@ svg {
.btnDanger {
color: var(--on-primary);
border-color: var(--danger);
background: var(--danger);
background: linear-gradient(180deg, color-mix(in oklab, var(--danger) 88%, #fff 12%), var(--danger));
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 1px 2px rgba(220, 38, 38, 0.22);
}
.btnDanger:hover {
color: var(--on-primary);
border-color: var(--danger-hover);
background: var(--danger-hover);
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 2px 6px rgba(220, 38, 38, 0.3);
}
.btnDanger:active {
background: color-mix(in oklab, var(--danger-hover) 90%, #000 10%);
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15) inset;
}
.btnDangerSoft {
@@ -430,29 +486,35 @@ svg {
position: relative;
overflow: hidden;
min-width: 0;
padding: 14px;
padding: 14px 16px;
border: 1px solid var(--border);
border-radius: var(--radius);
border-radius: var(--radius-md);
background: var(--surface);
box-shadow: var(--shadow-soft);
animation: surfaceIn var(--motion-slow) both;
transition: border-color var(--motion);
transition: border-color var(--motion), box-shadow var(--motion-fast);
}
.overviewCard:nth-child(2) {
animation-delay: 30ms;
}
.overviewCard:nth-child(3) {
animation-delay: 60ms;
}
.overviewCard:nth-child(4) {
animation-delay: 90ms;
.overviewCard::before {
position: absolute;
left: 0;
top: 14px;
bottom: 14px;
width: 2px;
content: "";
border-radius: 0 2px 2px 0;
background: var(--border-strong);
opacity: 0.5;
transition: background var(--motion-fast), opacity var(--motion-fast);
}
.overviewCard:hover {
border-color: var(--hover-border);
box-shadow: var(--shadow);
}
.overviewCard:hover::before {
opacity: 1;
}
.overviewPrimary {
@@ -460,11 +522,18 @@ svg {
background: var(--overview-primary-bg);
}
.overviewPrimary::before {
background: var(--primary);
opacity: 1;
}
.overviewLabel {
color: var(--muted);
font-size: 12px;
font-weight: 500;
font-size: var(--text-xs);
font-weight: 600;
line-height: 1.3;
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
}
.overviewValue {
@@ -472,27 +541,30 @@ svg {
align-items: center;
gap: 8px;
min-width: 0;
margin-top: 7px;
margin-top: 8px;
color: var(--text-strong);
font-size: 20px;
font-size: var(--text-xl);
font-weight: 600;
line-height: 1.2;
line-height: var(--leading-tight);
letter-spacing: var(--tracking-tight);
font-variant-numeric: tabular-nums;
overflow-wrap: anywhere;
}
.overviewMeta {
min-height: 18px;
margin-top: 7px;
margin-top: 6px;
color: var(--muted);
font-size: 12px;
line-height: 1.35;
font-size: var(--text-sm);
line-height: var(--leading-snug);
overflow-wrap: anywhere;
}
.statusDot {
flex: 0 0 9px;
width: 9px;
height: 9px;
position: relative;
flex: 0 0 8px;
width: 8px;
height: 8px;
border-radius: 50%;
background: var(--muted-soft);
box-shadow: var(--status-muted-ring);
@@ -506,7 +578,27 @@ svg {
.statusRunning {
background: var(--success);
box-shadow: var(--status-success-ring);
animation: statusPulse 2s ease-in-out infinite;
}
.statusRunning::after {
position: absolute;
inset: -4px;
content: "";
border-radius: 50%;
border: 1px solid var(--success);
opacity: 0.5;
animation: statusRing 1.8s ease-out infinite;
}
@keyframes statusRing {
0% {
transform: scale(0.8);
opacity: 0.7;
}
100% {
transform: scale(1.6);
opacity: 0;
}
}
.statusIdle {
@@ -708,20 +800,35 @@ svg {
display: flex;
align-items: center;
justify-content: flex-start;
gap: 8px;
gap: 9px;
width: 100%;
min-width: 0;
min-height: 38px;
padding: 0 10px;
min-height: 36px;
padding: 0 10px 0 12px;
border: 1px solid transparent;
border-radius: var(--radius);
border-radius: var(--radius-md);
color: var(--muted);
background: transparent;
font-size: 13px;
font-size: var(--text-base);
font-weight: 500;
text-align: left;
white-space: nowrap;
transition: color var(--motion-fast), background var(--motion-fast), transform var(--motion-fast), border-color var(--motion-fast);
transition: color var(--motion-fast), background var(--motion-fast), border-color var(--motion-fast);
}
.tabBtn::before {
position: absolute;
left: 4px;
top: 50%;
width: 2px;
height: 14px;
margin-top: -7px;
content: "";
border-radius: 2px;
background: var(--primary);
opacity: 0;
transform: scaleY(0.4);
transition: opacity var(--motion-fast), transform var(--motion-fast);
}
.tabBtn:hover {
@@ -731,9 +838,13 @@ svg {
.tabBtn.active {
color: var(--text-strong);
border-color: var(--border);
background: var(--surface-muted);
box-shadow: inset 2px 0 0 var(--primary);
box-shadow: none;
}
.tabBtn.active::before {
opacity: 1;
transform: scaleY(1);
}
.tabIcon {
@@ -741,6 +852,12 @@ svg {
flex: 0 0 16px;
width: 16px;
height: 16px;
color: var(--muted-soft);
}
.tabBtn.active .tabIcon,
.tabBtn:hover .tabIcon {
color: currentColor;
}
.tabIcon svg {
@@ -860,12 +977,12 @@ summary.sectionTitle {
min-height: var(--control-height);
padding: 0 10px;
border: 1px solid var(--border-strong);
border-radius: var(--radius);
border-radius: var(--radius-md);
color: var(--text);
background: var(--surface);
font-size: 13px;
font-size: var(--text-base);
outline: none;
transition: border-color var(--motion-fast), box-shadow var(--motion-fast);
transition: border-color var(--motion-fast), box-shadow var(--motion-fast), background var(--motion-fast);
}
.input:hover,
@@ -878,7 +995,24 @@ summary.sectionTitle {
.small:focus,
.logSearchBox:focus {
border-color: var(--primary);
box-shadow: var(--focus-ring);
box-shadow: 0 0 0 1px var(--primary), var(--focus-ring);
}
.input::placeholder,
.small::placeholder,
.logSearchBox::placeholder {
color: var(--muted-soft);
}
select.input {
appearance: none;
-webkit-appearance: none;
background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
linear-gradient(135deg, var(--muted) 50%, transparent 50%);
background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
background-size: 5px 5px, 5px 5px;
background-repeat: no-repeat;
padding-right: 28px;
}
.textarea {
@@ -894,18 +1028,24 @@ summary.sectionTitle {
gap: 8px;
min-width: 0;
min-height: var(--control-height);
padding: 8px 10px;
padding: 7px 10px;
border: 1px solid var(--border);
border-radius: var(--radius);
border-radius: var(--radius-md);
color: var(--text);
background: var(--surface-soft);
font-size: 13px;
line-height: 1.35;
font-size: var(--text-base);
line-height: var(--leading-snug);
transition: border-color var(--motion-fast), background var(--motion-fast);
}
.check:hover {
border-color: var(--hover-border);
background: var(--surface-elevated);
background: var(--surface-muted);
}
.check:has(input[type="checkbox"]:checked) {
border-color: var(--primary-border);
background: var(--primary-soft);
}
.check input[type="checkbox"] {
@@ -997,18 +1137,22 @@ summary.sectionTitle {
.chartBlock {
min-width: 0;
padding: 12px;
padding: 14px;
border: 1px solid var(--border);
border-radius: var(--radius);
border-radius: var(--radius-md);
background: var(--surface-soft);
box-shadow: 0 1px 0 var(--hairline) inset;
transition: border-color var(--motion-fast);
}
.chartBlock:hover {
border-color: var(--hover-border);
}
.chartTitle {
color: var(--text-strong);
font-size: 13px;
font-size: var(--text-base);
font-weight: 550;
line-height: 1.35;
line-height: var(--leading-snug);
}
.chart {
@@ -1028,28 +1172,38 @@ summary.sectionTitle {
.barRow {
display: grid;
grid-template-columns: minmax(78px, 0.9fr) minmax(80px, 2fr) 42px;
grid-template-columns: minmax(78px, 0.9fr) minmax(80px, 2fr) 48px;
align-items: center;
gap: 8px;
gap: 10px;
min-width: 0;
min-height: 26px;
min-height: 24px;
transition: opacity var(--motion-fast);
}
.barRow + .barRow {
margin-top: 8px;
margin-top: 6px;
}
.barRow:hover {
opacity: 1;
}
.chartBlock:hover .barRow:not(:hover) {
opacity: 0.55;
}
.barLabel {
min-width: 0;
color: var(--text);
font-size: 12px;
font-size: var(--text-sm);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.barTrack {
height: 8px;
position: relative;
height: 6px;
overflow: hidden;
border-radius: 99px;
background: var(--chart-track);
@@ -1058,14 +1212,15 @@ summary.sectionTitle {
.barFill {
height: 100%;
border-radius: 99px;
background: var(--primary);
background: linear-gradient(90deg, color-mix(in oklab, var(--primary) 80%, #fff 20%), var(--primary));
transition: width var(--motion-slow);
}
.barValue {
color: var(--muted);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
font-size: 12px;
font-size: var(--text-sm);
font-variant-numeric: tabular-nums;
text-align: right;
}
@@ -1122,18 +1277,54 @@ summary.sectionTitle {
margin-top: 14px;
overflow: hidden;
border: 1px solid var(--border);
border-radius: var(--radius);
border-radius: var(--radius-md);
background: var(--preview-bg);
transition: border-color var(--motion);
}
.preview::after {
position: absolute;
inset: 0;
pointer-events: none;
content: "";
border-radius: inherit;
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}
.preview:hover {
border-color: var(--hover-border);
}
.preview.isShotEmpty {
border-style: dashed;
background: var(--surface-soft);
background:
repeating-linear-gradient(135deg, transparent 0 12px, color-mix(in oklab, var(--border) 50%, transparent) 12px 13px),
var(--surface-soft);
}
.preview.isShotEmpty::before {
position: absolute;
inset: 0;
content: "";
pointer-events: none;
background: linear-gradient(180deg, transparent, color-mix(in oklab, var(--primary) 16%, transparent), transparent);
background-size: 100% 200%;
animation: previewScan 2.4s ease-in-out infinite;
mix-blend-mode: plus-lighter;
}
@keyframes previewScan {
0% {
background-position: 0 -100%;
opacity: 0;
}
40% {
opacity: 1;
}
100% {
background-position: 0 100%;
opacity: 0;
}
}
.preview img {
@@ -1144,6 +1335,7 @@ summary.sectionTitle {
opacity: 0;
color: transparent;
font-size: 0;
transition: opacity var(--motion-slow);
}
.preview img[src*="screenshot.png"][data-loading="false"] {
@@ -1358,16 +1550,37 @@ summary.sectionTitle {
min-height: clamp(250px, 32vh, 390px);
max-height: clamp(250px, 32vh, 390px);
margin: 0;
padding: 12px;
padding: 12px 14px;
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;
font-size: 12px;
line-height: 1.55;
font-size: var(--text-sm);
line-height: 1.6;
overflow-wrap: anywhere;
white-space: pre-wrap;
scrollbar-width: thin;
scrollbar-color: var(--border-strong) transparent;
}
.log::-webkit-scrollbar {
width: 10px;
height: 10px;
}
.log::-webkit-scrollbar-track {
background: transparent;
}
.log::-webkit-scrollbar-thumb {
background: var(--border-strong);
border: 2px solid var(--log-bg);
border-radius: 99px;
}
.log::-webkit-scrollbar-thumb:hover {
background: var(--hover-border);
}
.panel.cardLog .log {
@@ -1377,7 +1590,34 @@ summary.sectionTitle {
.log::selection {
color: var(--text-strong);
background: rgba(184, 205, 246, 0.42);
background: color-mix(in oklab, var(--primary) 25%, transparent);
}
/* Global thin scrollbars */
* {
scrollbar-width: thin;
scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar {
width: 10px;
height: 10px;
}
*::-webkit-scrollbar-track {
background: transparent;
}
*::-webkit-scrollbar-thumb {
background: var(--border-strong);
border: 2px solid transparent;
background-clip: padding-box;
border-radius: 99px;
}
*::-webkit-scrollbar-thumb:hover {
background: var(--hover-border);
background-clip: padding-box;
}
@media (max-width: 900px) {