Skip to content

Commit 1840fdf

Browse files
committed
Update anomation ui
1 parent 1ff3ecf commit 1840fdf

File tree

4 files changed

+77
-24
lines changed

4 files changed

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

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

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -113,25 +113,28 @@ <h3 class="box-title">Project code preview</h3>
113113
</main>
114114
<div class="frames-section-bottom">
115115
<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" />
127-
</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" />
132-
</div>
133-
<div id="frames" class="frames"></div>
134-
</div>
116+
<div class="sidebar-header">
117+
<h3 style="margin:0;font-size:0.9rem;color:#666">Animation</h3>
118+
<div class="anim-buttons">
119+
<button id="play-animation" title="Play Animation"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><path d="M4 2 L14 8 L4 14 Z"/></svg></button>
120+
<button id="stop-animation" title="Stop Animation"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor"><rect x="4" y="4" width="8" height="8"/></svg></button>
121+
</div>
122+
</div>
123+
<div class="animation-controls-body">
124+
<div>
125+
<label><input type="radio" name="mode" value="frames" checked> Frames</label>
126+
<label><input type="radio" name="mode" value="anim"> Animations</label>
127+
</div>
128+
<div id="anim-controls">
129+
<input id="anim-name" placeholder="Animation name" />
130+
</div>
131+
<!-- Frame name goes above the list of frames and below animation name (if present) -->
132+
<div>
133+
<input id="name" placeholder="Frame name (optional)" />
134+
<input id="duration" type="number" min="0" step="10" value="1000" title="Duration in ms" />
135+
</div>
136+
<div id="frames" class="frames"></div>
137+
</div> </div>
135138
</div>
136139
<div id="error-container" class="error-message" style="display: none;"></div>
137140
</div>

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

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -239,10 +239,14 @@ input:checked + .slider:before {
239239
border-radius: 8px;
240240
width: 100%;
241241
display: flex;
242-
flex-direction: row;
243-
flex-wrap: wrap;
244-
align-items: center;
245-
gap: 20px;
242+
flex-direction: column; /* Changed from row */
243+
gap: 16px; /* Adjusted gap */
244+
}
245+
246+
.animation-controls-body {
247+
display: flex;
248+
flex-direction: column;
249+
gap: 12px;
246250
}
247251

248252
.row {
@@ -390,7 +394,47 @@ input:checked + .slider:before {
390394
display: flex;
391395
gap: 8px;
392396
justify-content: space-between;
393-
margin-bottom: 8px;
397+
align-items: center; /* Added for vertical alignment */
398+
}
399+
400+
.anim-buttons {
401+
display: flex;
402+
gap: 8px; /* Space between play and stop buttons */
403+
}
404+
405+
/* Styling for the new icon-only buttons */
406+
.anim-buttons button {
407+
padding: 6px; /* Smaller padding for icon buttons */
408+
width: 32px; /* Fixed width for square buttons */
409+
height: 32px; /* Fixed height for square buttons */
410+
display: flex;
411+
align-items: center;
412+
justify-content: center;
413+
border-radius: 8px; /* Changed to 8px as requested */
414+
color: white; /* For the SVG fill */
415+
border: none;
416+
cursor: pointer;
417+
box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* Subtle shadow */
418+
transition: background 0.3s ease;
419+
}
420+
421+
#play-animation {
422+
background: #008184;
423+
}
424+
425+
#stop-animation {
426+
background: rgba(0, 129, 132, 0.2); /* #008184 with 20% alpha */
427+
}
428+
429+
430+
.anim-buttons button:hover {
431+
background: #006567;
432+
}
433+
434+
.anim-buttons button svg {
435+
width: 16px;
436+
height: 16px;
437+
fill: currentColor; /* Use button's text color for SVG fill */
394438
}
395439
.frames {
396440
display: flex;

0 commit comments

Comments
 (0)