hyperframes 0.6.96 → 0.6.98

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.
Files changed (77) hide show
  1. package/dist/beat-analyzer.global.js +326 -0
  2. package/dist/cli.js +3058 -1947
  3. package/dist/commands/layout-audit.browser.js +86 -0
  4. package/dist/hyperframe-runtime.js +20 -20
  5. package/dist/hyperframe.manifest.json +1 -1
  6. package/dist/hyperframe.runtime.iife.js +20 -20
  7. package/dist/skills/hyperframes-cli/SKILL.md +67 -103
  8. package/dist/skills/hyperframes-cli/references/doctor-browser.md +45 -0
  9. package/dist/skills/hyperframes-cli/references/init-and-scaffold.md +51 -0
  10. package/dist/skills/hyperframes-cli/references/lambda.md +132 -0
  11. package/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +93 -0
  12. package/dist/skills/hyperframes-cli/references/preview-render.md +107 -0
  13. package/dist/skills/hyperframes-cli/references/upgrade-info-misc.md +75 -0
  14. package/dist/studio/assets/hyperframes-player-DgsMQSvV.js +418 -0
  15. package/dist/studio/assets/index-B62bDCQv.css +1 -0
  16. package/dist/studio/assets/index-Ce3pBm_I.js +252 -0
  17. package/dist/studio/assets/{index-BWFaypdT.js → index-D-ET9M0b.js} +1 -1
  18. package/dist/studio/assets/index-D-bS9Dxx.js +1 -0
  19. package/dist/studio/index.html +2 -2
  20. package/dist/templates/_shared/AGENTS.md +46 -21
  21. package/dist/templates/_shared/CLAUDE.md +16 -14
  22. package/package.json +3 -2
  23. package/dist/pngDecodeBlitWorker.js +0 -239
  24. package/dist/skills/gsap/SKILL.md +0 -240
  25. package/dist/skills/gsap/references/effects.md +0 -297
  26. package/dist/skills/gsap/scripts/extract-audio-data.py +0 -188
  27. package/dist/skills/hyperframes/SKILL.md +0 -491
  28. package/dist/skills/hyperframes/data-in-motion.md +0 -19
  29. package/dist/skills/hyperframes/house-style.md +0 -73
  30. package/dist/skills/hyperframes/palettes/bold-energetic.md +0 -14
  31. package/dist/skills/hyperframes/palettes/clean-corporate.md +0 -14
  32. package/dist/skills/hyperframes/palettes/dark-premium.md +0 -14
  33. package/dist/skills/hyperframes/palettes/jewel-rich.md +0 -14
  34. package/dist/skills/hyperframes/palettes/monochrome.md +0 -14
  35. package/dist/skills/hyperframes/palettes/nature-earth.md +0 -14
  36. package/dist/skills/hyperframes/palettes/neon-electric.md +0 -14
  37. package/dist/skills/hyperframes/palettes/pastel-soft.md +0 -14
  38. package/dist/skills/hyperframes/palettes/warm-editorial.md +0 -14
  39. package/dist/skills/hyperframes/patterns.md +0 -191
  40. package/dist/skills/hyperframes/references/audio-reactive.md +0 -76
  41. package/dist/skills/hyperframes/references/beat-direction.md +0 -171
  42. package/dist/skills/hyperframes/references/captions.md +0 -163
  43. package/dist/skills/hyperframes/references/css-patterns.md +0 -373
  44. package/dist/skills/hyperframes/references/design-picker.md +0 -117
  45. package/dist/skills/hyperframes/references/dynamic-techniques.md +0 -102
  46. package/dist/skills/hyperframes/references/html-in-canvas-patterns.md +0 -507
  47. package/dist/skills/hyperframes/references/motion-principles.md +0 -150
  48. package/dist/skills/hyperframes/references/narration.md +0 -92
  49. package/dist/skills/hyperframes/references/prompt-expansion.md +0 -68
  50. package/dist/skills/hyperframes/references/techniques.md +0 -525
  51. package/dist/skills/hyperframes/references/text-effects.md +0 -64
  52. package/dist/skills/hyperframes/references/transcript-guide.md +0 -107
  53. package/dist/skills/hyperframes/references/transitions/catalog.md +0 -117
  54. package/dist/skills/hyperframes/references/transitions/css-3d.md +0 -12
  55. package/dist/skills/hyperframes/references/transitions/css-blur.md +0 -51
  56. package/dist/skills/hyperframes/references/transitions/css-cover.md +0 -43
  57. package/dist/skills/hyperframes/references/transitions/css-destruction.md +0 -95
  58. package/dist/skills/hyperframes/references/transitions/css-dissolve.md +0 -66
  59. package/dist/skills/hyperframes/references/transitions/css-distortion.md +0 -45
  60. package/dist/skills/hyperframes/references/transitions/css-grid.md +0 -10
  61. package/dist/skills/hyperframes/references/transitions/css-light.md +0 -49
  62. package/dist/skills/hyperframes/references/transitions/css-mechanical.md +0 -30
  63. package/dist/skills/hyperframes/references/transitions/css-other.md +0 -25
  64. package/dist/skills/hyperframes/references/transitions/css-push.md +0 -41
  65. package/dist/skills/hyperframes/references/transitions/css-radial.md +0 -37
  66. package/dist/skills/hyperframes/references/transitions/css-scale.md +0 -24
  67. package/dist/skills/hyperframes/references/transitions.md +0 -138
  68. package/dist/skills/hyperframes/references/typography.md +0 -175
  69. package/dist/skills/hyperframes/references/video-composition.md +0 -62
  70. package/dist/skills/hyperframes/scripts/animation-map.mjs +0 -601
  71. package/dist/skills/hyperframes/scripts/contrast-report.mjs +0 -348
  72. package/dist/skills/hyperframes/scripts/package-loader.mjs +0 -269
  73. package/dist/skills/hyperframes/templates/design-picker.html +0 -1432
  74. package/dist/skills/hyperframes/visual-styles.md +0 -443
  75. package/dist/studio/assets/hyperframes-player-0esDKGRk.js +0 -418
  76. package/dist/studio/assets/index-B0twsRu0.css +0 -1
  77. package/dist/studio/assets/index-BA979yF1.js +0 -251
@@ -1,41 +0,0 @@
1
- ## Linear / Push
2
-
3
- ### Push Slide
4
-
5
- Both scenes move together — new pushes old out.
6
-
7
- ```js
8
- tl.to(old, { x: -1920, duration: 0.5, ease: "power3.inOut" }, T);
9
- tl.fromTo(new, { x: 1920, opacity: 1 }, { x: 0, duration: 0.5, ease: "power3.inOut" }, T);
10
- ```
11
-
12
- ### Vertical Push
13
-
14
- Same as push slide but vertical.
15
-
16
- ```js
17
- tl.to(old, { y: -1080, duration: 0.5, ease: "power3.inOut" }, T);
18
- tl.fromTo(new, { y: 1080, opacity: 1 }, { y: 0, duration: 0.5, ease: "power3.inOut" }, T);
19
- ```
20
-
21
- ### Elastic Push
22
-
23
- Push with overshoot bounce on the incoming scene.
24
-
25
- ```js
26
- tl.to(old, { x: -1920, duration: 0.5, ease: "power3.in" }, T);
27
- tl.fromTo(new, { x: 1920, opacity: 1 }, { x: 30, duration: 0.4, ease: "power4.out" }, T + 0.1);
28
- tl.to(new, { x: -15, duration: 0.15, ease: "sine.inOut" }, T + 0.5);
29
- tl.to(new, { x: 0, duration: 0.1, ease: "sine.out" }, T + 0.65);
30
- ```
31
-
32
- ### Squeeze
33
-
34
- Old compresses, new expands from opposite side.
35
-
36
- ```js
37
- tl.to(old, { scaleX: 0, transformOrigin: "left center", duration: 0.4, ease: "power3.inOut" }, T);
38
- tl.fromTo(new, { scaleX: 0, transformOrigin: "right center", opacity: 1 },
39
- { scaleX: 1, duration: 0.4, ease: "power3.inOut" }, T + 0.1);
40
- tl.set(old, { opacity: 0 }, T + 0.5);
41
- ```
@@ -1,37 +0,0 @@
1
- ## Radial / Shape
2
-
3
- ### Circle Iris
4
-
5
- Expanding circle from center reveals new scene.
6
-
7
- ```js
8
- tl.set(new, { opacity: 1 }, T);
9
- tl.fromTo(new,
10
- { clipPath: "circle(0% at 50% 50%)" },
11
- { clipPath: "circle(75% at 50% 50%)", duration: 0.5, ease: "power2.out" }, T);
12
- tl.set(old, { opacity: 0 }, T + 0.5);
13
- ```
14
-
15
- ### Diamond Iris
16
-
17
- Expanding diamond shape from center.
18
-
19
- ```js
20
- tl.set(new, { opacity: 1 }, T);
21
- tl.fromTo(new,
22
- { clipPath: "polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%)" },
23
- { clipPath: "polygon(50% -20%, 120% 50%, 50% 120%, -20% 50%)", duration: 0.5, ease: "power2.out" }, T);
24
- tl.set(old, { opacity: 0 }, T + 0.5);
25
- ```
26
-
27
- ### Diagonal Split
28
-
29
- Old scene shrinks to a triangle in one corner.
30
-
31
- ```js
32
- tl.set(new, { opacity: 1, zIndex: 1 }, T);
33
- tl.set(old, { zIndex: 10, clipPath: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)" }, T);
34
- tl.to(old, { clipPath: "polygon(60% 0%, 100% 0%, 100% 40%, 60% 0%)", duration: 0.5, ease: "power3.inOut" }, T);
35
- tl.set(old, { opacity: 0, zIndex: "auto", clipPath: "none" }, T + 0.5);
36
- tl.set(new, { zIndex: "auto" }, T + 0.5);
37
- ```
@@ -1,24 +0,0 @@
1
- ## Scale / Zoom
2
-
3
- ### Zoom Through
4
-
5
- Old zooms past camera + blurs, new zooms in from behind.
6
-
7
- ```js
8
- tl.to(old, { scale: 2.5, opacity: 0, filter: "blur(8px)", duration: 0.4, ease: "power3.in" }, T);
9
- tl.fromTo(new,
10
- { scale: 0.5, opacity: 0, filter: "blur(8px)" },
11
- { scale: 1, opacity: 1, filter: "blur(0px)", duration: 0.4, ease: "power3.out" }, T + 0.15);
12
- ```
13
-
14
- ### Zoom Out
15
-
16
- Old shrinks away, new was behind it. Needs z-index management.
17
-
18
- ```js
19
- tl.set(new, { opacity: 1, zIndex: 1 }, T);
20
- tl.set(old, { zIndex: 10, transformOrigin: "50% 50%" }, T);
21
- tl.to(old, { scale: 0.3, opacity: 0, duration: 0.4, ease: "power3.in" }, T);
22
- tl.set(old, { zIndex: "auto" }, T + 0.4);
23
- tl.set(new, { zIndex: "auto" }, T + 0.4);
24
- ```
@@ -1,138 +0,0 @@
1
- # Scene Transitions
2
-
3
- A transition tells the viewer how two scenes relate. A crossfade says "this continues." A push slide says "next point." A blur crossfade says "drift with me." Choose transitions that match what the content is doing emotionally, not just technically.
4
-
5
- ## Animation Rules for Multi-Scene Compositions
6
-
7
- These are non-negotiable for every multi-scene composition:
8
-
9
- 1. **Every composition uses transitions.** No exceptions. Scenes without transitions feel like jump cuts.
10
- 2. **Every scene uses entrance animations.** Elements animate IN via `gsap.from()` — opacity, position, scale, etc. No scene should pop fully-formed onto screen.
11
- 3. **Exit animations are BANNED** except on the final scene. Do NOT use `gsap.to()` to animate elements out before a transition fires. The transition IS the exit. Outgoing scene content must be fully visible when the transition starts — the transition handles the visual handoff.
12
- 4. **Final scene exception:** The last scene MAY fade elements out (e.g., fade to black at the end of the composition). This is the only scene where exit animations are allowed.
13
-
14
- ## Energy → Transition Character
15
-
16
- The energy of a beat tells you what motion character the transition should have — not which specific transition to use. The motion character is a quality you derive from the brand and content, then find a transition that has that quality.
17
-
18
- **Soft/organic character:** transitions that breathe, dissolve, or drift. Nothing sharp, mechanical, or percussive. Duration 0.5–0.8s, smooth easing curves.
19
-
20
- **Directional/purposeful character:** transitions that move content decisively. Clear direction, readable momentum. Duration 0.3–0.5s, clean deceleration.
21
-
22
- **Percussive/instant character:** transitions that hit like a cut. Immediate, almost hard-cut energy. Duration 0.15–0.3s, aggressive or near-instant easing.
23
-
24
- These are calibration ranges, not recipes. A brand that treats its "high energy" section with restraint might use 0.4s for a moment that another brand transitions in 0.2s — both are correct for their brand. Pick ONE character that defines the video's primary transitions, then use 1–2 contrasting moments as intentional accents. See the **Mood → Motion Quality** section below to find transitions with the right character for a given mood.
25
-
26
- ## Mood → Motion Quality
27
-
28
- Think about what the transition _communicates_, not what it looks like. The question is: **what motion quality serves this mood?** Then find transitions that have that quality in the catalog (`transitions/catalog.md`).
29
-
30
- | Mood | Motion quality that fits | Why |
31
- | ------------------------ | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
32
- | **Warm / inviting** | Soft edges, dissolving, color-temperature washes — nothing sharp, mechanical, or percussive | Warmth reads as continuity and flow; hard cuts or compression feel cold |
33
- | **Cold / clinical** | Mechanical transformation — compression, slicing, gridding, precision | The content appears to be processed or structured, reinforcing a systematic quality |
34
- | **Editorial / magazine** | Clean directional movement — like turning a page | Feels like content is being browsed or curated, not revealed |
35
- | **Tech / futuristic** | Data-like fragmentation, digital displacement, scan artifacts | Transition feels computational rather than physical |
36
- | **Tense / edgy** | Instability, distortion, displacement — something slightly wrong about the image | Introduces friction where smooth transitions would release tension |
37
- | **Playful / fun** | Overshoot, expansion, rotation — motion with personality and bounce | Transitions that feel like objects rather than effects |
38
- | **Dramatic / cinematic** | Scale, weight, light extremes — the cut is an event, not a bridge | Every shader and every hard cut carries narrative gravity |
39
- | **Premium / luxury** | Restraint — transitions that are barely visible, or invisible | Luxury communicates through what it withholds |
40
- | **Retro / analog** | Organic imperfection — light bleed, scan lines, color wash | Physical film artifacts; imperfection as authenticity |
41
-
42
- Use this table to derive what **quality** the transition should have, then look at the specific options in `transitions/catalog.md` to find one that has that quality for this brand. The transitions listed in the catalog are all available; none are reserved for a specific mood.
43
-
44
- ## Narrative Position
45
-
46
- Each position in the video has a different job to do. What transition you pick for each should come from the brand's motion character and the storyboard's intent — not from a rule about "climax = boldest."
47
-
48
- - **Opening** — establishes the motion language for the entire video. Make a deliberate choice; whatever you pick here sets the viewer's expectation for everything that follows.
49
- - **Between related points** — should be almost invisible. The content is continuing; the transition shouldn't draw attention to itself. Consistency matters more than distinctiveness here.
50
- - **Topic change** — needs enough contrast from your primary that it signals "something different is starting." The contrast is in motion character, not just duration.
51
- - **Climax / hero reveal** — this is the moment the video has been building to. The transition should feel earned by what came before. "Use your boldest transition here" is a default, not a rule — the climax of a restrained editorial piece might be a hard cut.
52
- - **Wind-down** — returns to a motion character that allows the viewer to exhale. Matches the opening in tone, not necessarily in technique.
53
- - **Outro** — no new energy. Slowest and simplest in the video. Closure.
54
-
55
- ## Blur and Motion Intensity
56
-
57
- Blur and duration should express the energy of the content, not match a lookup table. The ranges below are calibration references — starting points to adjust from based on what the brand and storyboard call for.
58
-
59
- Higher-energy transitions: shorter duration, less blur, no hold at peak. The motion is immediate.
60
- Lower-energy transitions: longer duration, more blur, longer hold at peak. The motion has weight.
61
-
62
- Calibration ranges (not prescriptions):
63
-
64
- - Soft/organic: blur 20–30px, duration 0.8–1.2s, hold 0.3–0.5s
65
- - Directional/purposeful: blur 8–15px, duration 0.4–0.6s, hold 0.1–0.2s
66
- - Percussive/instant: blur 3–6px, duration 0.2–0.3s, no hold
67
-
68
- A brand that uses these as a formula will produce transitions that feel the same across every video. A brand-derived choice asks: what blur and duration expresses the weight this transition should have?
69
-
70
- ## Presets
71
-
72
- | Preset | Duration | Easing |
73
- | ---------- | -------- | ----------------- |
74
- | `snappy` | 0.2s | `power4.inOut` |
75
- | `smooth` | 0.4s | `power2.inOut` |
76
- | `gentle` | 0.6s | `sine.inOut` |
77
- | `dramatic` | 0.5s | `power3.in` → out |
78
- | `instant` | 0.15s | `expo.inOut` |
79
- | `luxe` | 0.7s | `power1.inOut` |
80
-
81
- ## Implementation
82
-
83
- Read [transitions/catalog.md](transitions/catalog.md) for GSAP code and hard rules for every transition type.
84
-
85
- | Category | CSS | Shader (WebGL) |
86
- | ----------- | -------------------------------------------------------------- | ------------------------------------------------------------------------- |
87
- | Push/slide | Push slide, vertical push, elastic push, squeeze | Whip pan |
88
- | Scale/zoom | Zoom through, zoom out, gravity drop, 3D flip | Cinematic zoom, gravitational lens |
89
- | Reveal/mask | Circle iris, diamond iris, diagonal split, clock wipe, shutter | SDF iris |
90
- | Dissolve | Crossfade, blur crossfade, focus pull, color dip | Cross-warp morph, domain warp |
91
- | Cover | Staggered blocks, horizontal blinds, vertical blinds | — |
92
- | Light | Light leak, overexposure burn, film burn | Light leak (shader), thermal distortion |
93
- | Distortion | Glitch, chromatic aberration, ripple, VHS tape | Glitch (shader), chromatic split, ridged burn, ripple waves, swirl vortex |
94
- | Pattern | Grid dissolve, morph circle | — |
95
-
96
- ## Transitions That Don't Work in CSS
97
-
98
- Avoid: star iris, tilt-shift, lens flare, hinge/door. See catalog.md for why.
99
-
100
- ## CSS vs Shader
101
-
102
- CSS transitions animate scene containers with opacity, transforms, clip-path, and filters. Shader transitions composite both scene textures per-pixel on a WebGL canvas — they can warp, dissolve, and morph in ways CSS cannot.
103
-
104
- **Both are first-class options.** Shaders are provided by the `@hyperframes/shader-transitions` package — import from the package instead of writing raw GLSL. CSS transitions are simpler to set up. Choose based on the effect you want, not based on which is easier.
105
-
106
- **Mixing is supported.** You can have some transitions use WebGL shaders and others use a CSS crossfade in the same composition. Omit the `shader` field on any `TransitionConfig` entry to get a smooth opacity crossfade instead of a WebGL effect:
107
-
108
- ```js
109
- var tl = HyperShader.init({
110
- bgColor: "#000",
111
- accentColor: "#6366f1",
112
- scenes: ["s1", "s2", "s3", "s4"],
113
- transitions: [
114
- { time: 4.0, shader: "sdf-iris", duration: 0.7 }, // WebGL shader
115
- { time: 8.5, duration: 0.8 }, // no shader → CSS crossfade
116
- { time: 13.0, shader: "domain-warp", duration: 0.6 }, // WebGL shader
117
- ],
118
- });
119
- ```
120
-
121
- HyperShader manages all scene visibility regardless of transition type. Let it create the timeline (don't pass `timeline:` into `init()`) and add your beat animations to the returned `tl` after the call.
122
-
123
- ## Shader-Compatible CSS Rules
124
-
125
- Shader transitions capture DOM scenes to WebGL textures via html2canvas. The canvas 2D rendering pipeline doesn't match CSS exactly. Follow these rules to avoid visible artifacts at transition boundaries:
126
-
127
- 1. **No `transparent` keyword in gradients.** Canvas interpolates `transparent` as `rgba(0,0,0,0)` (black at zero alpha), creating dark fringes. Always use the target color at zero alpha: `rgba(200,117,51,0)` not `transparent`.
128
- 2. **No gradient backgrounds on elements thinner than 4px.** Canvas can't match CSS gradient rendering on 1-2px elements. Use solid `background-color` on thin accent lines.
129
- 3. **No CSS variables (`var()`) on elements visible during capture.** html2canvas doesn't reliably resolve custom properties. Use literal color values in inline styles.
130
- 4. **Mark uncapturable decorative elements with `data-no-capture`.** The capture function skips these. They're present on the live DOM but absent from the shader texture. Use for elements that can't follow the rules above.
131
- 5. **No gradient opacity below 0.15.** Gradient elements below 10% opacity render differently in canvas vs CSS. Increase to 0.15+ or use a solid color at equivalent brightness.
132
- 6. **Every `.scene` div must have explicit `background-color`, AND pass the same color as `bgColor` in the `init()` config.** The package captures scene elements via html2canvas. Both the CSS `background-color` on `.scene` and the `bgColor` config must match. Without either, the texture renders as black.
133
-
134
- These rules only apply to shader transition compositions. CSS-only compositions have no restrictions.
135
-
136
- ## Visual Pattern Warning
137
-
138
- Avoid transitions that create visible repeating geometric patterns — grids of tiles, hexagonal cells, uniform dot arrays, evenly-spaced blob circles. These look cheap and artificial regardless of the math behind them. Organic noise (FBM, domain warping) is good because it's irregular. Geometric repetition is bad because the eye instantly sees the grid.
@@ -1,175 +0,0 @@
1
- # Typography
2
-
3
- The compiler embeds supported fonts — just write `font-family` in CSS.
4
-
5
- ## Banned
6
-
7
- Training-data defaults that every LLM reaches for. These produce monoculture across compositions.
8
-
9
- Inter, Roboto, Open Sans, Noto Sans, Arimo, Lato, Source Sans, PT Sans, Nunito, Poppins, Outfit, Sora, Playfair Display, Cormorant Garamond, Bodoni Moda, EB Garamond, Cinzel, Prata, Syne
10
-
11
- **Syne in particular** is the most overused "distinctive" display font. It is an instant AI design tell.
12
-
13
- ## Guardrails
14
-
15
- You know these rules but you violate them. Stop.
16
-
17
- - **Don't pair two sans-serifs.** You do this constantly — one for headlines, one for body. Cross the boundary: serif + sans, or sans + mono.
18
- - **One expressive font per scene.** You pick two interesting fonts trying to make it "better." One performs, one recedes.
19
- - **Weight contrast must be extreme.** You default to 400 vs 700. Video needs 300 vs 900. The difference must be visible in motion at a glance.
20
- - **Video sizes, not web sizes.** Body: 20px minimum. Headlines: 60px+. Data labels: 16px. You will try to use 14px. Don't.
21
-
22
- ## What You Don't Do Without Being Told
23
-
24
- - **Tension should mean something.** Don't pattern-match pairings. Ask WHY these two fonts disagree. The pairing should embody the content's contradiction — mechanical vs human, public vs private, institutional vs personal. If you can't articulate the tension, it's arbitrary.
25
- - **Register switching.** Assign different fonts to different communicative modes — one voice for statements, another for data, another for attribution. Not hierarchy on a page. Voices in a conversation.
26
- - **Tension can live inside a single font.** A font that looks familiar but is secretly strange creates tension with the viewer's expectations, not with another font.
27
- - **One variable changed = dramatic contrast.** Same letterforms, monospaced vs proportional. Same family at different optical sizes. Changing only rhythm while everything else stays constant.
28
- - **Double personality works.** Two expressive fonts can coexist if they share an attitude (both irreverent, both precise) even when their forms are completely different.
29
- - **Time is hierarchy.** The first element to appear is the most important. In video, sequence replaces position.
30
- - **Motion is typography.** How a word enters carries as much meaning as the font. A 0.1s slam vs a 2s fade — same font, completely different message.
31
- - **Fixed reading time.** 3 seconds on screen = must be readable in 2. Fewer words, larger type.
32
- - **Tracking tighter than web.** -0.03em to -0.05em on display sizes. Video encoding compresses letter detail.
33
-
34
- ## Finding Fonts
35
-
36
- Don't default to what you know. If the content is luxury, a grotesque sans might create more tension than the expected Didone serif. Decide the register first, then search.
37
-
38
- Save this script to `/tmp/fontquery.py` and run with `curl -s 'https://fonts.google.com/metadata/fonts' > /tmp/gfonts.json && python3 /tmp/fontquery.py /tmp/gfonts.json`:
39
-
40
- ```python
41
- import json, sys, random
42
- from collections import OrderedDict
43
-
44
- random.seed() # true random each run
45
-
46
- with open(sys.argv[1]) as f:
47
- data = json.load(f)
48
- fonts = data.get("familyMetadataList", [])
49
-
50
- ban = {"Inter","Roboto","Open Sans","Noto Sans","Lato","Poppins","Source Sans 3",
51
- "PT Sans","Nunito","Outfit","Sora","Playfair Display","Cormorant Garamond",
52
- "Bodoni Moda","EB Garamond","Cinzel","Prata","Arimo","Source Sans Pro","Syne"}
53
- skip_pfx = ("Roboto","Noto ","Google Sans","Bpmf","Playwrite","Anek","BIZ ",
54
- "Nanum","Shippori","Sawarabi","Zen ","Kaisei","Kiwi ","Yuji ","Radio ")
55
-
56
- def ok(f):
57
- if f["family"] in ban: return False
58
- if any(f["family"].startswith(b) for b in skip_pfx): return False
59
- if "latin" not in (f.get("subsets") or []): return False
60
- return True
61
-
62
- seen = set()
63
- R = OrderedDict()
64
-
65
- # Trending Sans — recent (2022+), popular (<300)
66
- R["Trending Sans"] = []
67
- for f in fonts:
68
- if not ok(f) or f["family"] in seen: continue
69
- if f.get("category") in ("Sans Serif","Display") and f.get("dateAdded","") >= "2022-01-01" and f.get("popularity",9999) < 300:
70
- R["Trending Sans"].append(f); seen.add(f["family"])
71
-
72
- # Trending Serif — recent (2018+), popular (<600)
73
- R["Trending Serif"] = []
74
- for f in fonts:
75
- if not ok(f) or f["family"] in seen: continue
76
- if f.get("category") == "Serif" and f.get("dateAdded","") >= "2018-01-01" and f.get("popularity",9999) < 600:
77
- R["Trending Serif"].append(f); seen.add(f["family"])
78
-
79
- # Monospace — recent (2018+), popular (<600)
80
- R["Monospace"] = []
81
- for f in fonts:
82
- if not ok(f) or f["family"] in seen: continue
83
- if f.get("category") == "Monospace" and f.get("dateAdded","") >= "2018-01-01" and f.get("popularity",9999) < 600:
84
- R["Monospace"].append(f); seen.add(f["family"])
85
-
86
- # Impact & Condensed — heavy display fonts with 800+ weight
87
- R["Impact & Condensed"] = []
88
- for f in fonts:
89
- if not ok(f) or f["family"] in seen: continue
90
- has_heavy = any(k in list(f.get("fonts",{}).keys()) for k in ("800","900"))
91
- is_display = f.get("category") in ("Sans Serif","Display")
92
- if has_heavy and is_display and f.get("popularity",9999) < 400:
93
- R["Impact & Condensed"].append(f); seen.add(f["family"])
94
-
95
- # Script & Handwriting — popular (<300)
96
- R["Script & Handwriting"] = []
97
- for f in fonts:
98
- if not ok(f) or f["family"] in seen: continue
99
- if f.get("category") == "Handwriting" and f.get("popularity",9999) < 300:
100
- R["Script & Handwriting"].append(f); seen.add(f["family"])
101
-
102
-
103
- # Randomize the top 5 in each category so the LLM doesn't always pick the same first result
104
- for cat in R:
105
- R[cat].sort(key=lambda x: x.get("popularity",9999))
106
- top5 = R[cat][:5]
107
- rest = R[cat][5:]
108
- random.shuffle(top5)
109
- R[cat] = top5 + rest
110
- limits = {"Trending Sans":15,"Trending Serif":12,"Monospace":8,
111
- "Impact & Condensed":12,"Script & Handwriting":10}
112
- for cat in R:
113
- items = R[cat][:limits.get(cat,10)]
114
- if not items: continue
115
- print(f"--- {cat} ({len(items)}) ---")
116
- for ff in items:
117
- var = "VAR" if ff.get("axes") else " "
118
- print(f' {ff.get("popularity"):4d} | {var} | {ff["family"]}')
119
- print()
120
- ```
121
-
122
- Five categories: trending sans, trending serif, monospace, impact/condensed, script/handwriting. All dynamically filtered from Google Fonts metadata — no hardcoded font names. Cross classification boundaries when pairing.
123
-
124
- ## Selection Thinking
125
-
126
- Don't pick fonts by category reflex (editorial → serif, tech → mono, modern → geometric sans). That's pattern matching, not design.
127
-
128
- 1. **Name the register.** What voice is the content speaking in? Institutional authority? Personal confession? Technical precision? Casual irreverence? The register narrows the field more than the category.
129
- 2. **Think physically.** Imagine the font as a physical object the brand could ship — a museum exhibit caption, a hand-painted shop sign, a 1970s mainframe terminal manual, a fabric label inside a coat, a children's book printed on cheap newsprint, a tax form. Whichever physical object fits the register is pointing at the right _kind_ of typeface.
130
- 3. **Reject your first instinct.** The first font that feels right is usually your training-data default for that register. If you picked it last time too, find something else.
131
- 4. **Cross-check the assumption.** An editorial brief does NOT need a serif. A technical brief does NOT need a sans. A children's product does NOT need a rounded display font. The most distinctive choice often contradicts the category expectation.
132
-
133
- ## Similar-Font Pairing
134
-
135
- Never pair two fonts that are similar but not identical — two geometric sans-serifs, two transitional serifs, two humanist sans. They create visual friction without clear hierarchy. The viewer senses something is "off" but can't articulate it. Either use one font at two weights, or pair fonts that contrast on multiple axes: serif + sans, condensed + wide, geometric + humanist.
136
-
137
- ## Dark Backgrounds
138
-
139
- Light text on dark backgrounds creates two optical illusions you need to compensate for:
140
-
141
- - **Increased apparent weight.** Light-on-dark reads heavier than dark-on-light at the same `font-weight`. Use 350 instead of 400 for body text. Headlines are less affected because size compensates.
142
- - **Tighter apparent spacing.** Light halos around letterforms reduce perceived gaps. Increase `line-height` by 0.05-0.1 beyond your light-background value. For display sizes, add 0.01em `letter-spacing` to counteract.
143
-
144
- ## OpenType Features for Data
145
-
146
- Most fonts ship with OpenType features that are off by default. Turn them on for data compositions:
147
-
148
- ```css
149
- /* Tabular numbers — digits align vertically in columns */
150
- .stat-value,
151
- .timer,
152
- .data-column {
153
- font-variant-numeric: tabular-nums;
154
- }
155
-
156
- /* Diagonal fractions — renders 1/2 as ½ */
157
- .recipe-amount,
158
- .ratio {
159
- font-variant-numeric: diagonal-fractions;
160
- }
161
-
162
- /* Small caps for abbreviations — less visual shouting */
163
- .abbreviation,
164
- .unit {
165
- font-variant-caps: all-small-caps;
166
- }
167
-
168
- /* Disable ligatures in code — fi, fl, ffi should stay separate */
169
- code,
170
- .code {
171
- font-variant-ligatures: none;
172
- }
173
- ```
174
-
175
- `tabular-nums` is essential any time numbers are stacked vertically — stat callouts, timers, scoreboards, data tables. Without it, digits have proportional widths and columns don't align.
@@ -1,62 +0,0 @@
1
- # Video Composition
2
-
3
- Video frames are not web pages. These rules apply to every composition regardless of brand, style, or design spec.
4
-
5
- ## The Design Spec Is Brand, Not Layout
6
-
7
- The design spec (`frame.md` or `design.md`) defines what the brand looks like: colors, fonts, personality, constraints. It does NOT define how to compose a video frame. Use brand colors at video-appropriate intensity — not at web-UI opacity.
8
-
9
- **Strict from the spec:** hex values (including background color), font families, weight relationships, Do's and Don'ts. If the user chose a light canvas, use a light canvas. If they chose dark, use dark. Do not override their palette.
10
-
11
- **Adapt for video:** type sizes, spacing, decorative opacity, border weight, component treatments. A web UI card at `border: 1px solid #e2e3e6` with `box-shadow: 0 2px 4px rgba(0,0,0,0.06)` is invisible on video. The brand color is sacred; the application is yours.
12
-
13
- ## Density
14
-
15
- A beat with 3 elements looks empty. A beat with 8-10 feels alive.
16
-
17
- Every scene needs:
18
-
19
- - **Background texture** — radial glow, oversized ghost type, color panel, grain, grid. Never solid flat color.
20
- - **Midground content** — the actual message. Cards, stats, code blocks, images.
21
- - **Foreground accents** — dividers, labels, data bars, registration marks, monospace metadata. The details that make it feel produced, not generated.
22
-
23
- Aim for 8-10 visual elements per scene. Two of those should be decorative elements the user didn't ask for — you add them because empty frames look broken.
24
-
25
- ## Color Presence
26
-
27
- Muted is fine. Flat is not. Every scene should have at least one color that pulls the eye.
28
-
29
- - Brand accent should be VISIBLE — not a 5% opacity glow lost in compression. 15-25% for atmospheric, full saturation for focal elements.
30
- - **Light canvases work differently than dark.** On dark: accent glows pop naturally. On light: use bolder borders (2px+ solid), stronger structural elements (rules, dividers), and full-saturation accent hits. Light backgrounds need texture (subtle grain, patterns) to avoid the "blank slide" feel. Don't switch to dark — make light cinematic.
31
- - Tint neutrals toward the brand hue. Dead gray reads as undesigned.
32
-
33
- ## Scale
34
-
35
- Web sizes are invisible on video. Everything scales up.
36
-
37
- | Element | Web | Video |
38
- | ------------------ | ------- | -------- |
39
- | Headlines | 32-48px | 64-120px |
40
- | Body text | 14-16px | 28-42px |
41
- | Labels | 12px | 18-24px |
42
- | Decorative opacity | 3-8% | 12-25% |
43
- | Borders | 1px | 2-4px |
44
- | Padding | 16-32px | 60-140px |
45
-
46
- If you're writing a font-size under 24px in a video composition, justify it. If you're writing decorative opacity under 10%, it's invisible.
47
-
48
- ## Motion Intensity
49
-
50
- Subtle reads as static at 30fps. Err toward more movement than feels safe.
51
-
52
- - Every decorative element should have ambient motion: breathe, drift, pulse, orbit. Static decoratives feel dead.
53
- - Vary motion per scene — don't repeat the same ambient pattern.
54
- - Scene entrances should use 3+ different eases and directions. If every element enters from `y: 30, opacity: 0`, the scene has no choreography.
55
-
56
- ## Frame Composition
57
-
58
- - **Two focal points minimum.** The eye needs somewhere to travel.
59
- - **Fill the frame.** Hero text: 60-80% of frame width.
60
- - **Anchor to edges.** Pin content to left/top or right/bottom. Centered-and-floating is a web layout pattern.
61
- - **Split frames.** Data panel left, content right. Top bar with metadata, full-width below. Zone-based layouts over centered stacks.
62
- - **Structural elements.** Rules, dividers, border panels. They create visual paths and animate well (`scaleX: 0` → `1`).