🪐 portal: the orrery gets a door — 🪐 SOLARGOD button deep-links at GODSIGH's scrubbed moment

Reciprocal to SOLARGOD's Earth-card link into GODSIGH. A subtle HUD pill
(above the footer, styled to the mode-button family) opens the orrery in a
new tab. The href is rebuilt fresh at click time from viewer.clock.currentTime
via the shared `#t=@<unixMs>` convention, so scrubbing GODSIGH's clock carries
straight through to SOLARGOD's sim time.

- index.html: <a#solargod-link.portal-link> between #layers and footer
- css: .portal-link (matches .modes button; accent on hover)
- ui.js: wireSolargodLink(getMs) — rebuilds href on pointerdown+click
  (covers ⌘/middle-click new-tab); Cesium stays out of the DOM module
- main.js: wire it with a getMs closure over viewer.clock

Verified in-browser: button renders, zero console errors, all layers boot;
live click → href tracks the clock; scrub -3h → href exactly 3h behind now +
chip flips SCRUBBED + live layers pause; opening the link launches SOLARGOD
in SCRUBBED state at the passed epoch (its hash echoes the exact ms).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
monsterrobotparty 2026-07-16 09:45:48 +10:00
parent 66d6df2689
commit d06ebf07cb
4 changed files with 38 additions and 0 deletions

View File

@ -111,6 +111,24 @@ html, body {
font-weight: 700;
}
/* ---- portal to SOLARGOD (sibling orrery) ---- */
.portal-link {
display: block;
text-align: center;
padding: 6px 8px;
font-size: 11px;
color: var(--dim);
text-decoration: none;
background: rgba(255, 255, 255, 0.03);
border: 1px solid var(--border);
border-radius: 8px;
transition: all 0.15s;
}
.portal-link:hover {
color: var(--accent);
border-color: var(--accent);
}
/* ---- layer rows ---- */
#layers {
display: flex;

View File

@ -23,6 +23,8 @@
<button id="mode-photo" type="button">Photo</button>
</div>
<div id="layers"></div>
<a id="solargod-link" class="portal-link" href="http://127.0.0.1:8147/"
target="_blank" rel="noopener" title="Open SOLARGOD at this moment">🪐 SOLARGOD</a>
<footer>
<div>Public OSINT feeds · Celestrak · OpenSky · EOX Sentinel-2 · CARTO/OSM</div>
<div class="demo">Ships &amp; events are <b>[DEMO]</b> data</div>

View File

@ -74,6 +74,11 @@ function setMode(mode) {
document.getElementById('mode-data').addEventListener('click', () => setMode('data'));
document.getElementById('mode-photo').addEventListener('click', () => setMode('photo'));
// ---- portal to SOLARGOD (sibling orrery) ----
// Deep-links to the solar-system app at GODSIGH's current sim moment via its
// shared `#t=@<unixMs>` convention; the href is rebuilt fresh at click time.
ui.wireSolargodLink(() => Cesium.JulianDate.toDate(viewer.clock.currentTime).getTime());
// ---- clock configuration ----
viewer.clock.startTime = start.clone();
viewer.clock.stopTime = stop.clone();

View File

@ -111,6 +111,19 @@ export function setLiveChip(isLive) {
chip.dataset.state = isLive ? 'live' : 'scrub';
}
// Portal to SOLARGOD (sibling orrery). `getMs` returns GODSIGH's current sim
// time as unix ms; we rebuild the deep-link href fresh at click time so the
// orrery opens at whatever moment the clock is scrubbed to, via the shared
// `#t=@<unixMs>` hash convention. pointerdown fires before navigation, so this
// also covers ⌘/ctrl-click and middle-click new-tab opens.
export function wireSolargodLink(getMs) {
const a = document.getElementById('solargod-link');
if (!a) return;
const sync = () => { a.href = `http://127.0.0.1:8147/#t=@${getMs()}`; };
a.addEventListener('pointerdown', sync);
a.addEventListener('click', sync);
}
// Small fixed overlay for primitive picks (aircraft), which have no Cesium InfoBox.
export function showPickOverlay(title, rowPairs) {
const el = document.getElementById('pick-overlay');