diff --git a/css/style.css b/css/style.css index 1860ee0..4651ba5 100644 --- a/css/style.css +++ b/css/style.css @@ -86,6 +86,35 @@ html, body { background: rgba(255, 207, 80, 0.1); font-size: 9px; } +/* The chip is a button now: click snaps the clock back to live. */ +#live-chip { cursor: pointer; } +#live-chip[data-state="scrub"]:hover { background: rgba(255, 207, 80, 0.25); } + +/* ---- HUD hide/unhide tab ---- */ +#hud-toggle { + position: absolute; + top: 20px; + left: 306px; /* rides the panel's right edge */ + z-index: 11; + width: 22px; + height: 30px; + padding: 0; + font: 11px ui-monospace, monospace; + color: var(--dim); + background: var(--panel); + border: 1px solid var(--border); + border-radius: 0 8px 8px 0; + border-left: none; + cursor: pointer; + transition: left 0.15s; +} +#hud-toggle:hover { color: var(--accent); } +body.hud-hidden #hud { display: none; } +body.hud-hidden #hud-toggle { + left: 14px; + border-radius: 8px; + border-left: 1px solid var(--border); +} .modes { display: flex; diff --git a/index.html b/index.html index 1585303..a56555c 100644 --- a/index.html +++ b/index.html @@ -32,6 +32,9 @@ + + + diff --git a/js/main.js b/js/main.js index a2bbe37..148b08c 100644 --- a/js/main.js +++ b/js/main.js @@ -77,6 +77,19 @@ function setMode(mode) { document.getElementById('mode-data').addEventListener('click', () => setMode('data')); document.getElementById('mode-photo').addEventListener('click', () => setMode('photo')); +// ---- HUD hide/unhide + snap-to-live chip ---- +const hudToggle = document.getElementById('hud-toggle'); +hudToggle.addEventListener('click', () => { + const hidden = document.body.classList.toggle('hud-hidden'); + hudToggle.textContent = hidden ? '▶' : '◀'; + hudToggle.title = hidden ? 'Show panel' : 'Hide panel'; +}); +// Clicking LIVE/SCRUBBED snaps the clock back to now — the panel can cover the +// Cesium clock dial, so this is the always-visible escape hatch from scrub mode. +document.getElementById('live-chip').addEventListener('click', () => { + viewer.clock.currentTime = clampToWindow(Cesium.JulianDate.now()); +}); + // ---- portal to SOLARGOD (sibling orrery) ---- // Deep-links to the solar-system app at GODSIGH's current sim moment via its // shared `#t=@` convention; the href is rebuilt fresh at click time. diff --git a/js/ui.js b/js/ui.js index f1e8ae1..3b5bef2 100644 --- a/js/ui.js +++ b/js/ui.js @@ -109,7 +109,7 @@ export function setLiveChip(isLive) { const chip = document.getElementById('live-chip'); if (!chip) return; chip.textContent = isLive ? 'LIVE' : 'SCRUBBED'; - chip.title = isLive ? 'Clock is at wall-clock now' : 'Live layers paused — scrubbed off now'; + chip.title = isLive ? 'Clock is at wall-clock now' : 'Scrubbed off now — click to snap back to live'; chip.dataset.state = isLive ? 'live' : 'scrub'; }