The shortest war
History on a map that draws itself, with voice
- 0–2.6 s The pocket watch close to the lens, “This war lasted ~40 min”, then the camera falls from the watch onto the map of East Africa
- 2.6–5.6 s The watch rewinds to 8:59:55, a flight onto Zanzibar Town harbour, the seconds tick, “9:00” hits in red
- 5.6–9.3 s Five ships are engraved, three volleys with tracers and smoke, the palaces break apart in a hatched dust cloud
- 9.3–11.6 s A fast zoom onto the mast, the red flag is hauled down, “~40 min” slams in big
- 11.6–13.8 s A dashed ink arrow runs into the cartouche “German consulate”, location not documented on this map
- 13.8–16 s The flight back out to East Africa, the watch grows towards the lens again, the last frame is the first
- Voice-over
- 16 s · with sound
- 1080 × 1920 · 30 fps
- Canvas 2D
- 6 MB
Prompt
Build a 16-second vertical (1080×1920, 30 fps) motion graphic that retells "Zanzibar 1896 – the shortest war" as an engraved map that draws itself on old paper. Inputs: one Higgsfield plate (paper.webp: an empty sheet of old paper with browned edges, 1152×2048) and five voice lines per language from ElevenLabs (voice "Alexander", tempo 1.3) with word timestamps. Bilingual via ?lang=de|en; every on-screen word exists in both languages. The last frame equals the first (poster with hook).
VOICE (line starts 0.25 / 2.75 / 5.75 / 9.55 / 11.45 s; events land on word timestamps)
1 "This war lasted about forty minutes." 2 "Nine o'clock. The ultimatum runs out." 3 "Five British warships open fire. The palaces on the harbour collapse." 4 "The red flag comes down." 5 "And the loser flees to the German consulate."
FACTS (only these may appear): about 40 minutes (37–45 depending on source, never "38"), ultimatum at 9:00, five British warships in the harbour, harbour palaces destroyed, the plain red flag was hauled down (not shot down), the loser took refuge in the German consulate. No portraits, no invented positions: ship and palace positions follow a contemporary sketch and are labelled "positions approximate"; the consulate gets no map point, only a cartouche "location not documented on this map".
DESIGN
Paper plate warmed by multiply towards old paper; palette ink #14181F, red #A3241C for everything that is the war (tracers, flag, elapsed sector, ~40), copper only as a hint. Coastlines are measured: traced from aerial tiles (EOX Sentinel-2 cloudless 2016, Commission for Lands Zanzibar / OpenAerialMap) by a blue-minus-red water mask, flood fill from the open sea, marching squares, Douglas–Peucker — four levels of detail (region, island, peninsula, harbour front) that cross-fade by zoom. Land is a warm tone with 45° engraving hatch; water carries six concentric ink water lines off every coast (19th-century chart style). Neat line with double rule, a real graticule (degrees and minutes chosen from the zoom, labelled on the edge), a scale bar computed from the projection, north arrow, source line. Type: Instrument Serif for map labels and the cartouche, Archivo 900 at 112 % width for "~40 min", Geist Mono for chips, coordinates and notes. A pocket watch in line engraving (bow, crown, Roman numerals with IIII, Breguet hands, seconds sub-dial at six, red-hatched elapsed sector) carries the number. Ships are side-view engraved silhouettes (two funnels, two masts, hatched hull, water lines), the palaces abstract plan blocks with courtyard lines. One light from the top left: soft offset shadows only.
STORYBOARD
0 cover = poster: chips 1896 · ZANZIBAR, "This war lasted" + "~40 min" huge with a red ink rule, the watch close to the lens (r 365) at 9:40 over the map of the East African coast; 0.15 big tick of the seconds hand · 0.3–0.85 the camera falls from the watch onto the map: the watch shrinks beside Zanzibar, the map zooms 2.9° → 1.9° with motion blur, jolt on landing; labels EAST AFRICA · ZANZIBAR · Indian Ocean; the rule swells on "forty" · 2.6–4.6 cover leaves, the watch springs to the top right and rewinds to 8:59:55 on "Nine", the camera zooms from 1.9° to 0.009° of width about a fixed point onto Zanzibar Town harbour; each finer coastline draws itself as its level fades in · 3.0–4.8 five seconds tick to 9:00:00 exactly on "out", "9:00" punches in red · 5.75 five ships engraved one by one from stern to bow · on "fire", "palaces" and "collapse" three volleys: jagged ink muzzle blots with a red core (three frames), thin red tracers, impact rings, ink-hatched smoke puffs rolling off the guns and drifting across the map, a one-sided camera jolt plus zoom push on each · on "collapse" the palace plans split into convex shards (recursive cuts), turn cross-hatched, debris, a hatched dust cloud and an engraved burst · the minute hand runs from 0 to 40 · 9.25–9.85 fast zoom (motion blur) onto the mast, the red flag big (wave, engraved fold shading) is hauled down slowly, then drops the last stretch on "down", jolt, "~40 min" slams in at 200 px and later flies beside the watch · 11.55–12.05 fast pull-back · 12.0 dashed ink arrow from the ruins into the cartouche, name writes itself on "German" · 13.85–15.4 zoom back out, 15.1–16 the watch grows back to the lens and the cover returns, identical to frame 0 at 16 s.
SUBTITLES
Word by word on the timestamps (lines 2–5; line 1 is the hook), 2–4 words per group, Archivo 800, white with a dark outline, active word pops, key words (Nine o'clock, ultimatum, Five, fire, collapse, red flag, German consulate) in war red #A3241C, baseline y 1468. On-map headings that the subtitle now carries are gone; only "positions approximate" stays.
MOTION
Camera keys with log-space zoom about the fixed point, quartic in-out; critically damped springs and exponential settles, no overshoot except the physical push on impacts. Sub-frame motion blur (10 samples across a half-frame shutter) on the fall from the watch, both flights, the zoom onto the flag and the pull-back; map labels fade while the camera rushes. Camera jolts are one-sided knocks (no wobble). Coastlines reveal with a dash offset along each traced polyline.
AUDIO
Voice per line at the starts above, SFX on the events: paper rustle at 0, a big tick at 0.15, whoosh-low + thump for the fall from the watch, soft ticks on the cover, whoosh-low and quill scratch for the flight, swish for the rewind, ticks to nine and a thump + stamp on "out", wooden clicks for the ships, three volleys of layered thumps with a low whoosh as the boom tail, stone grind + dry crackle on the collapse, whooshes on the zoom to the flag and the pull-back, flag flaps, thump + stamp when the flag lands and "~40 min" slams in, swish + quill for the arrow, paper for the cartouche and the cover. Music bed under the voice (−21 dB, ducked), loudness −16 LUFS.
TECHNIQUE
Canvas 2D, vanilla JS, window.MOTION = { duration: 16, fps: 30, width: 1080, height: 1920, seek(t), audio }; seek(t) redraws everything as a pure function of t (seeded PRNG only). Web Mercator in degrees with a local origin so float32 paths stay precise at 1 m per pixel. Water lines: stroke the coast at width 2d, erase at 2d − 0.9 (largest first), then erase the land. No inline script (CSP); fonts from ../fonts/.
TECHNIQUE
- One self-contained HTML page plus one JS file (no inline script, no libraries, no network requests). Stage exactly 1080×1080 CSS px, or the size named above (1080×1920 for portrait).
- Expose window.MOTION = { duration, fps: 30, width, height, seek(t) } with the stage size in width and height. seek(t) redraws the frame for time t from scratch: no state between frames, no Math.random (seeded PRNG only), no Date, no CSS transitions, no timers.
- Loop: seek(0) and seek(duration) must look identical.
- With ?render=1 the stage sits unscaled at the top left (for frame capture). Without it, scale the stage to fit the window and loop with requestAnimationFrame.
- prefers-reduced-motion: show one representative still, no loop.
CHECK
Render stills at the listed times, look at every one, fix anything that overlaps, is cut off, aliased or unreadable, then render again. Report only when frame 0 equals the last frame.
Stills: every 0.5 s from 0 to 16, plus every 0.1 s across 0–1.0, 2.4–4.8, 8.0–9.9, 11.2–12.2 and 13.6–16 — in both languages. How to recreate it
-
Give the prompt to a coding agent
Create an empty folder and paste the prompt into Claude Code, Codex or Cursor. The agent writes one HTML page and one script — the animation then runs right in the browser.
-
Let it check the stills
The prompt makes the agent render stills and look at them itself. Only refine what you don't like in the picture: “scene 3 is too busy” works better than a new prompt.
-
Render to MP4
Because every animation can draw any frame exactly through
window.MOTION.seek(t), a small script renders it frame by frame — no stutter, no screen recording. Then ffmpeg joins the frames into a clip.
# 1 · Render every frame (Chrome, Node ≥ 22) node render.mjs http://localhost:3000/ \ frames/ frames 30 # 2 · Join the frames into an MP4 ffmpeg -framerate 30 -i frames/%05d.png \ -c:v libx264 -preset slow -crf 22 \ -pix_fmt yuv420p -movflags +faststart \ my-motion.mp4
Background
Zanzibar 1896 as an engraved map that draws itself on old paper: the ultimatum runs out at 9:00, five British warships open fire, the harbour palaces collapse, and when the red flag is down the pocket watch shows about 40 minutes. 16 seconds, 9:16, with voice and sound, built as code — with a prompt to recreate it.
What I learned building it
A map only reads as precise when the coast is measured — every coastline came out of existing aerial tiles at four scales, and whatever is not documented (ship positions, the consulate) is marked on screen as approximate or not located.
How it was made
Photoreal image plates from Higgsfield, the animation as code, voice and sound from ElevenLabs. Below is exactly what was used: the same prompts, the same voice, the same sounds.
- 01
Higgsfield Soul 2 Image plates
Backgrounds only, no text: anything that has to be read is drawn on top by the code, pin-sharp. Whatever wasn't clean was generated again.
- 02
ElevenLabs Multilingual v2
Voice · Alexander
- This war lasted about forty minutes.
- Nine o'clock. The ultimatum runs out.
- Five British warships open fire. The palaces on the harbour collapse.
- The red flag comes down.
- And the loser flees to the German consulate.
One voice with a timestamp for every word. Pictures and numbers land exactly on the spoken word, and the subtitles follow word by word.
- 03
Claude Code
Animation
981 lines of code
Camera, type, numbers and graphics as canvas code, every frame computed from the time. The prompt is in the panel above.
- 04
ffmpeg −16 LUFS
Mix
53 sound cues
Voice, sound effects and music placed on the picture's events, music ducked under the voice, measured to −16 LUFS.
Image prompts, word for word (1)
Top-down macro photograph of a sheet of aged handmade paper, warm ivory with subtle foxing, faint fibres and soft creases from folding, slightly darker vignetted edges, even soft daylight, completely blank, tactile texture, no text, no lines, no drawings, no stains in the centre
More motions
-
An agent platform, introduced UI motion 0:15 -
Agents that pick the model UI motion 0:14 -
A sentence becomes an app UI motion 0:15 -
An operating system, introduced UI motion 0:47.2 -
Your new design partner Voice-over 0:54.3 -
Ten kilometres, floating UGC ad 0:12.6 -
The journey of an order Explainer 0:34 -
Make it move Kinetic typography 0:08 -
From noise to a workflow Particles 0:14 -
The Gimli Glider Voice-over 0:19 -
Oscilloscope intro Oscilloscope 0:20 -
A keystroke in cross-section Explainer 0:20 -
A ring called Orbit UI motion 0:10 -
The bug that wants to stay Short film 0:20 -
Shin, not foot Voice-over 0:17 -
Jellyfish in a light shaft Organic loop 0:18 -
A logo that comes alive Logo reveal 0:08 -
How circles draw any shape Explainer 0:20 -
Pixel wizard Pixel art 0:16 -
Loose mosaic wall Mosaic 0:20 -
Near fall Physics simulation 0:09 -
A Negroni, explained Explainer 0:20 -
Where the fuel money goes Voice-over 0:19.5 -
One print, nothing else Title sequence 0:20 -
Infinite zoom into the detail Infinite zoom 0:15 -
Cube stack Short film 0:07 -
A request at 22:47 Chat story 0:17 -
Claude Code in three steps Voice-over 0:17.5 -
The inbox factory Isometric loop 0:12 -
From 0 to 100 % soft Physics simulation 0:10 -
One line, three inks Showreel 0:20 -
The request breaks out Physics simulation 0:15 -
The slicing machine Isometric loop 0:09 -
How backlinks work Explainer 0:20 -
A ball that grows with every bounce Physics simulation 0:10 -
One shape, fourteen states UI motion 0:14 -
What makes a home Paper cut-out 0:20 -
Words that carry Kinetic typography 0:20 -
Shard logo reveal Logo reveal 0:11