gsap.to() with a keyframes array,
and the same motion being reshaped by dragging the ease curve in Studio rather
than guessing numbers.
Minimal contract
Give the composition a finite duration, create a paused timeline, and register it under the composition ID:data-composition-id.
Rules that matter
- Create the timeline with
{ paused: true }. - Register it on
window.__timelines. - Give important tweens an explicit position.
- Prefer
fromTo()when both endpoints matter; it remains reliable after backward or random seeks. - Animate transforms and opacity for movement. Avoid repeatedly animating layout properties such as
top,left,width, orheight. - Let HyperFrames control clip visibility and media playback.
to(), from(), fromTo(), and set(). GSAP supports many CSS properties, but the HyperFrames animation skill contains the render-safe patterns used by agents.
Load fonts before measuring text
An underline or a position calculated from text width needs the final font metrics. HyperFrames waits for fonts used by existing markup before starting composition scripts, but a face used only by script-created text may still be unloaded. Request that face withdocument.fonts.load() before measuring. Match the text’s font family, weight, and size, and pass the text so the browser can load the required character ranges. document.fonts.ready waits for fonts already requested; it does not request an unused face.
This example uses the intro composition, an inline-block #title styled with font: 700 64px "LocalFace" from a local @font-face, and a block-level #underline:
Duration
An explicit rootdata-duration is the composition’s render length:
data-duration, HyperFrames can infer length from registered timelines and supported media after the page initializes.
Do not assume a long source video automatically extends a shorter explicit root duration. The authored duration is the output window.