Technical
The system behind the magic.
Generation was the easy half. The engineering problem was keeping a cinematic, pointer-driven experience coherent: one source of truth for where the visitor is, guarded transitions, and media that arrives before it is needed.
Experience state machine · 23 states
- Arrival
bootingdarknessguide-idleguide-following
- Living book
book-sleepingbook-awarebook-awakeningbook-readybook-openingworlds-emerging
- Atlas
atlas-idleatlas-navigatingworld-focused
- Flight
flight-preparingflight-launchingportal-crossingcivilization-arriving
- World
chapter-playingchapter-pausedchronicle-open
- Return
return-preparingreturningbook-restoring
Transitions are an explicit adjacency table. The return journey closes the loop on the atlas, not the intro, with the same civilization focused. Route changes (refresh, hash, Escape) restore state from the URL.
Multi-state interaction architecture
One guarded state machine with 23 named states and an explicit transition table. Illegal transitions return false, which is how double clicks, duplicate animations and two guides on screen are prevented.
Pointer interaction engine
A single window-level pointer listener and one animation-frame loop publish a smoothed frame (position, velocity, direction, proximity to book and guide, idle time, touch flag) to subscribers that write straight to the DOM. No React state per mouse move.
Posed, reactive guide
Five audited pose plates (neutral, look left, look right, watch the book, inviting) chosen from pointer direction and proximity, crossfaded over 320 ms between two anchor-locked layers so a pose change can never flash.
Living-book system
Three pointer-proximity thresholds with hysteresis drive a nine-state book reducer: idle, noticing, awakening, ready, opening. A click made while media is still loading is queued and honoured the instant the book is ready.
Portal selection with intent
Focus and selection are separate acts. Focusing a portal only updates the route; selecting it must pass the state guard, so a world can never be entered mid-animation or by accident.
Civilization flight sequences
Framer Motion choreography driven from the portal’s measured screen rectangle, tinted per civilization, with a guide hand-off video. The route swap fires only once the screen is fully covered.
Environmental discoveries
Each of the ten worlds carries three authored hotspots. Discoveries reveal in four ways: always, pointer-near, chapter-time or guide-discovery, and tap is distinguished from drag so looking around never opens one.
Chronicle and progression
Chronicle text opens from a delayed glyph inside discovery chapters and owns the Escape key while visible. The story is the second reward, after the environment.
Animated return journey
The visible world compresses into a shrinking portal while a small book rises to receive it; the constellation is restored beneath with the same civilization focused.
Responsive and accessible input
Live listeners for prefers-reduced-motion and coarse pointers set a three-level particle budget (full, reduced, off). Tab visibility pauses animation. Reduced motion softens transitions but never diverts a visitor to a static fallback.
Asset and video orchestration
A single asset manifest is the only module allowed to import media. Pose plates are pre-warmed, the book video is preloaded as a metadata hint only, and scene videos are torn down explicitly (pause, drop source, reload) when travelling.
Depth-aware, 360-like scenes
Generated clips play on a three.js plane displaced by a per-frame depth texture, so the camera can drift and dolly with real parallax. A four-tier ladder (depth-aware, layered multiplane, flat pan-zoom, poster) demotes automatically when frame rate drops. Never genuine 360 degrees, and the code says so.