Vanilla JavaScript · HTML/CSS
HTML Reel
The hook of a talking-head reel, drawn in HTML from one clock.
Every frame is draw(t), with t the scratch voice's
seconds, so each word rises on its word and the zoom lands on “in.”
When the real take comes in, the same scene re-renders at
t = W(τ), straight lines between the words both takes
share, and follows the creator's delivery frame for frame. Animate it
with CSS timelines or timers and it can't follow: every new take means
animating it again, and stretching the render to fit judders.
Timed to
Scratch voice · t
Your take · τ
How it was made
- A scratch voice read the script (ElevenLabs). Its word times are the constants at the top of the scene, and the scene is animated to them.
-
One
draw(t)sets every part from t: each word through its mask, the camera, the window's layers, the tags and the light.HTMLReel.scene({ dur: 8.6, draw })puts it onwindow.__frame. -
The creator recorded the lines. Their words were matched to the
scratch's: 23 anchors,
[τ, t].anchorsturns them into W, straight lines between them, and the hook plays 7.77 s instead of 8.6 s. -
The renderer opens
?frame(or?frame&take), calls__frame(τ)once a frame at 540 × 960 and screenshots;__bounds()keeps thedata-safetitles inside the 3:4 safe area. - No video, canvas or WebGL: the window is HTML, so the 4.4× zoom is drawn at that size, not enlarged.