diff options
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`; +} |
