diff options
| author | godosa <godosa@godosa.eu> | 2026-10-07 00:14:38 +0200 |
|---|---|---|
| committer | godosa <godosa@godosa.eu> | 2026-10-07 00:14:38 +0200 |
| commit | 3443c1c65e9f1753e1e656b35d08416c1fa298f2 (patch) | |
| tree | 4e43236f460145a4d75d1b4616dcb7aa6ef08f51 /viewer/js/planet.js | |
| download | worldmap-viewer-3443c1c65e9f1753e1e656b35d08416c1fa298f2.tar.gz worldmap-viewer-3443c1c65e9f1753e1e656b35d08416c1fa298f2.zip | |
worldmap-viewer: initial public history
Diffstat (limited to 'viewer/js/planet.js')
| -rw-r--r-- | viewer/js/planet.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/viewer/js/planet.js b/viewer/js/planet.js new file mode 100644 index 0000000..3d068dd --- /dev/null +++ b/viewer/js/planet.js @@ -0,0 +1,10 @@ +// planet.js — the world being shown, from /api/meta before the app loads +export const PLANET = { name: 'World', radius_km: 6371, tilt_deg: 23.44, year_days: 365, day_hours: 24, sun_lock: null, moment_s: null }; + +export async function loadPlanet() { + try { + const m = await (await fetch('api/meta')).json(); + Object.assign(PLANET, m.planet || {}, { name: m.name || PLANET.name, moment_s: m.units?.moment_s ?? null }); + } catch { } + document.title = `${PLANET.name} — World Maps`; +} |
