Skip to content

Commit 2d7b7ec

Browse files
author
DavidQ
committed
`feat(parallax-editor): restore fullscreen popout UX and move diagnostics below canvas
- add left/right overlay close buttons (X) for fullscreen side popouts - wire close-button handlers and keep overlay open/close state synced - hide launcher buttons while corresponding popout is visible - move preview diagnostics text out of canvas rendering into dedicated below-canvas panel - add preview details panel markup/style (`#previewDetailsText`) - position fullscreen launcher buttons off-canvas at viewport edges - preserve existing tool behavior and project/remediation flows`
1 parent 1fdbcfe commit 2d7b7ec

3 files changed

Lines changed: 98 additions & 15 deletions

File tree

tools/Parallax Scene Studio/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575

7676
<div class="workspace tools-platform-layout-grid">
7777
<aside class="sidebar left-sidebar tools-platform-resize-panel" data-panel-side="left" id="leftSidebar">
78+
<button id="closeLeftOverlayButton" class="overlay-close-button" type="button" aria-label="Close Layers Panel">X</button>
7879
<section class="panel">
7980
<h3>Parallax Layers</h3>
8081
<ul id="layerList" class="layer-list"></ul>
@@ -120,10 +121,12 @@ <h3>Preview Camera</h3>
120121
<button id="showLeftPanelButton" class="fullscreen-overlay-button" type="button">Layers</button>
121122
<button id="showRightPanelButton" class="fullscreen-overlay-button" type="button">Properties</button>
122123
</div>
124+
<pre id="previewDetailsText" class="preview-details-text">Mode: EDIT</pre>
123125
<div id="statusText" class="status-text">Ready.</div>
124126
</main>
125127

126128
<aside class="sidebar right-sidebar tools-platform-resize-panel" data-panel-side="right" id="rightSidebar">
129+
<button id="closeRightOverlayButton" class="overlay-close-button" type="button" aria-label="Close Properties Panel">X</button>
127130
<section class="panel">
128131
<h3>Selected Layer</h3>
129132
<label>

tools/Parallax Scene Studio/main.js

Lines changed: 39 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -452,12 +452,15 @@ class ParallaxEditorApp {
452452

453453
this.refs.previewMeta = rootDocument.getElementById("previewMeta");
454454
this.refs.simulationContext = rootDocument.getElementById("simulationContext");
455+
this.refs.previewDetailsText = rootDocument.getElementById("previewDetailsText");
455456
this.refs.statusText = rootDocument.getElementById("statusText");
456457
this.refs.appShell = rootDocument.querySelector(".app-shell");
457458
this.refs.leftSidebar = rootDocument.getElementById("leftSidebar");
458459
this.refs.rightSidebar = rootDocument.getElementById("rightSidebar");
459460
this.refs.showLeftPanelButton = rootDocument.getElementById("showLeftPanelButton");
460461
this.refs.showRightPanelButton = rootDocument.getElementById("showRightPanelButton");
462+
this.refs.closeLeftOverlayButton = rootDocument.getElementById("closeLeftOverlayButton");
463+
this.refs.closeRightOverlayButton = rootDocument.getElementById("closeRightOverlayButton");
461464
this.refs.previewWrap = rootDocument.querySelector(".preview-wrap");
462465
this.refs.previewCanvas = rootDocument.getElementById("previewCanvas");
463466
this.refs.previewContext = this.refs.previewCanvas.getContext("2d", { alpha: false });
@@ -485,14 +488,25 @@ class ParallaxEditorApp {
485488
this.refs.applyRemediationButton.addEventListener("click", () => this.applyRemediationAction());
486489
this.refs.showLeftPanelButton?.addEventListener("click", () => {
487490
this.refs.leftSidebar?.classList.toggle("visible-overlay");
491+
this.syncOverlayToggleButtons();
488492
});
489493
this.refs.showRightPanelButton?.addEventListener("click", () => {
490494
this.refs.rightSidebar?.classList.toggle("visible-overlay");
495+
this.syncOverlayToggleButtons();
496+
});
497+
this.refs.closeLeftOverlayButton?.addEventListener("click", () => {
498+
this.refs.leftSidebar?.classList.remove("visible-overlay");
499+
this.syncOverlayToggleButtons();
500+
});
501+
this.refs.closeRightOverlayButton?.addEventListener("click", () => {
502+
this.refs.rightSidebar?.classList.remove("visible-overlay");
503+
this.syncOverlayToggleButtons();
491504
});
492505
document.addEventListener("fullscreenchange", () => {
493506
this.syncFullscreenState();
494507
this.refs.leftSidebar?.classList.remove("visible-overlay");
495508
this.refs.rightSidebar?.classList.remove("visible-overlay");
509+
this.syncOverlayToggleButtons();
496510
});
497511

498512
this.refs.applyMapMetaButton.addEventListener("click", () => this.applyMapMetaFromInputs());
@@ -532,6 +546,18 @@ class ParallaxEditorApp {
532546

533547
syncFullscreenState() {
534548
document.body.classList.toggle("fullscreen-mode", Boolean(document.fullscreenElement));
549+
this.syncOverlayToggleButtons();
550+
}
551+
552+
syncOverlayToggleButtons() {
553+
const leftVisible = this.refs.leftSidebar?.classList.contains("visible-overlay") === true;
554+
const rightVisible = this.refs.rightSidebar?.classList.contains("visible-overlay") === true;
555+
if (this.refs.showLeftPanelButton instanceof HTMLElement) {
556+
this.refs.showLeftPanelButton.style.display = leftVisible ? "none" : "";
557+
}
558+
if (this.refs.showRightPanelButton instanceof HTMLElement) {
559+
this.refs.showRightPanelButton.style.display = rightVisible ? "none" : "";
560+
}
535561
}
536562

537563
getSelectedLayer() {
@@ -1731,27 +1757,25 @@ class ParallaxEditorApp {
17311757
context.strokeRect(mapOriginX, mapOriginY, worldWidth, worldHeight);
17321758
this.ensureSimulationViewportFocus(proxyX);
17331759

1734-
context.fillStyle = "rgba(15, 23, 42, 0.72)";
1735-
context.fillRect(10, 10, Math.min(860, viewportWidth - 20), 148);
1736-
context.fillStyle = "#dbeafe";
1737-
context.font = "12px monospace";
1738-
context.textBaseline = "top";
17391760
const modeText = this.isSimulationMode
17401761
? `SIMULATION ${this.simulation.playing ? "PLAY" : "PAUSE"}`
17411762
: "EDIT";
17421763
const repeatCount = sortedLayers.filter((layer) => layer.repeatX || layer.repeatY).length;
17431764
const wrapCount = sortedLayers.filter((layer) => layer.wrapMode === "wrap").length;
17441765

1745-
context.fillText(`Mode: ${modeText}`, 18, 18);
1746-
context.fillText(`Map: ${this.documentModel.map.name}`, 18, 34);
1747-
context.fillText(`Camera: ${this.cameraX}, ${this.cameraY}`, 18, 50);
1748-
context.fillText(`Traverse: ${Math.round(progress * 100)}% (${Math.round(this.simulation.traversedDistance)}/${Math.round(this.simulation.traversalDistance || 0)} px)`, 18, 66);
1749-
context.fillText(`Layers: ${sortedLayers.length} repeat=${repeatCount} wrap=${wrapCount}`, 18, 82);
1750-
sortedLayers.slice(0, 3).forEach((layer, index) => {
1751-
const y = 100 + (index * 16);
1752-
const row = `${layer.drawOrder}:${layer.name} sf(${layer.scrollFactorX.toFixed(2)},${layer.scrollFactorY.toFixed(2)}) ${layer.repeatX ? "RX" : "--"}/${layer.repeatY ? "RY" : "--"} ${layer.wrapMode}`;
1753-
context.fillText(row, 18, y);
1754-
});
1766+
if (this.refs.previewDetailsText instanceof HTMLElement) {
1767+
const lines = [
1768+
`Mode: ${modeText}`,
1769+
`Map: ${this.documentModel.map.name}`,
1770+
`Camera: ${this.cameraX}, ${this.cameraY}`,
1771+
`Traverse: ${Math.round(progress * 100)}% (${Math.round(this.simulation.traversedDistance)}/${Math.round(this.simulation.traversalDistance || 0)} px)`,
1772+
`Layers: ${sortedLayers.length} repeat=${repeatCount} wrap=${wrapCount}`
1773+
];
1774+
sortedLayers.slice(0, 3).forEach((layer) => {
1775+
lines.push(`${layer.drawOrder}:${layer.name} sf(${layer.scrollFactorX.toFixed(2)},${layer.scrollFactorY.toFixed(2)}) ${layer.repeatX ? "RX" : "--"}/${layer.repeatY ? "RY" : "--"} ${layer.wrapMode}`);
1776+
});
1777+
this.refs.previewDetailsText.textContent = lines.join("\n");
1778+
}
17551779
this.updateSimulationContextReadout();
17561780
}
17571781

tools/Parallax Scene Studio/parallaxEditor.css

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,20 @@ button:hover,
167167
margin-top: 8px;
168168
}
169169

170+
.preview-details-text {
171+
margin: 8px 0 0;
172+
min-height: 84px;
173+
max-height: 180px;
174+
overflow: auto;
175+
border: 1px solid var(--parallax-border);
176+
border-radius: 8px;
177+
padding: 10px;
178+
background: rgba(15, 23, 42, 0.72);
179+
color: #dbeafe;
180+
font: 12px/1.35 Consolas, Monaco, monospace;
181+
white-space: pre-wrap;
182+
}
183+
170184
.layer-list {
171185
list-style: none;
172186
margin: 0;
@@ -234,6 +248,10 @@ button:hover,
234248
padding: 0 10px;
235249
}
236250

251+
.parallax-editor-page .overlay-close-button {
252+
display: none;
253+
}
254+
237255
.parallax-editor-page #showLeftPanelButton {
238256
left: 10px;
239257
}
@@ -278,6 +296,29 @@ body.parallax-editor-page.fullscreen-mode .sidebar.visible-overlay {
278296
width: min(360px, calc(100vw - 24px));
279297
z-index: 50;
280298
overflow: auto;
299+
padding-top: 48px;
300+
}
301+
302+
body.parallax-editor-page.fullscreen-mode .sidebar.visible-overlay .overlay-close-button {
303+
position: absolute;
304+
top: 13px;
305+
right: 13px;
306+
z-index: 80;
307+
display: inline-flex;
308+
align-items: center;
309+
justify-content: center;
310+
width: 34px;
311+
height: 34px;
312+
min-height: 34px;
313+
padding: 0;
314+
border-radius: 999px;
315+
font-size: 16px;
316+
font-weight: 900;
317+
line-height: 1;
318+
border: 2px solid #ffffff;
319+
background: #ed9700;
320+
color: #ffffff;
321+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
281322
}
282323

283324
body.parallax-editor-page.fullscreen-mode .left-sidebar.visible-overlay {
@@ -308,8 +349,23 @@ body.parallax-editor-page.fullscreen-mode #previewCanvas {
308349

309350
body.parallax-editor-page.fullscreen-mode .fullscreen-overlay-button {
310351
display: inline-flex;
352+
position: fixed;
311353
align-items: center;
312354
justify-content: center;
355+
top: 96px;
356+
z-index: 60;
357+
}
358+
359+
body.parallax-editor-page.fullscreen-mode #showLeftPanelButton {
360+
left: 10px;
361+
}
362+
363+
body.parallax-editor-page.fullscreen-mode #showRightPanelButton {
364+
right: 10px;
365+
}
366+
367+
body.parallax-editor-page.fullscreen-mode .preview-details-text {
368+
max-height: 150px;
313369
}
314370

315371
@media (max-width: 1260px) {

0 commit comments

Comments
 (0)