fix(playground): move Visual/Synth toggle into bottom toolbar in immersive UI
Relocated the output mode toggle from a floating top-right position into the bottom floating bar where it's more discoverable. Removed the duplicate toggle from the expanded sheet. Compact pill-toggle-sm style fits the toolbar layout.
This commit is contained in:
parent
295221d1b2
commit
a0adb8b14b
3 changed files with 13 additions and 52 deletions
|
|
@ -30,12 +30,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Output mode toggle (floating, top-right) -->
|
|
||||||
<div class="output-toggle-float" id="output-toggle-float">
|
|
||||||
<button class="otf-opt active" data-mode="visual">Visual</button>
|
|
||||||
<button class="otf-opt" data-mode="synth">Synth</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Fullscreen flow field canvas -->
|
<!-- Fullscreen flow field canvas -->
|
||||||
<canvas id="vis-canvas"></canvas>
|
<canvas id="vis-canvas"></canvas>
|
||||||
|
|
||||||
|
|
@ -67,6 +61,10 @@
|
||||||
<div class="bottom-sheet collapsed" id="bottom-sheet">
|
<div class="bottom-sheet collapsed" id="bottom-sheet">
|
||||||
<!-- Floating mode bar (sticky inside sheet) -->
|
<!-- Floating mode bar (sticky inside sheet) -->
|
||||||
<div class="floating-bar" id="floating-bar">
|
<div class="floating-bar" id="floating-bar">
|
||||||
|
<div class="pill-toggle pill-toggle-sm" id="output-toggle-float">
|
||||||
|
<button class="pill-opt active" data-mode="visual">Visual</button>
|
||||||
|
<button class="pill-opt" data-mode="synth">Synth</button>
|
||||||
|
</div>
|
||||||
<button class="float-btn accent" id="btn-train-bar" title="Train on examples">Train</button>
|
<button class="float-btn accent" id="btn-train-bar" title="Train on examples">Train</button>
|
||||||
<button class="float-btn" id="btn-randomize-bar" title="Randomize weights">Randomize</button>
|
<button class="float-btn" id="btn-randomize-bar" title="Randomize weights">Randomize</button>
|
||||||
<button class="float-btn" id="btn-clear-examples-bar" title="Clear examples">Clear Ex</button>
|
<button class="float-btn" id="btn-clear-examples-bar" title="Clear examples">Clear Ex</button>
|
||||||
|
|
@ -81,14 +79,6 @@
|
||||||
|
|
||||||
<!-- Sheet content -->
|
<!-- Sheet content -->
|
||||||
<div class="sheet-content" id="sheet-content">
|
<div class="sheet-content" id="sheet-content">
|
||||||
<!-- Output mode toggle -->
|
|
||||||
<div class="mode-row">
|
|
||||||
<div class="pill-toggle" id="output-toggle">
|
|
||||||
<button class="pill-opt active" data-mode="visual">Visual</button>
|
|
||||||
<button class="pill-opt" data-mode="synth">Synth</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Examples mode actions -->
|
<!-- Examples mode actions -->
|
||||||
<div class="action-row" id="examples-actions">
|
<div class="action-row" id="examples-actions">
|
||||||
<button class="action-btn" id="btn-add-example">Add Example</button>
|
<button class="action-btn" id="btn-add-example">Add Example</button>
|
||||||
|
|
|
||||||
|
|
@ -64,35 +64,15 @@ html, body {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---- Output mode toggle (floating) ---- */
|
/* ---- Output mode toggle (floating) ---- */
|
||||||
.output-toggle-float {
|
.pill-toggle-sm {
|
||||||
position: fixed;
|
border-radius: 4px;
|
||||||
top: 30px;
|
|
||||||
right: 12px;
|
|
||||||
z-index: 30;
|
|
||||||
display: flex;
|
|
||||||
border-radius: 6px;
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
border: 1px solid var(--glass-border);
|
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||||
background: var(--glass-bg);
|
|
||||||
backdrop-filter: blur(var(--glass-blur));
|
|
||||||
-webkit-backdrop-filter: blur(var(--glass-blur));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.otf-opt {
|
.pill-toggle-sm .pill-opt {
|
||||||
padding: 6px 14px;
|
padding: 3px 10px;
|
||||||
font-size: 12px;
|
font-size: 11px;
|
||||||
font-family: inherit;
|
|
||||||
color: var(--text-dim);
|
|
||||||
background: transparent;
|
|
||||||
border: none;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: all 0.15s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.otf-opt.active {
|
|
||||||
background: var(--accent-dim);
|
|
||||||
color: var(--accent);
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---- Fullscreen canvas ---- */
|
/* ---- Fullscreen canvas ---- */
|
||||||
|
|
|
||||||
|
|
@ -738,16 +738,8 @@ function wireBottomSheet() {
|
||||||
|
|
||||||
// ---- Controls wiring ----
|
// ---- Controls wiring ----
|
||||||
function wireControls() {
|
function wireControls() {
|
||||||
// Output mode toggle (sheet)
|
// Output mode toggle (floating bar)
|
||||||
document.querySelectorAll('#output-toggle .pill-opt').forEach(btn => {
|
document.querySelectorAll('#output-toggle-float .pill-opt').forEach(btn => {
|
||||||
btn.addEventListener('click', () => {
|
|
||||||
syncOutputToggles(btn.dataset.mode);
|
|
||||||
setOutputMode(btn.dataset.mode);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// Output mode toggle (floating)
|
|
||||||
document.querySelectorAll('#output-toggle-float .otf-opt').forEach(btn => {
|
|
||||||
btn.addEventListener('click', () => {
|
btn.addEventListener('click', () => {
|
||||||
syncOutputToggles(btn.dataset.mode);
|
syncOutputToggles(btn.dataset.mode);
|
||||||
setOutputMode(btn.dataset.mode);
|
setOutputMode(btn.dataset.mode);
|
||||||
|
|
@ -778,8 +770,7 @@ function wireControls() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function syncOutputToggles(mode) {
|
function syncOutputToggles(mode) {
|
||||||
document.querySelectorAll('#output-toggle .pill-opt').forEach(b => b.classList.toggle('active', b.dataset.mode === mode));
|
document.querySelectorAll('#output-toggle-float .pill-opt').forEach(b => b.classList.toggle('active', b.dataset.mode === mode));
|
||||||
document.querySelectorAll('#output-toggle-float .otf-opt').forEach(b => b.classList.toggle('active', b.dataset.mode === mode));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setOutputMode(mode) {
|
function setOutputMode(mode) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue