hyperframes 0.1.6 → 0.1.8
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 +249 -103
- package/dist/hyperframe-runtime.js +3 -3
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +3 -3
- package/dist/skills/captions/SKILL.md +138 -0
- package/dist/skills/compose-video/SKILL.md +150 -0
- package/dist/skills/compose-video/data-in-motion.md +19 -0
- package/dist/skills/compose-video/house-style.md +130 -0
- package/dist/skills/compose-video/palettes/bold-energetic.md +14 -0
- package/dist/skills/compose-video/palettes/clean-corporate.md +14 -0
- package/dist/skills/compose-video/palettes/dark-premium.md +14 -0
- package/dist/skills/compose-video/palettes/jewel-rich.md +14 -0
- package/dist/skills/compose-video/palettes/monochrome.md +14 -0
- package/dist/skills/compose-video/palettes/nature-earth.md +14 -0
- package/dist/skills/compose-video/palettes/neon-electric.md +14 -0
- package/dist/skills/compose-video/palettes/pastel-soft.md +14 -0
- package/dist/skills/compose-video/palettes/warm-editorial.md +14 -0
- package/dist/skills/compose-video/patterns.md +118 -0
- package/dist/templates/_shared/CLAUDE.md +50 -0
- package/package.json +7 -2
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# Composition Patterns
|
|
2
|
+
|
|
3
|
+
## Picture-in-Picture (Video in a Frame)
|
|
4
|
+
|
|
5
|
+
Animate a wrapper div for position/size. The video fills the wrapper. The wrapper has NO data attributes.
|
|
6
|
+
|
|
7
|
+
```html
|
|
8
|
+
<div
|
|
9
|
+
id="pip-frame"
|
|
10
|
+
style="position:absolute;top:0;left:0;width:1920px;height:1080px;z-index:50;overflow:hidden;"
|
|
11
|
+
>
|
|
12
|
+
<video
|
|
13
|
+
id="el-video"
|
|
14
|
+
data-start="0"
|
|
15
|
+
data-duration="60"
|
|
16
|
+
data-track-index="0"
|
|
17
|
+
src="talking-head.mp4"
|
|
18
|
+
muted
|
|
19
|
+
playsinline
|
|
20
|
+
></video>
|
|
21
|
+
</div>
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
tl.to(
|
|
26
|
+
"#pip-frame",
|
|
27
|
+
{ top: 700, left: 1360, width: 500, height: 280, borderRadius: 16, duration: 1 },
|
|
28
|
+
10,
|
|
29
|
+
);
|
|
30
|
+
tl.to("#pip-frame", { left: 40, duration: 0.6 }, 30);
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Title Card with Fade
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<div
|
|
37
|
+
id="title-card"
|
|
38
|
+
data-start="0"
|
|
39
|
+
data-duration="5"
|
|
40
|
+
data-track-index="5"
|
|
41
|
+
style="display:flex;align-items:center;justify-content:center;background:#111;z-index:60;"
|
|
42
|
+
>
|
|
43
|
+
<h1 style="font-size:64px;color:#fff;opacity:0;">My Video Title</h1>
|
|
44
|
+
</div>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
```js
|
|
48
|
+
tl.to("#title-card h1", { opacity: 1, duration: 0.6 }, 0.3);
|
|
49
|
+
tl.to("#title-card", { opacity: 0, duration: 0.5 }, 4);
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Slide Show with Section Headers
|
|
53
|
+
|
|
54
|
+
Use separate elements on the same track, each with its own time range. Slides auto-mount/unmount based on `data-start`/`data-duration`.
|
|
55
|
+
|
|
56
|
+
```html
|
|
57
|
+
<div class="slide" data-start="0" data-duration="30" data-track-index="3">...</div>
|
|
58
|
+
<div class="slide" data-start="30" data-duration="25" data-track-index="3">...</div>
|
|
59
|
+
<div class="slide" data-start="55" data-duration="20" data-track-index="3">...</div>
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Top-Level Composition Example
|
|
63
|
+
|
|
64
|
+
```html
|
|
65
|
+
<div
|
|
66
|
+
id="comp-1"
|
|
67
|
+
data-composition-id="my-video"
|
|
68
|
+
data-start="0"
|
|
69
|
+
data-duration="60"
|
|
70
|
+
data-width="1920"
|
|
71
|
+
data-height="1080"
|
|
72
|
+
>
|
|
73
|
+
<!-- Primitive clips -->
|
|
74
|
+
<video
|
|
75
|
+
id="el-1"
|
|
76
|
+
data-start="0"
|
|
77
|
+
data-duration="10"
|
|
78
|
+
data-track-index="0"
|
|
79
|
+
src="..."
|
|
80
|
+
muted
|
|
81
|
+
playsinline
|
|
82
|
+
></video>
|
|
83
|
+
<video
|
|
84
|
+
id="el-2"
|
|
85
|
+
data-start="el-1"
|
|
86
|
+
data-duration="8"
|
|
87
|
+
data-track-index="0"
|
|
88
|
+
src="..."
|
|
89
|
+
muted
|
|
90
|
+
playsinline
|
|
91
|
+
></video>
|
|
92
|
+
<img id="el-3" data-start="5" data-duration="4" data-track-index="1" src="..." />
|
|
93
|
+
<audio id="el-4" data-start="0" data-duration="30" data-track-index="2" src="..." />
|
|
94
|
+
|
|
95
|
+
<!-- Sub-compositions loaded from files -->
|
|
96
|
+
<div
|
|
97
|
+
id="el-5"
|
|
98
|
+
data-composition-id="intro-anim"
|
|
99
|
+
data-composition-src="compositions/intro-anim.html"
|
|
100
|
+
data-start="0"
|
|
101
|
+
data-track-index="3"
|
|
102
|
+
></div>
|
|
103
|
+
|
|
104
|
+
<div
|
|
105
|
+
id="el-6"
|
|
106
|
+
data-composition-id="captions"
|
|
107
|
+
data-composition-src="compositions/caption-overlay.html"
|
|
108
|
+
data-start="0"
|
|
109
|
+
data-track-index="4"
|
|
110
|
+
></div>
|
|
111
|
+
|
|
112
|
+
<script>
|
|
113
|
+
// Just register the timeline — framework auto-nests sub-compositions
|
|
114
|
+
const tl = gsap.timeline({ paused: true });
|
|
115
|
+
window.__timelines["my-video"] = tl;
|
|
116
|
+
</script>
|
|
117
|
+
</div>
|
|
118
|
+
```
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# HyperFrames Composition Project
|
|
2
|
+
|
|
3
|
+
## Skills — USE THESE FIRST
|
|
4
|
+
|
|
5
|
+
**Always invoke the relevant skill before writing or modifying compositions.** Skills encode framework-specific patterns (e.g., `class="clip"`, `window.__timelines`, `data-*` attributes) that are NOT in generic web docs. Skipping them produces broken compositions.
|
|
6
|
+
|
|
7
|
+
| Skill | Command | When to use |
|
|
8
|
+
| -------------------- | ------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
9
|
+
| **compose-video** | `/compose-video` | Creating or editing ANY HTML composition — videos, animations, title cards, overlays, sub-compositions |
|
|
10
|
+
| **captions** | `/captions` | Building captions from whisper transcripts — style detection, per-word styling |
|
|
11
|
+
| **gsap-core** | `/gsap-core` | GSAP tweens: `gsap.to()`, `from()`, `fromTo()`, easing, stagger, defaults |
|
|
12
|
+
| **gsap-timeline** | `/gsap-timeline` | Timeline sequencing, position parameter, labels, nesting |
|
|
13
|
+
| **gsap-performance** | `/gsap-performance` | Animation performance — transforms over layout props, will-change, batching |
|
|
14
|
+
|
|
15
|
+
> **Skills not available?** Ask the user to run `npx hyperframes skills` and restart their
|
|
16
|
+
> agent session, or install manually: `npx skills add heygen-com/hyperframes` and
|
|
17
|
+
> `npx skills add greensock/gsap-skills`.
|
|
18
|
+
|
|
19
|
+
## Commands
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx hyperframes dev # preview in browser (studio editor)
|
|
23
|
+
npx hyperframes render # render to MP4
|
|
24
|
+
npx hyperframes lint # validate compositions
|
|
25
|
+
npx hyperframes docs <topic> # reference docs in terminal
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Available doc topics: `data-attributes`, `gsap`, `compositions`, `rendering`, `templates`, `troubleshooting`
|
|
29
|
+
|
|
30
|
+
Full docs: [hyperframes.heygen.com](https://hyperframes.heygen.com)
|
|
31
|
+
|
|
32
|
+
## Project Structure
|
|
33
|
+
|
|
34
|
+
- `index.html` — main composition (root timeline)
|
|
35
|
+
- `compositions/` — sub-compositions referenced via `data-composition-src`
|
|
36
|
+
- `meta.json` — project metadata (id, name)
|
|
37
|
+
- `transcript.json` — whisper word-level transcript (if generated)
|
|
38
|
+
|
|
39
|
+
## Key Rules
|
|
40
|
+
|
|
41
|
+
1. Every timed element needs `data-start`, `data-duration`, and `data-track-index`
|
|
42
|
+
2. Elements with timing **MUST** have `class="clip"` — the framework uses this for visibility control
|
|
43
|
+
3. Timelines must be paused and registered on `window.__timelines`:
|
|
44
|
+
```js
|
|
45
|
+
window.__timelines = window.__timelines || {};
|
|
46
|
+
window.__timelines["composition-id"] = gsap.timeline({ paused: true });
|
|
47
|
+
```
|
|
48
|
+
4. Videos use `muted` with a separate `<audio>` element for the audio track
|
|
49
|
+
5. Sub-compositions use `data-composition-src="compositions/file.html"` to reference other HTML files
|
|
50
|
+
6. Only deterministic logic — no `Date.now()`, no `Math.random()`, no network fetches
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hyperframes",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "HyperFrames CLI — create, preview, and render HTML video compositions",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/heygen-com/hyperframes",
|
|
8
|
+
"directory": "packages/cli"
|
|
9
|
+
},
|
|
5
10
|
"bin": {
|
|
6
11
|
"hyperframes": "./dist/cli.js"
|
|
7
12
|
},
|
|
@@ -15,7 +20,7 @@
|
|
|
15
20
|
"build:fonts": "cd ../producer && tsx scripts/generate-font-data.ts",
|
|
16
21
|
"build:studio": "cd ../studio && bun run build",
|
|
17
22
|
"build:runtime": "tsx scripts/build-runtime.ts",
|
|
18
|
-
"build:copy": "mkdir -p dist/studio dist/docs dist/templates && cp -r ../studio/dist/* dist/studio/ && cp -r src/templates/blank src/templates/warm-grain src/templates/play-mode src/templates/swiss-grid src/templates/vignelli dist/templates/ && (cp src/docs/*.md dist/docs/ 2>/dev/null || true)",
|
|
23
|
+
"build:copy": "mkdir -p dist/studio dist/docs dist/templates dist/skills && cp -r ../studio/dist/* dist/studio/ && cp -r src/templates/blank src/templates/warm-grain src/templates/play-mode src/templates/swiss-grid src/templates/vignelli src/templates/_shared dist/templates/ && cp -r ../../skills/compose-video ../../skills/captions dist/skills/ && (cp src/docs/*.md dist/docs/ 2>/dev/null || true)",
|
|
19
24
|
"typecheck": "tsc --noEmit"
|
|
20
25
|
},
|
|
21
26
|
"dependencies": {
|