astraeus 0.7.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +189 -0
- package/README.md +202 -38
- package/data/ephemerides/planets/planets.json +1 -1
- package/package.json +5 -4
- package/src/api/AstraeusScene.d.ts +21 -5
- package/src/api/AstraeusScene.js +34 -10
- package/src/api/AstraeusScene.node.js +34 -10
- package/src/api/assembleScene.d.ts +36 -0
- package/src/api/assembleScene.js +175 -0
- package/src/api/bodySetChecks.d.ts +10 -0
- package/src/api/bodySetChecks.js +117 -0
- package/src/api/bodySetInput.d.ts +81 -0
- package/src/api/bodySetInput.js +1 -0
- package/src/api/containingBlock.d.ts +6 -0
- package/src/api/containingBlock.js +16 -0
- package/src/api/data.d.ts +17 -5
- package/src/api/data.js +28 -10
- package/src/api/definitionOf.d.ts +16 -0
- package/src/api/definitionOf.js +20 -0
- package/src/api/errors.d.ts +63 -1
- package/src/api/frozenCopy.d.ts +6 -0
- package/src/api/frozenCopy.js +26 -0
- package/src/api/group.d.ts +8 -2
- package/src/api/group.js +24 -5
- package/src/api/index.d.ts +18 -7
- package/src/api/index.js +2 -2
- package/src/api/index.node.js +2 -2
- package/src/api/listeners.d.ts +5 -0
- package/src/api/listeners.js +25 -0
- package/src/api/look.d.ts +47 -0
- package/src/api/look.js +1 -0
- package/src/api/lookInput.d.ts +3 -0
- package/src/api/lookInput.js +41 -0
- package/src/api/moonPanelInput.d.ts +60 -0
- package/src/api/moonPanelInput.js +1 -0
- package/src/api/mount.d.ts +9 -19
- package/src/api/mount.js +27 -13
- package/src/api/mount.node.js +27 -13
- package/src/api/pathProvenance.js +1 -1
- package/src/api/pickerInput.d.ts +25 -0
- package/src/api/pickerInput.js +1 -0
- package/src/api/planBodies.d.ts +72 -0
- package/src/api/planBodies.js +300 -0
- package/src/api/planBodySets.d.ts +68 -0
- package/src/api/planBodySets.js +234 -0
- package/src/api/planCamera.d.ts +83 -0
- package/src/api/planCamera.js +184 -0
- package/src/api/planGroups.d.ts +36 -0
- package/src/api/planGroups.js +103 -0
- package/src/api/planMoonPanel.d.ts +19 -0
- package/src/api/planMoonPanel.js +104 -0
- package/src/api/planPaths.d.ts +40 -0
- package/src/api/planPaths.js +212 -0
- package/src/api/planPicker.d.ts +12 -0
- package/src/api/planPicker.js +40 -0
- package/src/api/planPlaces.d.ts +16 -0
- package/src/api/planPlaces.js +99 -0
- package/src/api/planStory.d.ts +26 -0
- package/src/api/planStory.js +66 -0
- package/src/api/planTimeline.d.ts +27 -0
- package/src/api/planTimeline.js +68 -0
- package/src/api/planViews.d.ts +25 -0
- package/src/api/planViews.js +35 -0
- package/src/api/prepared.js +4 -1
- package/src/api/renamedInputs.d.ts +15 -0
- package/src/api/renamedInputs.js +39 -0
- package/src/api/scene.d.ts +162 -68
- package/src/api/scene.js +247 -793
- package/src/api/sceneFreeze.d.ts +4 -0
- package/src/api/sceneFreeze.js +10 -0
- package/src/api/sceneReads.d.ts +171 -0
- package/src/api/sceneReads.js +6 -0
- package/src/api/story.d.ts +49 -19
- package/src/api/story.js +54 -22
- package/src/api/sunOrbit.js +9 -11
- package/src/api/time.d.ts +2 -1
- package/src/api/time.js +2 -1
- package/src/api/viewerCamera.d.ts +22 -0
- package/src/api/viewerCamera.js +84 -0
- package/src/api/viewerClock.d.ts +30 -0
- package/src/api/viewerClock.js +85 -0
- package/src/api/viewerFirstDraw.d.ts +14 -0
- package/src/api/viewerFirstDraw.js +26 -0
- package/src/api/viewerHandle.d.ts +85 -0
- package/src/api/viewerHandle.js +32 -0
- package/src/api/viewerLink.d.ts +88 -15
- package/src/api/viewerLink.js +117 -75
- package/src/api/viewerLooks.d.ts +19 -0
- package/src/api/viewerLooks.js +37 -0
- package/src/api/viewerPicker.d.ts +22 -0
- package/src/api/viewerPicker.js +49 -0
- package/src/api/viewerSelection.d.ts +30 -0
- package/src/api/viewerSelection.js +46 -0
- package/src/api/viewerViews.d.ts +10 -0
- package/src/api/viewerViews.js +18 -0
- package/src/api/viewerZones.d.ts +20 -0
- package/src/api/viewerZones.js +47 -0
- package/src/api/views.d.ts +7 -6
- package/src/api/views.js +12 -6
- package/src/app/App.d.ts +5 -3
- package/src/app/App.js +211 -82
- package/src/app/App.node.js +211 -82
- package/src/app/AstraeusScene.d.ts +18 -2
- package/src/app/AstraeusScene.js +4 -4
- package/src/app/BodyView.d.ts +4 -1
- package/src/app/BodyView.js +2 -2
- package/src/app/CameraController.d.ts +6 -0
- package/src/app/DeveloperSettings.d.ts +1 -4
- package/src/app/DeveloperSettings.js +6 -10
- package/src/app/FeatureMarkers.d.ts +4 -3
- package/src/app/FeatureMarkers.js +8 -13
- package/src/app/FrameRateSection.js +2 -1
- package/src/app/OrbitSetView.js +1 -1
- package/src/app/SettingControls.d.ts +11 -3
- package/src/app/SettingControls.js +10 -2
- package/src/app/SkyView.d.ts +3 -10
- package/src/app/SkyView.js +6 -28
- package/src/app/address.d.ts +16 -0
- package/src/app/address.js +31 -0
- package/src/app/bodyDraw.d.ts +10 -7
- package/src/app/bodyDraw.js +12 -32
- package/src/app/bodyMetrics.js +2 -2
- package/src/app/bodySet.d.ts +4 -20
- package/src/app/bodySet.js +5 -16
- package/src/app/debugReadout.js +1 -1
- package/src/app/displaySwitches.d.ts +4 -0
- package/src/app/displaySwitches.js +6 -0
- package/src/app/experienceDefinition.d.ts +11 -23
- package/src/app/listSwitch.d.ts +8 -14
- package/src/app/listSwitch.js +3 -10
- package/src/app/liveLook.d.ts +39 -0
- package/src/app/liveLook.js +66 -0
- package/src/app/look.d.ts +36 -0
- package/src/app/look.js +61 -0
- package/src/app/mission.d.ts +1 -1
- package/src/app/mission.js +1 -1
- package/src/app/openClock.d.ts +3 -2
- package/src/app/openClock.js +3 -3
- package/src/app/sceneCamera.d.ts +2 -0
- package/src/app/sceneCamera.js +11 -1
- package/src/app/sceneFrame.d.ts +4 -4
- package/src/app/sceneFrame.js +13 -8
- package/src/app/sceneHooks.js +3 -2
- package/src/app/style.css +114 -139
- package/src/app/trackedMetrics.d.ts +10 -3
- package/src/app/trackedMetrics.js +22 -11
- package/src/app/viewLink.d.ts +10 -32
- package/src/app/viewLink.js +10 -49
- package/src/app/viewerPort.d.ts +52 -0
- package/src/app/views.d.ts +3 -0
- package/src/assets/bodies/galileanMoons.js +1 -2
- package/src/assets/bodies/io.js +2 -2
- package/src/assets/bodies/listedMoons.d.ts +1 -1
- package/src/assets/bodies/listedMoons.js +2 -3
- package/src/assets/bodies/planetSystemMaps.js +2 -3
- package/src/assets/bodies/venus.js +2 -6
- package/src/assets/catalogue.js +1 -2
- package/src/assets/licence.d.ts +3 -3
- package/src/assets/licence.js +3 -3
- package/src/assets/pictures.d.ts +15 -12
- package/src/assets/pictures.js +24 -20
- package/src/assets/sky.d.ts +6 -5
- package/src/assets/sky.js +6 -9
- package/src/assets/visual.d.ts +4 -0
- package/src/core/astronomyAdapter.d.ts +1 -1
- package/src/core/astronomyAdapter.js +3 -3
- package/src/core/bodies/index.d.ts +0 -4
- package/src/core/bodies/index.js +14 -18
- package/src/core/bodies/jupiter.js +1 -1
- package/src/core/bodies/jupiterData.d.ts +0 -1
- package/src/core/bodies/jupiterData.js +2 -5
- package/src/core/bodies/mars.js +1 -1
- package/src/core/bodies/mercury.js +1 -1
- package/src/core/bodies/moonSystem.d.ts +1 -1
- package/src/core/bodies/moonSystem.js +102 -55
- package/src/core/bodies/outerPlanetRingData.js +2 -2
- package/src/core/bodies/outerPlanets.d.ts +2 -3
- package/src/core/bodies/outerPlanets.js +4 -13
- package/src/core/bodies/planetMoons.d.ts +0 -2
- package/src/core/bodies/planetMoons.js +1 -18
- package/src/core/bodies/planetRecords.d.ts +8 -2
- package/src/core/bodies/planetRecords.js +13 -5
- package/src/core/bodies/planetTrajectory.d.ts +21 -4
- package/src/core/bodies/planetTrajectory.js +29 -5
- package/src/core/bodies/venus.js +1 -1
- package/src/core/bodySetFamilies.d.ts +20 -0
- package/src/core/bodySetFamilies.js +14 -0
- package/src/core/chebyshevEphemeris.js +1 -1
- package/src/core/elementsBody.d.ts +8 -4
- package/src/core/elementsBody.js +32 -11
- package/src/core/elementsGroup.d.ts +27 -0
- package/src/core/elementsGroup.js +85 -0
- package/src/core/events.d.ts +2 -0
- package/src/core/events.js +2 -0
- package/src/core/illumination.js +1 -1
- package/src/core/listedOrbitGroup.d.ts +2 -0
- package/src/core/listedOrbitGroup.js +11 -7
- package/src/core/moonListText.d.ts +6 -0
- package/src/core/moonListText.js +19 -0
- package/src/core/moonTrajectory.js +1 -1
- package/src/core/pacing.d.ts +38 -3
- package/src/core/pacing.js +55 -4
- package/src/core/planetModels.d.ts +1 -1
- package/src/core/planetModels.js +3 -3
- package/src/core/planetSeries.d.ts +10 -2
- package/src/core/planetSeries.js +17 -3
- package/src/core/pointGroup.js +1 -1
- package/src/core/provenance.d.ts +2 -1
- package/src/core/provenance.js +2 -2
- package/src/core/referenceCenters.js +5 -5
- package/src/core/sampledTrajectory.js +1 -1
- package/src/core/scalePolicy.d.ts +1 -0
- package/src/core/startView.d.ts +19 -0
- package/src/core/startView.js +28 -0
- package/src/core/state.d.ts +6 -2
- package/src/core/state.js +3 -3
- package/src/core/storyPanels.d.ts +63 -0
- package/src/core/storyPanels.js +111 -0
- package/src/core/sunCentredSources.d.ts +4 -0
- package/src/core/sunCentredSources.js +9 -2
- package/src/core/timeInput.d.ts +4 -0
- package/src/core/timeInput.js +4 -0
- package/src/shell/AstraeusShell.d.ts +18 -2
- package/src/shell/AstraeusShell.js +53 -14
- package/src/shell/AstraeusShell.node.js +53 -14
- package/src/shell/Collapsible.d.ts +4 -3
- package/src/shell/Collapsible.js +5 -5
- package/src/shell/ControlsDrawer.d.ts +1 -1
- package/src/shell/ControlsDrawer.js +3 -1
- package/src/shell/DisplaySwitches.js +2 -1
- package/src/shell/InfoPanel.d.ts +3 -1
- package/src/shell/InfoPanel.js +5 -4
- package/src/shell/MoonFamilyPanel.js +1 -1
- package/src/shell/ObjectControls.d.ts +3 -1
- package/src/shell/ObjectControls.js +2 -2
- package/src/shell/Sources.d.ts +5 -3
- package/src/shell/Sources.js +5 -5
- package/src/shell/StoryPanelView.d.ts +4 -3
- package/src/shell/StoryPanelView.js +8 -6
- package/src/shell/SwitchControl.d.ts +5 -11
- package/src/shell/SwitchControl.js +2 -20
- package/src/shell/TimelineBar.css +81 -81
- package/src/shell/TimelineBar.d.ts +5 -2
- package/src/shell/TimelineBar.js +9 -8
- package/src/shell/TimelineBar.node.js +9 -8
- package/src/shell/TopBar.css +22 -22
- package/src/shell/TopBar.d.ts +5 -1
- package/src/shell/TopBar.js +2 -2
- package/src/shell/TopBar.node.js +2 -2
- package/src/shell/bootLoader.d.ts +4 -10
- package/src/shell/bootLoader.js +6 -52
- package/src/shell/embedded.css +18 -18
- package/src/shell/experience.d.ts +1 -1
- package/src/shell/moonFamilies.d.ts +2 -6
- package/src/shell/moonFamilies.js +2 -18
- package/src/shell/phone.css +58 -58
- package/src/shell/storyPanels.d.ts +2 -53
- package/src/shell/storyPanels.js +1 -106
- package/src/shell/style.css +153 -134
- package/src/shell/useDrawers.d.ts +3 -2
- package/src/shell/useDrawers.js +4 -3
- package/src/shell/viewerKeys.d.ts +8 -0
- package/src/shell/viewerKeys.js +16 -0
- package/src/synthetic/syntheticDefinition.js +20 -24
- package/src/synthetic/syntheticJourneyScene.js +3 -3
- package/src/synthetic/syntheticProbeDefinition.js +2 -1
- package/src/synthetic/syntheticViewsDefinition.d.ts +0 -3
- package/src/synthetic/syntheticViewsDefinition.js +10 -16
- package/data/moons/jupiter.json +0 -3333
- package/data/moons/neptune.json +0 -555
- package/data/moons/pluto.json +0 -205
- package/data/moons/saturn.json +0 -8267
- package/data/moons/uranus.json +0 -887
- package/src/app/addressNavigation.d.ts +0 -17
- package/src/app/addressNavigation.js +0 -16
- package/src/assets/bodies/jupiterMoonCatalogue.d.ts +0 -3
- package/src/assets/bodies/jupiterMoonCatalogue.js +0 -4
- package/src/assets/bodies/outerPlanetCatalogues.d.ts +0 -7
- package/src/assets/bodies/outerPlanetCatalogues.js +0 -8
- package/src/assets/bodies/swiftTuttle.d.ts +0 -12
- package/src/assets/bodies/swiftTuttle.js +0 -13
- package/src/assets/moonCatalogue.d.ts +0 -49
- package/src/assets/moonCatalogue.js +0 -80
- package/src/core/bodies/outerPlanetData.d.ts +0 -4
- package/src/core/bodies/outerPlanetData.js +0 -13
- package/src/core/bodies/swiftTuttle.d.ts +0 -46
- package/src/core/bodies/swiftTuttle.js +0 -106
package/src/shell/bootLoader.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
// The loading
|
|
2
|
-
//
|
|
1
|
+
// The loading fade time the viewer keeps: the look's `loadFadeSeconds`, the Developer drawer's saved setting, else the default.
|
|
2
|
+
// The cover itself belongs to the host page (the demo site owns its markup, showing, fading and failure); the engine never looks one up.
|
|
3
3
|
export const BOOT_FADE_DEFAULT_SECONDS = 0.6;
|
|
4
4
|
export const BOOT_FADE_LIMITS = { min: 0, max: 3 };
|
|
5
5
|
const STORAGE_KEY = "astraeus.loadFade";
|
|
6
6
|
function clampFade(seconds) {
|
|
7
7
|
return Number.isFinite(seconds) ? Math.min(BOOT_FADE_LIMITS.max, Math.max(BOOT_FADE_LIMITS.min, seconds)) : BOOT_FADE_DEFAULT_SECONDS;
|
|
8
8
|
}
|
|
9
|
-
/** The fade time in force:
|
|
10
|
-
export function bootFadeSeconds(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return clampFade(Number(asked));
|
|
9
|
+
/** The fade time in force: the look's `loadFadeSeconds` (the scene's, or the address's over it), else the saved setting, else the default. */
|
|
10
|
+
export function bootFadeSeconds(look = {}) {
|
|
11
|
+
if (look.loadFadeSeconds !== undefined)
|
|
12
|
+
return clampFade(look.loadFadeSeconds);
|
|
14
13
|
try {
|
|
15
14
|
const saved = window.localStorage.getItem(STORAGE_KEY);
|
|
16
15
|
if (saved !== null)
|
|
@@ -26,48 +25,3 @@ export function saveBootFadeSeconds(seconds) {
|
|
|
26
25
|
}
|
|
27
26
|
catch { /* not saved */ }
|
|
28
27
|
}
|
|
29
|
-
// The loader's markup as the page first had it, kept so a switch inside the page can bring the cover back after it was removed.
|
|
30
|
-
const bootTemplate = typeof document === "undefined" ? null : document.getElementById("boot")?.cloneNode(true) ?? null;
|
|
31
|
-
// How many times the cover has been brought back, so a scene mounted before the latest showing cannot hide it (I-074).
|
|
32
|
-
let showings = 0;
|
|
33
|
-
// The removal a hide scheduled after its fade, cancelled when the cover is shown again before it runs (I-074).
|
|
34
|
-
let removal;
|
|
35
|
-
/** The cover's current showing; a scene notes it when it mounts and hands it to `hideBootLoader`. */
|
|
36
|
-
export function bootShowing() {
|
|
37
|
-
return showings;
|
|
38
|
-
}
|
|
39
|
-
/** Brings the loading cover back (a switch inside the page); a no-op when the page never had one. Hidden again by `hideBootLoader` on the next scene's first frame. */
|
|
40
|
-
export function showBootLoader() {
|
|
41
|
-
showings += 1;
|
|
42
|
-
if (removal !== undefined) {
|
|
43
|
-
window.clearTimeout(removal);
|
|
44
|
-
removal = undefined;
|
|
45
|
-
}
|
|
46
|
-
const existing = document.getElementById("boot");
|
|
47
|
-
if (existing !== null) {
|
|
48
|
-
existing.style.removeProperty("--boot-fade");
|
|
49
|
-
existing.dataset.state = "loading";
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
if (bootTemplate === null)
|
|
53
|
-
return;
|
|
54
|
-
const boot = bootTemplate.cloneNode(true);
|
|
55
|
-
boot.dataset.state = "loading";
|
|
56
|
-
document.body.prepend(boot);
|
|
57
|
-
}
|
|
58
|
-
/** Fades the loader out and removes it. Safe to call more than once. A scene passes the showing it mounted under; a later showing is not its to hide. */
|
|
59
|
-
export function hideBootLoader(showing = showings) {
|
|
60
|
-
const boot = document.getElementById("boot");
|
|
61
|
-
if (showing !== showings || boot === null || boot.dataset.state === "done" || boot.dataset.state === "failed")
|
|
62
|
-
return;
|
|
63
|
-
const seconds = bootFadeSeconds();
|
|
64
|
-
boot.style.setProperty("--boot-fade", `${seconds}s`);
|
|
65
|
-
boot.dataset.state = "done";
|
|
66
|
-
removal = window.setTimeout(() => { removal = undefined; boot.remove(); }, seconds * 1000 + 100);
|
|
67
|
-
}
|
|
68
|
-
/** Replaces the loader's animation with its failure message. */
|
|
69
|
-
export function failBootLoader() {
|
|
70
|
-
const boot = document.getElementById("boot");
|
|
71
|
-
if (boot !== null)
|
|
72
|
-
boot.dataset.state = "failed";
|
|
73
|
-
}
|
package/src/shell/embedded.css
CHANGED
|
@@ -10,27 +10,27 @@
|
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/* Top bar: one tight row, close to the corner. */
|
|
13
|
-
[data-embedded="true"][data-phone="false"] .shell-top { top: 6px; left: 6px; max-width: calc(100vw - 120px); --shell-timeline-space: 60px; }
|
|
14
|
-
[data-embedded="true"][data-phone="false"] .top-bar { gap: 4px; padding: 3px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0, 0, 0, .24); }
|
|
15
|
-
[data-embedded="true"][data-phone="false"] .top-bar-divider { height: 16px; margin: 0 2px; }
|
|
16
|
-
[data-embedded="true"][data-phone="false"] .developer-mode-toggle { top: 9px; right: 8px; }
|
|
17
|
-
[data-embedded="true"][data-phone="false"] .scale-menu,
|
|
18
|
-
[data-embedded="true"][data-phone="false"] .scale-explanation-panel { top: calc(100% + 4px); }
|
|
13
|
+
.astraeus-shell[data-embedded="true"]:where([data-phone="false"]) .shell-top { top: 6px; left: 6px; max-width: calc(100vw - 120px); --shell-timeline-space: 60px; }
|
|
14
|
+
.astraeus-shell[data-embedded="true"][data-phone="false"] .top-bar { gap: 4px; padding: 3px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0, 0, 0, .24); }
|
|
15
|
+
.astraeus-shell[data-embedded="true"][data-phone="false"] .top-bar-divider { height: 16px; margin: 0 2px; }
|
|
16
|
+
.astraeus-shell[data-embedded="true"][data-phone="false"] .developer-mode-toggle { top: 9px; right: 8px; }
|
|
17
|
+
.astraeus-shell[data-embedded="true"][data-phone="false"] .scale-menu,
|
|
18
|
+
.astraeus-shell[data-embedded="true"][data-phone="false"] .scale-explanation-panel { top: calc(100% + 4px); }
|
|
19
19
|
|
|
20
20
|
/* Timeline: one slim line, a thinner scrubber. */
|
|
21
|
-
[data-embedded="true"][data-phone="false"] .timeline-bar { right: 6px; bottom: 6px; left: 6px; padding: 3px 8px; border-radius: 10px; font-size: 12px; }
|
|
22
|
-
[data-embedded="true"][data-phone="false"] .timeline-main-row { gap: 8px; }
|
|
23
|
-
[data-embedded="true"][data-phone="false"] .timeline-time { font-size: 12px; }
|
|
24
|
-
[data-embedded="true"][data-phone="false"] .timeline-bar .timeline-speed select { width: 150px; }
|
|
21
|
+
.astraeus-shell[data-embedded="true"][data-phone="false"] .timeline-bar { right: 6px; bottom: 6px; left: 6px; padding: 3px 8px; border-radius: 10px; font-size: 12px; }
|
|
22
|
+
.astraeus-shell[data-embedded="true"][data-phone="false"] .timeline-main-row { gap: 8px; }
|
|
23
|
+
.astraeus-shell[data-embedded="true"][data-phone="false"] .timeline-time { font-size: 12px; }
|
|
24
|
+
.astraeus-shell[data-embedded="true"][data-phone="false"] .timeline-bar .timeline-speed select { width: 150px; }
|
|
25
25
|
@media (pointer: fine) {
|
|
26
|
-
[data-embedded="true"][data-phone="false"] .timeline-track,
|
|
27
|
-
[data-embedded="true"][data-phone="false"] .timeline-track input[type="range"],
|
|
28
|
-
[data-embedded="true"][data-phone="false"] .timeline-track input[type="range"]::-webkit-slider-runnable-track { height: 20px; }
|
|
29
|
-
[data-embedded="true"][data-phone="false"] .timeline-track input[type="range"]::-webkit-slider-thumb { margin-top: 1px; }
|
|
26
|
+
.astraeus-shell[data-embedded="true"][data-phone="false"] .timeline-track,
|
|
27
|
+
.astraeus-shell[data-embedded="true"][data-phone="false"] .timeline-track input[type="range"],
|
|
28
|
+
.astraeus-shell[data-embedded="true"][data-phone="false"] .timeline-track input[type="range"]::-webkit-slider-runnable-track { height: 20px; }
|
|
29
|
+
.astraeus-shell[data-embedded="true"][data-phone="false"] .timeline-track input[type="range"]::-webkit-slider-thumb { margin-top: 1px; }
|
|
30
30
|
}
|
|
31
|
-
[data-embedded="true"][data-phone="false"] .timeline-bar .timeline-expanded { bottom: calc(100% + 6px); }
|
|
31
|
+
.astraeus-shell[data-embedded="true"][data-phone="false"] .timeline-bar .timeline-expanded { bottom: calc(100% + 6px); }
|
|
32
32
|
|
|
33
33
|
/* A phone-sized frame keeps its pill, drawers and 44 px targets; only the margins and the timeline's padding tighten. */
|
|
34
|
-
[data-embedded="true"][data-phone="true"] .controls-pill { top: calc(4px + var(--safe-top)); left: calc(4px + var(--safe-left)); }
|
|
35
|
-
[data-embedded="true"][data-phone="true"] .developer-mode-toggle { top: calc(4px + var(--safe-top)); right: calc(4px + var(--safe-right)); }
|
|
36
|
-
[data-embedded="true"][data-phone="true"] .timeline-bar { right: calc(4px + var(--safe-right)); bottom: calc(4px + var(--safe-bottom)); left: calc(4px + var(--safe-left)); padding: 14px 8px 1px; }
|
|
34
|
+
.astraeus-shell[data-embedded="true"][data-phone="true"] .controls-pill { top: calc(4px + var(--safe-top)); left: calc(4px + var(--safe-left)); }
|
|
35
|
+
.astraeus-shell[data-embedded="true"][data-phone="true"] .developer-mode-toggle { top: calc(4px + var(--safe-top)); right: calc(4px + var(--safe-right)); }
|
|
36
|
+
.astraeus-shell[data-embedded="true"][data-phone="true"] .timeline-bar { right: calc(4px + var(--safe-right)); bottom: calc(4px + var(--safe-bottom)); left: calc(4px + var(--safe-left)); padding: 14px 8px 1px; }
|
|
@@ -65,7 +65,7 @@ export interface ExperienceConfig {
|
|
|
65
65
|
readonly rates: readonly number[];
|
|
66
66
|
/** True draws no timeline bar (and no phone timeline drawer or reserved space); the clock then runs or stays frozen as the definition says. Absent: the bar is shown. */
|
|
67
67
|
readonly hideTimeline?: boolean;
|
|
68
|
-
/** Short story panels that open as playback reaches their time; see `
|
|
68
|
+
/** Short story panels that open as playback reaches their time; see `resolveStoryPanels`. Omit for an experience with none. */
|
|
69
69
|
readonly storyPanels?: StoryPanelSet;
|
|
70
70
|
/** A planet's moons by family for the sliding moon panel; omit for an experience with none. Every moon listed must also be an object. */
|
|
71
71
|
readonly moonFamilies?: MoonFamilyList;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { moonCountText, moonListDateText, moonListSummary } from "../core/moonListText.js";
|
|
2
|
+
export { moonCountText, moonListDateText, moonListSummary };
|
|
1
3
|
/**
|
|
2
4
|
* What the moon browser (the sliding panel of a planet's moons by family) needs, as plain data any experience can hand the shell
|
|
3
5
|
* (ARCH-01): families with a one-line description, and each family's moons. The panel shows named moons first and folds the unnamed away.
|
|
@@ -35,12 +37,6 @@ export interface MoonSplit {
|
|
|
35
37
|
}
|
|
36
38
|
/** Named moons first (as listed), provisional designations apart. */
|
|
37
39
|
export declare function splitNamed(moons: readonly MoonListing[]): MoonSplit;
|
|
38
|
-
/** A family's heading count: "5 moons", "1 moon". */
|
|
39
|
-
export declare function moonCountText(count: number): string;
|
|
40
|
-
/** A date from the data (YYYY-MM-DD, or an ISO timestamp) as "18 October 2026"; the text itself when it is not a date. */
|
|
41
|
-
export declare function moonListDateText(date: string): string;
|
|
42
|
-
/** "115 moons in the JPL Horizons list of 18 October 2026": the count is the moons the list holds, the source and date come from the data. */
|
|
43
|
-
export declare function moonListSummary(count: number, source?: string, date?: string): string;
|
|
44
40
|
/** The summary of a whole moon list: every moon in every family, counted live. */
|
|
45
41
|
export declare const moonFamilyListSummary: (list: MoonFamilyList) => string;
|
|
46
42
|
export interface MoonMatch {
|
|
@@ -1,26 +1,10 @@
|
|
|
1
|
+
import { moonCountText, moonListDateText, moonListSummary } from "../core/moonListText.js";
|
|
2
|
+
export { moonCountText, moonListDateText, moonListSummary };
|
|
1
3
|
/** Named moons first (as listed), provisional designations apart. */
|
|
2
4
|
export function splitNamed(moons) {
|
|
3
5
|
return { named: moons.filter((moon) => moon.named), unnamed: moons.filter((moon) => !moon.named) };
|
|
4
6
|
}
|
|
5
7
|
const squash = (text) => text.toLowerCase().replace(/[^a-z0-9]+/g, "");
|
|
6
|
-
/** A family's heading count: "5 moons", "1 moon". */
|
|
7
|
-
export function moonCountText(count) {
|
|
8
|
-
return count === 1 ? "1 moon" : `${count} moons`;
|
|
9
|
-
}
|
|
10
|
-
/** A date from the data (YYYY-MM-DD, or an ISO timestamp) as "18 October 2026"; the text itself when it is not a date. */
|
|
11
|
-
export function moonListDateText(date) {
|
|
12
|
-
const parsed = /^\d{4}-\d{2}-\d{2}/.test(date) ? new Date(`${date.slice(0, 10)}T00:00:00Z`) : new Date(Number.NaN);
|
|
13
|
-
return Number.isNaN(parsed.getTime()) ? date : parsed.toLocaleDateString("en-GB", { day: "numeric", month: "long", year: "numeric", timeZone: "UTC" });
|
|
14
|
-
}
|
|
15
|
-
/** "115 moons in the JPL Horizons list of 18 October 2026": the count is the moons the list holds, the source and date come from the data. */
|
|
16
|
-
export function moonListSummary(count, source, date) {
|
|
17
|
-
const head = moonCountText(count);
|
|
18
|
-
if (source !== undefined && date !== undefined)
|
|
19
|
-
return `${head} in the ${source} list of ${moonListDateText(date)}`;
|
|
20
|
-
if (date !== undefined)
|
|
21
|
-
return `${head}, list of ${moonListDateText(date)}`;
|
|
22
|
-
return head;
|
|
23
|
-
}
|
|
24
8
|
/** The summary of a whole moon list: every moon in every family, counted live. */
|
|
25
9
|
export const moonFamilyListSummary = (list) => moonListSummary(list.families.reduce((total, family) => total + family.moons.length, 0), list.listSource, list.listDate);
|
|
26
10
|
/** The moons whose name or designation contains the query, ignoring case, spaces and punctuation ("s2003 j19" finds "S/2003 J 19"); none for an empty query. */
|
package/src/shell/phone.css
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
/* ---- Top: the pill and the cog ---- */
|
|
17
|
-
[data-phone="true"] .controls-pill {
|
|
17
|
+
.astraeus-shell[data-phone="true"] .controls-pill {
|
|
18
18
|
position: absolute;
|
|
19
19
|
z-index: 5;
|
|
20
20
|
top: calc(8px + var(--safe-top));
|
|
@@ -24,19 +24,19 @@
|
|
|
24
24
|
/* A vertical swipe on the pill is ours (it opens the drawer), not a page pan. */
|
|
25
25
|
touch-action: none;
|
|
26
26
|
}
|
|
27
|
-
[data-phone="true"] .controls-pill-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
28
|
-
[data-phone="true"] .controls-pill[aria-expanded="true"] { visibility: hidden; }
|
|
29
|
-
[data-phone="true"] .developer-mode-toggle { z-index: 9; top: calc(8px + var(--safe-top)); right: calc(8px + var(--safe-right)); }
|
|
27
|
+
.astraeus-shell[data-phone="true"] .controls-pill-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
28
|
+
.astraeus-shell[data-phone="true"] .controls-pill[aria-expanded="true"] { visibility: hidden; }
|
|
29
|
+
.astraeus-shell[data-phone="true"] .developer-mode-toggle { z-index: 9; top: calc(8px + var(--safe-top)); right: calc(8px + var(--safe-right)); }
|
|
30
30
|
|
|
31
31
|
/* ---- The drawers ---- */
|
|
32
|
-
.drawer-handle { position: absolute; left: 50%; display: flex; width: 140px; height: 44px; transform: translateX(-50%); touch-action: none; }
|
|
33
|
-
.drawer-handle span { display: block; width: 36px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ui-color, #f0e6da) 28%, transparent); }
|
|
34
|
-
.drawer-handle:hover span { background: color-mix(in srgb, var(--ui-color, #f0e6da) 50%, transparent); }
|
|
32
|
+
.astraeus-shell :where(.drawer-handle) { position: absolute; left: 50%; display: flex; width: 140px; height: 44px; transform: translateX(-50%); touch-action: none; }
|
|
33
|
+
.astraeus-shell .drawer-handle span { display: block; width: 36px; height: 4px; border-radius: 2px; background: color-mix(in srgb, var(--ui-color, #f0e6da) 28%, transparent); }
|
|
34
|
+
.astraeus-shell .drawer-handle:hover span { background: color-mix(in srgb, var(--ui-color, #f0e6da) 50%, transparent); }
|
|
35
35
|
/* The hit area (44 px) reaches past the panel's edge so a thumb finds it; the grip is drawn inside the panel. */
|
|
36
|
-
.drawer-handle-top { top: -28px; align-items: flex-end; justify-content: center; padding-bottom: 10px; }
|
|
37
|
-
.drawer-handle-bottom { bottom: -20px; align-items: flex-start; justify-content: center; padding-top: 12px; }
|
|
36
|
+
.astraeus-shell :where(.drawer-handle-top) { top: -28px; align-items: flex-end; justify-content: center; padding-bottom: 10px; }
|
|
37
|
+
.astraeus-shell :where(.drawer-handle-bottom) { bottom: -20px; align-items: flex-start; justify-content: center; padding-top: 12px; }
|
|
38
38
|
|
|
39
|
-
[data-phone="true"] .controls-drawer {
|
|
39
|
+
.astraeus-shell[data-phone="true"] .controls-drawer {
|
|
40
40
|
position: absolute;
|
|
41
41
|
z-index: 7;
|
|
42
42
|
top: 0;
|
|
@@ -55,13 +55,13 @@
|
|
|
55
55
|
visibility: hidden;
|
|
56
56
|
transition: transform var(--drawer-ms, 240ms) var(--drawer-ease), visibility 0s linear var(--drawer-ms, 240ms);
|
|
57
57
|
}
|
|
58
|
-
[data-phone="true"] .controls-drawer[data-open="true"] {
|
|
58
|
+
.astraeus-shell[data-phone="true"] .controls-drawer[data-open="true"] {
|
|
59
59
|
transform: none;
|
|
60
60
|
visibility: visible;
|
|
61
61
|
transition: transform var(--drawer-ms, 240ms) var(--drawer-ease), visibility 0s;
|
|
62
62
|
}
|
|
63
|
-
[data-phone="true"] .controls-drawer .shell-toolbar { max-width: none; }
|
|
64
|
-
[data-phone="true"] .controls-drawer .top-bar {
|
|
63
|
+
.astraeus-shell[data-phone="true"] .controls-drawer .shell-toolbar { max-width: none; }
|
|
64
|
+
.astraeus-shell[data-phone="true"] .controls-drawer .top-bar {
|
|
65
65
|
display: grid;
|
|
66
66
|
grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
|
|
67
67
|
gap: 8px;
|
|
@@ -71,26 +71,26 @@
|
|
|
71
71
|
box-shadow: none;
|
|
72
72
|
backdrop-filter: none;
|
|
73
73
|
}
|
|
74
|
-
[data-phone="true"] .controls-drawer .object-camera-actions { display: contents; }
|
|
75
|
-
[data-phone="true"] .controls-drawer .top-bar-divider { display: none; }
|
|
74
|
+
.astraeus-shell[data-phone="true"] .controls-drawer .object-camera-actions { display: contents; }
|
|
75
|
+
.astraeus-shell[data-phone="true"] .controls-drawer .top-bar-divider { display: none; }
|
|
76
76
|
/* The object list takes the first row, leaving room for the cog at the right. */
|
|
77
|
-
[data-phone="true"] .controls-drawer .object-picker { grid-column: 1 / -1; width: calc(100% - 52px); max-width: none; }
|
|
77
|
+
.astraeus-shell[data-phone="true"] .controls-drawer .object-picker { grid-column: 1 / -1; width: calc(100% - 52px); max-width: none; }
|
|
78
78
|
/* Each button: icon over a short word. */
|
|
79
|
-
[data-phone="true"] .controls-drawer .display-switches { display: contents; }
|
|
80
|
-
[data-phone="true"] .controls-drawer .top-bar-button { width: auto; flex-direction: column; gap: 2px; padding: 0 4px; }
|
|
81
|
-
[data-phone="true"] .controls-drawer .top-bar-button-text { display: block; max-width: 100%; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
|
|
82
|
-
[data-phone="true"] .controls-drawer .switch-control { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; }
|
|
83
|
-
[data-phone="true"] .controls-drawer .scale-toggle { padding: 0 4px; }
|
|
84
|
-
[data-phone="true"] .controls-drawer .scale-toggle > span { font-size: 11px; }
|
|
85
|
-
[data-phone="true"] .controls-drawer .scale-menu,
|
|
86
|
-
[data-phone="true"] .controls-drawer .scale-explanation-panel { top: calc(100% + 6px); right: auto; left: 0; width: min(320px, calc(100vw - 32px)); }
|
|
79
|
+
.astraeus-shell[data-phone="true"] .controls-drawer .display-switches { display: contents; }
|
|
80
|
+
.astraeus-shell[data-phone="true"] .controls-drawer .top-bar-button { width: auto; flex-direction: column; gap: 2px; padding: 0 4px; }
|
|
81
|
+
.astraeus-shell[data-phone="true"] .controls-drawer .top-bar-button-text { display: block; max-width: 100%; overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
|
|
82
|
+
.astraeus-shell[data-phone="true"] .controls-drawer .switch-control { display: grid; grid-column: 1 / -1; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 8px; }
|
|
83
|
+
.astraeus-shell[data-phone="true"] .controls-drawer .scale-toggle { padding: 0 4px; }
|
|
84
|
+
.astraeus-shell[data-phone="true"] .controls-drawer .scale-toggle > span { font-size: 11px; }
|
|
85
|
+
.astraeus-shell[data-phone="true"] .controls-drawer .scale-menu,
|
|
86
|
+
.astraeus-shell[data-phone="true"] .controls-drawer .scale-explanation-panel { top: calc(100% + 6px); right: auto; left: 0; width: min(320px, calc(100vw - 32px)); }
|
|
87
87
|
/* The switch panel stays clear of the cog's column (60 px at the right) and the drawer's edge. */
|
|
88
|
-
[data-phone="true"] .controls-drawer .switch-panel { top: calc(100% + 6px); right: auto; left: 0; width: min(260px, calc(100vw - 84px)); min-width: 0; }
|
|
89
|
-
[data-phone="true"] .controls-drawer .top-bar { position: relative; }
|
|
90
|
-
[data-phone="true"] .controls-drawer .scale-control { position: static; }
|
|
88
|
+
.astraeus-shell[data-phone="true"] .controls-drawer .switch-panel { top: calc(100% + 6px); right: auto; left: 0; width: min(260px, calc(100vw - 84px)); min-width: 0; }
|
|
89
|
+
.astraeus-shell[data-phone="true"] .controls-drawer .top-bar { position: relative; }
|
|
90
|
+
.astraeus-shell[data-phone="true"] .controls-drawer .scale-control { position: static; }
|
|
91
91
|
|
|
92
92
|
/* ---- Bottom: the two-line timeline and its drawer ---- */
|
|
93
|
-
[data-phone="true"] .timeline-bar {
|
|
93
|
+
.astraeus-shell[data-phone="true"] .timeline-bar {
|
|
94
94
|
right: calc(8px + var(--safe-right));
|
|
95
95
|
bottom: calc(8px + var(--safe-bottom));
|
|
96
96
|
left: calc(8px + var(--safe-left));
|
|
@@ -99,26 +99,26 @@
|
|
|
99
99
|
padding: 16px 10px 2px;
|
|
100
100
|
border-radius: 18px;
|
|
101
101
|
}
|
|
102
|
-
[data-phone="true"] .timeline-bar[data-drawer-open="true"] { z-index: 6; background: var(--panel-bg); }
|
|
103
|
-
[data-phone="true"] .timeline-main-row { gap: 4px; }
|
|
104
|
-
[data-phone="true"] .timeline-time { flex-basis: auto; width: auto; }
|
|
105
|
-
[data-phone="true"] .timeline-time-full { display: none; }
|
|
106
|
-
[data-phone="true"] .timeline-time-short { display: inline; }
|
|
107
|
-
[data-phone="true"] .timeline-bar .timeline-speed select { width: 96px; }
|
|
108
|
-
[data-phone="true"] .timeline-scrubber { flex-basis: 100%; }
|
|
102
|
+
.astraeus-shell[data-phone="true"] .timeline-bar[data-drawer-open="true"] { z-index: 6; background: var(--panel-bg); }
|
|
103
|
+
.astraeus-shell[data-phone="true"] .timeline-main-row { gap: 4px; }
|
|
104
|
+
.astraeus-shell[data-phone="true"] .timeline-time { flex-basis: auto; width: auto; }
|
|
105
|
+
.astraeus-shell[data-phone="true"] .timeline-time-full { display: none; }
|
|
106
|
+
.astraeus-shell[data-phone="true"] .timeline-time-short { display: inline; }
|
|
107
|
+
.astraeus-shell[data-phone="true"] .timeline-bar .timeline-speed select { width: 96px; }
|
|
108
|
+
.astraeus-shell[data-phone="true"] .timeline-scrubber { flex-basis: 100%; }
|
|
109
109
|
|
|
110
|
-
.timeline-drawer {
|
|
110
|
+
.astraeus-shell .timeline-drawer {
|
|
111
111
|
display: grid;
|
|
112
112
|
grid-template-rows: 0fr;
|
|
113
113
|
visibility: hidden;
|
|
114
114
|
transition: grid-template-rows var(--drawer-ms, 240ms) var(--drawer-ease), visibility 0s linear var(--drawer-ms, 240ms);
|
|
115
115
|
}
|
|
116
|
-
.timeline-drawer[data-open="true"] {
|
|
116
|
+
.astraeus-shell .timeline-drawer[data-open="true"] {
|
|
117
117
|
grid-template-rows: 1fr;
|
|
118
118
|
visibility: visible;
|
|
119
119
|
transition: grid-template-rows var(--drawer-ms, 240ms) var(--drawer-ease), visibility 0s;
|
|
120
120
|
}
|
|
121
|
-
.timeline-drawer-body {
|
|
121
|
+
.astraeus-shell .timeline-drawer-body {
|
|
122
122
|
display: flex;
|
|
123
123
|
flex-direction: column;
|
|
124
124
|
gap: 10px;
|
|
@@ -127,22 +127,22 @@
|
|
|
127
127
|
overflow-y: auto;
|
|
128
128
|
overscroll-behavior: contain;
|
|
129
129
|
}
|
|
130
|
-
.timeline-drawer[data-open="true"] .timeline-drawer-body { padding-top: 10px; }
|
|
131
|
-
.timeline-speed-slider { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 10px; color: var(--ui-muted, #c7bdb3); font-size: 13px; }
|
|
132
|
-
.timeline-speed-slider input { grid-column: 1 / -1; grid-row: 2; width: 100%; min-height: 44px; margin: 0; accent-color: var(--ui-accent, #fc6323); }
|
|
133
|
-
.timeline-speed-slider output { color: var(--ui-color, #f0e6da); font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
|
|
130
|
+
.astraeus-shell .timeline-drawer[data-open="true"] .timeline-drawer-body { padding-top: 10px; }
|
|
131
|
+
.astraeus-shell .timeline-speed-slider { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 10px; color: var(--ui-muted, #c7bdb3); font-size: 13px; }
|
|
132
|
+
.astraeus-shell :where(.timeline-speed-slider) input { grid-column: 1 / -1; grid-row: 2; width: 100%; min-height: 44px; margin: 0; accent-color: var(--ui-accent, #fc6323); }
|
|
133
|
+
.astraeus-shell .timeline-speed-slider output { color: var(--ui-color, #f0e6da); font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; text-align: right; }
|
|
134
134
|
/* Inside the drawer the events list is plain content, not a pop-up. */
|
|
135
|
-
.timeline-drawer .timeline-expanded { position: static; width: auto; max-height: none; overflow: visible; padding: 0; border: 0; background: none; box-shadow: none; }
|
|
135
|
+
.astraeus-shell .timeline-drawer .timeline-expanded { position: static; width: auto; max-height: none; overflow: visible; padding: 0; border: 0; background: none; box-shadow: none; }
|
|
136
136
|
|
|
137
137
|
/* An event row is two short lines (the time, then its name) so the name is not cut off. */
|
|
138
|
-
.timeline-drawer .timeline-expanded li button { flex-direction: column; align-items: flex-start; gap: 0; padding-top: 4px; padding-bottom: 4px; }
|
|
139
|
-
.timeline-drawer .timeline-expanded li span { max-width: 100%; white-space: normal; }
|
|
138
|
+
.astraeus-shell .timeline-drawer .timeline-expanded li button { flex-direction: column; align-items: flex-start; gap: 0; padding-top: 4px; padding-bottom: 4px; }
|
|
139
|
+
.astraeus-shell .timeline-drawer .timeline-expanded li span { max-width: 100%; white-space: normal; }
|
|
140
140
|
|
|
141
141
|
/* ---- Sheets: information and story panels ---- */
|
|
142
|
-
[data-phone="true"] .sheet-handle { display: block; flex: 0 0 auto; align-self: center; width: 40px; height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--ui-accent, #fc6323) 45%, transparent); }
|
|
142
|
+
.astraeus-shell[data-phone="true"] .sheet-handle { display: block; flex: 0 0 auto; align-self: center; width: 40px; height: 4px; border-radius: 999px; background: color-mix(in srgb, var(--ui-accent, #fc6323) 45%, transparent); }
|
|
143
143
|
/* Both sheets ride above the timeline bar, so the Play button is never covered (C-053 Observation 2, O-020 Decision 13). */
|
|
144
|
-
[data-phone="true"] .info-panel,
|
|
145
|
-
[data-phone="true"] .story-panel {
|
|
144
|
+
.astraeus-shell[data-phone="true"] .info-panel,
|
|
145
|
+
.astraeus-shell[data-phone="true"] .story-panel {
|
|
146
146
|
position: fixed;
|
|
147
147
|
top: auto;
|
|
148
148
|
bottom: calc(var(--timeline-space, 150px) + 8px);
|
|
@@ -158,12 +158,12 @@
|
|
|
158
158
|
border-radius: 16px;
|
|
159
159
|
animation: story-sheet-in var(--drawer-ms, 240ms) var(--drawer-ease);
|
|
160
160
|
}
|
|
161
|
-
[data-phone="true"] .info-panel { z-index: 8; background: #0e0e13; }
|
|
162
|
-
[data-phone="true"] .story-panel { z-index: 4; touch-action: pan-y; } /* a pinch reaches the scene beneath (useZoomThrough); a vertical drag still scrolls or dismisses */
|
|
163
|
-
[data-phone="true"] .info-panel-header h2 { margin: 0; font-size: 22px; }
|
|
161
|
+
.astraeus-shell[data-phone="true"] .info-panel { z-index: 8; background: #0e0e13; }
|
|
162
|
+
.astraeus-shell[data-phone="true"] .story-panel { z-index: 4; touch-action: pan-y; } /* a pinch reaches the scene beneath (useZoomThrough); a vertical drag still scrolls or dismisses */
|
|
163
|
+
.astraeus-shell[data-phone="true"] .info-panel-header h2 { margin: 0; font-size: 22px; }
|
|
164
164
|
|
|
165
165
|
/* ---- The Developer panel below the pill, above the timeline ---- */
|
|
166
|
-
[data-phone="true"] .developer-tools {
|
|
166
|
+
.astraeus-shell[data-phone="true"] .developer-tools {
|
|
167
167
|
top: calc(60px + var(--safe-top));
|
|
168
168
|
right: calc(8px + var(--safe-right));
|
|
169
169
|
left: calc(8px + var(--safe-left));
|
|
@@ -171,12 +171,12 @@
|
|
|
171
171
|
max-height: max(160px, calc(100dvh - 60px - var(--safe-top) - var(--timeline-space, 150px) - 16px));
|
|
172
172
|
padding: 9px;
|
|
173
173
|
}
|
|
174
|
-
[data-phone="true"] .shell-top { top: 8px; left: 8px; width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: none; }
|
|
175
|
-
[data-phone="true"] .astraeus-label { font-size: 12px; }
|
|
174
|
+
.astraeus-shell[data-phone="true"] .shell-top { top: 8px; left: 8px; width: calc(100vw - 16px); max-width: calc(100vw - 16px); max-height: none; }
|
|
175
|
+
.astraeus-shell[data-phone="true"] .astraeus-label { font-size: 12px; }
|
|
176
176
|
|
|
177
177
|
@media (prefers-reduced-motion: reduce) {
|
|
178
|
-
.controls-drawer,
|
|
179
|
-
.timeline-drawer,
|
|
180
|
-
.info-panel,
|
|
181
|
-
.story-panel { transition: none !important; animation: none !important; }
|
|
178
|
+
.astraeus-shell .controls-drawer,
|
|
179
|
+
.astraeus-shell .timeline-drawer,
|
|
180
|
+
.astraeus-shell .info-panel,
|
|
181
|
+
.astraeus-shell .story-panel { transition: none !important; animation: none !important; }
|
|
182
182
|
}
|
|
@@ -1,61 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export type PanelBadge = "observed" | "modelled" | "illustrative";
|
|
4
|
-
export declare const PANEL_BADGES: readonly PanelBadge[];
|
|
5
|
-
/** One short story panel, resolved to a UTC time. */
|
|
6
|
-
export interface StoryPanel {
|
|
7
|
-
readonly id: string;
|
|
8
|
-
readonly timeUtcMs: number;
|
|
9
|
-
readonly title: string;
|
|
10
|
-
/** Paragraphs, in order. */
|
|
11
|
-
readonly body: readonly string[];
|
|
12
|
-
readonly badge: PanelBadge;
|
|
13
|
-
/** Short paragraphs of exact figures and measured-versus-reconstructed notes, shown in the folded section above the sources. Empty when the panel has none. */
|
|
14
|
-
readonly details: readonly string[];
|
|
15
|
-
/** One line per cited source (PROV-01); never empty. */
|
|
16
|
-
readonly sources: readonly string[];
|
|
17
|
-
/** A shell object this panel is about; the scene draws a marker on it that reopens the panel. */
|
|
18
|
-
readonly objectId?: string;
|
|
19
|
-
}
|
|
20
|
-
/** The panels an experience offers, with the defaults of the two settings that govern them. */
|
|
21
|
-
export interface StoryPanelSet {
|
|
22
|
-
readonly panels: readonly StoryPanel[];
|
|
23
|
-
/** How long playback holds when a panel opens by itself, in seconds (0 never pauses). */
|
|
24
|
-
readonly pauseSeconds: number;
|
|
25
|
-
/** Whether panels open by themselves as forward playback reaches them. */
|
|
26
|
-
readonly autoOpen: boolean;
|
|
27
|
-
}
|
|
28
|
-
export declare const DEFAULT_PANEL_PAUSE_SECONDS = 6;
|
|
29
|
-
export declare const MAX_PANEL_PAUSE_SECONDS = 20;
|
|
30
|
-
/** What a story's settings may point a panel's time at, besides a plain UTC time. */
|
|
31
|
-
export interface PanelLookup {
|
|
32
|
-
readonly events: readonly {
|
|
33
|
-
readonly id: string;
|
|
34
|
-
readonly timeUtcMs: number;
|
|
35
|
-
}[];
|
|
36
|
-
/** Source anchors by id, when the experience has them. */
|
|
37
|
-
readonly anchors?: ReadonlyMap<string, number>;
|
|
38
|
-
/** Ids a panel's `object` may name. Absent: any id is accepted. */
|
|
39
|
-
readonly objectIds?: readonly string[];
|
|
40
|
-
/** When given, every panel must fall inside it. */
|
|
41
|
-
readonly window?: TimeBounds;
|
|
42
|
-
}
|
|
43
|
-
/** A panel's settings entry is wrong; the message names the panel and the field. */
|
|
44
|
-
export declare class StoryPanelError extends Error {
|
|
45
|
-
constructor(panel: string, field: string, problem: string);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Validates a story's panel settings (STYLE-06) and resolves each panel's time. Shape:
|
|
49
|
-
* `{ pauseSeconds?, autoOpen?, panels: [{ id, at: { utc | event | anchor }, title, body, details?, badge, sources, object? }] }`.
|
|
50
|
-
* Panels come back sorted by time; ids must be unique.
|
|
51
|
-
*/
|
|
52
|
-
export declare function parseStoryPanels(raw: unknown, lookup: PanelLookup): StoryPanelSet;
|
|
1
|
+
import type { StoryPanel } from "../core/storyPanels.js";
|
|
2
|
+
export { checkPanelPlayback, checkStoryPanel, DEFAULT_PANEL_PAUSE_SECONDS, MAX_PANEL_PAUSE_SECONDS, resolveStoryPanels, StoryPanelError, type PanelLookup, type StoryPanel, type StoryPanelSet, } from "../core/storyPanels.js";
|
|
53
3
|
/**
|
|
54
4
|
* The panels forward playback just passed: those with `previousMs < time <= currentMs`, in time order.
|
|
55
5
|
* A backward step or no movement crosses nothing, so loops and rewinds never open a panel.
|
|
56
6
|
*/
|
|
57
7
|
export declare function panelsCrossed(panels: readonly StoryPanel[], previousMs: number, currentMs: number): readonly StoryPanel[];
|
|
58
|
-
export declare const BADGE_LABELS: Readonly<Record<PanelBadge, string>>;
|
|
59
8
|
/**
|
|
60
9
|
* Decides, tick by tick, whether playback has just carried the clock across a panel. It remembers the last time it saw;
|
|
61
10
|
* `rebase` moves that memory when a person seeks, so a jump is never read as playback and opens nothing.
|
package/src/shell/storyPanels.js
CHANGED
|
@@ -1,104 +1,4 @@
|
|
|
1
|
-
export
|
|
2
|
-
export const DEFAULT_PANEL_PAUSE_SECONDS = 6;
|
|
3
|
-
export const MAX_PANEL_PAUSE_SECONDS = 20;
|
|
4
|
-
/** A panel's settings entry is wrong; the message names the panel and the field. */
|
|
5
|
-
export class StoryPanelError extends Error {
|
|
6
|
-
constructor(panel, field, problem) {
|
|
7
|
-
super(`story panel ${panel}: ${field} ${problem}`);
|
|
8
|
-
this.name = "StoryPanelError";
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
12
|
-
function text(panel, field, value) {
|
|
13
|
-
if (typeof value !== "string" || value.trim() === "")
|
|
14
|
-
throw new StoryPanelError(panel, field, "must be non-empty text");
|
|
15
|
-
return value;
|
|
16
|
-
}
|
|
17
|
-
function lines(panel, field, value) {
|
|
18
|
-
const list = typeof value === "string" ? [value] : value;
|
|
19
|
-
if (!Array.isArray(list) || list.length === 0)
|
|
20
|
-
throw new StoryPanelError(panel, field, "must be one or more non-empty lines");
|
|
21
|
-
return list.map((line, index) => text(panel, `${field}[${index}]`, line));
|
|
22
|
-
}
|
|
23
|
-
function timeOf(panel, at, lookup) {
|
|
24
|
-
if (!isRecord(at))
|
|
25
|
-
throw new StoryPanelError(panel, "at", "must name a time: { utc }, { event } or { anchor }");
|
|
26
|
-
const keys = ["utc", "event", "anchor"].filter((key) => at[key] !== undefined);
|
|
27
|
-
if (keys.length !== 1)
|
|
28
|
-
throw new StoryPanelError(panel, "at", "must give exactly one of utc, event or anchor");
|
|
29
|
-
if (keys[0] === "utc") {
|
|
30
|
-
const utc = text(panel, "at.utc", at.utc);
|
|
31
|
-
const ms = Date.parse(utc);
|
|
32
|
-
if (!/Z$/.test(utc) || !Number.isFinite(ms))
|
|
33
|
-
throw new StoryPanelError(panel, "at.utc", `must be an ISO-8601 UTC time ending in Z, got "${utc}"`);
|
|
34
|
-
return ms;
|
|
35
|
-
}
|
|
36
|
-
if (keys[0] === "event") {
|
|
37
|
-
const id = text(panel, "at.event", at.event);
|
|
38
|
-
const event = lookup.events.find((candidate) => candidate.id === id);
|
|
39
|
-
if (event === undefined)
|
|
40
|
-
throw new StoryPanelError(panel, "at.event", `names "${id}", which the experience's events lack`);
|
|
41
|
-
return event.timeUtcMs;
|
|
42
|
-
}
|
|
43
|
-
const id = text(panel, "at.anchor", at.anchor);
|
|
44
|
-
const anchor = lookup.anchors?.get(id);
|
|
45
|
-
if (anchor === undefined)
|
|
46
|
-
throw new StoryPanelError(panel, "at.anchor", `names "${id}", which the experience's anchors lack`);
|
|
47
|
-
return anchor;
|
|
48
|
-
}
|
|
49
|
-
function parsePanel(raw, index, lookup) {
|
|
50
|
-
if (!isRecord(raw))
|
|
51
|
-
throw new StoryPanelError(`#${index + 1}`, "entry", "must be an object");
|
|
52
|
-
const id = text(`#${index + 1}`, "id", raw.id);
|
|
53
|
-
const timeUtcMs = timeOf(id, raw.at, lookup);
|
|
54
|
-
if (lookup.window !== undefined && (timeUtcMs < lookup.window.startUtcMs || timeUtcMs > lookup.window.endUtcMs)) {
|
|
55
|
-
throw new StoryPanelError(id, "at", "falls outside the timeline window");
|
|
56
|
-
}
|
|
57
|
-
const badge = raw.badge;
|
|
58
|
-
if (!PANEL_BADGES.includes(badge))
|
|
59
|
-
throw new StoryPanelError(id, "badge", `must be one of ${PANEL_BADGES.join(", ")}, got ${JSON.stringify(badge)}`);
|
|
60
|
-
const objectId = raw.object === undefined ? undefined : text(id, "object", raw.object);
|
|
61
|
-
if (objectId !== undefined && lookup.objectIds !== undefined && !lookup.objectIds.includes(objectId)) {
|
|
62
|
-
throw new StoryPanelError(id, "object", `names "${objectId}", which the experience lacks`);
|
|
63
|
-
}
|
|
64
|
-
return {
|
|
65
|
-
id,
|
|
66
|
-
timeUtcMs,
|
|
67
|
-
title: text(id, "title", raw.title),
|
|
68
|
-
body: lines(id, "body", raw.body),
|
|
69
|
-
badge: badge,
|
|
70
|
-
details: raw.details === undefined ? [] : lines(id, "details", raw.details),
|
|
71
|
-
sources: lines(id, "sources", raw.sources),
|
|
72
|
-
...(objectId === undefined ? {} : { objectId }),
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Validates a story's panel settings (STYLE-06) and resolves each panel's time. Shape:
|
|
77
|
-
* `{ pauseSeconds?, autoOpen?, panels: [{ id, at: { utc | event | anchor }, title, body, details?, badge, sources, object? }] }`.
|
|
78
|
-
* Panels come back sorted by time; ids must be unique.
|
|
79
|
-
*/
|
|
80
|
-
export function parseStoryPanels(raw, lookup) {
|
|
81
|
-
if (!isRecord(raw))
|
|
82
|
-
throw new StoryPanelError("settings", "panels", "must be an object with a panels list");
|
|
83
|
-
const list = raw.panels;
|
|
84
|
-
if (!Array.isArray(list))
|
|
85
|
-
throw new StoryPanelError("settings", "panels", "must be a list");
|
|
86
|
-
const pauseSeconds = raw.pauseSeconds ?? DEFAULT_PANEL_PAUSE_SECONDS;
|
|
87
|
-
if (typeof pauseSeconds !== "number" || !Number.isFinite(pauseSeconds) || pauseSeconds < 0 || pauseSeconds > MAX_PANEL_PAUSE_SECONDS) {
|
|
88
|
-
throw new StoryPanelError("settings", "pauseSeconds", `must be between 0 and ${MAX_PANEL_PAUSE_SECONDS}, got ${JSON.stringify(pauseSeconds)}`);
|
|
89
|
-
}
|
|
90
|
-
const autoOpen = raw.autoOpen ?? true;
|
|
91
|
-
if (typeof autoOpen !== "boolean")
|
|
92
|
-
throw new StoryPanelError("settings", "autoOpen", "must be true or false");
|
|
93
|
-
const panels = list.map((entry, index) => parsePanel(entry, index, lookup));
|
|
94
|
-
const seen = new Set();
|
|
95
|
-
for (const panel of panels) {
|
|
96
|
-
if (seen.has(panel.id))
|
|
97
|
-
throw new StoryPanelError(panel.id, "id", "is used twice");
|
|
98
|
-
seen.add(panel.id);
|
|
99
|
-
}
|
|
100
|
-
return { panels: [...panels].sort((a, b) => a.timeUtcMs - b.timeUtcMs), pauseSeconds, autoOpen };
|
|
101
|
-
}
|
|
1
|
+
export { checkPanelPlayback, checkStoryPanel, DEFAULT_PANEL_PAUSE_SECONDS, MAX_PANEL_PAUSE_SECONDS, resolveStoryPanels, StoryPanelError, } from "../core/storyPanels.js";
|
|
102
2
|
/**
|
|
103
3
|
* The panels forward playback just passed: those with `previousMs < time <= currentMs`, in time order.
|
|
104
4
|
* A backward step or no movement crosses nothing, so loops and rewinds never open a panel.
|
|
@@ -108,11 +8,6 @@ export function panelsCrossed(panels, previousMs, currentMs) {
|
|
|
108
8
|
return [];
|
|
109
9
|
return panels.filter((panel) => panel.timeUtcMs > previousMs && panel.timeUtcMs <= currentMs);
|
|
110
10
|
}
|
|
111
|
-
export const BADGE_LABELS = {
|
|
112
|
-
observed: "Observed",
|
|
113
|
-
modelled: "Modelled",
|
|
114
|
-
illustrative: "Illustrative",
|
|
115
|
-
};
|
|
116
11
|
/**
|
|
117
12
|
* Decides, tick by tick, whether playback has just carried the clock across a panel. It remembers the last time it saw;
|
|
118
13
|
* `rebase` moves that memory when a person seeks, so a jump is never read as playback and opens nothing.
|