--- name: hyperframes-compose description: Create HyperFrames HTML video compositions. Use when asked to create a video, build an animation, make a composition, add a title card, or generate any HTML-based video content for HyperFrames. --- # Compose Video HTML is the source of truth for video. A composition is an HTML file with `data-*` attributes for timing, a GSAP timeline for animation, and CSS for appearance. The framework handles clip visibility, media playback, and timeline sync. ## Approach Before writing HTML, think at a high level: 1. **What** — what should the viewer experience? Identify the narrative arc, key moments, and emotional beats. 2. **Structure** — how many compositions, which are sub-compositions vs inline, what tracks carry what (video, audio, overlays, captions). 3. **Timing** — which clips drive the duration, where do transitions land, what's the pacing. 4. **Execute** — then implement using the rules below. For small edits (fix a color, adjust timing, add one element), skip straight to the rules. When no `visual-style.md` or animation direction is provided, follow [house-style.md](./house-style.md) for motion defaults, sizing, and color palettes. ## Data Attributes ### All Clips | Attribute | Required | Values | | ------------------ | --------------------------------- | ------------------------------------------------------ | | `id` | Yes | Unique identifier | | `data-start` | Yes | Seconds or clip ID reference (`"el-1"`, `"intro + 2"`) | | `data-duration` | Required for img/div/compositions | Seconds. Video/audio defaults to media duration. | | `data-track-index` | Yes | Integer. Same-track clips **cannot overlap**. | | `data-media-start` | No | Trim offset into source (seconds) | | `data-volume` | No | 0-1 (default 1) | `data-track-index` does **not** affect visual layering — use CSS `z-index`. ### Composition Clips | Attribute | Required | Values | | ---------------------------- | -------- | -------------------------------------------- | | `data-composition-id` | Yes | Unique composition ID | | `data-duration` | Yes | Takes precedence over GSAP timeline duration | | `data-width` / `data-height` | Yes | Pixel dimensions (1920x1080 or 1080x1920) | | `data-composition-src` | No | Path to external HTML file | ## Composition Structure Every composition is a `