--- name: hyperframes-gsap-adapter description: GSAP animation API reference for HyperFrames. Use when writing seekable GSAP timelines in HyperFrames compositions, including gsap.to(), from(), fromTo(), set(), timeline position parameters, labels, easing, stagger, finite repeats, and transform performance. --- # HyperFrames GSAP GSAP usage scoped to HyperFrames' seek-driven render model. This skill is the GSAP reference _as constrained by HyperFrames_ — for the framework's broader composition contract see `hyperframes-core`. ## HyperFrames Contract HyperFrames controls GSAP through its `gsap` runtime adapter. Create a paused timeline synchronously, register it on `window.__timelines` with the exact `data-composition-id`, and let HyperFrames seek it. ```html ``` - The registry key must match the composition root's `data-composition-id`. - Bracket and dot syntax both register: `window.__timelines["main"] = tl` and `window.__timelines.main = tl` are equivalent (the linter recognizes both). Bracket form is required when the id isn't a valid identifier (e.g. contains `-`). - Do not call `tl.play()` for render-critical motion. - Do not build timelines inside async code, timers, or event handlers. - Keep loops finite. HyperFrames renders finite video durations. - **Render duration comes from `data-duration` on the composition root, not from GSAP timeline length.** Do not pad the timeline with empty tweens like `tl.set({}, {}, 283)` to "extend" it. (Some external docs show this trick; in HyperFrames it conflicts with the seek-driven duration model — set `data-duration` instead.) ## Core Tween Methods - **gsap.to(targets, vars)** — animate from current state to `vars`. Most common. - **gsap.from(targets, vars)** — animate from `vars` to current state (entrances). - **gsap.fromTo(targets, fromVars, toVars)** — explicit start and end. - **gsap.set(targets, vars)** — apply immediately (duration 0). Always use **camelCase** property names (e.g. `backgroundColor`, `rotationX`). ## Common vars (cheatsheet) - **duration** — seconds (default 0.5). - **delay** — seconds before start. - **ease** — `"power1.out"` (default), `"power3.inOut"`, `"back.out(1.7)"`, `"elastic.out(1, 0.3)"`, `"none"`. See `./gsap-easing-and-stagger.md`. - **stagger** — number or object. See `./gsap-easing-and-stagger.md`. - **repeat** — finite number; never `-1` in HyperFrames. Compute repeats from the visible duration. - **yoyo** — alternates direction with repeat. - **overwrite** — `false` (default), `true`, or `"auto"`. - **immediateRender** — default `true` for from()/fromTo(). Set `false` on later tweens targeting the same property+element. - **onComplete**, **onStart**, **onUpdate** — callbacks. For transforms, autoAlpha, clearProps, and SVG specifics see `./gsap-transforms-and-perf.md`. ## Animated Property Allowlist HyperFrames is stricter than vanilla GSAP. Animate only: - **Compositor-cheap**: `opacity`, `x`, `y`, `scale`, `scaleX`, `scaleY`, `rotation`, `rotationX`, `rotationY`, `skewX`, `skewY`, `transformOrigin` - **Visual fills**: `color`, `backgroundColor`, `borderColor`, `borderRadius` - **CSS variables**: `"--hue": 180` etc. - **Media `volume`** (on `