hyperframes 0.2.5 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +7152 -6407
- package/dist/docs/{templates.md → examples.md} +2 -2
- package/dist/skills/gsap/SKILL.md +5 -16
- package/dist/skills/gsap/references/effects.md +7 -14
- package/dist/skills/hyperframes/SKILL.md +124 -43
- package/dist/skills/hyperframes/house-style.md +34 -93
- package/dist/skills/hyperframes/references/captions.md +2 -2
- package/dist/skills/hyperframes/references/css-patterns.md +36 -34
- package/dist/skills/hyperframes/references/transitions/catalog.md +4 -19
- package/dist/skills/hyperframes/references/transitions/css-other.md +0 -11
- package/dist/skills/hyperframes/references/transitions.md +53 -37
- package/dist/skills/hyperframes/references/{fonts.md → typography.md} +73 -32
- package/dist/skills/hyperframes/scripts/animation-map.mjs +596 -0
- package/dist/skills/hyperframes/scripts/contrast-report.mjs +335 -0
- package/dist/skills/hyperframes-cli/SKILL.md +1 -1
- package/dist/studio/assets/hyperframes-player-eEkqo7g7.js +198 -0
- package/dist/studio/assets/index-DZEa45DQ.css +1 -0
- package/dist/studio/assets/{index-BkSXiHxK.js → index-Pn53dCTs.js} +27 -224
- package/dist/studio/index.html +2 -2
- package/dist/templates/_shared/AGENTS.md +59 -0
- package/dist/templates/_shared/CLAUDE.md +7 -7
- package/package.json +1 -1
- package/dist/skills/gsap/references/frameworks.md +0 -56
- package/dist/skills/gsap/references/plugins.md +0 -194
- package/dist/skills/gsap/references/react.md +0 -80
- package/dist/skills/gsap/references/scrolltrigger.md +0 -147
- package/dist/skills/gsap/references/utils.md +0 -91
- package/dist/skills/hyperframes/references/examples.md +0 -146
- package/dist/skills/hyperframes/references/marker-highlight.md +0 -158
- package/dist/skills/hyperframes/references/transitions/shader-setup.md +0 -463
- package/dist/skills/hyperframes/references/transitions/shader-transitions.md +0 -329
- package/dist/studio/assets/index-DHr9yo58.css +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Templates
|
|
2
2
|
|
|
3
|
-
Built-in templates available via `npx hyperframes init --
|
|
3
|
+
Built-in templates available via `npx hyperframes init --example <name>`.
|
|
4
4
|
|
|
5
5
|
## blank
|
|
6
6
|
|
|
@@ -16,4 +16,4 @@ Video element with trimming, audio, and track controls. Starting point for video
|
|
|
16
16
|
|
|
17
17
|
## Custom Templates
|
|
18
18
|
|
|
19
|
-
Any directory with an `index.html` can serve as
|
|
19
|
+
Any directory with an `index.html` can serve as an example. Copy it manually or build your own init workflow.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: gsap
|
|
3
|
-
description:
|
|
3
|
+
description: GSAP animation reference for HyperFrames. Covers gsap.to(), from(), fromTo(), easing, stagger, defaults, timelines (gsap.timeline(), position parameter, labels, nesting, playback), and performance (transforms, will-change, quickTo). Use when writing GSAP animations in HyperFrames compositions.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# GSAP
|
|
@@ -57,7 +57,7 @@ gsap.to(".item", {
|
|
|
57
57
|
|
|
58
58
|
## Easing
|
|
59
59
|
|
|
60
|
-
Built-in eases: `power1`–`power4`, `back`, `bounce`, `circ`, `elastic`, `expo`, `sine`. Each has `.in`, `.out`, `.inOut`.
|
|
60
|
+
Built-in eases: `power1`–`power4`, `back`, `bounce`, `circ`, `elastic`, `expo`, `sine`. Each has `.in`, `.out`, `.inOut`.
|
|
61
61
|
|
|
62
62
|
## Defaults
|
|
63
63
|
|
|
@@ -186,17 +186,12 @@ Use `stagger` instead of separate tweens with manual delays.
|
|
|
186
186
|
|
|
187
187
|
### Cleanup
|
|
188
188
|
|
|
189
|
-
Pause or kill off-screen animations.
|
|
189
|
+
Pause or kill off-screen animations.
|
|
190
190
|
|
|
191
191
|
---
|
|
192
192
|
|
|
193
193
|
## References (loaded on demand)
|
|
194
194
|
|
|
195
|
-
- **[references/scrolltrigger.md](references/scrolltrigger.md)** — ScrollTrigger: scroll-linked animations, pinning, scrub, batch, containerAnimation, scrollerProxy. Read when building scroll-driven UI, parallax, or pinned sections.
|
|
196
|
-
- **[references/plugins.md](references/plugins.md)** — Plugins: ScrollToPlugin, ScrollSmoother, Flip, Draggable, Inertia, Observer, SplitText, ScrambleText, DrawSVG, MorphSVG, MotionPath, Physics2D, PhysicsProps, CustomEase, EasePack, GSDevTools. Read when using any GSAP plugin.
|
|
197
|
-
- **[references/utils.md](references/utils.md)** — gsap.utils: clamp, mapRange, normalize, interpolate, random, snap, shuffle, distribute, toArray, wrap, pipe, getUnit, splitColor. Read when using utility helpers.
|
|
198
|
-
- **[references/react.md](references/react.md)** — React: useGSAP hook, refs, gsap.context(), cleanup, contextSafe, SSR. Read when using GSAP in React or Next.js.
|
|
199
|
-
- **[references/frameworks.md](references/frameworks.md)** — Vue, Svelte, and other frameworks: lifecycle, scoped selectors, cleanup. Read when using GSAP in Vue, Nuxt, Svelte, or SvelteKit.
|
|
200
195
|
- **[references/effects.md](references/effects.md)** — Drop-in effects: typewriter text, audio visualizer. Read when needing ready-made effect patterns for HyperFrames.
|
|
201
196
|
|
|
202
197
|
## Best Practices
|
|
@@ -205,18 +200,12 @@ Pause or kill off-screen animations. In frameworks, revert context on unmount.
|
|
|
205
200
|
- Prefer timelines over chaining with delay; use the position parameter.
|
|
206
201
|
- Add labels with `addLabel()` for readable sequencing.
|
|
207
202
|
- Pass defaults into timeline constructor.
|
|
208
|
-
- Use gsap.matchMedia() for responsive breakpoints and prefers-reduced-motion.
|
|
209
203
|
- Store tween/timeline return value when controlling playback.
|
|
210
|
-
- Register every plugin with `gsap.registerPlugin()` before use.
|
|
211
204
|
|
|
212
205
|
## Do Not
|
|
213
206
|
|
|
214
207
|
- Animate layout properties (width/height/top/left) when transforms suffice.
|
|
215
208
|
- Use both svgOrigin and transformOrigin on the same SVG element.
|
|
216
209
|
- Chain animations with delay when a timeline can sequence them.
|
|
217
|
-
-
|
|
218
|
-
-
|
|
219
|
-
- Use scrub and toggleActions together on the same ScrollTrigger.
|
|
220
|
-
- Create tweens/ScrollTriggers before the component is mounted (DOM must exist).
|
|
221
|
-
- Skip cleanup — always revert context or kill tweens on unmount.
|
|
222
|
-
- Ship GSDevTools to production.
|
|
210
|
+
- Create tweens before the DOM exists.
|
|
211
|
+
- Skip cleanup — always kill tweens when no longer needed.
|
|
@@ -210,25 +210,18 @@ Requires ffmpeg and numpy.
|
|
|
210
210
|
|
|
211
211
|
```js
|
|
212
212
|
// Option A: inline (small files, under ~500KB)
|
|
213
|
-
|
|
213
|
+
var AUDIO_DATA = {
|
|
214
214
|
/* paste audio-data.json contents */
|
|
215
215
|
};
|
|
216
|
-
setupTimeline(AUDIO_DATA);
|
|
217
216
|
|
|
218
|
-
// Option B:
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
function setupTimeline(AUDIO_DATA) {
|
|
224
|
-
// IMPORTANT: all tl.call() setup must be inside this callback
|
|
225
|
-
for (let f = 0; f < AUDIO_DATA.totalFrames; f++) {
|
|
226
|
-
tl.call(() => draw(AUDIO_DATA.frames[f]), [], f / AUDIO_DATA.fps);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
217
|
+
// Option B: sync XHR (large files — must be synchronous for deterministic timeline construction)
|
|
218
|
+
var xhr = new XMLHttpRequest();
|
|
219
|
+
xhr.open("GET", "audio-data.json", false);
|
|
220
|
+
xhr.send();
|
|
221
|
+
var AUDIO_DATA = JSON.parse(xhr.responseText);
|
|
229
222
|
```
|
|
230
223
|
|
|
231
|
-
|
|
224
|
+
**Do NOT use async `fetch()` to load audio data.** HyperFrames requires synchronous timeline construction — the capture engine reads `window.__timelines` synchronously after page load. Building timelines inside `.then()` callbacks means the timeline isn't ready when capture starts.
|
|
232
225
|
|
|
233
226
|
### Rendering Approaches
|
|
234
227
|
|
|
@@ -30,31 +30,44 @@ Position every element where it should be at its **most visible moment** — the
|
|
|
30
30
|
### The process
|
|
31
31
|
|
|
32
32
|
1. **Identify the hero frame** for each scene — the moment when the most elements are simultaneously visible. This is the layout you build.
|
|
33
|
-
2. **Write static CSS** for that frame.
|
|
33
|
+
2. **Write static CSS** for that frame. The `.scene-content` container MUST fill the full scene using `width: 100%; height: 100%; padding: Npx;` with `display: flex; flex-direction: column; gap: Npx; box-sizing: border-box`. Use padding to push content inward — NEVER `position: absolute; top: Npx` on a content container. Absolute-positioned content containers overflow when content is taller than the remaining space. Reserve `position: absolute` for decoratives only.
|
|
34
34
|
3. **Add entrances with `gsap.from()`** — animate FROM offscreen/invisible TO the CSS position. The CSS position is the ground truth; the tween describes the journey to get there.
|
|
35
35
|
4. **Add exits with `gsap.to()`** — animate TO offscreen/invisible FROM the CSS position.
|
|
36
36
|
|
|
37
37
|
### Example
|
|
38
38
|
|
|
39
39
|
```css
|
|
40
|
-
/*
|
|
40
|
+
/* scene-content fills the scene, padding positions content */
|
|
41
|
+
.scene-content {
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
justify-content: center;
|
|
45
|
+
width: 100%;
|
|
46
|
+
height: 100%;
|
|
47
|
+
padding: 120px 160px;
|
|
48
|
+
gap: 24px;
|
|
49
|
+
box-sizing: border-box;
|
|
50
|
+
}
|
|
41
51
|
.title {
|
|
42
|
-
|
|
43
|
-
top: 200px;
|
|
44
|
-
left: 160px;
|
|
45
|
-
opacity: 1;
|
|
52
|
+
font-size: 120px;
|
|
46
53
|
}
|
|
47
54
|
.subtitle {
|
|
48
|
-
|
|
49
|
-
top: 320px;
|
|
50
|
-
left: 160px;
|
|
51
|
-
opacity: 1;
|
|
55
|
+
font-size: 42px;
|
|
52
56
|
}
|
|
53
|
-
.
|
|
57
|
+
/* Container fills any scene size (1920x1080, 1080x1920, etc).
|
|
58
|
+
Padding positions content. Flex + gap handles spacing. */
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**WRONG — hardcoded dimensions and absolute positioning:**
|
|
62
|
+
|
|
63
|
+
```css
|
|
64
|
+
.scene-content {
|
|
54
65
|
position: absolute;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
top: 200px;
|
|
67
|
+
left: 160px;
|
|
68
|
+
width: 1920px;
|
|
69
|
+
height: 1080px;
|
|
70
|
+
display: flex; /* ... */
|
|
58
71
|
}
|
|
59
72
|
```
|
|
60
73
|
|
|
@@ -98,13 +111,16 @@ Layered effects (glow behind text, shadow elements, background patterns) and z-s
|
|
|
98
111
|
| Attribute | Required | Values |
|
|
99
112
|
| ---------------------------- | -------- | -------------------------------------------- |
|
|
100
113
|
| `data-composition-id` | Yes | Unique composition ID |
|
|
114
|
+
| `data-start` | Yes | Start time (root composition: use `"0"`) |
|
|
101
115
|
| `data-duration` | Yes | Takes precedence over GSAP timeline duration |
|
|
102
116
|
| `data-width` / `data-height` | Yes | Pixel dimensions (1920x1080 or 1080x1920) |
|
|
103
117
|
| `data-composition-src` | No | Path to external HTML file |
|
|
104
118
|
|
|
105
119
|
## Composition Structure
|
|
106
120
|
|
|
107
|
-
|
|
121
|
+
Sub-compositions loaded via `data-composition-src` use a `<template>` wrapper. **Standalone compositions (the main index.html) do NOT use `<template>`** — they put the `data-composition-id` div directly in `<body>`. Using `<template>` on a standalone file hides all content from the browser and breaks rendering.
|
|
122
|
+
|
|
123
|
+
Sub-composition structure:
|
|
108
124
|
|
|
109
125
|
```html
|
|
110
126
|
<template id="my-comp-template">
|
|
@@ -183,24 +199,56 @@ Video must be `muted playsinline`. Audio is always a separate `<audio>` element:
|
|
|
183
199
|
7. Create a top-level container without `data-composition-id`
|
|
184
200
|
8. Use `repeat: -1` on any timeline or tween — always finite repeats
|
|
185
201
|
9. Build timelines asynchronously (inside `async`, `setTimeout`, `Promise`)
|
|
202
|
+
10. Use `gsap.set()` on clip elements from later scenes — they don't exist in the DOM at page load. Use `tl.set(selector, vars, timePosition)` inside the timeline at or after the clip's `data-start` time instead.
|
|
203
|
+
11. Use `<br>` in content text — forced line breaks don't account for actual rendered font width. Text that wraps naturally + a `<br>` produces an extra unwanted break, causing overlap. Let text wrap via `max-width` instead. Exception: short display titles where each word is deliberately on its own line (e.g., "THE\nIMMORTAL\nGAME" at 130px).
|
|
204
|
+
|
|
205
|
+
## Scene Transitions (Non-Negotiable)
|
|
206
|
+
|
|
207
|
+
Every multi-scene composition MUST follow ALL of these rules. Violating any one of them is a broken composition.
|
|
208
|
+
|
|
209
|
+
1. **ALWAYS use transitions between scenes.** No jump cuts. No exceptions.
|
|
210
|
+
2. **ALWAYS use entrance animations on every scene.** Every element animates IN via `gsap.from()`. No element may appear fully-formed. If a scene has 5 elements, it needs 5 entrance tweens.
|
|
211
|
+
3. **NEVER use exit animations** except on the final scene. This means: NO `gsap.to()` that animates opacity to 0, y offscreen, scale to 0, or any other "out" animation before a transition fires. The transition IS the exit. The outgoing scene's content MUST be fully visible at the moment the transition starts.
|
|
212
|
+
4. **Final scene only:** The last scene may fade elements out (e.g., fade to black). This is the ONLY scene where `gsap.to(..., { opacity: 0 })` is allowed.
|
|
213
|
+
|
|
214
|
+
**WRONG — exit animation before transition:**
|
|
215
|
+
|
|
216
|
+
```js
|
|
217
|
+
// BANNED — this empties the scene before the transition can use it
|
|
218
|
+
tl.to("#s1-title", { opacity: 0, y: -40, duration: 0.4 }, 6.5);
|
|
219
|
+
tl.to("#s1-subtitle", { opacity: 0, duration: 0.3 }, 6.7);
|
|
220
|
+
// transition fires on empty frame
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
**RIGHT — entrance only, transition handles exit:**
|
|
224
|
+
|
|
225
|
+
```js
|
|
226
|
+
// Scene 1 entrance animations
|
|
227
|
+
tl.from("#s1-title", { y: 50, opacity: 0, duration: 0.7, ease: "power3.out" }, 0.3);
|
|
228
|
+
tl.from("#s1-subtitle", { y: 30, opacity: 0, duration: 0.5, ease: "power2.out" }, 0.6);
|
|
229
|
+
// NO exit tweens — transition at 7.2s handles the scene change
|
|
230
|
+
// Scene 2 entrance animations
|
|
231
|
+
tl.from("#s2-heading", { x: -40, opacity: 0, duration: 0.6, ease: "expo.out" }, 8.0);
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
## Animation Guardrails
|
|
235
|
+
|
|
236
|
+
- Offset first animation 0.1-0.3s (not t=0)
|
|
237
|
+
- Vary eases across entrance tweens — use at least 3 different eases per scene
|
|
238
|
+
- Don't repeat an entrance pattern within a scene
|
|
239
|
+
- Avoid full-screen linear gradients on dark backgrounds (H.264 banding — use radial or solid + localized glow)
|
|
240
|
+
- 60px+ headlines, 20px+ body, 16px+ data labels for rendered video
|
|
241
|
+
- `font-variant-numeric: tabular-nums` on number columns
|
|
242
|
+
|
|
243
|
+
When no `visual-style.md` or animation direction is provided, follow [house-style.md](./house-style.md) for aesthetic defaults.
|
|
186
244
|
|
|
187
245
|
## Typography and Assets
|
|
188
246
|
|
|
189
|
-
- **Fonts:** Just write the `font-family` you want in CSS — the compiler embeds supported fonts automatically
|
|
247
|
+
- **Fonts:** Just write the `font-family` you want in CSS — the compiler embeds supported fonts automatically. If a font isn't supported, the compiler warns.
|
|
190
248
|
- Add `crossorigin="anonymous"` to external media
|
|
191
|
-
-
|
|
192
|
-
- Body/label text: 20px minimum (landscape), 18px minimum (portrait)
|
|
193
|
-
- Data labels, axis labels, footnotes: 16px minimum — anything smaller becomes illegible after encoding
|
|
194
|
-
- Headlines: 36px+ recommended
|
|
195
|
-
- Avoid sub-14px text entirely — it will be unreadable in the final MP4
|
|
196
|
-
- For dynamic text overflow, use `window.__hyperframes.fitTextFontSize(text, { maxWidth, fontFamily, fontWeight })` — returns `{ fontSize, fits }`
|
|
249
|
+
- For dynamic text overflow, use `window.__hyperframes.fitTextFontSize(text, { maxWidth, fontFamily, fontWeight })`
|
|
197
250
|
- All files live at the project root alongside `index.html`; sub-compositions use `../`
|
|
198
251
|
|
|
199
|
-
### Backgrounds and Color
|
|
200
|
-
|
|
201
|
-
- **Avoid full-screen linear gradients on dark backgrounds** — H.264 encoding creates visible color banding. Prefer: solid colors, radial gradients with limited range, or subtle noise/texture overlays to break up banding.
|
|
202
|
-
- For dark themes, use solid `#000` or `#0A0A0A` with localized radial glows rather than a linear gradient spanning the full viewport.
|
|
203
|
-
|
|
204
252
|
## Editing Existing Compositions
|
|
205
253
|
|
|
206
254
|
- Read the full composition first — match existing fonts, colors, animation patterns
|
|
@@ -209,18 +257,52 @@ Video must be `muted playsinline`. Audio is always a separate `<audio>` element:
|
|
|
209
257
|
|
|
210
258
|
## Output Checklist
|
|
211
259
|
|
|
212
|
-
- [ ] Every top-level container has `data-composition-id`, `data-width`, `data-height`, `data-duration`
|
|
213
|
-
- [ ] Compositions in own HTML files, loaded via `data-composition-src`
|
|
214
|
-
- [ ] `<template>` wrapper on sub-compositions
|
|
215
|
-
- [ ] `window.__timelines` registered for every composition
|
|
216
|
-
- [ ] Timeline construction is synchronous (no async/await wrapping timeline code)
|
|
217
|
-
- [ ] No `repeat: -1` on any tween or nested timeline
|
|
218
|
-
- [ ] No text below 16px (data labels, footnotes) or 20px (body text)
|
|
219
|
-
- [ ] No full-screen linear dark gradients (use radial or solid + localized glow)
|
|
220
|
-
- [ ] Font families declared in CSS (compiler embeds them automatically)
|
|
221
|
-
- [ ] 100% deterministic
|
|
222
|
-
- [ ] Each composition includes GSAP script tag
|
|
223
260
|
- [ ] `npx hyperframes lint` and `npx hyperframes validate` both pass
|
|
261
|
+
- [ ] Contrast warnings addressed (see Quality Checks below)
|
|
262
|
+
- [ ] Animation choreography verified (see Quality Checks below)
|
|
263
|
+
|
|
264
|
+
## Quality Checks
|
|
265
|
+
|
|
266
|
+
### Contrast
|
|
267
|
+
|
|
268
|
+
`hyperframes validate` runs a WCAG contrast audit by default. It seeks to 5 timestamps, screenshots the page, samples background pixels behind every text element, and computes contrast ratios. Failures appear as warnings:
|
|
269
|
+
|
|
270
|
+
```
|
|
271
|
+
⚠ WCAG AA contrast warnings (3):
|
|
272
|
+
· .subtitle "secondary text" — 2.67:1 (need 4.5:1, t=5.3s)
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
If warnings appear:
|
|
276
|
+
|
|
277
|
+
- On dark backgrounds: brighten the failing color until it clears 4.5:1 (normal text) or 3:1 (large text, 24px+ or 19px+ bold)
|
|
278
|
+
- On light backgrounds: darken it
|
|
279
|
+
- Stay within the palette family — don't invent a new color, adjust the existing one
|
|
280
|
+
- Re-run `hyperframes validate` until clean
|
|
281
|
+
|
|
282
|
+
Use `--no-contrast` to skip if iterating rapidly and you'll check later.
|
|
283
|
+
|
|
284
|
+
### Animation Map
|
|
285
|
+
|
|
286
|
+
After authoring animations, run the animation map to verify choreography:
|
|
287
|
+
|
|
288
|
+
```bash
|
|
289
|
+
node skills/hyperframes/scripts/animation-map.mjs <composition-dir> \
|
|
290
|
+
--out <composition-dir>/.hyperframes/anim-map
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
Outputs a single `animation-map.json` with:
|
|
294
|
+
|
|
295
|
+
- **Per-tween summaries**: `"#card1 animates opacity+y over 0.50s. moves 23px up. fades in. ends at (120, 200)"`
|
|
296
|
+
- **ASCII timeline**: Gantt chart of all tweens across the composition duration
|
|
297
|
+
- **Stagger detection**: reports actual intervals (`"3 elements stagger at 120ms"`)
|
|
298
|
+
- **Dead zones**: periods over 1s with no animation — intentional hold or missing entrance?
|
|
299
|
+
- **Element lifecycles**: first/last animation time, final visibility
|
|
300
|
+
- **Scene snapshots**: visible element state at 5 key timestamps
|
|
301
|
+
- **Flags**: `offscreen`, `collision`, `invisible`, `paced-fast` (under 0.2s), `paced-slow` (over 2s)
|
|
302
|
+
|
|
303
|
+
Read the JSON. Scan summaries for anything unexpected. Check every flag — fix or justify. Verify the timeline shows the intended choreography rhythm. Re-run after fixes.
|
|
304
|
+
|
|
305
|
+
Skip on small edits (fixing a color, adjusting one duration). Run on new compositions and significant animation changes.
|
|
224
306
|
|
|
225
307
|
---
|
|
226
308
|
|
|
@@ -229,8 +311,8 @@ Video must be `muted playsinline`. Audio is always a separate `<audio>` element:
|
|
|
229
311
|
- **[references/captions.md](references/captions.md)** — Captions, subtitles, lyrics, karaoke synced to audio. Tone-adaptive style detection, per-word styling, text overflow prevention, caption exit guarantees, word grouping. Read when adding any text synced to audio timing.
|
|
230
312
|
- **[references/tts.md](references/tts.md)** — Text-to-speech with Kokoro-82M. Voice selection, speed tuning, TTS+captions workflow. Read when generating narration or voiceover.
|
|
231
313
|
- **[references/audio-reactive.md](references/audio-reactive.md)** — Audio-reactive animation: map frequency bands and amplitude to GSAP properties. Read when visuals should respond to music, voice, or sound.
|
|
232
|
-
- **[references/
|
|
233
|
-
- **[references/
|
|
314
|
+
- **[references/css-patterns.md](references/css-patterns.md)** — CSS+GSAP marker highlighting: highlight, circle, burst, scribble, sketchout. Deterministic, fully seekable. Read when adding visual emphasis to text.
|
|
315
|
+
- **[references/typography.md](references/typography.md)** — Typography: font pairing, OpenType features, dark-background adjustments, font discovery script. **Always read** — every composition has text.
|
|
234
316
|
- **[references/motion-principles.md](references/motion-principles.md)** — Motion design principles: easing as emotion, timing as weight, choreography as hierarchy, scene pacing, ambient motion, anti-patterns. Read when choreographing GSAP animations.
|
|
235
317
|
- **[house-style.md](house-style.md)** — Default motion, sizing, and color palettes when no style is specified.
|
|
236
318
|
- **[patterns.md](patterns.md)** — PiP, title cards, slide show patterns.
|
|
@@ -238,9 +320,8 @@ Video must be `muted playsinline`. Audio is always a separate `<audio>` element:
|
|
|
238
320
|
- **[references/transcript-guide.md](references/transcript-guide.md)** — Transcription commands, whisper models, external APIs, troubleshooting.
|
|
239
321
|
- **[references/dynamic-techniques.md](references/dynamic-techniques.md)** — Dynamic caption animation techniques (karaoke, clip-path, slam, scatter, elastic, 3D).
|
|
240
322
|
|
|
241
|
-
- **[references/transitions.md](references/transitions.md)** — Scene transitions: crossfades, wipes, reveals, shader transitions. Energy/mood selection,
|
|
323
|
+
- **[references/transitions.md](references/transitions.md)** — Scene transitions: crossfades, wipes, reveals, shader transitions. Energy/mood selection, CSS vs WebGL guidance. **Always read for multi-scene compositions** — scenes without transitions feel like jump cuts.
|
|
242
324
|
- [transitions/catalog.md](references/transitions/catalog.md) — Hard rules, scene template, and routing to per-type implementation code.
|
|
243
|
-
-
|
|
244
|
-
- [transitions/shader-transitions.md](references/transitions/shader-transitions.md) — 14 fragment shaders.
|
|
325
|
+
- Shader transitions are in `@hyperframes/shader-transitions` (`packages/shader-transitions/`) — read package source, not skill files.
|
|
245
326
|
|
|
246
327
|
GSAP patterns and effects are in the `/gsap` skill.
|
|
@@ -1,119 +1,60 @@
|
|
|
1
1
|
# House Style
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Creative direction for compositions when no `visual-style.md` is provided. These are starting points — override anything that doesn't serve the content.
|
|
4
4
|
|
|
5
5
|
## Before Writing HTML
|
|
6
6
|
|
|
7
|
-
1. **Interpret the prompt.** Generate real content
|
|
8
|
-
2. **Pick a palette.**
|
|
9
|
-
3. **Pick
|
|
10
|
-
4. **Pick a layout approach.** Don't default to the same structure every time.
|
|
11
|
-
5. **Pick your entrance patterns.** Plan how elements enter — never use the same entrance pattern twice in a composition.
|
|
7
|
+
1. **Interpret the prompt.** Generate real content. A recipe lists real ingredients. A HUD has real readouts.
|
|
8
|
+
2. **Pick a palette.** Light or dark? Declare bg, fg, accent before writing code.
|
|
9
|
+
3. **Pick typefaces.** Run the font discovery script in [references/typography.md](references/typography.md) — or pick a font you already know that fits the theme. The script broadens your options; it's not the only source.
|
|
12
10
|
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
### Easing
|
|
16
|
-
|
|
17
|
-
Vary your eases. Don't use the same ease on more than 2 tweens in a composition. Pick from the full GSAP vocabulary:
|
|
18
|
-
|
|
19
|
-
`power1-4.in/out/inOut`, `back.out(1.4-2.5)`, `elastic.out(1, 0.3-0.5)`, `circ.out`, `expo.out`, `sine.inOut`, `steps(n)`
|
|
20
|
-
|
|
21
|
-
A few principles:
|
|
22
|
-
|
|
23
|
-
- Opacity fades should be gentle (`power1` or `none`) — don't draw attention to the fade itself
|
|
24
|
-
- Overshoot on scale or position feels alive — `back.out` or `elastic.out`
|
|
25
|
-
- Snappy moves want `expo.out` or `power4.out` — fast departure, hard stop
|
|
26
|
-
- Smooth arcs want `sine.inOut` or `circ.inOut` — no hard edges
|
|
11
|
+
## Lazy Defaults to Question
|
|
27
12
|
|
|
28
|
-
|
|
13
|
+
These patterns are AI design tells — the first thing every LLM reaches for. If you're about to use one, pause and ask: is this a deliberate choice for THIS content, or am I defaulting?
|
|
29
14
|
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
15
|
+
- Gradient text (`background-clip: text` + gradient)
|
|
16
|
+
- Left-edge accent stripes on cards/callouts
|
|
17
|
+
- Cyan-on-dark / purple-to-blue gradients / neon accents
|
|
18
|
+
- Pure `#000` or `#fff` (tint toward your accent hue instead)
|
|
19
|
+
- Identical card grids (same-size cards repeated)
|
|
20
|
+
- Everything centered with equal weight (lead the eye somewhere)
|
|
21
|
+
- Banned fonts (see [references/typography.md](references/typography.md) for full list)
|
|
35
22
|
|
|
36
|
-
|
|
23
|
+
If the content genuinely calls for one of these — centered layout for a solemn closing, cards for a real product UI mockup, a banned font because it's the perfect thematic match — use it. The goal is intentionality, not avoidance.
|
|
37
24
|
|
|
38
|
-
|
|
25
|
+
## Color
|
|
39
26
|
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
- **
|
|
44
|
-
-
|
|
45
|
-
- **Letter spacing / word spacing** — for text, animate tracking from wide to tight or vice versa.
|
|
46
|
-
- **Skew** — `skewX` or `skewY` gives a motion-blur feeling without actual blur.
|
|
47
|
-
- **3D transforms** — `rotationX`, `rotationY` with `transformPerspective` for depth.
|
|
27
|
+
- Match light/dark to content: food, wellness, kids → light. Tech, cinema, finance → dark.
|
|
28
|
+
- One accent hue. Same background across all scenes.
|
|
29
|
+
- Tint neutrals toward your accent (even subtle warmth/coolness beats dead gray).
|
|
30
|
+
- **Contrast:** enforced by `hyperframes validate` (WCAG AA). Text must be readable with decoratives removed.
|
|
31
|
+
- Declare palette up front. Don't invent colors per-element.
|
|
48
32
|
|
|
49
|
-
|
|
33
|
+
## Background Layer
|
|
50
34
|
|
|
51
|
-
|
|
35
|
+
Every scene needs visual depth — persistent decorative elements that stay visible while content animates in. Without these, scenes feel empty during entrance staggering.
|
|
52
36
|
|
|
53
|
-
|
|
54
|
-
- **Coordinated entry** — when a new element enters, existing elements react. Anchor moves, follower tracks.
|
|
55
|
-
- **Ambient motion** — keep the composition alive during holds. Don't default to zoom-in every time. Pick one per composition:
|
|
56
|
-
- Slow pan (x or y drift on a container)
|
|
57
|
-
- Subtle rotation (0.5–2deg over several seconds)
|
|
58
|
-
- Scale push or pull (zoom in OR out — both work)
|
|
59
|
-
- Parallax layers (background moves slower than foreground)
|
|
60
|
-
- Color/opacity shift on an accent element
|
|
61
|
-
- No ambient motion at all — stillness can be powerful
|
|
62
|
-
- **End with intention** — don't always zoom at the end. Options: snap to black, fade to stillness, final element snaps into place, a hard cut. Vary this across compositions.
|
|
37
|
+
Ideas (mix and match, 2-5 per scene):
|
|
63
38
|
|
|
64
|
-
|
|
39
|
+
- Radial glows (accent-tinted, low opacity, breathing scale)
|
|
40
|
+
- Ghost text (theme words at 3-8% opacity, very large, slow drift)
|
|
41
|
+
- Accent lines (hairline rules, subtle pulse)
|
|
42
|
+
- Grain/noise overlay, geometric shapes, grid patterns
|
|
43
|
+
- Thematic decoratives (orbit rings for space, vinyl grooves for music, grid lines for data)
|
|
65
44
|
|
|
66
|
-
|
|
45
|
+
All decoratives should have slow ambient GSAP animation — breathing, drift, pulse. Static decoratives feel dead.
|
|
67
46
|
|
|
68
|
-
|
|
69
|
-
- **Breathe (30–70%)** — content is visible. Keep it alive with subtle motion: slow camera push, gentle drift, a color shift, a pulsing accent. Static holds feel dead.
|
|
70
|
-
- **Resolve (70–100%)** — elements exit or the composition punctuates. Exits are faster than entrances. End with intention — a final zoom, a fade to black, a snap to stillness.
|
|
71
|
-
|
|
72
|
-
Don't crowd the build phase. If you have 6 elements, let 2-3 enter, breathe, then bring in the rest. Layers of reveals beat a single wave.
|
|
73
|
-
|
|
74
|
-
## Sizing
|
|
75
|
-
|
|
76
|
-
- **Text scale contrast** — headings at 3–5x body size, not 1.5x. Big contrast reads as cinematic.
|
|
77
|
-
- **Element fill** — hero elements fill 60–80% of the frame. Don't leave them floating at 30%.
|
|
78
|
-
- **Travel distance** — entrance moves should cover 80–200px. Under 20px looks like a glitch.
|
|
79
|
-
- **Overshoot** — 5–10% overshoot reads as energy. Under 2% reads as a bug.
|
|
80
|
-
|
|
81
|
-
## Visual Depth
|
|
47
|
+
## Motion
|
|
82
48
|
|
|
83
|
-
|
|
49
|
+
See [references/motion-principles.md](references/motion-principles.md) for full rules. Quick: 0.3–0.6s, vary eases, combine transforms on entrances, overlap entries.
|
|
84
50
|
|
|
85
51
|
## Typography
|
|
86
52
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
- **Weight contrast** — pair a heavy weight (700-900) headline with a light weight (300-400) body. Always use at least two explicit font-weight values — even with display fonts that look bold by default, set labels or secondary text to a lighter weight.
|
|
90
|
-
- **Case deliberately** — ALL CAPS for labels and short text (under 5 words). Sentence case for longer text. Don't uppercase paragraphs.
|
|
91
|
-
- **Tracking** — tight tracking (-0.02em) on large headlines. Normal or wide tracking on small labels.
|
|
92
|
-
- **One typeface, two weights** — don't mix typefaces unless you have a reason. One family at two weights creates more hierarchy than two families at one weight each.
|
|
93
|
-
|
|
94
|
-
## Anti-Defaults
|
|
95
|
-
|
|
96
|
-
Things the LLM reaches for that look generic. Do the opposite.
|
|
97
|
-
|
|
98
|
-
| Default | Instead |
|
|
99
|
-
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
100
|
-
| Inter / Roboto / system font | Pick a typeface with character — commit to it |
|
|
101
|
-
| `#f5f5f5` / `#333` / mid-gray | Go high contrast. Near-black or near-white, not the middle |
|
|
102
|
-
| Blue accent `#3b82f6` | No blue unless the user asks for blue |
|
|
103
|
-
| Everything centered, equal weight | One focal point per frame. Lead the eye somewhere |
|
|
104
|
-
| Uniform spacing | Tight clusters and open gaps. Vary deliberately |
|
|
105
|
-
| Same entrance on every element | Never repeat an entrance pattern in a composition |
|
|
106
|
-
| 1s duration on everything | 0.3–0.6s. Shorter than you think |
|
|
107
|
-
| `power2.out` on everything | Vary eases — no more than 2 independent tweens with the same ease (staggers are exempt) |
|
|
108
|
-
| Always dark background | Match the content: food, weddings, kids, wellness, education → light palette |
|
|
109
|
-
| Inventing colors per-element | Declare palette up front. Every element references it |
|
|
110
|
-
| Content in cards/containers | Place content directly on the canvas — separate with space and alignment, not box boundaries. Cards are a web pattern. Exception: dashboards, lower thirds, captions over footage |
|
|
111
|
-
| Hand-drawn SVG illustrations | Don't attempt to draw real-world objects (faces, buildings, food, animals) with SVG paths — they look crude. Use geometric shapes, lines, and abstract forms only. If the composition needs imagery, use text and typography to evoke it instead |
|
|
112
|
-
| Overlapping elements | Every element needs its own clear space. Check that positioned elements don't collide — stagger positions vertically with enough margin. Overlapping text is always ugly |
|
|
53
|
+
See [references/typography.md](references/typography.md) for full rules. Quick: 700-900 headlines / 300-400 body, serif + sans (not two sans), 60px+ headlines / 20px+ body.
|
|
113
54
|
|
|
114
55
|
## Palettes
|
|
115
56
|
|
|
116
|
-
|
|
57
|
+
Declare one background, one foreground, one accent before writing HTML.
|
|
117
58
|
|
|
118
59
|
| Category | Use for | File |
|
|
119
60
|
| ----------------- | --------------------------------------------- | ---------------------------------------------------------- |
|
|
@@ -127,4 +68,4 @@ Before writing any HTML, declare your palette: one background, one foreground, o
|
|
|
127
68
|
| Jewel / Rich | Luxury, events, sophisticated | [palettes/jewel-rich.md](palettes/jewel-rich.md) |
|
|
128
69
|
| Monochrome | Dramatic, typography-focused | [palettes/monochrome.md](palettes/monochrome.md) |
|
|
129
70
|
|
|
130
|
-
|
|
71
|
+
Or derive from OKLCH — pick a hue, build bg/fg/accent at different lightnesses, tint everything toward that hue.
|
|
@@ -44,7 +44,7 @@ Scan for words deserving distinct treatment:
|
|
|
44
44
|
- **Numbers/statistics** — bold weight, accent color
|
|
45
45
|
- **Emotional keywords** — exaggerated animation (overshoot, bounce)
|
|
46
46
|
- **Call-to-action** — highlight, underline, color pop
|
|
47
|
-
- **Marker highlight** — for beyond-color emphasis, see [
|
|
47
|
+
- **Marker highlight** — for beyond-color emphasis, see [css-patterns.md](css-patterns.md)
|
|
48
48
|
|
|
49
49
|
## Script-to-Style Mapping
|
|
50
50
|
|
|
@@ -121,7 +121,7 @@ tl.seek(0);
|
|
|
121
121
|
|
|
122
122
|
- [dynamic-techniques.md](dynamic-techniques.md) — karaoke, clip-path reveals, slam words, scatter exits, elastic, 3D rotation
|
|
123
123
|
- [transcript-guide.md](transcript-guide.md) — transcription commands, whisper models, external APIs
|
|
124
|
-
- [
|
|
124
|
+
- [css-patterns.md](css-patterns.md) — CSS+GSAP marker highlighting (deterministic, fully seekable)
|
|
125
125
|
|
|
126
126
|
## Constraints
|
|
127
127
|
|