For fun
Planet
A living window onto Earth: the real day/night terminator, city lights coming on across the night side, and the cities watching the sun rise and set at this exact moment. When Osaka is losing the light, San Francisco is just catching it.
- 147 cities classified against the live sun
- 6° horizon band that counts as dawn or dusk
- ±12 h timeline scrub, then snap back to LIVE
- 0 network requests after first load
The idea
Born on the road, from a traveler's question: the sun is setting here — where is it rising?
Planet started during travels. Checking sunrise and sunset times in one more time zone, the question flipped outward: never mind here — where on Earth is the sun coming up right now? Nothing answered that at a glance, so we built the glance.
A photoreal globe renders the terminator — the moving line between day and night — exactly where it is at this moment, with NASA’s night-lights imagery glowing on the dark side. Beside it, the cities meeting the sun: who is getting first light, who is watching it go. Drag the timeline and the terminator sweeps up to twelve hours either way; release it and the planet snaps back to LIVE.
How it works
There is no backend. The sun's position is computed, not fetched.
Any moment in time can be turned into the spot on Earth where the sun is directly overhead — astronomers call it the subsolar point — using a compact astronomy formula (a solar ephemeris plus the Earth’s rotation angle). No lookup, no service: it is pure math. One clock owns the app’s idea of “now”; the time scrubber never touches anything else, it just shifts that clock.
That one moment feeds two consumers. On the globe, the graphics card compares every pixel with the sun’s direction, so the day/night line stays razor-sharp at any zoom and animates for free — there are no baked day-and-night images to crossfade. In parallel, the same moment is checked against a bundled list of 147 cities: any city where the sun sits within six degrees of the horizon is at dawn or dusk, ranked by population — and when the line crosses open water, the nearest city is shown with minutes to the event.
Decisions worth noting
- Shader, not textures. Day/night shading is computed per pixel from the sun vector instead of blending pre-baked frames — the terminator stays sharp at any zoom, and animating it costs nothing.
- Validated, not eyeballed. The solar math is unit-tested against an independent reference implementation (suncalc3, a dev dependency only) — the approximation is checked, not assumed.
- Offline by design. The app installs as a PWA with textures and shell precached; after the first visit it runs with the network off.
- Nothing to operate. React and three.js ship as static assets from a Cloudflare Worker — no server code, no API to monitor, nothing to wake up for.
Built with
- Three.js
- React
- TypeScript
- PWA