Skip to content

Commit ed29e30

Browse files
committed
Update frames UI
1 parent a43f78e commit ed29e30

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

examples/led-matrix-painter/assets/app.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ function renderFrames(){
456456
} else if (typeof row === 'string') {
457457
isOn = row[c] === '1';
458458
}
459-
const dot = document.createElement('div'); dot.style.background = isOn ? '#0b76ff' : '#fff'; thumb.appendChild(dot);
459+
const dot = document.createElement('div'); dot.style.background = isOn ? '#3CE2FF' : 'transparent'; thumb.appendChild(dot);
460460
}
461461
}
462462
const name = document.createElement('div'); name.className = 'frame-name'; name.textContent = f.name || ('Frame ' + f.id);
@@ -654,7 +654,7 @@ async function handleNewFrameClick() {
654654
headers: {'Content-Type':'application/json'},
655655
body: JSON.stringify({
656656
rows: grid,
657-
name: '', // empty name = backend will assign Frame{id}
657+
name: '', // empty name = backend will assign Frame {id}
658658
duration_ms: 1000,
659659
brightness_levels: BRIGHTNESS_LEVELS
660660
})
@@ -663,7 +663,7 @@ async function handleNewFrameClick() {
663663
if (data && data.ok && data.frame) {
664664
loadedFrame = data.frame;
665665
loadedFrameId = data.frame.id;
666-
// Set name to the backend-assigned name (Frame{id})
666+
// Set name to the backend-assigned name (Frame {id})
667667
if(frameTitle) frameTitle.textContent = data.frame.name || `Frame ${data.frame.id}`;
668668

669669
// Show C vector representation

examples/led-matrix-painter/assets/style.css

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -480,12 +480,13 @@ input:checked + .slider:before {
480480
.frames {
481481
display: flex;
482482
flex-direction: row; /* Horizontal layout */
483-
flex-wrap: nowrap; /* Keep in a single line */
483+
flex-wrap: wrap; /* Allow frames to wrap to the next line */
484484
gap: 8px;
485-
overflow-x: auto; /* Allow horizontal scrolling */
486-
overflow-y: hidden;
487-
align-items: center; /* Vertically center items */
488-
height: 100%; /* Set fixed height to match buttons */
485+
/* Removed overflow-x: auto as horizontal scrolling is no longer needed */
486+
/* Changed height to auto to allow the container to expand vertically */
487+
height: auto;
488+
align-items: flex-start; /* Align items to the start of the cross axis (top) */
489+
align-items: center;
489490
}
490491
.frame-item {
491492
display: flex;
@@ -496,14 +497,13 @@ input:checked + .slider:before {
496497
border: 1px solid #f0f0f0; /* Default border */
497498
border-radius: 8px; /* Requested border-radius */
498499
background: transparent; /* Remove default background */
499-
max-width: 132px;
500+
width: 120px;
500501
flex-shrink: 0; /* Prevent shrinking */
501-
height: 100%; /* Make frame item fill the height of its container */
502502
}
503503
.frame-thumb {
504-
width: 65px;
505-
height: 40px;
506-
background: #fff;
504+
width: 112px;
505+
height: 69px;
506+
background: #374146; /* Changed to match original matrix background */
507507
border: 1px solid #ddd;
508508
display: grid;
509509
grid-template-columns: repeat(13, 1fr);

examples/led-matrix-painter/python/store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def save_frame(frame: AppFrame) -> int:
8989

9090
# Backend responsibility: assign progressive name if empty
9191
if new_id and (not frame.name or frame.name.strip() == ''):
92-
frame.name = f'Frame{new_id}'
92+
frame.name = f'Frame {new_id}'
9393
frame.id = new_id
9494
db.update("frames", {"name": frame.name}, condition=f"id = {new_id}")
9595

0 commit comments

Comments
 (0)