Split monolithic index.html and style.css for maintainability

- Extract 15 modals and 3 partials from index.html into Jinja2 templates
  (templates/modals/*.html, templates/partials/*.html)
- Split style.css (3,712 lines) into 11 feature-scoped CSS files under
  static/css/ (base, layout, components, cards, modal, calibration,
  dashboard, streams, patterns, profiles, tutorials)
- Switch root route from FileResponse to Jinja2Templates
- Add jinja2 dependency
- Consolidate duplicate @keyframes spin definition
- Browser receives identical assembled HTML — zero JS changes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-20 00:42:50 +03:00
parent 755077607a
commit 2b90fafb9c
35 changed files with 4986 additions and 4990 deletions

View File

@@ -0,0 +1,209 @@
header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px 0 10px;
margin-bottom: 10px;
position: relative;
z-index: 2100;
}
.header-title {
display: flex;
align-items: center;
gap: 10px;
}
h1 {
font-size: 2rem;
color: var(--primary-color);
}
h2 {
margin-bottom: 20px;
color: var(--text-color);
font-size: 1.5rem;
}
.server-info {
display: flex;
align-items: center;
gap: 15px;
}
.header-link {
color: var(--text-secondary);
text-decoration: none;
font-size: 0.85rem;
font-weight: 500;
padding: 4px 8px;
border-radius: 4px;
transition: color 0.2s, background 0.2s;
}
.header-link:hover {
color: var(--text-color);
background: var(--bg-secondary);
}
#server-version {
font-size: 0.75rem;
font-weight: 400;
color: var(--text-secondary);
background: var(--border-color);
padding: 2px 8px;
border-radius: 10px;
letter-spacing: 0.03em;
}
.status-badge {
font-size: 1.5rem;
animation: pulse 2s infinite;
}
.status-badge.online {
color: var(--primary-color);
}
.status-badge.offline {
color: var(--danger-color);
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
/* WLED device health indicator */
.health-dot {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 50%;
margin-right: 8px;
vertical-align: middle;
flex-shrink: 0;
}
.health-dot.health-online {
background-color: #4CAF50;
box-shadow: 0 0 6px rgba(76, 175, 80, 0.6);
}
.health-dot.health-offline {
background-color: var(--danger-color);
box-shadow: 0 0 6px rgba(244, 67, 54, 0.6);
}
.health-dot.health-unknown {
background-color: #9E9E9E;
animation: pulse 2s infinite;
}
.health-latency {
font-size: 0.7rem;
font-weight: 400;
color: #4CAF50;
margin-left: auto;
padding-left: 8px;
opacity: 0.85;
}
.health-latency.offline {
color: var(--danger-color);
}
/* Tabs */
.tab-bar {
display: flex;
align-items: center;
gap: 4px;
border-bottom: 2px solid var(--border-color);
margin-bottom: 16px;
}
.tab-btn {
background: none;
border: none;
padding: 10px 18px;
font-size: 1rem;
font-weight: 500;
color: var(--text-secondary);
cursor: pointer;
border-bottom: 2px solid transparent;
margin-bottom: -2px;
transition: color 0.2s, border-color 0.2s;
}
.tab-btn:hover {
color: var(--text-color);
}
.tab-btn.active {
color: var(--primary-color);
border-bottom-color: var(--primary-color);
}
.tab-panel {
display: none;
}
.tab-panel.active {
display: block;
}
/* Theme Toggle */
.theme-toggle {
background: var(--card-bg);
border: 1px solid var(--border-color);
padding: 6px 12px;
border-radius: 4px;
cursor: pointer;
font-size: 1.2rem;
transition: transform 0.2s;
margin-left: 10px;
}
.theme-toggle:hover {
transform: scale(1.1);
}
/* Footer */
.app-footer {
margin-top: 20px;
padding: 15px 0;
text-align: center;
}
.footer-content {
color: var(--text-secondary);
font-size: 0.9rem;
}
.footer-content p {
margin: 0;
}
.footer-content strong {
color: var(--text-color);
}
.footer-content a {
color: var(--primary-color);
text-decoration: none;
transition: opacity 0.2s;
}
.footer-content a:hover {
opacity: 0.8;
text-decoration: underline;
}
@media (max-width: 768px) {
header {
flex-direction: column;
gap: 15px;
text-align: center;
}
}