Frontend polish: loading states, CSS variables, focus indicators, scroll lock

- Add tab refresh loading bar animation for all 4 tab loaders
- Add profiles loading guard to prevent concurrent fetches
- Centralize theme colors into CSS variables (--text-secondary, --text-muted,
  --bg-secondary, --success-color, --shadow-color) for both dark/light themes
- Replace hardcoded gray values across 10 CSS files with variables
- Fix duplicate .btn-sm definition in modal.css
- Fix z-index: toast 2001→2500 to safely clear modals at 2000
- Add :focus-visible keyboard navigation indicators for all interactive elements
- Add responsive breakpoints for tab bar and header on narrow screens
- Prevent background page scroll when command palette is open

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-25 21:09:42 +03:00
parent 82e12ffaac
commit 7f80faf8be
17 changed files with 162 additions and 49 deletions

View File

@@ -14,22 +14,32 @@
/* Dark theme (default) */
[data-theme="dark"] {
--bg-color: #1a1a1a;
--bg-secondary: #242424;
--card-bg: #2d2d2d;
--text-color: #e0e0e0;
--text-secondary: #999;
--text-muted: #777;
--border-color: #404040;
--display-badge-bg: rgba(0, 0, 0, 0.4);
--primary-text-color: #66bb6a;
--success-color: #28a745;
--shadow-color: rgba(0, 0, 0, 0.3);
color-scheme: dark;
}
/* Light theme */
[data-theme="light"] {
--bg-color: #f5f5f5;
--bg-secondary: #eee;
--card-bg: #ffffff;
--text-color: #333333;
--text-secondary: #666;
--text-muted: #999;
--border-color: #e0e0e0;
--display-badge-bg: rgba(255, 255, 255, 0.85);
--primary-text-color: #3d8b40;
--success-color: #2e7d32;
--shadow-color: rgba(0, 0, 0, 0.12);
color-scheme: light;
}

View File

@@ -61,7 +61,7 @@ section {
}
.card:hover {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
box-shadow: 0 4px 12px var(--shadow-color);
}
.card-tutorial-btn {
@@ -106,7 +106,7 @@ section {
.card-autostart-btn {
background: none;
border: none;
color: #777;
color: var(--text-muted);
font-size: 1rem;
width: 28px;
height: 28px;
@@ -130,7 +130,7 @@ section {
.card-power-btn {
background: none;
border: none;
color: #777;
color: var(--text-muted);
font-size: 1rem;
width: 28px;
height: 28px;
@@ -153,7 +153,7 @@ section {
right: 10px;
background: none;
border: none;
color: #777;
color: var(--text-muted);
font-size: 1rem;
width: 28px;
height: 28px;
@@ -221,7 +221,7 @@ section {
.card-meta {
font-size: 0.8rem;
color: #999;
color: var(--text-secondary);
display: inline-flex;
align-items: center;
gap: 4px;
@@ -507,7 +507,7 @@ ul.section-tip li {
.metric-label {
font-size: 0.8rem;
color: #999;
color: var(--text-secondary);
}
/* Target FPS sparkline row */
@@ -586,7 +586,7 @@ ul.section-tip li {
flex-wrap: wrap;
gap: 8px;
font-size: 0.75rem;
color: #999;
color: var(--text-secondary);
margin-top: 4px;
}

View File

@@ -36,7 +36,7 @@
}
.info-label {
color: #999;
color: var(--text-secondary);
}
.info-value {
@@ -155,7 +155,7 @@
label {
display: block;
margin-bottom: 5px;
color: #999;
color: var(--text-secondary);
font-weight: 500;
}
@@ -211,7 +211,7 @@ input:-webkit-autofill:focus {
.loading {
text-align: center;
padding: 40px;
color: #999;
color: var(--text-secondary);
}
.loading-spinner {
@@ -325,8 +325,8 @@ input:-webkit-autofill:focus {
font-size: 15px;
opacity: 0;
transition: opacity 0.3s, transform 0.3s;
z-index: 2001;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
z-index: 2500;
box-shadow: 0 4px 20px var(--shadow-color);
min-width: 300px;
text-align: center;
}
@@ -354,3 +354,35 @@ input:-webkit-autofill:focus {
.toast.info {
background: var(--info-color);
}
/* ── Focus-visible indicators for keyboard navigation ── */
.btn:focus-visible,
.btn-icon:focus-visible,
.card-remove-btn:focus-visible,
.card-autostart-btn:focus-visible,
.card-power-btn:focus-visible,
.card-tutorial-btn:focus-visible,
.hint-toggle:focus-visible,
.modal-close-btn:focus-visible,
.modal-header-btn:focus-visible,
.tab-btn:focus-visible,
.stream-tab-btn:focus-visible,
.search-toggle:focus-visible,
.theme-toggle:focus-visible,
.tutorial-trigger-btn:focus-visible,
.tutorial-close-btn:focus-visible,
.btn-expand-collapse:focus-visible,
.btn-filter-action:focus-visible,
.settings-toggle:focus-visible {
outline: 2px solid var(--primary-color);
outline-offset: 2px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.2);
}

View File

@@ -183,7 +183,7 @@
}
.dashboard-status-dot.active {
color: #4CAF50;
color: var(--primary-color);
animation: pulse 2s infinite;
}
@@ -209,7 +209,7 @@
border-radius: 10px;
font-size: 0.7rem;
font-weight: 600;
background: var(--success-color, #28a745);
background: var(--success-color);
color: #fff;
flex-shrink: 0;
}

View File

@@ -87,7 +87,7 @@ h2 {
}
.health-dot.health-online {
background-color: #4CAF50;
background-color: var(--primary-color);
box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
}
@@ -97,7 +97,7 @@ h2 {
}
.health-dot.health-unknown {
background-color: #9E9E9E;
background-color: var(--text-secondary);
animation: pulse 2s infinite;
}
@@ -166,12 +166,32 @@ h2 {
.tab-panel {
display: none;
position: relative;
}
.tab-panel.active {
display: block;
}
/* Thin animated bar at top of tab panel during data refresh */
.tab-panel.refreshing::before {
content: '';
position: absolute;
top: 0;
left: 0;
width: 40%;
height: 2px;
background: var(--primary-color);
border-radius: 1px;
animation: tab-loading-slide 1.2s ease-in-out infinite;
z-index: 2;
}
@keyframes tab-loading-slide {
0% { left: -40%; }
100% { left: 100%; }
}
/* Theme Toggle */
.search-toggle,
.theme-toggle {
@@ -247,7 +267,7 @@ h2 {
background: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: 12px;
box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
box-shadow: 0 16px 48px var(--shadow-color);
display: flex;
flex-direction: column;
overflow: hidden;
@@ -347,10 +367,32 @@ h2 {
text-align: center;
}
@media (max-width: 900px) {
.server-info {
flex-wrap: wrap;
gap: 4px;
}
}
@media (max-width: 768px) {
header {
flex-direction: column;
gap: 8px;
text-align: center;
}
.container {
padding: 12px;
}
}
@media (max-width: 600px) {
.tab-bar {
flex-wrap: wrap;
}
.tab-btn {
padding: 8px 12px;
font-size: 0.9rem;
}
}

View File

@@ -27,7 +27,7 @@
max-height: calc(100vh - 40px);
display: flex;
flex-direction: column;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
box-shadow: 0 8px 32px var(--shadow-color);
animation: slideUp 0.3s ease-out;
}
@@ -96,7 +96,7 @@
.modal-close-btn {
background: none;
border: none;
color: #777;
color: var(--text-muted);
font-size: 1.2rem;
width: 32px;
height: 32px;
@@ -123,7 +123,7 @@
}
.modal-description {
color: #999;
color: var(--text-secondary);
margin-bottom: 20px;
line-height: 1.6;
}
@@ -175,7 +175,7 @@
height: 18px;
font-size: 0.7rem;
line-height: 1;
color: var(--text-secondary, #888);
color: var(--text-secondary);
cursor: pointer;
padding: 0;
display: inline-flex;
@@ -199,14 +199,14 @@
.input-hint {
display: block;
margin: 0 0 6px 0;
color: #666;
color: var(--text-muted);
font-size: 0.85rem;
}
.field-desc {
display: block;
margin: 4px 0 0 0;
color: #888;
color: var(--text-secondary);
font-size: 0.82rem;
font-style: italic;
}
@@ -224,7 +224,7 @@
display: block;
margin-bottom: 4px;
font-size: 0.85rem;
color: #aaa;
color: var(--text-secondary);
}
.inline-field input[type="number"] {
@@ -243,7 +243,7 @@
.device-led-info {
display: block;
margin-top: 4px;
color: var(--text-muted, #888);
color: var(--text-muted);
font-size: 0.85em;
}
@@ -257,7 +257,7 @@
.segment-index-label {
font-size: 0.8rem;
font-weight: 600;
color: #888;
color: var(--text-secondary);
}
.btn-icon-inline {
@@ -297,7 +297,7 @@
.segment-range-fields label {
font-size: 0.82rem;
color: #aaa;
color: var(--text-secondary);
white-space: nowrap;
}
@@ -310,7 +310,7 @@
align-items: center;
gap: 4px;
font-size: 0.85rem;
color: #aaa;
color: var(--text-secondary);
cursor: pointer;
white-space: nowrap;
}
@@ -320,8 +320,9 @@
}
.btn-sm {
font-size: 0.85rem;
font-size: 0.8rem;
padding: 4px 10px;
min-width: auto;
}
.fps-hint {
@@ -363,7 +364,7 @@
gap: 6px;
font-size: 0.9rem;
font-weight: 500;
color: var(--text-secondary, #888);
color: var(--text-secondary);
padding: 4px 0;
user-select: none;
}
@@ -413,12 +414,6 @@
font-size: 1.4rem;
}
.btn-sm {
padding: 4px 10px;
font-size: 0.8rem;
min-width: auto;
}
.btn-display-picker {
width: 100%;
padding: 10px;

View File

@@ -25,10 +25,10 @@
border-radius: 4px;
}
.validation-status.success {
color: #4caf50;
color: var(--primary-color);
}
.validation-status.error {
color: #f44336;
color: var(--danger-color);
}
.validation-status.loading {
color: var(--text-muted);
@@ -131,7 +131,7 @@
.kc-rect-row .kc-rect-remove-btn {
background: none;
border: none;
color: #777;
color: var(--text-muted);
font-size: 1rem;
cursor: pointer;
padding: 4px;
@@ -336,7 +336,7 @@
.pattern-rect-row .pattern-rect-remove-btn {
background: none;
border: none;
color: #777;
color: var(--text-muted);
font-size: 0.9rem;
cursor: pointer;
padding: 2px 4px;

View File

@@ -1,7 +1,7 @@
/* ===== PROFILES ===== */
.badge-profile-active {
background: var(--success-color, #28a745);
background: var(--success-color);
color: #fff;
}

View File

@@ -731,3 +731,14 @@
grid-template-columns: 1fr;
}
}
@media (max-width: 600px) {
.stream-tab-bar {
flex-wrap: wrap;
}
.stream-tab-btn {
padding: 6px 10px;
font-size: 0.85rem;
}
}

View File

@@ -73,7 +73,7 @@
background: var(--card-bg);
border: 2px solid var(--primary-color);
border-radius: 8px;
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
box-shadow: 0 8px 24px var(--shadow-color);
z-index: 102;
pointer-events: auto;
animation: tutorial-tooltip-in 0.25s ease-out;
@@ -101,7 +101,7 @@
.tutorial-close-btn {
background: none;
border: none;
color: #777;
color: var(--text-muted);
font-size: 1.3rem;
width: 24px;
height: 24px;