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:
337
server/src/wled_controller/static/css/patterns.css
Normal file
337
server/src/wled_controller/static/css/patterns.css
Normal file
@@ -0,0 +1,337 @@
|
||||
/* Static image stream styles */
|
||||
.image-preview-container {
|
||||
text-align: center;
|
||||
margin: 12px 0;
|
||||
padding: 12px;
|
||||
background: var(--bg-secondary);
|
||||
border-radius: 8px;
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
.stream-image-preview {
|
||||
max-width: 100%;
|
||||
max-height: 200px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
.stream-image-info {
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-muted);
|
||||
margin-top: 6px;
|
||||
}
|
||||
.validation-status {
|
||||
font-size: 0.8rem;
|
||||
margin-top: 4px;
|
||||
padding: 4px 8px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.validation-status.success {
|
||||
color: #4caf50;
|
||||
}
|
||||
.validation-status.error {
|
||||
color: #f44336;
|
||||
}
|
||||
.validation-status.loading {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
.stream-card-props {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.stream-card-prop {
|
||||
display: inline-block;
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-secondary);
|
||||
background: var(--border-color);
|
||||
padding: 2px 8px;
|
||||
border-radius: 10px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 180px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.stream-card-prop-full {
|
||||
max-width: 100%;
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
|
||||
/* Key Colors target styles */
|
||||
.kc-rect-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.kc-rect-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 8px;
|
||||
background: var(--bg-color);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
.kc-rect-row input[type="text"] {
|
||||
flex: 2;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.kc-rect-row input[type="number"] {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
.kc-rect-row .kc-rect-remove-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
color: #777;
|
||||
font-size: 1rem;
|
||||
cursor: pointer;
|
||||
padding: 4px;
|
||||
border-radius: 4px;
|
||||
flex-shrink: 0;
|
||||
transition: color 0.2s, background 0.2s;
|
||||
}
|
||||
|
||||
.kc-rect-row .kc-rect-remove-btn:hover {
|
||||
color: var(--danger-color);
|
||||
background: rgba(244, 67, 54, 0.1);
|
||||
}
|
||||
|
||||
.kc-rect-labels {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
padding: 0 8px;
|
||||
margin-bottom: 4px;
|
||||
font-size: 0.7rem;
|
||||
color: var(--text-secondary);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.kc-rect-labels span:first-child {
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
.kc-rect-labels span {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.kc-rect-labels span:last-child {
|
||||
width: 28px;
|
||||
flex: 0 0 28px;
|
||||
}
|
||||
|
||||
.kc-add-rect-btn {
|
||||
width: 100%;
|
||||
font-size: 0.85rem;
|
||||
padding: 6px 12px;
|
||||
}
|
||||
|
||||
.kc-rect-empty {
|
||||
text-align: center;
|
||||
color: var(--text-secondary);
|
||||
font-size: 0.85rem;
|
||||
padding: 12px;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.kc-color-swatches {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 6px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.kc-swatch {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 3px;
|
||||
}
|
||||
|
||||
.kc-swatch-color {
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border-radius: 6px;
|
||||
border: 2px solid var(--border-color);
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
.kc-swatch-label {
|
||||
font-size: 0.6rem;
|
||||
color: var(--text-secondary);
|
||||
max-width: 40px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.kc-no-colors {
|
||||
color: var(--text-secondary);
|
||||
font-size: 0.8rem;
|
||||
font-style: italic;
|
||||
padding: 4px 0;
|
||||
}
|
||||
|
||||
/* Pattern Template Visual Editor */
|
||||
.pattern-canvas-container {
|
||||
position: relative;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
background: var(--bg-color);
|
||||
border: 1px solid var(--border-color);
|
||||
margin-bottom: 12px;
|
||||
resize: both;
|
||||
width: 820px;
|
||||
min-width: 400px;
|
||||
max-width: 100%;
|
||||
min-height: 200px;
|
||||
height: 450px;
|
||||
max-height: calc(100vh - 400px);
|
||||
}
|
||||
|
||||
#pattern-canvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: block;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.pattern-canvas-toolbar {
|
||||
display: flex;
|
||||
gap: 2px;
|
||||
padding: 4px;
|
||||
align-items: center;
|
||||
background: var(--bg-secondary);
|
||||
border-radius: 6px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.pattern-canvas-toolbar .btn {
|
||||
flex: 0 0 auto;
|
||||
min-width: 32px;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
padding: 0;
|
||||
font-size: 1rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.pattern-bg-row {
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
align-items: center;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.pattern-bg-row select {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.pattern-capture-btn {
|
||||
flex: 0 0 auto;
|
||||
min-width: 36px !important;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
padding: 0 !important;
|
||||
font-size: 1.1rem;
|
||||
line-height: 36px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pattern-rect-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
margin-top: 8px;
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.pattern-rect-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
padding: 6px 8px;
|
||||
background: var(--bg-color);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: 6px;
|
||||
font-size: 0.85rem;
|
||||
cursor: pointer;
|
||||
transition: border-color 0.15s;
|
||||
}
|
||||
|
||||
.pattern-rect-row.selected {
|
||||
border-color: var(--primary-color);
|
||||
background: rgba(76, 175, 80, 0.08);
|
||||
}
|
||||
|
||||
.pattern-rect-row input[type="text"] {
|
||||
flex: 2;
|
||||
min-width: 0;
|
||||
padding: 4px 6px;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.pattern-rect-row input[type="number"] {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
width: 55px;
|
||||
padding: 4px 6px;
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.pattern-rect-row .pattern-rect-remove-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
color: #777;
|
||||
font-size: 0.9rem;
|
||||
cursor: pointer;
|
||||
padding: 2px 4px;
|
||||
border-radius: 4px;
|
||||
flex-shrink: 0;
|
||||
transition: color 0.2s, background 0.2s;
|
||||
}
|
||||
|
||||
.pattern-rect-row .pattern-rect-remove-btn:hover {
|
||||
color: var(--danger-color);
|
||||
background: rgba(244, 67, 54, 0.1);
|
||||
}
|
||||
|
||||
.pattern-rect-labels {
|
||||
display: flex;
|
||||
gap: 6px;
|
||||
padding: 0 8px;
|
||||
margin-bottom: 2px;
|
||||
font-size: 0.7rem;
|
||||
color: var(--text-secondary);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.pattern-rect-labels span:first-child {
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
.pattern-rect-labels span {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.pattern-rect-labels span:last-child {
|
||||
width: 24px;
|
||||
flex: 0 0 24px;
|
||||
}
|
||||
Reference in New Issue
Block a user