Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
A tiny oracle that hands you a cosmic fortune from the void. Tap the orb (or
press Space) and the cosmos answers — over an animated, twinkling
starfield rendered on a <canvas>.
Built on Val Town from the basic-html-starter, then taken somewhere stranger.
- Site: open the val's HTTP endpoint (
main.tsx) in a browser. - API:
GET /api/fortune→{ "fortune": "...", "total": 20 } - Source:
GET /source→ redirects here.
Rendering mermaid diagram...
| File | Role |
|---|---|
main.tsx | HTTP entrypoint. Routes /source and /api/fortune, serves everything else statically. |
fortunes.ts | The shared fortune deck used by the JSON API. |
index.html | Page markup — card, orb button, fortune slot, starfield canvas. |
style.css | Cosmic theme: gradients, glassmorphism card, pulsing orb. |
script.js | Client logic: picks a fortune (no immediate repeats) + animates the starfield. |
favicon.svg | Gradient star on a deep-space backdrop. |
- Add lines to both
fortunes.ts(API) and theFORTUNESarray inscript.js(page) to keep them in sync. - Tweak the palette via the CSS custom properties at the top of
style.css.
Inspired originally by https://glitch.new/blank — now thoroughly cosmic.