Skip to content

Commit be7cdbd

Browse files
committed
Update matrix UI
1 parent 1ff3ecf commit be7cdbd

File tree

7 files changed

+103
-24
lines changed

7 files changed

+103
-24
lines changed
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading

examples/led-matrix-painter/assets/index.html

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -112,25 +112,37 @@ <h3 class="box-title">Project code preview</h3>
112112
</div>
113113
</main>
114114
<div class="frames-section-bottom">
115-
<div class="controls-section-left">
116-
<div class="sidebar-header">
117-
<h3 style="margin:0;font-size:0.9rem;color:#666">Frames (auto-saved)</h3>
118-
<button id="new-frame" title="Create new frame">+</button>
119-
<button id="play-animation">Play Animation</button>
120-
</div>
121-
<div>
122-
<label><input type="radio" name="mode" value="frames" checked> Frames</label>
123-
<label><input type="radio" name="mode" value="anim"> Animations</label>
124-
</div>
125-
<div id="anim-controls">
126-
<input id="anim-name" placeholder="Animation name" />
115+
<div class="animation-section">
116+
<div class="animation-header">
117+
<h3 style="margin:0;font-size:0.9rem;color:#666">Animation</h3>
118+
<div class="animation-main-controls">
119+
<button id="play-animation"><img src="img/play-icon.svg" alt="Play" style="width: 14px; height: 14px;"></button>
120+
<button id="stop-animation"><img src="img/stop-icon.svg" alt="Stop" style="width: 14px; height: 14px;"></button>
121+
</div>
127122
</div>
128-
<!-- Frame name goes above the list of frames and below animation name (if present) -->
129-
<div>
130-
<input id="name" placeholder="Frame name (optional)" />
131-
<input id="duration" type="number" min="0" step="10" value="1000" title="Duration in ms" />
123+
<div class="animation-body">
124+
<div class="animation-sidebar">
125+
<button id="copy-frame"><img src="img/copy.svg" alt="Copy" style="width: 14px; height: 14px;"></button>
126+
<button id="delete-frame"><img src="img/trash.svg" alt="Delete" style="width: 14px; height: 14px;"></button>
127+
<hr class="animation-separator">
128+
<button id="duration-button"><img src="img/duration.svg" alt="Duration" style="width: 14px; height: 14px;"></button>
129+
</div>
130+
<div class="animation-content">
131+
<div id="frames" class="frames"></div>
132+
<div id="anim-controls">
133+
<input id="anim-name" placeholder="Animation name" />
134+
</div>
135+
<div>
136+
<input id="name" placeholder="Frame name (optional)" />
137+
<input id="duration" type="number" min="0" step="10" value="1000" title="Duration in ms" />
138+
</div>
139+
<div>
140+
<label><input type="radio" name="mode" value="frames" checked> Frames</label>
141+
<label><input type="radio" name="mode" value="anim"> Animations</label>
142+
<button id="new-frame" title="Create new frame">+</button>
143+
</div>
144+
</div>
132145
</div>
133-
<div id="frames" class="frames"></div>
134146
</div>
135147
</div>
136148
<div id="error-container" class="error-message" style="display: none;"></div>

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

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -386,12 +386,6 @@ input:checked + .slider:before {
386386
.cell[data-b="7"] { background: #3CE2FF; }
387387

388388
/* Frame previews */
389-
.sidebar-header {
390-
display: flex;
391-
gap: 8px;
392-
justify-content: space-between;
393-
margin-bottom: 8px;
394-
}
395389
.frames {
396390
display: flex;
397391
flex-direction: column;
@@ -627,7 +621,7 @@ input {
627621
border-radius: 50%; /* Make it a circle */
628622
background: #008184 !important; /* Green background */
629623
cursor: pointer; /* Cursor on hover */
630-
margin-top: -5px; /* Adjust this to center the thumb vertically on the track */
624+
margin-top: -5px;
631625
filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.25));
632626
}
633627

@@ -665,3 +659,59 @@ input {
665659
.grid[data-tool='eraser'] {
666660
cursor: url('img/mouse-eraser.svg') 8 8, auto;
667661
}
662+
663+
.animation-section {
664+
background: #ECF1F1;
665+
padding: 16px;
666+
border-radius: 8px;
667+
}
668+
669+
.animation-header {
670+
display: flex;
671+
justify-content: space-between;
672+
align-items: center;
673+
margin-bottom: 8px;
674+
}
675+
676+
.animation-main-controls {
677+
display: flex;
678+
gap: 8px;
679+
}
680+
681+
.animation-body {
682+
display: flex;
683+
gap: 16px;
684+
}
685+
686+
.animation-sidebar {
687+
display: flex;
688+
flex-direction: column;
689+
gap: 16px;
690+
align-items: center;
691+
}
692+
693+
.animation-sidebar button {
694+
padding: 4px;
695+
width: 28px;
696+
height: 28px;
697+
display: flex;
698+
align-items: center;
699+
justify-content: center;
700+
background: transparent;
701+
border: 1px solid #C9D2D2;
702+
}
703+
704+
.animation-separator {
705+
width: 100%;
706+
border: none;
707+
border-top: 1px solid #C9D2D2;
708+
margin: 0;
709+
}
710+
711+
.animation-content {
712+
flex-grow: 1;
713+
}
714+
715+
#stop-animation {
716+
background: rgba(0, 129, 132, 0.2);
717+
}

0 commit comments

Comments
 (0)