9d593379b8
Each target now has a segments list where each segment maps a color strip source to a pixel range (start/end) on the device with optional reverse. This enables composing multiple visualizations on a single LED strip. Old targets auto-migrate from the single source format on load. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
73 lines
5.0 KiB
HTML
73 lines
5.0 KiB
HTML
<!-- Target Editor Modal (name, device, segments, settings) -->
|
|
<div id="target-editor-modal" class="modal" role="dialog" aria-modal="true" aria-labelledby="target-editor-title">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h2 id="target-editor-title" data-i18n="targets.add">🎯 Add Target</h2>
|
|
<button class="modal-close-btn" onclick="closeTargetEditorModal()" title="Close" data-i18n-aria-label="aria.close">✕</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form id="target-editor-form">
|
|
<input type="hidden" id="target-editor-id">
|
|
|
|
<div class="form-group">
|
|
<label for="target-editor-name" data-i18n="targets.name">Target Name:</label>
|
|
<input type="text" id="target-editor-name" data-i18n-placeholder="targets.name.placeholder" placeholder="My Target" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<div class="label-row">
|
|
<label for="target-editor-device" data-i18n="targets.device">Device:</label>
|
|
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?">?</button>
|
|
</div>
|
|
<small class="input-hint" style="display:none" data-i18n="targets.device.hint">Select the LED device to send data to</small>
|
|
<select id="target-editor-device"></select>
|
|
</div>
|
|
|
|
<div class="form-group" id="target-editor-segments-group">
|
|
<div class="label-row">
|
|
<label data-i18n="targets.segments">Segments:</label>
|
|
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?">?</button>
|
|
</div>
|
|
<small class="input-hint" style="display:none" data-i18n="targets.segments.hint">Each segment maps a color strip source to a pixel range on the LED strip. Gaps between segments stay black. A single segment with Start=0, End=0 auto-fits to the full strip.</small>
|
|
<div id="target-editor-segment-list"></div>
|
|
<button type="button" class="btn btn-secondary btn-sm" onclick="addTargetSegment()" data-i18n="targets.segments.add">+ Add Segment</button>
|
|
</div>
|
|
|
|
<div class="form-group" id="target-editor-fps-group">
|
|
<div class="label-row">
|
|
<label for="target-editor-fps">
|
|
<span data-i18n="targets.fps">Target FPS:</span>
|
|
<span id="target-editor-fps-value">30</span>
|
|
</label>
|
|
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?">?</button>
|
|
</div>
|
|
<small class="input-hint" style="display:none" data-i18n="targets.fps.hint">How many frames per second to send to the device (1-90). Higher values give smoother animations but use more bandwidth.</small>
|
|
<div class="slider-row">
|
|
<input type="range" id="target-editor-fps" min="1" max="90" value="30" oninput="document.getElementById('target-editor-fps-value').textContent = this.value">
|
|
<span class="slider-value">fps</span>
|
|
</div>
|
|
<small id="target-editor-fps-rec" class="input-hint" style="display:none"></small>
|
|
</div>
|
|
|
|
<div class="form-group" id="target-editor-keepalive-group">
|
|
<div class="label-row">
|
|
<label for="target-editor-keepalive-interval">
|
|
<span data-i18n="targets.keepalive_interval">Keep Alive Interval:</span>
|
|
<span id="target-editor-keepalive-interval-value">1.0</span><span>s</span>
|
|
</label>
|
|
<button type="button" class="hint-toggle" onclick="toggleHint(this)" title="?">?</button>
|
|
</div>
|
|
<small class="input-hint" style="display:none" data-i18n="targets.keepalive_interval.hint">How often to resend the last frame when the screen is static, to keep the device in live mode (0.5-5.0s)</small>
|
|
<input type="range" id="target-editor-keepalive-interval" min="0.5" max="5.0" step="0.5" value="1.0" oninput="document.getElementById('target-editor-keepalive-interval-value').textContent = this.value">
|
|
</div>
|
|
|
|
<div id="target-editor-error" class="error-message" style="display: none;"></div>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button class="btn btn-icon btn-secondary" onclick="closeTargetEditorModal()" title="Cancel" data-i18n-aria-label="aria.cancel">✕</button>
|
|
<button class="btn btn-icon btn-primary" onclick="saveTargetEditor()" title="Save" data-i18n-aria-label="aria.save">✓</button>
|
|
</div>
|
|
</div>
|
|
</div>
|