A cinematic 3D chess game built with Three.js, played against an offline AI opponent. The entire application is a static site: no server-side code, no API calls, no network requests at runtime, and no external assets. Everything — textures, geometry, sound effects and the chess engine itself — is generated or computed in the browser.
Play it now: https://shawt.im/chess3d/
Because ES modules are blocked over file://, serve the directory over HTTP:
npm run serve # http://localhost:4173Any static host works. To deploy, publish the repository root as-is (see Deployment).
Gameplay
- Single-player against a built-in AI opponent, with six difficulty tiers from Beginner (~500) to Maximum (~1700), labelled by estimated strength rather than by chess titles it does not play at.
- Play as White or Black; the AI opens when you take Black.
- Full rules: castling, en passant, promotion (including underpromotion, chosen from a four-piece picker rather than assumed to be a queen), check, checkmate, stalemate, the fifty-move rule, threefold repetition and insufficient material.
- The engine opens from a small built-in book of main lines, so the first moves arrive instantly and vary from game to game (1.e4 or 1.d4, and a different defence each time); past eight plies it searches on its own.
- Undo (takes back both your move and the AI's reply, and cancels a search that is still running), a Hint button that asks the worker for a strong move, and a move list in standard algebraic notation with captured-piece trays. Clicking a move shows the board as it stood after that move, with a visible way back.
- Starting a new game, or switching sides, asks for confirmation while a live position is on the board.
- Promotion, hint and undo are all reachable from the keyboard, and the promotion dialog is a real modal with focus handling.
- Share a game as a link. The whole game rides in the URL fragment
(
https://shawt.im/chess3d/#moves=e2e4,e7e5,g1f3), which browsers never send to the server, so a link needs no backend and no database: whoever opens it watches the moves replay through the rules engine and gets the position. The same game can be copied as PGN for any other chess program.
Presentation
- Procedurally generated Staunton pieces: the pawn, rook, bishop, queen and king are lathed from hand-tuned profiles; the knight's head is lofted along a curved spine.
- The profiles are treated as cut work, not as a smooth surface of revolution:
every corner sharper than 31° is creased, so a bead's highlight stops at its
arris instead of being averaged away, and each piece carries a sub-millimetre
ovality so no section is a perfect circle. Both are asserted in
tests/geometry.test.mjs, which also checks that the creasing stays at the corners (the rook's straight body reports none). - Turned detail rather than stacked cones: every foot is a flat underside, fillet, plinth band, parting groove, cove and a pair of beads; the pawn, bishop, queen and king share a collar cut as neck groove, fillet, main bead, groove, second bead and waist. The rook's crown is a moulded band, six tapered merlons standing on a bead ring, and a recessed well behind them; the queen's coronet alternates spikes with set pearls; the king's orb carries a ferrule at the dome and a socket where the cross leaves it.
- Procedural wood and marble textures with derived roughness and normal maps. Each board square samples a different part of the tiling grain (and half are rotated a quarter turn), so the 32 light squares are no longer identical. A hairline seam over a dark substrate separates the squares, so the top reads as veneer rather than a printed surface.
- A hand-built studio environment: a dark room with a warm key softbox, a cool fill panel, a narrow rim strip and a low bounce, captured to a PMREM. This is what gives marble a long highlight down one flank instead of chalky white.
- A gradient backdrop sphere, atmospheric dust in the key light, soft contact shadows under every piece, and a beveled frame with a brass inlay line and a felt pad. A soft warm pool of practical light on the table grounds the set.
- Physically based materials with clearcoat, sheen and anisotropic brushed metal, soft shadows, ACES tone mapping, bloom on the glints, a vignette, SMAA, and a final grade pass with film grain and a touch of lens aberration.
- Animated moves: pieces slide with a slight arc, knights leap and roll, the picked piece lifts off the board, captured pieces dissolve into dust, promotions pop, and a landed piece compresses a hair before it springs back. Knights kick up a little dust on landing; reduced-motion users keep the slide and lose the decoration.
- Synthesised sound effects (wooden knocks, chimes, check sting) via WebAudio, played through a generated 0.45 s room so a knock reads as wood in a room rather than a dry UI click.
- A phone layout that collapses both side panels into an on-demand sheet, so the board gets the screen; framing adapts to the viewport shape and leans towards a plan view on tall screens so the board fills the space instead of floating low in it.
- Camera presets that solve their own framing against the live UI layout, centre the board in the free band, and keep the whole board visible at any size.
Offline
- The opponent is a real search engine computed in the browser, not a model called over the network. See How the AI works.
- Three.js is vendored into
vendor/threeand referenced through an import map. - The AI runs in a Web Worker so the render loop never stutters while it thinks.
- No
fetch,XMLHttpRequest, WebSocket or CDN reference exists in the game's source. The onlyfetchin the repository is the service worker asking for its own static files, which it then serves from the cache. - A service worker (
sw.js) caches the whole game on the first visit, so the page opens with the network switched off — and the manifest plus this worker are what make it installable as an app. The AI keeps playing offline, because the engine was always local; the cache only removes the last thing that still needed a network, which was fetching the code itself. - A shared link is a URL fragment, and fragments are never sent to the server. The feature adds no request, no endpoint and no storage: the moves are replayed locally, exactly like the auto-save.
| Input | Action |
|---|---|
| Click / tap a piece, then a destination | Move |
| Drag on the board | Orbit the camera |
| Scroll or pinch | Zoom |
| Click a move in the list (or focus it and press Enter) | Review the position after that move (click again, or press Esc, to return) |
| Tap Menu (phone) | Open difficulty, side, move list and captured pieces |
| Copy link / Copy PGN (left panel, or the phone sheet) | Copy a link that reopens this position, or the game as PGN |
| How it works (left panel, or the phone sheet) | Open the About panel: what the set, the engine and the offline cache are |
U |
Undo (also cancels an engine search in flight) |
H |
Hint (computed in the worker, so the board keeps rendering) |
N |
New game |
F |
Flip the camera 180 — this does not change sides or restart the game |
Q R B N |
Choose the promotion piece while the promotion dialog is open |
1 2 3 4 |
White / Black / Side / Top view |
Esc |
Close the promotion dialog, leave review, close the phone sheet, or clear the selection |
Difficulty, sound and the cinematic toggle are remembered in localStorage, so
a reload keeps the session's preferences. The game is auto-saved as well: the
move list is written after every move, undo and new game, and a reload replays it
through the rules engine. The position, the move list, the side you took and the
difficulty all come back. Only moves are stored — a stored board is never
trusted — so an entry that no longer replays is discarded instead of reaching the
screen. Everything else — the engine, the textures, the audio — is still
generated in the browser with no network access.
The address bar carries the game for the same reason: after every move it is
rewritten (with history.replaceState, so the back button still leaves the app
rather than walking through your own moves) to #moves=e2e4,e7e5,…. That makes
Copy link a copy of the current URL rather than a separate code path, and it
means a link you paste into a running game is followed — changing only the
fragment does not reload the page, so the controller watches hashchange. A link
that no longer replays is refused: the position on screen stays, and the bar is
put back.
src/
engine/ Pure chess logic, no rendering or DOM dependencies
chess.js Board, move generation, FEN, SAN, game-end detection
evaluate.js Static evaluation (material, piece-square tables, structure)
ai.js Negamax + alpha-beta, transposition table, quiescence
render/ Three.js scene construction
textures.js Procedural canvas textures, roughness and normal maps
materials.js Shared PBR material library
pieces.js Lathed and lofted Staunton piece geometry
board.js Tiles, frame, coordinate labels, interaction overlays
pieceViews.js Piece meshes and every move/capture/promotion animation
scene.js Renderer, lighting, IBL environment, post-processing
camera.js Orbit controls and the framing solver
ui/ DOM overlay (HUD, move list, captured trays, modals)
audio/ Procedural WebAudio sound effects
game/ Game controller (single owner of state) and auto-save
worker/ AI Web Worker
The dependency rule is that engine/ imports nothing outside itself. That is
what lets the AI run in a Worker (import maps do not apply inside workers, so the
worker may only use relative imports) and keeps the rules testable in plain Node.
State flows one way: the controller mutates the Chess instance, then calls into
the views and the HUD. Views are pure functions of state, which is why undo and
new-game are simply "change state, rebuild views" and can never desync.
The opponent is not a language model and not a remote service. It is a conventional chess search engine: the same approach that has beaten human world champions since 1997. Nothing about it needs a network connection, because searching a game tree is arithmetic over data already in memory. The AI is computed, not queried.
src/engine/ai.js is roughly 500 lines of plain JavaScript, in three parts.
evaluate.js scores any position in centipawns (100 = one pawn). Positive
favours White; the search negates the score as it descends.
| Term | What it captures |
|---|---|
| Material | Pawn 100, knight 320, bishop 335, rook 500, queen 950 |
| Piece-square tables | Where a piece stands — a knight in the centre is worth far more than one on the rim |
| Pawn structure | Doubled and isolated pawns |
| Bishop pair | Two bishops are worth more than the sum of their parts |
| Rooks | Bonus on open and semi-open files |
| King safety | A pawn shield in front of the king while the queens are on |
| King activity | A separate table for the endgame, where the king should march up the board |
Piece-square tables do most of the work. Instead of hand-writing dozens of rules, one table per piece type encodes the principles directly, and each is a single array lookup at evaluation time.
Negamax with alpha-beta pruning. The engine tries every move, assumes the opponent replies with their best, tries every reply, and so on. Unpruned, the branching factor is about 30, so six plies is 30^6 ~ 700 million positions — hopeless.
Alpha-beta pruning fixes that. As soon as a branch is provably worse than a choice already in hand, the whole branch is abandoned. In the best case this cuts the work to roughly the square root, so six plies costs on the order of 30^3 nodes instead of 30^6.
On top of that:
- Iterative deepening. Search one ply, then two, then three. Each pass reorders moves using the previous pass's results, which makes pruning far more effective — and it means the engine can stop at any moment and still have a complete answer, which is what makes a wall-clock time limit possible.
- Transposition table (1M entries, Zobrist-hashed). Different move orders reach the same position; the table remembers what was already computed. Entries are tagged exact, lower bound or upper bound.
- Quiescence search. At the depth limit the engine does not simply stop — it keeps searching captures only, so it never misjudges a position mid-trade.
- Check extension. Being in check extends the search, so tactical sequences are not cut off partway.
- Move ordering by transposition-table move, MVV-LVA captures, promotions, killer moves and the history heuristic. Better ordering means better pruning.
Each tier pairs a search budget with a little randomness, so the weaker bots feel like a club player who makes mistakes rather than a shallow program:
| Tier | Depth | Time | Randomness | Blunder rate | Book |
|---|---|---|---|---|---|
| Beginner (~500) | 1 | 120 ms | 90 cp | 30% | no |
| Easy (~700) | 2 | 250 ms | 55 cp | 16% | no |
| Intermediate (~950) | 3 | 600 ms | 28 cp | 7% | yes |
| Advanced (~1200) | 5 | 1200 ms | 12 cp | 2% | yes |
| Expert (~1450) | 7 | 2500 ms | 4 cp | 0% | yes |
| Maximum (~1700) | 12 | 5000 ms | 0 cp | 0% | yes |
| Randomness is a tolerance in centipawns, not score noise: every root move | |||||
| within that many centipawns of the best one is treated as equally playable, so | |||||
| the weaker tiers vary their play without ever throwing away a clearly better | |||||
| move. Blunder rate is the separate chance of a deliberate, still-legal | |||||
| mistake. Both act only on the finished search — the evaluation the engine | |||||
| reports for a position is the same at every tier. |
The ratings are estimates, and deliberately conservative ones: they follow the depth each tier actually reaches and the results of self-play between the tiers, not a measured rating list. Putting a hand-written engine on a human rating scale is guesswork, and the old labels claimed strength this one does not play at — which is why the top two are called Expert and Maximum rather than Master and Grandmaster. On a laptop the top setting reaches about depth nine inside its five seconds; on a phone it is less.
At the top tiers the engine searches roughly 90k–260k positions per second in the browser.
src/engine/book.js holds a few dozen main lines — the open games, the
Sicilian, the French, the Caro-Kann, the Queen's Gambit, the Indian defences and
the flank openings — written as move sequences from the starting position, about
1.2 KB of text in total. Each line contributes every prefix along it to an index,
so a reply's weight is simply the number of lines that play it: 1.e4 is offered
more often than 1.Nf3 because more lines start that way, which is also how a
human opens.
It is a candidate list, not a script. Whatever the book suggests is looked up in the legal moves of the position that is actually on the board, so a stale entry, a hand-edited line or a caller that passes the wrong move list cannot put an illegal move on the board — the search takes over instead. Past eight plies the book says nothing and the engine is on its own.
The two weakest tiers do not use it at all: a book line is better than anything one-ply search can find, and a beginner that opens like a strong player feels scripted rather than weak. A book answer is also labelled as one in the engine readout, instead of reporting a depth of 0 and no nodes and looking broken.
One architectural decision makes it work: src/engine/ imports nothing
outside itself. It never touches Three.js, the DOM or window. It is pure
logic over a 64-entry array.
That unlocks two things.
It can run in a Web Worker. A deep search takes real time, and running it on
the main thread would freeze the render loop. The engine therefore lives in
src/worker/aiWorker.js. Note the trap here: import maps do not apply inside a
worker, so the worker may only use relative imports — the bare specifier
three that the page's import map resolves would fail there. Because the engine
has no Three.js dependency at all, this is not a problem.
It can be tested in plain Node. tests/ai.test.mjs runs without a browser,
which is how the engine's tactics and strength are verified (see
Testing).
So "offline" is not a degraded mode. Nothing is cached, stubbed or faked: the engine plays exactly the same game with the network cable unplugged, because the CPU was always the only thing it needed.
npm testFourteen suites run in plain Node:
tests/perft.test.mjs— perft node counts against the published values for six standard positions (including Kiwipete and the en-passant/promotion stress positions) to depth 4-5, plus targeted rule tests for en passant, castling, pins, promotion, hash correctness and game-end detection. A 160-ply random game also checks that make/undo restores the position exactly and that the board stays legal (one king a side, no pawn on a back rank, no side left in check by its own move).tests/ai.test.mjs— the engine must find forced mates and knight forks, must not hang material, must respect its time budget, must return legal moves in every test position, and must beat a random mover from the stronger tiers.tests/geometry.test.mjs— the generated pieces must be closed solids wound outward, reach their declared heights, overlap their pedestals, taper in three dimensions, and shade smoothly rather than faceted. Once the profiles became cut work it also pins the surface finish: every piece must keep at least 128 coincident-but-disagreeing vertices (the arrises), the sharpest must exceed 45 degrees, the rook's straight body must report none of them, the hand-worked warp must stay between 0.2% and 3% of the radius, and a piece must come out identical whether it is the first or the fifth built. These assertions caught three real bugs after visual review had already passed the same builds: an inward-wound knight head that back-face culling hid entirely, a non-indexed merge that flattened its shading, and ears seated inside the skull.tests/capture.test.mjs— the view layer, run headlessly against a stubbed canvas: a capture must remove the captured piece, not the capturing one.tests/board.test.mjs— the board's square colours, asserted against the rules of chess rather than against the implementation: a1 dark, h1 light, the queen on her own colour. This caught a real bug that had inverted every square for most of the project's life and survived repeated visual review, because nothing checked it and a rendered board looks plausible either way.tests/ux.test.mjs— the stateful controls: a promotion offers four pieces and applies the one chosen (not always a queen), flipping the camera leaves the FEN and move list untouched, undo cancels a pending engine search and its late reply cannot be played, and clicking a move enters and leaves review without changing the live game. It also drives every legal move in a position through the two clicks a player makes — promotion captures, castling and the opening — and fails if any of them produces no move or the wrong one.tests/input.test.mjs— what counts as a tap: a press held while the player decides is still a tap, a drag (including a circular one that ends where it began) is not, a second finger cancels, and a missedpointerupcannot swallow the next click.tests/autosave.test.mjs— a game survives a reload: the entry round-trips, wrong versions and corrupt JSON are ignored, a game in progress comes back with its position, move list, side, difficulty and whose turn it is, a finished game comes back finished, a move that no longer replays is discarded rather than shown, and undo and new game rewrite the save.tests/share.test.mjs— the link and the PGN: a fragment round-trips, every malformed or hostile one is rejected, an illegal move list is refused by the replay rather than trusted, a link beats the auto-save, a pasted link is followed while an unusable one leaves the game alone, the URL tracks moves, undo and a new game, and the exported PGN keeps its headers, its result tag, its escaping and its 80-column wrapping.tests/offline.test.mjs— the offline cache, on both sides. The precache list must match the files that ship: nothing listed that does not exist, nothing needed at runtime left out, and the worker is registered from the app root after the first frame. Then the handlers themselves run: sw.js is loaded into Node with stand-ins forself,cachesandfetch, and prompted with the requests a browser sends. Install fetches every listed file and survives a 404; activate drops older cache versions; a navigation is fresh online and cached offline; a cached asset answers without waiting for the network; and a cold offline visit gets a readable page rather than a browser error.tests/book.test.mjs— the opening book is data the engine trusts, so it is checked as data: every line must replay as a legal game, every reply the index offers must be legal in the position it is offered for (this caught a line with an illegal fourth move while it was being written), the whole thing must stay under 5KB, and the replies must vary between games. It also pins the behaviour: a book-enabled tier answers with no search at all, the two weakest tiers never use it, and a move list that does not match the position produces a legal move from the search rather than an illegal one from the book.tests/mobile.test.mjs— the pointer-events specificity trap: every rule that re-enables input under#uimust outrank the blanket#ui > *click-through rule, and a closed sheet must stay off-screen.tests/seo.test.mjs— the social and search metadata: absolute og:image URLs, a canonical matching the deployed host and subpath, structured data that parses, every referenced icon present on disk, and the static text itself — the About article and the no-JavaScript summary must be present, verbatim, and long enough to index, because the game renders nothing a crawler can read.tests/loader.test.mjs— the loading screen. Every boot stage must report a real fraction (the bar used to be an indeterminate sweep), the fraction must never go backwards, and the yield between stages must still resolve when no frame is ever painted — a page opened in a background tab fires norequestAnimationFrame, so the fallback timer is what stops the boot hanging forever. The test lifts the realsetLoadingout ofmain.jsand runs it against fake elements and schedulers, because asserting the shape of that code would pass even if it deadlocked.
tools/ carries a few small probes, handy when changing a piece:
| Tool | What it reports |
|---|---|
check-imports.mjs |
asserts every import under src/ resolves |
knight_render.mjs |
the knight mesh as an ASCII side elevation |
shading_audit.mjs |
normal deviation per piece (0 deg = flat-shaded, >1 deg = smooth) |
mesh_audit.mjs |
signed volume and edge topology per piece (winding, watertightness) |
tools/dev/mobile-harness.html runs the app inside an iframe at real device
sizes, one at a time (?only=ip14), and reports the projected board rect, the
panel rects, and the on-screen size of one board square. It exists because the
mobile layout cannot be judged by eye — the failures it found were numbers:
the board overflowing by 29px, panels overlapping it, and a square 21.9px across.
npm run serve # then open /tools/dev/mobile-harness.html?only=ip14Measured square sizes, all five viewports with zero overflow and no panel overlap:
| Device | Square |
|---|---|
| iPhone SE 375x667 | 36.2px |
| iPhone 14 390x844 | 39.4px |
| Pixel 7 412x915 | 42.7px |
| iPad mini 744x1133 | 74.4px |
| iPhone landscape 844x390 | 26.6px (81.8px after pinch) |
Landscape stays smaller because the space between the bars is only 276px of a 390px screen — that is geometry, not a defect. Pinch-zoom is the answer there, and the camera also tilts towards top-down on short wide viewports so the squares project as large as the band allows.
tools/dev/ux-audit.html?w=390&h=844 loads the real app in an iframe of exactly
that size and answers the questions a screenshot cannot:
- does
.bottombaroverflow horizontally (scrollWidth <= clientWidth + 1)? - can every named control be reached without scrolling (Sound, Cinematic and the four view presets, opening the phone sheet first)?
- do toast, thinking, selection and review overlays intersect?
- is the board centred in the free band, and does it fill at least one axis?
Run it at 390x844, 612x893, 768x1024 and 1280x800. The measured values used to verify this build were: 1.07%, 1.01%, 0.88% and 0.44% vertical centre error, with 100.8%, 95.7%, 95.8% and 80.3% fill on the binding axis, no horizontal bar overflow and no overlay intersections at any size.
npm run serve # then open /tools/dev/ux-audit.html?w=390&h=844The app is static files, so any static host works: GitHub Pages, Netlify, Cloudflare Pages, S3, nginx. There is no build step.
Live: https://shawt.im/chess3d/
Everything except the development-only paths:
| Path | Why it ships |
|---|---|
index.html |
the page, including all SEO and social metadata |
styles.css |
the UI styling |
src/ |
the engine, renderer, HUD and AI worker |
vendor/ |
Three.js, vendored so nothing loads from a CDN |
docs/ |
the social card, app icons and README screenshot |
robots.txt |
crawler policy and sitemap pointer |
sitemap.xml |
the single URL, for search engines |
site.webmanifest |
app name, icons and theme colour for install |
sw.js |
the offline cache and the installable-app requirement; must sit next to index.html |
.nojekyll |
required on GitHub Pages — without it Jekyll processing can drop files |
Development-only, safe to exclude: node_modules/, tests/, tools/,
package.json, package-lock.json.
Three things must be true of the host, and all three are worth checking because they fail in ways that are easy to miss:
.jsmust be served with a JavaScript MIME type. The page uses a module worker, and a wrong content type stops the AI worker loading. Every common static host does this correctly.- The site may live under a subpath. All asset paths are relative and the
import map points at
./vendor/..., so the app works at/chess3d/as well as at a domain root. The absolute URLs inindex.html(canonical,og:image, sitemap) are the one place a subpath is hard-coded — update those four values if you host it somewhere else. sw.jsmust be served from the app root, and must not be pinned by the HTTP cache. A service worker's scope is its own directory, which is why the file sits next toindex.htmlrather than insrc/. The browser also revalidates it on navigation, but aCache-Controllonger than a day delays updates past that check; GitHub Pages sends ten minutes, which is fine. If a cached path is ever renamed, bumpCACHE_VERSIONinsw.js— a stale entry under the old name would otherwise be kept for good.
Publish the repository root from the main branch. .nojekyll is already
committed. If you use a custom domain, set it in the repository's Pages settings
and add a CNAME file containing the domain.
The page is a canvas and a HUD that JavaScript builds, so a crawler that runs no
scripts used to find one sentence in the body: thin content, and part of the
reason a site: query returned nothing. The About article is therefore real
markup in index.html, inside a native <dialog> that stays closed until a
player opens it — about 650 words on the set, the engine, the rules, the offline
cache and the controls — and the <noscript> block repeats a short summary for
readers and crawlers with no scripting at all. tests/seo.test.mjs fails if
either text disappears or drops below the length that makes it worth indexing.
Indexing itself is still a manual step: verify the property in Google Search
Console and submit sitemap.xml once. No amount of on-page work substitutes for
that, or for links from somewhere else on the web.
docs/promo.md holds drafted posts for the places worth telling: a Show HN title
and first comment, per-subreddit variants (including one subreddit explicitly not
to post in), the Three.js forum showcase post, itch.io metadata, the shot list for
a short clip, and the order to do them in. It also fixes the rule the copy
follows: lead with the zero-asset, no-build-step claim, because that is the
unusual and true part — and never with a strength the engine does not play at.
docs/og-image.png (1200x630) is referenced by absolute URL, and og:image
points at it. Platforms cache a preview against the exact URL, so the card URLs
in index.html carry a ?v= version: bumping it is what makes a regenerated
card appear without signing in anywhere. That matters because neither platform
can be scripted — the Facebook Graph scrape endpoint replies (#100) Must have a valid access token, and cards-dev.twitter.com/validator now redirects to a
login. npm test includes tests/seo.test.mjs, which fails if the image goes
missing, if the URLs drift from the deployed origin, or if og:image,
og:image:secure_url and twitter:image stop pointing at the same card.
Capture the app, compose the card, then bump the version.
# 1. capture the live app (needs a headless Chrome exposing CDP)
npm run serve
"/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" \
--headless=new --remote-debugging-port=9222 \
--user-data-dir=/tmp/chess3d-cdp --window-size=1280,720 about:blank &
node tools/shot.mjs --out docs/screenshot.png
# 2. compose the social card from that capture (needs Pillow)
cp docs/screenshot.png /tmp/hero-render.png
python3 tools/make-social-images.pytools/shot.mjs waits for the controller to reach a playable phase, checks the
canvas is the requested size, and waits for the camera to stop moving before it
captures. It refuses to write a frame from a page that never rendered, and it
exits non-zero if the console logged an error or a warning — a screenshot of a
broken page still looks plausible.
Finally bump the version on the three card URLs in index.html (?v=3 today),
so the platforms fetch the new card. Bump it in the same commit as the new
image and do not request the new URL before that commit is deployed: the CDN
caches the bytes it finds under the new key, and a check run early leaves the
old card sitting there until the TTL expires.
Needs WebGL2 and ES module workers: current Chrome, Edge, Firefox and Safari.
Three.js is bundled under the MIT licence; see vendor/three/LICENSE.
