whiskers.git / web / worker

worker

The Cloudflare Worker, whiskers-web. It serves one page and the few things the page asks for, keeps nothing and asks nobody anything.

RouteWhat
GET /The page. ?mascot=ginger|grey|bunny pre-selects who is on stage; a value that is not a mascot is Ginger.
GET /cat.css, /favicon.svg, /robots.txtIts files. The stylesheet is the cat's keyframes, named by content and cached for good.
GET /ui.css, /ui.js, /datastar.js, /fonts/*The shared look's files, from jev-ui's embedded bytes (jev_ui::asset); a request carrying the right ?v= is cached for good.
POST /mood, /mascot, /tick, /tourThe demo: Datastar posts the page's signals; the answer is the cat, its caption, the stages it is busy with, the mood pills (the one the tour is on carries an hourglass and a countdown bar) and the tour button, as HTML to morph in, and new signals. On load the page posts /tour once (unless the visitor asked for less motion) so the server starts the tour.
/preview/card.pngA static asset built by ../tools/preview, served by Cloudflare before this code runs.
/preview/loop.mp4The link preview's video, built the same way but run through the Worker first (run_worker_first) so it answers byte ranges (Accept-Ranges, 206, 416), which Discord, Twitter and iOS rely on and static assets do not give. It is read through the ASSETS binding and sliced in src/media.rs; which bytes is site::range.

Every response carries a strict Content-Security-Policy (nothing from elsewhere), and HTML says no-transform so Cloudflare does not add its analytics script. Invocation logs are off.

Run it as described in ../README.md. wrangler.toml holds the route whiskers.lmjtfy.fun as a Workers custom domain (workers.dev stays on too); it is inert until someone deploys.

PathWhat
src/The code.
wrangler.tomlThe Worker's configuration, route and asset directory.
public/preview/Generated, gitignored: the preview files.