hyperframes 0.1.1 → 0.1.4

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 (31) hide show
  1. package/README.md +121 -0
  2. package/dist/cli.js +2755 -1167
  3. package/dist/docs/compositions.md +8 -1
  4. package/dist/docs/data-attributes.md +4 -0
  5. package/dist/docs/gsap.md +3 -0
  6. package/dist/docs/rendering.md +4 -0
  7. package/dist/docs/templates.md +4 -0
  8. package/dist/docs/troubleshooting.md +7 -0
  9. package/dist/hyperframe-runtime.js +4 -3
  10. package/dist/hyperframe.manifest.json +22 -0
  11. package/dist/hyperframe.runtime.iife.js +13 -0
  12. package/dist/studio/index.html +11 -11
  13. package/dist/templates/blank/compositions/captions.html +92 -0
  14. package/dist/templates/blank/index.html +44 -0
  15. package/dist/templates/play-mode/compositions/captions.html +96 -30
  16. package/dist/templates/play-mode/compositions/intro.html +90 -71
  17. package/dist/templates/play-mode/compositions/stats.html +210 -74
  18. package/dist/templates/play-mode/index.html +214 -148
  19. package/dist/templates/swiss-grid/compositions/captions.html +70 -17
  20. package/dist/templates/swiss-grid/compositions/graphics.html +52 -43
  21. package/dist/templates/swiss-grid/compositions/intro.html +42 -25
  22. package/dist/templates/swiss-grid/index.html +227 -165
  23. package/dist/templates/vignelli/compositions/captions.html +87 -28
  24. package/dist/templates/vignelli/compositions/overlays.html +83 -31
  25. package/dist/templates/vignelli/index.html +183 -164
  26. package/dist/templates/warm-grain/compositions/captions.html +80 -66
  27. package/dist/templates/warm-grain/compositions/graphics.html +29 -22
  28. package/dist/templates/warm-grain/compositions/intro.html +29 -20
  29. package/dist/templates/warm-grain/index.html +278 -179
  30. package/package.json +16 -15
  31. package/LICENSE +0 -21
@@ -1,5 +1,10 @@
1
1
  <template id="captions-template">
2
- <div data-composition-id="captions" data-width="1920" data-height="1080" data-duration="18">
2
+ <div
3
+ data-composition-id="captions"
4
+ data-width="1920"
5
+ data-height="1080"
6
+ data-duration="__VIDEO_DURATION__"
7
+ >
3
8
  <div class="captions-container">
4
9
  <div id="caption-box" class="caption-box">
5
10
  <span id="caption-text" class="caption-text"></span>
@@ -18,7 +23,7 @@
18
23
  }
19
24
 
20
25
  [data-composition-id="captions"] .caption-box {
21
- background-color: #7A6248;
26
+ background-color: #7a6248;
22
27
  padding: 12px 32px;
23
28
  border-radius: 24px;
24
29
  display: flex;
@@ -31,8 +36,8 @@
31
36
  }
32
37
 
33
38
  [data-composition-id="captions"] .caption-text {
34
- color: #F5F0E0;
35
- font-family: 'Outfit', sans-serif;
39
+ color: #f5f0e0;
40
+ font-family: "Outfit", sans-serif;
36
41
  font-size: 48px;
37
42
  font-weight: 700;
38
43
  text-align: center;
@@ -42,54 +47,54 @@
42
47
  </style>
43
48
 
44
49
  <script>
45
- (function() {
50
+ (function () {
46
51
  const script = [
47
- {"text": "We", "start": 0.119, "end": 0.259},
48
- {"text": "asked", "start": 0.319, "end": 0.479},
49
- {"text": "what", "start": 0.519, "end": 0.659},
50
- {"text": "you", "start": 0.699, "end": 0.819},
51
- {"text": "needed.", "start": 0.859, "end": 1.819},
52
- {"text": "Forty-seven", "start": 1.86, "end": 2.299},
53
- {"text": "percent", "start": 2.399, "end": 2.679},
54
- {"text": "of", "start": 2.7, "end": 2.799},
55
- {"text": "you", "start": 2.839, "end": 2.939},
56
- {"text": "said", "start": 3.039, "end": 3.179},
57
- {"text": "motion", "start": 3.24, "end": 3.559},
58
- {"text": "graphics,", "start": 3.579, "end": 4.599},
59
- {"text": "sixty-two", "start": 4.679, "end": 5.179},
60
- {"text": "percent", "start": 5.299, "end": 5.759},
61
- {"text": "said", "start": 5.859, "end": 5.98},
62
- {"text": "static", "start": 6.079, "end": 6.399},
63
- {"text": "content", "start": 6.46, "end": 6.879},
64
- {"text": "was", "start": 6.92, "end": 7.079},
65
- {"text": "costing", "start": 7.099, "end": 7.48},
66
- {"text": "you", "start": 7.5, "end": 7.579},
67
- {"text": "attention,", "start": 7.679, "end": 8.659},
68
- {"text": "and", "start": 8.699, "end": 8.86},
69
- {"text": "three", "start": 8.88, "end": 9.06},
70
- {"text": "out", "start": 9.079, "end": 9.18},
71
- {"text": "of", "start": 9.199, "end": 9.34},
72
- {"text": "four", "start": 9.38, "end": 9.799},
73
- {"text": "said", "start": 9.84, "end": 10.0},
74
- {"text": "you", "start": 10.019, "end": 10.159},
75
- {"text": "know", "start": 10.179, "end": 10.36},
76
- {"text": "the", "start": 10.38, "end": 10.42},
77
- {"text": "look", "start": 10.519, "end": 10.699},
78
- {"text": "you", "start": 10.739, "end": 10.859},
79
- {"text": "want", "start": 10.98, "end": 11.34},
80
- {"text": "but", "start": 11.359, "end": 11.52},
81
- {"text": "don't", "start": 11.56, "end": 11.779},
82
- {"text": "have", "start": 11.819, "end": 11.94},
83
- {"text": "the", "start": 11.96, "end": 12.06},
84
- {"text": "editing", "start": 12.079, "end": 12.4},
85
- {"text": "skills", "start": 12.52, "end": 12.86},
86
- {"text": "to", "start": 12.88, "end": 13.0},
87
- {"text": "get", "start": 13.019, "end": 13.18},
88
- {"text": "there.", "start": 13.22, "end": 14.22},
89
- {"text": "So", "start": 14.239, "end": 14.399},
90
- {"text": "we", "start": 14.42, "end": 14.52},
91
- {"text": "built", "start": 14.619, "end": 14.88},
92
- {"text": "Hyperframes.", "start": 15.079, "end": 16.02}
52
+ { text: "We", start: 0.119, end: 0.259 },
53
+ { text: "asked", start: 0.319, end: 0.479 },
54
+ { text: "what", start: 0.519, end: 0.659 },
55
+ { text: "you", start: 0.699, end: 0.819 },
56
+ { text: "needed.", start: 0.859, end: 1.819 },
57
+ { text: "Forty-seven", start: 1.86, end: 2.299 },
58
+ { text: "percent", start: 2.399, end: 2.679 },
59
+ { text: "of", start: 2.7, end: 2.799 },
60
+ { text: "you", start: 2.839, end: 2.939 },
61
+ { text: "said", start: 3.039, end: 3.179 },
62
+ { text: "motion", start: 3.24, end: 3.559 },
63
+ { text: "graphics,", start: 3.579, end: 4.599 },
64
+ { text: "sixty-two", start: 4.679, end: 5.179 },
65
+ { text: "percent", start: 5.299, end: 5.759 },
66
+ { text: "said", start: 5.859, end: 5.98 },
67
+ { text: "static", start: 6.079, end: 6.399 },
68
+ { text: "content", start: 6.46, end: 6.879 },
69
+ { text: "was", start: 6.92, end: 7.079 },
70
+ { text: "costing", start: 7.099, end: 7.48 },
71
+ { text: "you", start: 7.5, end: 7.579 },
72
+ { text: "attention,", start: 7.679, end: 8.659 },
73
+ { text: "and", start: 8.699, end: 8.86 },
74
+ { text: "three", start: 8.88, end: 9.06 },
75
+ { text: "out", start: 9.079, end: 9.18 },
76
+ { text: "of", start: 9.199, end: 9.34 },
77
+ { text: "four", start: 9.38, end: 9.799 },
78
+ { text: "said", start: 9.84, end: 10.0 },
79
+ { text: "you", start: 10.019, end: 10.159 },
80
+ { text: "know", start: 10.179, end: 10.36 },
81
+ { text: "the", start: 10.38, end: 10.42 },
82
+ { text: "look", start: 10.519, end: 10.699 },
83
+ { text: "you", start: 10.739, end: 10.859 },
84
+ { text: "want", start: 10.98, end: 11.34 },
85
+ { text: "but", start: 11.359, end: 11.52 },
86
+ { text: "don't", start: 11.56, end: 11.779 },
87
+ { text: "have", start: 11.819, end: 11.94 },
88
+ { text: "the", start: 11.96, end: 12.06 },
89
+ { text: "editing", start: 12.079, end: 12.4 },
90
+ { text: "skills", start: 12.52, end: 12.86 },
91
+ { text: "to", start: 12.88, end: 13.0 },
92
+ { text: "get", start: 13.019, end: 13.18 },
93
+ { text: "there.", start: 13.22, end: 14.22 },
94
+ { text: "So", start: 14.239, end: 14.399 },
95
+ { text: "we", start: 14.42, end: 14.52 },
96
+ { text: "built", start: 14.619, end: 14.88 },
97
+ { text: "Hyperframes.", start: 15.079, end: 16.02 },
93
98
  ];
94
99
 
95
100
  // Group words into lines (max 5 words per line)
@@ -97,9 +102,9 @@
97
102
  for (let i = 0; i < script.length; i += 5) {
98
103
  const lineWords = script.slice(i, i + 5);
99
104
  lines.push({
100
- text: lineWords.map(w => w.text).join(' '),
105
+ text: lineWords.map((w) => w.text).join(" "),
101
106
  start: lineWords[0].start,
102
- end: lineWords[lineWords.length - 1].end
107
+ end: lineWords[lineWords.length - 1].end,
103
108
  });
104
109
  }
105
110
 
@@ -109,23 +114,32 @@
109
114
 
110
115
  lines.forEach((line, index) => {
111
116
  // Fade in and set text
112
- tl.to(box, {
113
- opacity: 1,
114
- duration: 0.1,
115
- ease: "power2.out",
116
- onStart: () => {
117
- textEl.textContent = line.text;
118
- }
119
- }, line.start);
117
+ tl.to(
118
+ box,
119
+ {
120
+ opacity: 1,
121
+ duration: 0.1,
122
+ ease: "power2.out",
123
+ onStart: () => {
124
+ textEl.textContent = line.text;
125
+ },
126
+ },
127
+ line.start,
128
+ );
120
129
 
121
130
  // Fade out at the end of the line
122
- tl.to(box, {
123
- opacity: 0,
124
- duration: 0.1,
125
- ease: "power2.in"
126
- }, line.end);
131
+ tl.to(
132
+ box,
133
+ {
134
+ opacity: 0,
135
+ duration: 0.1,
136
+ ease: "power2.in",
137
+ },
138
+ line.end,
139
+ );
127
140
  });
128
141
 
142
+ window.__timelines = window.__timelines || {};
129
143
  window.__timelines["captions"] = tl;
130
144
  })();
131
145
  </script>
@@ -17,7 +17,10 @@
17
17
  <div id="moment-3" class="moment rect-stat">
18
18
  <div class="icon-shape">
19
19
  <svg viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
20
- <path d="M20,20 Q50,0 80,20 Q100,50 80,80 Q50,100 20,80 Q0,50 20,20" fill="currentColor" />
20
+ <path
21
+ d="M20,20 Q50,0 80,20 Q100,50 80,80 Q50,100 20,80 Q0,50 20,20"
22
+ fill="currentColor"
23
+ />
21
24
  </svg>
22
25
  </div>
23
26
  <div class="stat-text">Editing Skills</div>
@@ -28,7 +31,7 @@
28
31
  position: relative;
29
32
  width: 1920px;
30
33
  height: 1080px;
31
- font-family: 'Outfit', sans-serif;
34
+ font-family: "Outfit", sans-serif;
32
35
  color: white;
33
36
  overflow: hidden;
34
37
  }
@@ -46,7 +49,7 @@
46
49
  [data-composition-id="graphics"] #moment-1 {
47
50
  width: 500px;
48
51
  height: 500px;
49
- background-color: #3B5E3A;
52
+ background-color: #3b5e3a;
50
53
  border-radius: 50%;
51
54
  left: 1400px;
52
55
  top: 540px;
@@ -72,7 +75,7 @@
72
75
  [data-composition-id="graphics"] #moment-2 {
73
76
  width: 500px;
74
77
  height: 220px;
75
- background-color: #CC8832;
78
+ background-color: #cc8832;
76
79
  border-radius: 110px;
77
80
  left: 960px;
78
81
  top: 200px;
@@ -83,7 +86,7 @@
83
86
  [data-composition-id="graphics"] #moment-3 {
84
87
  width: 550px;
85
88
  height: 180px;
86
- background-color: #C45D3E;
89
+ background-color: #c45d3e;
87
90
  border-radius: 40px;
88
91
  left: 400px;
89
92
  top: 540px;
@@ -117,41 +120,45 @@
117
120
  </style>
118
121
 
119
122
  <script>
120
- (function() {
123
+ (function () {
121
124
  const tl = gsap.timeline({ paused: true });
122
125
 
123
126
  // Moment 1: 1.8s - 4.5s
124
127
  // Gentle drift into place and settle
125
- tl.fromTo('#moment-1',
126
- { opacity: 0, x: '+=40', y: '+=15', scale: 0.8 },
127
- { opacity: 1, x: 0, y: 0, scale: 1, duration: 1.2, ease: 'back.out(1.7)' },
128
- 1.8
128
+ tl.fromTo(
129
+ "#moment-1",
130
+ { opacity: 0, x: "+=40", y: "+=15", scale: 0.8 },
131
+ { opacity: 1, x: 0, y: 0, scale: 1, duration: 1.2, ease: "back.out(1.7)" },
132
+ 1.8,
129
133
  );
130
134
  // Hold until 4.5s, then fade out
131
- tl.to('#moment-1', { opacity: 0, scale: 0.8, duration: 0.3, ease: 'power2.in' }, 4.2);
135
+ tl.to("#moment-1", { opacity: 0, scale: 0.8, duration: 0.3, ease: "power2.in" }, 4.2);
132
136
 
133
137
  // Moment 2: 4.6s - 8.6s
134
138
  // Gentle drift into place and settle
135
- tl.fromTo('#moment-2',
136
- { opacity: 0, y: '-=40', x: '+=10', scale: 0.8 },
137
- { opacity: 1, y: 0, x: 0, scale: 1, duration: 1.2, ease: 'back.out(1.7)' },
138
- 4.6
139
+ tl.fromTo(
140
+ "#moment-2",
141
+ { opacity: 0, y: "-=40", x: "+=10", scale: 0.8 },
142
+ { opacity: 1, y: 0, x: 0, scale: 1, duration: 1.2, ease: "back.out(1.7)" },
143
+ 4.6,
139
144
  );
140
145
  // Hold until 8.6s, then fade out
141
- tl.to('#moment-2', { opacity: 0, scale: 0.8, duration: 0.3, ease: 'power2.in' }, 8.3);
146
+ tl.to("#moment-2", { opacity: 0, scale: 0.8, duration: 0.3, ease: "power2.in" }, 8.3);
142
147
 
143
148
  // Moment 3: 8.8s - 14s
144
149
  // Gentle drift into place and settle
145
- tl.fromTo('#moment-3',
146
- { opacity: 0, x: '-=40', y: '-=10', scale: 0.8 },
147
- { opacity: 1, x: 0, y: 0, scale: 1, duration: 1.2, ease: 'back.out(1.7)' },
148
- 8.8
150
+ tl.fromTo(
151
+ "#moment-3",
152
+ { opacity: 0, x: "-=40", y: "-=10", scale: 0.8 },
153
+ { opacity: 1, x: 0, y: 0, scale: 1, duration: 1.2, ease: "back.out(1.7)" },
154
+ 8.8,
149
155
  );
150
156
  // Hold until end (14s)
151
- tl.to('#moment-3', { opacity: 0, duration: 0.5, ease: 'power2.in' }, 13.5);
157
+ tl.to("#moment-3", { opacity: 0, duration: 0.5, ease: "power2.in" }, 13.5);
152
158
 
159
+ window.__timelines = window.__timelines || {};
153
160
  window.__timelines["graphics"] = tl;
154
161
  })();
155
162
  </script>
156
163
  </div>
157
- </template>
164
+ </template>
@@ -9,7 +9,7 @@
9
9
 
10
10
  <style>
11
11
  /* Import a rounded humanist sans-serif font */
12
- @import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600&display=swap');
12
+ @import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;600&display=swap");
13
13
 
14
14
  [data-composition-id="intro"] .container {
15
15
  width: 100%;
@@ -18,15 +18,15 @@
18
18
  justify-content: flex-start; /* Align to left for speaker card */
19
19
  align-items: center;
20
20
  padding-left: 5%;
21
- font-family: 'Outfit', sans-serif;
21
+ font-family: "Outfit", sans-serif;
22
22
  background: transparent;
23
23
  }
24
24
 
25
25
  [data-composition-id="intro"] .title-card {
26
- background-color: #3B5E3A; /* Forest Green for contrast */
26
+ background-color: #3b5e3a; /* Forest Green for contrast */
27
27
  padding: 40px 60px;
28
28
  border-radius: 30px;
29
- box-shadow: 0 15px 40px rgba(0,0,0,0.2);
29
+ box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
30
30
  text-align: left;
31
31
  opacity: 0;
32
32
  transform: translateX(-100%); /* Start off-screen left */
@@ -35,7 +35,7 @@
35
35
  [data-composition-id="intro"] .title {
36
36
  font-size: 100px;
37
37
  font-weight: 600;
38
- color: #F5F0E0; /* Cream text on green card */
38
+ color: #f5f0e0; /* Cream text on green card */
39
39
  margin: 0;
40
40
  line-height: 1.1;
41
41
  letter-spacing: -2px;
@@ -44,32 +44,41 @@
44
44
  [data-composition-id="intro"] .subtitle {
45
45
  font-size: 50px;
46
46
  font-weight: 400;
47
- color: #CC8832; /* Ochre accent */
47
+ color: #cc8832; /* Ochre accent */
48
48
  margin: 10px 0 0 0;
49
49
  line-height: 1.2;
50
50
  }
51
51
  </style>
52
52
 
53
53
  <script>
54
- (function() {
54
+ (function () {
55
55
  const tl = gsap.timeline({ paused: true });
56
-
56
+
57
57
  // Animation: Speaker card slides in from the left
58
- tl.to('[data-composition-id="intro"] .title-card', {
59
- opacity: 1,
60
- x: 0,
61
- duration: 0.8,
62
- ease: 'power2.out'
63
- }, 0.2);
58
+ tl.to(
59
+ '[data-composition-id="intro"] .title-card',
60
+ {
61
+ opacity: 1,
62
+ x: 0,
63
+ duration: 0.8,
64
+ ease: "power2.out",
65
+ },
66
+ 0.2,
67
+ );
64
68
 
65
69
  // Exit: Slide off left at 1.8s (synced with 47% graphic)
66
- tl.to('[data-composition-id="intro"] .title-card', {
67
- x: '-120%',
68
- opacity: 0,
69
- duration: 0.6,
70
- ease: 'power2.in'
71
- }, 1.8);
70
+ tl.to(
71
+ '[data-composition-id="intro"] .title-card',
72
+ {
73
+ x: "-120%",
74
+ opacity: 0,
75
+ duration: 0.6,
76
+ ease: "power2.in",
77
+ },
78
+ 1.8,
79
+ );
72
80
 
81
+ window.__timelines = window.__timelines || {};
73
82
  window.__timelines["intro"] = tl;
74
83
  })();
75
84
  </script>