In script and slip the bright web babbles, JavaScript, root and rot of all our little evils, and had we clipped that vine in the dawn of wires, we'd dine tomorrow already, silver-souled, in the future tense.
A small static site with a Scala-doc-inspired layout and an animated Lorenz attractor, configured for Cloudflare Workers.
public/index.html— page structure and stylingpublic/lorenz.js— Lorenz system simulation and canvas renderingworker.js— minimal Cloudflare Worker that serves static assetswrangler.toml— Cloudflare Workers configurationpackage.json— local scripts for dev, config checking, and deployment
Run commands from the project root (web/).
python3 -m http.server 8000 --directory publicThen open http://localhost:8000.
npm install
npm run devWrangler will print a local preview URL, typically http://127.0.0.1:8787.
Before deploying, make sure public/ is committed to git. Cloudflare's remote build only sees files present in the repository snapshot it checks out.
- Authenticate Wrangler if needed:
npx wrangler login- Optionally validate the config and bundle before deployment:
npm run check- Deploy:
npm run deployIf you are deploying from a Git-connected Cloudflare project, also make sure the project root is the repository root that contains wrangler.toml, worker.js, and public/.
- The Worker serves everything from the
public/directory via theASSETSbinding. - The canvas is responsive and supports high-DPI displays.
- If the device requests reduced motion, the page renders a still frame instead of a continuous animation.
- Styling is embedded in
public/index.htmlto keep the site portable and simple. - The project is pinned to
wrangler3.x so it can be validated locally on Node 18 in this workspace. npm run verify:cloudflarechecks that the required deploy files exist before a dry run or real deploy.