fuzzyworld

tower / files / src / main.ts

main.ts

Blame: the commit that last changed each line · file · history

09a64747 2026-09-07 Pavel Safronov1import './style.css'
2import { App } from './ui/app.js'
9d5a061c 2026-09-27 Pavel Safronov3import { type World, emptyWorld, parseWorld } from './world/schema.js'
09a64747 2026-09-07 Pavel Safronov4
cf37225c 2026-09-07 Pavel Safronov5/**
6 * The slat count stays at its canon value of 0. The runtime control is disabled and
7 * its UI removed — see decisions.md D-033. Restoring a stored non-zero count here
8 * would silently reintroduce the bug for anyone who had already moved the slider.
9 */
9d5a061c 2026-09-27 Pavel Safronov10
11/**
12 * The world as readers get it, made from `content/world.json` at build time (D-072).
13 * The app only reads it: the world is changed in the repository, not in the browser.
14 */
15async function loadWorld(url: string): Promise<World> {
16 try {
17 const res = await fetch(url)
18 if (res.ok) return parseWorld(await res.json())
19 } catch {
20 // Unreachable or unreadable: an empty world still shows the cylinder.
21 }
22 return emptyWorld()
23}
24
25new App(await loadWorld(`${import.meta.env.BASE_URL}world.json`))