Files
led-controller/led-simulator/web/index.html
T
jimmyandClaude Haiku 5.5 cb51a726bc feat: pattern gallery as a preset editor; chase steps; sim split with the preset editor
- Pattern gallery shows the controller's presets, one at a time, with a dropdown, Save, Add preset, and
  the controller's field labels, delay limits and colour counts. Edits show in the preview; Save writes to
  the controller only.
- Presets are always timed in ms (beat_time is no longer sent to drivers); beats stay in sequences.
- Chase steps of 0 hold still; the marquee style is removed from the controller, the gallery and the
  driver (submodule commit 12a8e22).
- The rig's split pane opens the preset editor too (Rig / Presets switch and a Preset editor menu entry).
- Sequence editor, room layout and simulator controls from earlier work are included.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-11-17 07:16:51 +13:00

140 lines
6.7 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="theme-color" content="#0e0f12">
<title>LED Rig Simulator</title>
<link rel="icon" href="data:,">
<link rel="stylesheet" href="/sim/styles.css">
</head>
<body>
<header class="topbar">
<div class="brand">
<span class="brand-mark" aria-hidden="true"></span>
<span class="brand-name">led-simulator</span>
</div>
<div class="chips">
<button type="button" id="add-bridge" class="secondary" hidden
title="The controller sends its ESP-NOW frames only to the bridges in its settings">Add the browser bridge</button>
</div>
<div class="room-bar">
<label class="field-inline">Room <select id="room-select" aria-label="Room"></select></label>
<button type="button" id="edit-toggle" class="secondary">Edit room</button>
<span class="zoom-tools" role="group" aria-label="Zoom">
<button type="button" id="zoom-out" class="secondary" aria-label="Zoom out" title="Zoom out (wheel)">−</button>
<button type="button" id="zoom-fit" class="secondary" title="Fit the room (0)">Fit</button>
<button type="button" id="zoom-in" class="secondary" aria-label="Zoom in" title="Zoom in (wheel)">+</button>
</span>
<span id="edit-tools" class="edit-tools" hidden>
<button type="button" id="add-strip">Add strip</button>
<button type="button" id="centre-strips" class="secondary" title="Move all the strips so they sit in the middle of the room">Centre strips</button>
<button type="button" id="room-settings" class="secondary">Size &amp; strip types…</button>
<button type="button" id="room-new" class="secondary">New room…</button>
<button type="button" id="room-delete" class="secondary">Delete room</button>
<span class="muted" id="save-state"></span>
</span>
</div>
<div class="actions">
<a class="button secondary not-embedded" href="/">Controller</a>
<label class="toggle" title="Boot every strip when this page opens">
<input type="checkbox" id="auto-power"> Auto-power
</label>
</div>
</header>
<div id="banner" class="banner" hidden></div>
<div class="edit-hint" id="edit-hint">
Add strip or click the floor to add one · drag the floor to select the strips in a box (Shift: add to the selection; zoomed in, a plain drag pans instead) ·Shift-click a strip to add or remove it · drag a selected strip to move them all (Alt: no snap) · drag its end circle to turn it (Shift: no snap) · Delete removes the selection · wheel or +/− zooms, right-drag, middle-drag or Space-drag pans
</div>
<main class="stage">
<div class="rig" id="rig">
<canvas id="rig-canvas" aria-label="LED rig"></canvas>
</div>
<aside class="drawer" id="drawer" hidden aria-label="Strip details">
<p class="drawer-empty" id="d-empty" hidden>
Select a strip to edit it, or click the floor to add one. Changes are saved to
<code>rooms/&lt;room&gt;.json</code> as you make them.
</p>
<div class="drawer-body" id="d-body">
<div class="drawer-head">
<div>
<div class="drawer-title" id="d-name">sim-01</div>
<div class="drawer-sub" id="d-meta">02:51:4d:00:00:01</div>
</div>
<button type="button" class="icon" id="d-close" aria-label="Close">×</button>
</div>
<dl class="facts">
<dt>State</dt><dd id="d-state">off</dd>
<dt>Position</dt><dd id="d-pos">–</dd>
<dt>Packets</dt><dd id="d-packets">–</dd>
</dl>
<p class="note" id="d-note" hidden></p>
<form class="edit-form" id="d-edit" hidden onsubmit="return false">
<label>Label <input id="e-label" maxlength="47"></label>
<label>Strip type <select id="e-def"></select></label>
<label>LEDs <input id="e-leds" type="number" min="1" max="512" step="1" title="Empty: the strip type's count"></label>
<label>Pixel 0 x (m) <input id="e-x" type="number" step="0.05"></label>
<label>Pixel 0 y (m) <input id="e-y" type="number" step="0.05"></label>
<label>Heading (°) <input id="e-dir" type="number" step="15" title="Degrees clockwise from up: 90 runs right, -90 runs left"></label>
<button type="button" id="d-delete" class="danger">Remove strip</button>
</form>
<div class="drawer-actions">
<button type="button" id="d-on">Power on</button>
<button type="button" id="d-reset">Reset</button>
<button type="button" id="d-off" class="secondary">Power off</button>
</div>
<div class="log-head">
<span>Serial</span>
<button type="button" class="link" id="d-clear">clear</button>
</div>
<pre class="log" id="d-log"></pre>
</div>
</aside>
</main>
<dialog id="room-dialog" aria-labelledby="r-title">
<h2 id="r-title">Room size and strip types</h2>
<div class="dialog-row">
<label>Width (m) <input id="r-width" type="number" min="0.5" max="200" step="0.1"></label>
<label>Depth (m) <input id="r-depth" type="number" min="0.5" max="200" step="0.1"></label>
</div>
<table class="defs">
<thead><tr><th>Type</th><th>LEDs</th><th>LEDs per metre</th><th></th><th></th></tr></thead>
<tbody id="r-defs"></tbody>
<tfoot>
<tr>
<td><input id="r-def-name" placeholder="name, e.g. bar-60"></td>
<td><input id="r-def-leds" type="number" min="1" max="512" step="1" value="60"></td>
<td><input id="r-def-perm" type="number" min="1" max="1000" step="1" value="60"></td>
<td colspan="2"><button type="button" id="r-add-def" class="secondary">Add type</button></td>
</tr>
</tfoot>
</table>
<div class="dialog-actions"><button type="button" id="r-close">Done</button></div>
</dialog>
<dialog id="new-dialog" aria-labelledby="n-title">
<form id="new-form">
<h2 id="n-title">New room</h2>
<label>Name <input id="n-name" required pattern="[A-Za-z0-9_\-]{1,40}" title="Letters, digits, - or _"></label>
<div class="dialog-row">
<label>Width (m) <input id="n-width" type="number" min="0.5" max="200" step="0.1" required></label>
<label>Depth (m) <input id="n-depth" type="number" min="0.5" max="200" step="0.1" required></label>
</div>
<label class="check"><input type="checkbox" id="n-copy"> Copy the strips of the current room</label>
<p class="error" id="n-error"></p>
<div class="dialog-actions">
<button type="button" id="n-cancel" class="secondary">Cancel</button>
<button type="submit">Create and edit</button>
</div>
</form>
</dialog>
<script src="/sim/layout.js"></script>
<script src="/sim/app.js"></script>
</body>
</html>