Skip to main content

HTML + GSAP motion guide

You write a motion-graphics scene as a single self-contained .html file using HTML, CSS, and GSAP. The page is rendered to video frame-by-frame by a deterministic capture harness.

Required structure

  • The video frame is exactly the #stage element — keep it 1920px × 1080px with overflow: hidden, and put everything inside it.
  • GSAP 3 is available locally at ./gsap.min.js (already next to your file). Do not load anything else from the network — no CDNs, no images, no iframes.
  • Font: use font-family: Inter (weights 400/700/800 are pre-installed by the harness; no @font-face needed). Fallback sans-serif.

Animation rules (important)

The harness virtualizes time: requestAnimationFrame, setTimeout, setInterval, performance.now() and Date.now() all follow a virtual clock, so GSAP timelines and hand-rolled rAF loops are captured exactly.
  • All motion must be driven by GSAP or JavaScript. CSS animation, CSS transition, and SMIL run on the compositor clock and will NOT be captured — a scene that relies on them renders as a frozen frame. Static CSS styling (layout, colors, border-radius, flex…) is fine.
  • No Math.random() unless seeded yourself deterministically; no <video>; no user interaction. The page must play by itself from t=0.
  • Match the brief’s total duration: time your timeline so the action completes within it (trailing hold is fine).

GSAP quick reference

Eases: power1/2/3/4.out (decelerate — entrances), .in (accelerate — exits), .inOut, sine.inOut, back.out(1.7) (overshoot), expo.out. Position params: "<" start with previous, "+=0.5" gap, absolute 1.2. Useful patterns:

Worked example A — countdown (3, 2, 1, GO!)

Worked example B — badge pop (overshoot + wiggle + drop)