Files
wled-screen-controller-mixed/server/src/wled_controller/static/css/modal.css
alexei.dolgolyov 9ee6dcf94a Add PWA support and mobile responsive layout
- PWA manifest, service worker (stale-while-revalidate for static assets,
  network-only for API), and app icons for installability
- Root-scoped /manifest.json and /sw.js routes in FastAPI
- New mobile.css with responsive breakpoints at 768/600/400px:
  fixed bottom tab bar on phones, single-column cards, full-screen modals,
  compact header toolbar, touch-friendly targets
- Fix modal-content-wide min-width overflow on small screens
- Update README with Camera, OpenRGB, and PWA features

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 13:20:21 +03:00

972 lines
18 KiB
CSS

/* Modal Styles */
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.8);
z-index: 2000;
align-items: center;
justify-content: center;
animation: fadeIn 0.2s ease-out;
backdrop-filter: blur(2px);
}
/* Confirm dialog must stack above all other modals */
#confirm-modal {
z-index: 2500;
}
/* Audio test spectrum canvas */
.audio-test-canvas {
display: block;
width: 100%;
height: 200px;
background: #111;
border-radius: 6px;
}
.audio-test-stats {
display: flex;
gap: 20px;
align-items: center;
padding: 10px 0 0;
font-family: monospace;
}
.audio-test-stat {
display: flex;
align-items: center;
gap: 6px;
}
.audio-test-stat-label {
color: var(--text-muted, #888);
font-size: 0.85em;
}
.audio-test-stat-value {
font-weight: 600;
min-width: 50px;
}
.audio-test-beat-dot {
display: inline-block;
width: 10px;
height: 10px;
border-radius: 50%;
background: #444;
transition: background 0.1s;
}
.audio-test-beat-dot.active {
background: #ff4444;
box-shadow: 0 0 8px #ff4444;
}
.audio-test-status {
text-align: center;
padding: 8px 0;
color: var(--text-muted, #888);
font-size: 0.9em;
}
/* Value source test chart canvas */
.vs-test-canvas {
display: block;
width: 100%;
height: 200px;
background: #111;
border-radius: 6px;
}
.vs-test-stats {
display: flex;
gap: 20px;
align-items: center;
padding: 10px 0 0;
font-family: monospace;
}
.vs-test-stat {
display: flex;
align-items: center;
gap: 6px;
}
.vs-test-stat-label {
color: var(--text-muted, #888);
font-size: 0.85em;
}
.vs-test-stat-value {
font-weight: 600;
min-width: 50px;
}
.vs-test-value-large {
font-size: 1.3em;
color: #4caf50;
}
.vs-test-status {
text-align: center;
padding: 8px 0;
color: var(--text-muted, #888);
font-size: 0.9em;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.modal-content {
background: var(--card-bg);
border: 1px solid var(--border-color);
border-radius: 12px;
max-width: 500px;
width: 90%;
max-height: calc(100vh - 40px);
display: flex;
flex-direction: column;
box-shadow: 0 8px 32px var(--shadow-color);
animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
#template-modal .modal-content {
max-width: 500px !important;
width: 100% !important;
}
#test-template-modal .modal-content {
max-width: 420px;
}
@keyframes slideUp {
from {
transform: translateY(20px) scale(0.98);
opacity: 0;
}
to {
transform: translateY(0) scale(1);
opacity: 1;
}
}
.modal-header {
padding: 24px 24px 16px 24px;
border-bottom: 1px solid var(--border-color);
display: flex;
align-items: center;
justify-content: space-between;
}
.modal-header h2 {
margin: 0;
font-size: 1.5rem;
color: var(--text-color);
}
.modal-header-actions {
display: flex;
align-items: center;
gap: 4px;
}
.modal-header-btn {
background: none;
border: none;
font-size: 1.1rem;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
border-radius: 4px;
transition: background 0.2s;
flex-shrink: 0;
}
.modal-header-btn:hover {
background: rgba(128, 128, 128, 0.15);
}
.modal-header-btn:disabled {
opacity: 0.4;
cursor: default;
}
.modal-close-btn {
background: none;
border: none;
color: var(--text-muted);
font-size: 1.2rem;
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
border-radius: 4px;
transition: color 0.2s, background 0.2s;
flex-shrink: 0;
}
.modal-close-btn:hover {
color: var(--text-color);
background: rgba(128, 128, 128, 0.15);
}
.modal-body {
padding: 24px;
overflow-y: auto;
scrollbar-gutter: stable;
flex: 1 1 auto;
min-height: 0;
}
.modal-description {
color: var(--text-secondary);
margin-bottom: 20px;
line-height: 1.6;
}
.password-input-wrapper {
position: relative;
display: flex;
align-items: center;
}
.password-input-wrapper input {
flex: 1;
padding-right: 45px;
}
.password-toggle {
position: absolute;
right: 8px;
background: none;
border: none;
cursor: pointer;
font-size: 1.2rem;
padding: 8px;
color: var(--text-color);
opacity: 0.6;
transition: opacity 0.2s;
}
.password-toggle:hover {
opacity: 1;
}
.label-row {
display: flex;
align-items: center;
gap: 6px;
margin-bottom: 5px;
}
.label-row label {
margin-bottom: 0;
}
.hint-toggle {
background: none;
border: 1px solid var(--border-color);
border-radius: 50%;
width: 18px;
height: 18px;
font-size: 0.7rem;
line-height: 1;
color: var(--text-secondary);
cursor: pointer;
padding: 0;
display: inline-flex;
align-items: center;
justify-content: center;
opacity: 0.6;
transition: opacity 0.2s;
flex-shrink: 0;
}
.hint-toggle:hover {
opacity: 1;
}
.hint-toggle.active {
opacity: 1;
color: var(--primary-text-color, #4CAF50);
border-color: var(--primary-color, #4CAF50);
}
.input-hint {
display: block;
margin: 0 0 6px 0;
color: var(--text-muted);
font-size: 0.85rem;
}
.field-desc {
display: block;
margin: 4px 0 0 0;
color: var(--text-secondary);
font-size: 0.82rem;
font-style: italic;
}
.inline-fields {
display: flex;
gap: 12px;
}
.inline-field {
flex: 1;
}
.inline-field label {
display: block;
margin-bottom: 4px;
font-size: 0.85rem;
color: var(--text-secondary);
}
.inline-field input[type="number"] {
width: 100%;
}
/* Segment rows in target editor */
.segment-row {
border: 1px solid var(--border-color, #333);
border-radius: 6px;
padding: 8px 10px;
margin-bottom: 6px;
background: var(--card-bg, #1e1e1e);
}
.device-led-info {
display: block;
margin-top: 4px;
color: var(--text-muted);
font-size: 0.85em;
}
.segment-row-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 6px;
}
.segment-index-label {
font-size: 0.8rem;
font-weight: 600;
color: var(--text-secondary);
}
.btn-icon-inline {
background: none;
border: none;
cursor: pointer;
font-size: 1.1rem;
padding: 0 4px;
line-height: 1;
}
.btn-danger-text {
color: var(--danger-color, #f44336);
}
.btn-danger-text:hover {
color: #ff6659;
}
.segment-row-fields {
display: flex;
flex-wrap: wrap;
gap: 8px;
align-items: center;
}
.segment-row-fields select {
flex: 1 1 100%;
}
.segment-range-fields {
display: flex;
gap: 6px;
align-items: center;
flex: 1;
}
.segment-range-fields label {
font-size: 0.82rem;
color: var(--text-secondary);
white-space: nowrap;
}
.segment-range-fields input[type="number"] {
width: 70px;
}
.segment-reverse-label {
display: flex;
align-items: center;
gap: 4px;
font-size: 0.85rem;
color: var(--text-secondary);
cursor: pointer;
white-space: nowrap;
}
.segment-reverse-label input[type="checkbox"] {
margin: 0;
}
.btn-sm {
font-size: 0.8rem;
padding: 4px 10px;
min-width: auto;
}
.fps-hint {
display: block;
margin-top: 4px;
font-size: 0.82rem;
color: var(--info-color, #2196F3);
}
.slider-row {
display: flex;
align-items: center;
gap: 12px;
}
.slider-row input[type="range"] {
flex: 1;
}
.slider-value {
min-width: 28px;
text-align: center;
font-weight: 600;
font-size: 0.95rem;
color: var(--text-primary);
}
.form-collapse {
margin-bottom: 12px;
border-top: 1px solid var(--border-color);
padding-top: 8px;
}
.form-collapse > summary {
cursor: pointer;
list-style: none;
display: flex;
align-items: center;
gap: 6px;
font-size: 0.9rem;
font-weight: 500;
color: var(--text-secondary);
padding: 4px 0;
user-select: none;
}
.form-collapse > summary::-webkit-details-marker { display: none; }
.form-collapse > summary::before {
content: '';
display: inline-block;
width: 0;
height: 0;
border-left: 0.35em solid currentColor;
border-top: 0.25em solid transparent;
border-bottom: 0.25em solid transparent;
opacity: 0.6;
transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
flex-shrink: 0;
}
.form-collapse[open] > summary::before {
transform: rotate(90deg);
}
.form-collapse > summary:hover {
color: var(--text-color);
}
.form-collapse-body {
padding-top: 8px;
}
.error-message {
background: rgba(244, 67, 54, 0.1);
border: 1px solid var(--danger-color);
color: var(--danger-color);
padding: 12px;
border-radius: 4px;
margin-top: 15px;
font-size: 0.9rem;
}
.modal-footer {
padding: 16px 24px 24px 24px;
display: flex;
justify-content: flex-end;
gap: 8px;
}
.modal-footer .btn-icon {
min-width: 60px;
padding: 10px 20px;
font-size: 1.4rem;
}
.btn-display-picker {
width: 100%;
padding: 10px;
border: 1px solid var(--border-color);
border-radius: 4px;
background: var(--bg-color);
color: var(--text-color);
font-size: 1rem;
cursor: pointer;
text-align: left;
transition: border-color 0.2s, box-shadow 0.2s;
font-weight: 400;
}
.btn-display-picker:hover {
border-color: var(--primary-color);
box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.15);
}
.modal-content-wide {
width: fit-content;
max-width: calc(100vw - 40px);
max-height: calc(100vh - 40px);
display: flex;
flex-direction: column;
}
@media (min-width: 769px) {
.modal-content-wide {
min-width: 500px;
}
}
.modal-content-wide .modal-body {
overflow-y: auto;
scrollbar-gutter: stable;
flex: 1 1 auto;
min-height: 0;
}
@media (max-width: 768px) {
.modal-content {
width: 95%;
margin: 20px;
}
.modal-footer .btn {
min-width: 80px;
}
}
/* Image Lightbox */
.lightbox {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.92);
z-index: 10000;
justify-content: center;
align-items: center;
cursor: zoom-out;
}
.lightbox.active {
display: flex;
}
.lightbox-content {
position: relative;
max-width: 95%;
max-height: 95%;
cursor: default;
}
.lightbox-content img {
max-width: 100%;
max-height: 90vh;
object-fit: contain;
border-radius: 4px;
display: block;
}
.lightbox-close {
position: absolute;
top: 16px;
right: 16px;
background: rgba(255, 255, 255, 0.15);
border: none;
color: white;
font-size: 1.5rem;
width: 40px;
height: 40px;
border-radius: 50%;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.2s;
z-index: 1;
}
.lightbox-close:hover {
background: rgba(255, 255, 255, 0.3);
}
.lightbox-refresh-btn {
position: absolute;
top: 16px;
right: 64px;
background: rgba(255, 255, 255, 0.15);
border: none;
color: white;
font-size: 1.2rem;
width: 40px;
height: 40px;
border-radius: 50%;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.2s;
z-index: 1;
}
.lightbox-refresh-btn:hover {
background: rgba(255, 255, 255, 0.3);
}
.lightbox-refresh-btn.active {
background: var(--primary-color);
}
.lightbox-stats {
position: absolute;
bottom: 8px;
left: 8px;
background: rgba(0, 0, 0, 0.7);
backdrop-filter: blur(8px);
color: white;
padding: 8px 14px;
border-radius: 6px;
font-size: 0.8rem;
display: flex;
gap: 16px;
flex-wrap: wrap;
}
.lightbox-stats .stat-item {
display: flex;
gap: 4px;
align-items: center;
}
.lightbox-stats .stat-item span {
opacity: 0.7;
}
.lightbox-stats .stat-item strong {
font-weight: 600;
}
/* Display Picker Lightbox */
.display-picker-content {
max-width: 900px;
width: 90%;
text-align: center;
}
.display-picker-title {
color: white;
font-size: 1.3rem;
margin-bottom: 20px;
font-weight: 500;
}
.display-picker-canvas {
background: rgba(255, 255, 255, 0.05);
border: 2px dashed rgba(255, 255, 255, 0.15);
border-radius: 8px;
padding: 24px;
width: 100%;
box-sizing: border-box;
}
.layout-display-pickable {
cursor: pointer !important;
border: 2px solid var(--border-color) !important;
background: linear-gradient(135deg, rgba(128, 128, 128, 0.08), rgba(128, 128, 128, 0.03)) !important;
}
.layout-display-pickable:hover {
box-shadow: 0 0 20px rgba(76, 175, 80, 0.4);
border-color: var(--primary-color) !important;
}
.layout-display-pickable.selected {
border-color: var(--primary-color) !important;
box-shadow: 0 0 16px rgba(76, 175, 80, 0.5);
background: rgba(76, 175, 80, 0.12) !important;
}
/* ── Device picker list (cameras, scrcpy) ─────────────────────── */
.device-picker-list {
display: flex;
flex-direction: column;
gap: 0.5rem;
}
.device-picker-item {
position: relative;
display: flex;
align-items: center;
gap: 0.75rem;
padding: 0.75rem 1rem;
border: 2px solid var(--border-color);
border-radius: 8px;
background: linear-gradient(135deg, rgba(128, 128, 128, 0.08), rgba(128, 128, 128, 0.03));
cursor: pointer;
}
.device-picker-item .layout-index-label {
position: static;
flex-shrink: 0;
}
.device-picker-item .layout-display-label {
text-align: left;
padding: 0;
}
/* ── Gradient editor ────────────────────────────────────────────── */
.effect-palette-preview {
width: 100%;
height: 20px;
border-radius: 6px;
margin-top: 6px;
border: 1px solid var(--border-color);
}
.gradient-editor {
position: relative;
width: 100%;
user-select: none;
}
#gradient-canvas {
width: 100%;
height: 44px;
display: block;
border-radius: 6px 6px 0 0;
cursor: crosshair;
border: 1px solid var(--border-color);
border-bottom: none;
}
.gradient-markers-track {
position: relative;
height: 28px;
border: 1px solid var(--border-color);
border-radius: 0 0 6px 6px;
background: var(--card-bg);
cursor: crosshair;
margin-bottom: 12px;
}
.gradient-marker {
position: absolute;
width: 16px;
height: 16px;
border-radius: 50%;
border: 2px solid #fff;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
cursor: grab;
transform: translateX(-50%);
top: 6px;
transition: box-shadow 0.1s;
}
.gradient-marker.selected {
border-color: var(--primary-color);
box-shadow: 0 0 0 2px var(--primary-color), 0 1px 4px rgba(0, 0, 0, 0.5);
}
.gradient-marker:active {
cursor: grabbing;
}
.gradient-stop-row {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 8px;
margin-bottom: 6px;
border: 1px solid var(--border-color);
border-radius: 4px;
background: var(--card-bg);
}
.gradient-stop-row.selected {
border-color: var(--primary-color);
}
.gradient-stop-pos {
width: 76px;
max-width: 76px;
flex-shrink: 0;
}
.gradient-stop-color {
width: 38px;
height: 28px;
flex-shrink: 0;
border: 1px solid var(--border-color);
padding: 1px;
border-radius: 4px;
cursor: pointer;
background: transparent;
}
.gradient-stop-bidir-btn {
font-size: 0.75rem;
padding: 0;
width: 26px;
height: 26px;
flex: 0 0 26px;
opacity: 0.6;
}
.gradient-stop-remove-btn {
font-size: 0.75rem;
padding: 0;
width: 26px;
height: 26px;
flex: 0 0 26px;
}
.gradient-stop-bidir-btn.active {
background: var(--primary-color);
color: var(--primary-contrast);
border-color: var(--primary-color);
opacity: 1;
}
.gradient-stop-spacer {
flex: 1;
}
/* ── Color Cycle editor ──────────────────────────────────────── */
#color-cycle-colors-list {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-bottom: 8px;
}
.color-cycle-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
}
.color-cycle-item input[type="color"] {
width: 36px;
height: 28px;
border: 1px solid var(--border-color);
border-radius: 4px;
padding: 1px;
cursor: pointer;
background: transparent;
flex-shrink: 0;
}
.color-cycle-remove-btn {
font-size: 0.6rem;
padding: 0;
width: 36px;
height: 14px;
min-width: unset;
line-height: 1;
}
/* ── Composite layer editor ────────────────────────────────────── */
#composite-layers-list {
display: flex;
flex-direction: column;
gap: 6px;
margin-bottom: 8px;
}
.composite-layer-item {
display: flex;
flex-direction: column;
gap: 4px;
padding: 6px 8px;
border: 1px solid var(--border-color);
border-radius: 4px;
background: var(--card-bg);
}
.composite-layer-row {
display: flex;
align-items: center;
gap: 6px;
}
.composite-layer-source {
flex: 1;
min-width: 0;
}
.composite-layer-blend {
width: 100px;
flex-shrink: 0;
}
.composite-layer-opacity-label {
font-size: 0.8rem;
white-space: nowrap;
flex-shrink: 0;
}
.composite-layer-opacity {
flex: 1;
min-width: 60px;
}
.composite-layer-toggle {
flex-shrink: 0;
}
.composite-layer-remove-btn {
font-size: 0.75rem;
padding: 0;
width: 26px;
height: 26px;
flex: 0 0 26px;
}