@vanillaskyai/video 0.8.8 → 0.10.0

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 (173) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/PUBLIC-API.md +5 -8
  3. package/dist/{builtin-server-CUYPIDE7.js → builtin-server-W4PLJUZ5.js} +2 -2
  4. package/dist/{catalog-types-BIhSpOWK.d.ts → catalog-types-WTbLP6Jh.d.ts} +5 -1
  5. package/dist/chapter-title-YRLIQY3V.js +7 -0
  6. package/dist/check-runtime.js +5 -14
  7. package/dist/{chunk-AITKH6QT.js → chunk-2HFO22K2.js} +15 -40
  8. package/dist/chunk-4YM2M62S.js +13 -0
  9. package/dist/chunk-4ZJLPHBV.js +684 -0
  10. package/dist/chunk-77VY4O7A.js +390 -0
  11. package/dist/{chunk-MMUXVA47.js → chunk-7M56IUUX.js} +9 -8
  12. package/dist/chunk-7NZOMTAL.js +63 -0
  13. package/dist/{chunk-2DOLF4QN.js → chunk-AUPC6MDK.js} +12 -14
  14. package/dist/{chunk-352ZZCET.js → chunk-EGVQODKU.js} +2 -2
  15. package/dist/{chunk-2USVB3CY.js → chunk-ELVOT2FQ.js} +284 -177
  16. package/dist/chunk-EWWCQFTI.js +18 -0
  17. package/dist/{chunk-KT3M7KDL.js → chunk-HKUI5BTB.js} +3 -3
  18. package/dist/chunk-IIN5M5HW.js +697 -0
  19. package/dist/{chunk-LMG3GHLL.js → chunk-IQMYK5DX.js} +29 -3
  20. package/dist/{chunk-OWBT45EN.js → chunk-IR44XKBI.js} +1 -1
  21. package/dist/{chunk-MXZSDGZQ.js → chunk-NMFDC2W2.js} +4 -6
  22. package/dist/{chunk-5SLENAJW.js → chunk-PAJ44TFW.js} +1 -2
  23. package/dist/{chunk-L7QGGKJ2.js → chunk-PDQFQIQW.js} +1 -1
  24. package/dist/{chunk-WJ6FLKNC.js → chunk-R3XAOMKP.js} +14 -0
  25. package/dist/{chunk-2OKB27TG.js → chunk-RXTN2CW6.js} +2 -2
  26. package/dist/{chunk-XWWLKRNU.js → chunk-TVIU23OM.js} +38 -49
  27. package/dist/chunk-XX4GXKTX.js +35 -0
  28. package/dist/chunk-Z67Q5KUW.js +16 -0
  29. package/dist/{chunk-3VRMKFM7.js → chunk-ZDJNFA52.js} +11 -24
  30. package/dist/cinema-media-C7OUPNSH.js +12 -0
  31. package/dist/cli.js +18 -9
  32. package/dist/comparison-GNZOR7MF.js +37 -0
  33. package/dist/compose-video-TBFTONUC.js +12 -0
  34. package/dist/editorial-timeline-EMV5335S.js +43 -0
  35. package/dist/{events-BQ6z264n.d.ts → events-B4YCc4vc.d.ts} +1 -1
  36. package/dist/index.d.ts +4 -6
  37. package/dist/index.js +3 -7
  38. package/dist/key-figure-P37VK425.js +30 -0
  39. package/dist/{kit-tQnCPMOM.d.ts → kit-DrRpdn0p.d.ts} +2 -2
  40. package/dist/mobile-message-OF7T62B7.js +50 -0
  41. package/dist/quote-T6WYLN7A.js +33 -0
  42. package/dist/react.d.ts +21 -11
  43. package/dist/react.js +585 -826
  44. package/dist/scene-video-backdrop-PCTARAAJ.js +7 -0
  45. package/dist/server.d.ts +7 -8
  46. package/dist/server.js +179 -84
  47. package/dist/{system-prompt-RRXIWDDD.js → system-prompt-SYRT5DWM.js} +1 -1
  48. package/dist/template-catalog.d.ts +392 -16
  49. package/dist/template-catalog.js +1 -1
  50. package/dist/templates.d.ts +5 -5
  51. package/dist/test.d.ts +3 -3
  52. package/dist/test.js +18 -18
  53. package/dist/text-stream-LD364KBI.js +9 -0
  54. package/dist/{types-DWFO6qca.d.ts → types-CdBmNTGD.d.ts} +1 -1
  55. package/dist/{types-CEh9eUFu.d.ts → types-DdZw4GRQ.d.ts} +17 -48
  56. package/dist/validate-4OUD2CLX.js +10 -0
  57. package/docs/architecture.md +1 -1
  58. package/docs/concepts.md +1 -1
  59. package/docs/custom-templates.md +13 -28
  60. package/docs/customization.md +11 -59
  61. package/docs/getting-started.md +2 -2
  62. package/docs/immersive-interface.md +3 -4
  63. package/docs/maintainers/cinematic-migration.md +38 -0
  64. package/docs/media-and-audio.md +14 -14
  65. package/docs/motion-and-effects.md +6 -14
  66. package/docs/persistence.md +3 -3
  67. package/docs/production.md +11 -9
  68. package/docs/provider-integration.md +9 -16
  69. package/docs/reference/design-system.html +1 -1
  70. package/docs/reference/protocol.md +14 -4
  71. package/docs/testing.md +1 -1
  72. package/package.json +6 -3
  73. package/registry/items/backgrounds.json +1 -1
  74. package/registry/items/chapterTitle.json +80 -0
  75. package/registry/items/cinemaMedia.json +136 -0
  76. package/registry/items/comparison.json +168 -0
  77. package/registry/items/editorialTimeline.json +172 -0
  78. package/registry/items/keyFigure.json +162 -0
  79. package/registry/items/mobileMessage.json +153 -0
  80. package/registry/items/quote.json +161 -0
  81. package/registry/items/template-context.json +1 -1
  82. package/registry/items/theme.json +1 -1
  83. package/starters/video-chat/README.md +24 -26
  84. package/starters/video-chat/package.json +1 -1
  85. package/starters/video-chat/providers/video.ts +6 -5
  86. package/starters/video-chat/stock.ts +35 -151
  87. package/styles/fonts/OFL.txt +93 -0
  88. package/styles/fonts/manifest.json +66 -0
  89. package/styles/fonts/roboto-v51-cyrillic-ext.woff2 +0 -0
  90. package/styles/fonts/roboto-v51-cyrillic.woff2 +0 -0
  91. package/styles/fonts/roboto-v51-greek-ext.woff2 +0 -0
  92. package/styles/fonts/roboto-v51-greek.woff2 +0 -0
  93. package/styles/fonts/roboto-v51-latin-ext.woff2 +0 -0
  94. package/styles/fonts/roboto-v51-latin.woff2 +0 -0
  95. package/styles/fonts/roboto-v51-math.woff2 +0 -0
  96. package/styles/fonts/roboto-v51-symbols.woff2 +0 -0
  97. package/styles/fonts/roboto-v51-vietnamese.woff2 +0 -0
  98. package/styles/fonts/roboto.css +91 -0
  99. package/styles/video-chat.css +30 -22
  100. package/dist/bg-confetti-HITCGLGD.js +0 -89
  101. package/dist/bg-emoji-VU4UZYZN.js +0 -150
  102. package/dist/bg-media-L34PDQXJ.js +0 -106
  103. package/dist/brand-message-FUJ4STFO.js +0 -256
  104. package/dist/chart-bar-EGPHJATL.js +0 -310
  105. package/dist/chart-counter-5FFWQNZO.js +0 -306
  106. package/dist/chart-progress-ring-JMXQLMLC.js +0 -302
  107. package/dist/chunk-4UNKZEAT.js +0 -3575
  108. package/dist/chunk-5CDAM24P.js +0 -31
  109. package/dist/chunk-AOWSXU2K.js +0 -18
  110. package/dist/chunk-CJ7F2CE6.js +0 -104
  111. package/dist/chunk-FRN6WKHA.js +0 -185
  112. package/dist/chunk-G5JPHBX7.js +0 -336
  113. package/dist/chunk-L5BTTCZV.js +0 -97
  114. package/dist/chunk-P22HHFDK.js +0 -43
  115. package/dist/chunk-PP3MCPN4.js +0 -1998
  116. package/dist/chunk-QAAO7OAY.js +0 -19
  117. package/dist/chunk-S7HFLYNN.js +0 -35
  118. package/dist/chunk-W3VDIBGR.js +0 -217
  119. package/dist/chunk-XGRA2MUV.js +0 -242
  120. package/dist/chunk-XTOXFMLM.js +0 -105
  121. package/dist/chunk-YJJC4N4D.js +0 -761
  122. package/dist/compose-video-2NFH4DZY.js +0 -13
  123. package/dist/cta-logo-YR7LYUR5.js +0 -212
  124. package/dist/cta-media-DQJBKUO2.js +0 -221
  125. package/dist/incoming-call-54KQ7O5A.js +0 -323
  126. package/dist/infographic-before-after-ROS52GOW.js +0 -460
  127. package/dist/infographic-feature-list-E7MGUDAN.js +0 -272
  128. package/dist/infographic-problem-solution-3S6NGO5N.js +0 -343
  129. package/dist/infographic-stat-row-SYB7AB7H.js +0 -247
  130. package/dist/infographic-steps-KCE6JWE2.js +0 -406
  131. package/dist/prompt-input-MHX4O42G.js +0 -239
  132. package/dist/reaction-SLEGR3BE.js +0 -122
  133. package/dist/scene-video-backdrop-XFPX4O3I.js +0 -10
  134. package/dist/showcase-code-2HLAVKBM.js +0 -357
  135. package/dist/showcase-phone-Q4HEO4LH.js +0 -278
  136. package/dist/showcase-terminal-DL45LUFG.js +0 -312
  137. package/dist/showcase-web-2QZO73FZ.js +0 -396
  138. package/dist/social-conversation-75SD2637.js +0 -695
  139. package/dist/social-milestone-GEFUQSBF.js +0 -296
  140. package/dist/social-notification-FJ5VHVLK.js +0 -247
  141. package/dist/social-review-stack-KXQCKFRP.js +0 -242
  142. package/dist/social-testimonial-JZ7CHC7S.js +0 -287
  143. package/dist/social-tweet-UCDXM25F.js +0 -298
  144. package/dist/text-stream-54LXABJW.js +0 -10
  145. package/dist/validate-T7GBU2YF.js +0 -8
  146. package/registry/items/barChart.json +0 -245
  147. package/registry/items/beforeAfter.json +0 -180
  148. package/registry/items/bigNumber.json +0 -232
  149. package/registry/items/brandMessage.json +0 -164
  150. package/registry/items/cardList.json +0 -214
  151. package/registry/items/chatMessenger.json +0 -151
  152. package/registry/items/chatWhatsapp.json +0 -151
  153. package/registry/items/codeEditor.json +0 -191
  154. package/registry/items/confetti.json +0 -107
  155. package/registry/items/ctaLogo.json +0 -167
  156. package/registry/items/ctaMedia.json +0 -200
  157. package/registry/items/emojiBurst.json +0 -101
  158. package/registry/items/incomingCall.json +0 -177
  159. package/registry/items/media.json +0 -187
  160. package/registry/items/milestone.json +0 -212
  161. package/registry/items/notification.json +0 -189
  162. package/registry/items/phoneMockup.json +0 -261
  163. package/registry/items/problemSolution.json +0 -193
  164. package/registry/items/progressRing.json +0 -206
  165. package/registry/items/promptInput.json +0 -155
  166. package/registry/items/reaction.json +0 -176
  167. package/registry/items/reviewStack.json +0 -231
  168. package/registry/items/steps.json +0 -215
  169. package/registry/items/terminal.json +0 -219
  170. package/registry/items/testimonial.json +0 -171
  171. package/registry/items/tripleStats.json +0 -235
  172. package/registry/items/tweet.json +0 -210
  173. package/registry/items/webMockup.json +0 -280
@@ -1,272 +0,0 @@
1
- import {
2
- parseList
3
- } from "./chunk-P22HHFDK.js";
4
- import {
5
- stripPipe
6
- } from "./chunk-S7HFLYNN.js";
7
- import {
8
- SceneBackground,
9
- getMediaBackgroundProps
10
- } from "./chunk-MXZSDGZQ.js";
11
- import {
12
- TemplateText
13
- } from "./chunk-YJJC4N4D.js";
14
- import {
15
- Emoji
16
- } from "./chunk-L5BTTCZV.js";
17
- import "./chunk-FRN6WKHA.js";
18
- import "./chunk-W3VDIBGR.js";
19
- import {
20
- interpolate,
21
- spring
22
- } from "./chunk-XTOXFMLM.js";
23
- import {
24
- hasSceneMedia
25
- } from "./chunk-224QNWRA.js";
26
- import "./chunk-5CDAM24P.js";
27
- import {
28
- TOKEN_DEFAULTS,
29
- resolveTokens
30
- } from "./chunk-XWWLKRNU.js";
31
-
32
- // src/visual-system/primitives/infographic/FeatureList.tsx
33
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
34
- var SPRING_ROW = { damping: 14, stiffness: 170 };
35
- var SPRING_EMOJI = { damping: 8, stiffness: 200 };
36
- var FeatureList = ({
37
- progress,
38
- width,
39
- height,
40
- features,
41
- textColor = "#ffffff",
42
- font = TOKEN_DEFAULTS.font,
43
- beatIntensity = 0
44
- }) => {
45
- void beatIntensity;
46
- const s = Math.min(width, height) / 1080;
47
- const itemLabels = features.slice(0, 3).map((f) => stripPipe(String(f.title || f.description || "")));
48
- const itemEmojis = features.slice(0, 3).map((f) => String(f.icon || ""));
49
- const itemCount = itemLabels.length;
50
- if (itemCount === 0) return null;
51
- const isLandscape = width > height;
52
- const contentAreaTop = height * (isLandscape ? 0.28 : 0.25);
53
- const contentAreaHeight = height * (isLandscape ? 0.65 : 0.7);
54
- const sidePadding = 40 * s;
55
- const gap = 20 * s;
56
- const borderRadius = 20 * s;
57
- let cardWidth;
58
- let cardHeight;
59
- let emojiFontSize;
60
- let labelFontSize;
61
- let listLeft;
62
- if (isLandscape) {
63
- const totalWidth = width * 0.9;
64
- cardWidth = (totalWidth - gap * (itemCount - 1)) / itemCount;
65
- cardHeight = Math.min(cardWidth, contentAreaHeight * 0.85);
66
- emojiFontSize = Math.min(cardHeight * 0.35, 110 * s);
67
- labelFontSize = Math.min(cardHeight * 0.16, 48 * s);
68
- listLeft = (width - (cardWidth * itemCount + gap * (itemCount - 1))) / 2;
69
- } else {
70
- cardWidth = width - sidePadding * 2;
71
- const maxRowHeight = 260 * s;
72
- cardHeight = Math.min((contentAreaHeight - gap * (itemCount - 1)) / itemCount, maxRowHeight);
73
- emojiFontSize = Math.min(cardHeight * 0.35, 64 * s);
74
- labelFontSize = Math.min(cardHeight * 0.25, 44 * s);
75
- listLeft = sidePadding;
76
- }
77
- const totalHeight = isLandscape ? cardHeight : cardHeight * itemCount + gap * (itemCount - 1);
78
- const verticalAnchor = isLandscape ? 0.5 : 0.25;
79
- const listTop = contentAreaTop + (contentAreaHeight - totalHeight) * verticalAnchor;
80
- const cardBg = "rgba(255,255,255,0.15)";
81
- const cardBorder = "rgba(255,255,255,0.2)";
82
- const firstRow = 0.08;
83
- return /* @__PURE__ */ jsx(Fragment, { children: itemLabels.map((label, i) => {
84
- const x = isLandscape ? listLeft + i * (cardWidth + gap) : listLeft;
85
- const y = isLandscape ? listTop : listTop + i * (cardHeight + gap);
86
- const itemStart = firstRow;
87
- const rowP = spring(
88
- interpolate(progress, [itemStart, itemStart + 0.12], [0, 1], {
89
- extrapolateLeft: "clamp",
90
- extrapolateRight: "clamp"
91
- }),
92
- SPRING_ROW
93
- );
94
- const cardScale = isLandscape ? interpolate(rowP, [0, 1], [0.6, 1]) : 1;
95
- const rowX = isLandscape ? 0 : (1 - rowP) * -120 * s;
96
- const rowOpacity = interpolate(progress, [itemStart, itemStart + 0.05], [0, 1], {
97
- extrapolateLeft: "clamp",
98
- extrapolateRight: "clamp"
99
- });
100
- const emojiDelay = itemStart + 0.04;
101
- const emojiP = spring(
102
- interpolate(progress, [emojiDelay, emojiDelay + 0.08], [0, 1], {
103
- extrapolateLeft: "clamp",
104
- extrapolateRight: "clamp"
105
- }),
106
- SPRING_EMOJI
107
- );
108
- const emojiScale = interpolate(emojiP, [0, 1], [0, 1]);
109
- const textDelay = itemStart + 0.06;
110
- const textOpacity = interpolate(progress, [textDelay, textDelay + 0.05], [0, 1], {
111
- extrapolateLeft: "clamp",
112
- extrapolateRight: "clamp"
113
- });
114
- const EXIT_START = 0.78;
115
- const EXIT_DURATION = 0.1;
116
- const EXIT_STAGGER = 0.04;
117
- const exitStart = EXIT_START + i * EXIT_STAGGER;
118
- const exitEnd = exitStart + EXIT_DURATION;
119
- const exitRaw = interpolate(progress, [exitStart, exitEnd], [0, 1], {
120
- extrapolateLeft: "clamp",
121
- extrapolateRight: "clamp"
122
- });
123
- const exitEased = exitRaw * exitRaw;
124
- const exitTranslateX = -90 * s * exitEased;
125
- const exitFade = 1 - exitEased;
126
- const emoji = itemEmojis[i] || "\u2726";
127
- const transform = isLandscape ? `translate(${exitTranslateX}px, 0) scale(${cardScale})` : `translateX(${rowX + exitTranslateX}px)`;
128
- return /* @__PURE__ */ jsxs(
129
- "div",
130
- {
131
- "data-template-item": "cardList",
132
- style: {
133
- position: "absolute",
134
- left: x,
135
- top: y,
136
- width: cardWidth,
137
- height: cardHeight,
138
- borderRadius,
139
- backgroundColor: cardBg,
140
- border: `1.5px solid ${cardBorder}`,
141
- display: "flex",
142
- flexDirection: isLandscape ? "column" : "row",
143
- alignItems: "center",
144
- justifyContent: isLandscape ? "center" : void 0,
145
- gap: isLandscape ? 32 * s : 0,
146
- opacity: rowOpacity * exitFade,
147
- transform,
148
- transformOrigin: "center center"
149
- },
150
- children: [
151
- /* @__PURE__ */ jsx(
152
- "div",
153
- {
154
- style: {
155
- width: isLandscape ? void 0 : Math.min(cardHeight * 0.7, 130 * s),
156
- height: isLandscape ? void 0 : cardHeight,
157
- display: "flex",
158
- alignItems: "center",
159
- justifyContent: "center",
160
- flexShrink: 0
161
- },
162
- children: /* @__PURE__ */ jsx(
163
- Emoji,
164
- {
165
- char: emoji,
166
- size: emojiFontSize,
167
- verticalAlign: "middle",
168
- style: { transform: `scale(${emojiScale})`, display: "block" }
169
- }
170
- )
171
- }
172
- ),
173
- /* @__PURE__ */ jsx(
174
- "div",
175
- {
176
- style: {
177
- flex: isLandscape ? void 0 : 1,
178
- fontSize: labelFontSize,
179
- fontWeight: 600,
180
- color: textColor,
181
- fontFamily: font,
182
- lineHeight: 1.25,
183
- letterSpacing: -0.3,
184
- opacity: textOpacity,
185
- textAlign: isLandscape ? "center" : void 0,
186
- padding: isLandscape ? `0 ${16 * s}px` : `0 ${20 * s}px 0 0`,
187
- textShadow: "0 1px 6px rgba(0,0,0,0.1)"
188
- },
189
- children: label
190
- }
191
- )
192
- ]
193
- },
194
- i
195
- );
196
- }) });
197
- };
198
-
199
- // src/visual-system/scene-templates/infographic-feature-list.tsx
200
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
201
- var InfographicFeatureListTemplate = ({
202
- variables,
203
- style,
204
- progress,
205
- motionProgress = progress,
206
- beatIntensity,
207
- width,
208
- height,
209
- safeZone,
210
- sceneDuration,
211
- backgroundEffect,
212
- isPlaying = true
213
- }) => {
214
- const { foreground, font } = resolveTokens(style);
215
- const textColor = foreground;
216
- const text = String(variables.texts || "");
217
- const labels = parseList(variables.items, 3);
218
- const emojis = parseList(variables.itemEmojis);
219
- const features = labels.map((title, index) => ({ title, icon: emojis[index] || "\u2726" }));
220
- return /* @__PURE__ */ jsxs2("div", { style: { width, height, backgroundColor: "var(--vanillasky-template-surface, #000)", position: "relative", overflow: "hidden", fontFamily: font }, children: [
221
- /* @__PURE__ */ jsx2(
222
- SceneBackground,
223
- {
224
- style,
225
- progress,
226
- sceneDuration,
227
- width,
228
- height,
229
- ...getMediaBackgroundProps(variables),
230
- backgroundEffect,
231
- seed: text,
232
- isPlaying,
233
- beatIntensity
234
- }
235
- ),
236
- /* @__PURE__ */ jsx2(
237
- TemplateText,
238
- {
239
- overMedia: hasSceneMedia(variables),
240
- motionProgress,
241
- typeTreatment: resolveTokens(style).preset.type,
242
- archetype: "subtle",
243
- text,
244
- progress,
245
- sceneDuration: sceneDuration ?? 3,
246
- width,
247
- height,
248
- position: "top",
249
- sizeRole: "headline",
250
- safeZone,
251
- font,
252
- color: textColor,
253
- beatIntensity
254
- }
255
- ),
256
- /* @__PURE__ */ jsx2(
257
- FeatureList,
258
- {
259
- progress: motionProgress,
260
- width,
261
- height,
262
- features,
263
- textColor,
264
- font,
265
- beatIntensity
266
- }
267
- )
268
- ] });
269
- };
270
- export {
271
- InfographicFeatureListTemplate
272
- };
@@ -1,343 +0,0 @@
1
- import {
2
- stripPipe
3
- } from "./chunk-S7HFLYNN.js";
4
- import {
5
- SceneBackground,
6
- getMediaBackgroundProps
7
- } from "./chunk-MXZSDGZQ.js";
8
- import {
9
- smoothSize
10
- } from "./chunk-YJJC4N4D.js";
11
- import "./chunk-L5BTTCZV.js";
12
- import "./chunk-FRN6WKHA.js";
13
- import "./chunk-W3VDIBGR.js";
14
- import {
15
- interpolate,
16
- spring
17
- } from "./chunk-XTOXFMLM.js";
18
- import "./chunk-224QNWRA.js";
19
- import "./chunk-5CDAM24P.js";
20
- import {
21
- TOKEN_DEFAULTS,
22
- resolveTokens
23
- } from "./chunk-XWWLKRNU.js";
24
-
25
- // src/visual-system/primitives/infographic/ProblemSolution.tsx
26
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
27
- var SPRING_TEXT = { damping: 10, stiffness: 150 };
28
- var ProblemSolution = ({
29
- progress,
30
- width,
31
- height,
32
- problemText: rawProblemText,
33
- solutionText: rawSolutionText,
34
- problemLabel = "THE PROBLEM",
35
- solutionLabel = "THE SOLUTION",
36
- textColor = "#ffffff",
37
- font = TOKEN_DEFAULTS.font,
38
- beatIntensity = 0
39
- }) => {
40
- void beatIntensity;
41
- const s = Math.min(width, height) / 1080;
42
- const problemText = stripPipe(String(rawProblemText || ""));
43
- const solutionText = stripPipe(String(rawSolutionText || ""));
44
- const problemColor = "#ef4444";
45
- const solutionColor = "#22c55e";
46
- const isLandscape = width > height;
47
- const pillTop = height * (isLandscape ? 0.3 : 0.38);
48
- const textTop = height * (isLandscape ? 0.45 : 0.46);
49
- const labelFontSize = 32 * s;
50
- const longerChars = Math.max(problemText.length, solutionText.length, 1);
51
- const mainSize = smoothSize(longerChars, 70, 88, 60) * s;
52
- const CLAMP = { extrapolateLeft: "clamp", extrapolateRight: "clamp" };
53
- const problemLabelOpacity = interpolate(progress, [0.03, 0.1], [0, 1], CLAMP);
54
- const problemPillP = spring(interpolate(progress, [0.03, 0.15], [0, 1], CLAMP), { damping: 9, stiffness: 220 });
55
- const problemPillScale = interpolate(problemPillP, [0, 1], [0.55, 1]);
56
- const problemTextP = spring(interpolate(progress, [0.1, 0.25], [0, 1], CLAMP), SPRING_TEXT);
57
- const problemTextScale = interpolate(problemTextP, [0, 1], [1.4, 1]);
58
- const problemTextOpacity = interpolate(progress, [0.1, 0.2], [0, 1], CLAMP);
59
- const tremorActive = progress > 0.2 && progress < 0.4;
60
- const tremorX = tremorActive ? Math.sin(progress * 90) * 3 * s : 0;
61
- const problemFadeOut = interpolate(progress, [0.4, 0.48], [1, 0], CLAMP);
62
- const problemFallY = interpolate(progress, [0.4, 0.5], [0, height * 0.35], CLAMP);
63
- const solutionOverall = interpolate(progress, [0.5, 0.55], [0, 1], CLAMP);
64
- const SOLUTION_LAND = [0.55, 0.7];
65
- const solutionLandP = spring(
66
- interpolate(progress, [SOLUTION_LAND[0], SOLUTION_LAND[1]], [0, 1], CLAMP),
67
- { damping: 9, stiffness: 220 }
68
- );
69
- const solutionLandScale = interpolate(solutionLandP, [0, 1], [0.7, 1]);
70
- const solutionLandRiseY = interpolate(solutionLandP, [0, 1], [40 * s, 0]);
71
- const solutionLandOpacity = interpolate(
72
- progress,
73
- [SOLUTION_LAND[0], SOLUTION_LAND[0] + 0.05],
74
- [0, 1],
75
- CLAMP
76
- );
77
- const solutionLabelOpacity = solutionLandOpacity;
78
- const solutionPillScale = solutionLandScale;
79
- const solutionTextOpacity = solutionLandOpacity;
80
- const solutionTextScale = solutionLandScale;
81
- const solutionTextRiseY = solutionLandRiseY;
82
- const CONFETTI_COUNT = 14;
83
- const CONFETTI_ANGLE_JITTER = [-12, 8, -5, 14, -7, 11, -16, 6, -9, 13, -4, 10, -11, 7];
84
- const CONFETTI_DISTANCE = [60, 230, 100, 180, 130, 260, 80, 210, 50, 240, 150, 90, 220, 170];
85
- const CONFETTI_ROTATION = [-180, 220, -140, 260, -200, 180, -240, 200, -160, 240, -200, 280, -180, 220];
86
- const CONFETTI_COLORS = [
87
- "#22c55e",
88
- "#4ade80",
89
- "#86efac",
90
- "#bbf7d0",
91
- "#dcfce7",
92
- "#f0fdf4"
93
- ];
94
- const CONFETTI_TINT_INDEX = [0, 1, 2, 0, 3, 1, 4, 0, 2, 1, 5, 0, 3, 2];
95
- const confettiRaw = interpolate(progress, [0.55, 0.7], [0, 1], CLAMP);
96
- const confettiActive = confettiRaw > 0 && confettiRaw < 1;
97
- const confettiDist = 1 - Math.pow(1 - confettiRaw, 2.5);
98
- return /* @__PURE__ */ jsxs(Fragment, { children: [
99
- /* @__PURE__ */ jsxs(
100
- "div",
101
- {
102
- style: {
103
- position: "absolute",
104
- inset: 0,
105
- opacity: problemFadeOut,
106
- transform: `translateY(${problemFallY}px)`
107
- },
108
- children: [
109
- /* @__PURE__ */ jsx(
110
- "div",
111
- {
112
- style: {
113
- position: "absolute",
114
- top: pillTop,
115
- left: 0,
116
- right: 0,
117
- display: "flex",
118
- justifyContent: "center"
119
- },
120
- children: /* @__PURE__ */ jsx(
121
- "div",
122
- {
123
- style: {
124
- fontSize: labelFontSize,
125
- fontWeight: 700,
126
- color: problemColor,
127
- letterSpacing: 3 * s,
128
- textTransform: "uppercase",
129
- whiteSpace: "nowrap",
130
- opacity: problemLabelOpacity,
131
- transform: `scale(${problemPillScale})`,
132
- transformOrigin: "center center",
133
- fontFamily: font,
134
- backgroundColor: "rgba(0,0,0,0.3)",
135
- border: "1px solid rgba(255,255,255,0.15)",
136
- borderRadius: 100 * s,
137
- padding: `${14 * s}px ${36 * s}px`,
138
- textShadow: "0 1px 6px rgba(0,0,0,0.1)"
139
- },
140
- children: problemLabel
141
- }
142
- )
143
- }
144
- ),
145
- /* @__PURE__ */ jsx(
146
- "div",
147
- {
148
- style: {
149
- position: "absolute",
150
- top: textTop,
151
- left: 0,
152
- right: 0,
153
- fontSize: mainSize,
154
- fontWeight: 800,
155
- color: textColor,
156
- textAlign: "center",
157
- padding: `0 ${60 * s}px`,
158
- lineHeight: 1.2,
159
- letterSpacing: -1,
160
- opacity: problemTextOpacity,
161
- transform: `translateX(${tremorX}px) scale(${problemTextScale})`,
162
- fontFamily: font,
163
- textShadow: "0 2px 12px rgba(0,0,0,0.15)"
164
- },
165
- children: problemText
166
- }
167
- )
168
- ]
169
- }
170
- ),
171
- /* @__PURE__ */ jsxs(
172
- "div",
173
- {
174
- style: {
175
- position: "absolute",
176
- inset: 0,
177
- opacity: solutionOverall
178
- },
179
- children: [
180
- confettiActive && Array.from({ length: CONFETTI_COUNT }, (_, i) => {
181
- const baseAngle = 200 + i / (CONFETTI_COUNT - 1) * 140 + CONFETTI_ANGLE_JITTER[i];
182
- const angleRad = baseAngle * Math.PI / 180;
183
- const distance = confettiDist * CONFETTI_DISTANCE[i] * s;
184
- const gravity = confettiRaw * confettiRaw * 35 * s;
185
- const dx = Math.cos(angleRad) * distance;
186
- const dy = Math.sin(angleRad) * distance + gravity;
187
- const rot = confettiRaw * CONFETTI_ROTATION[i];
188
- const op = interpolate(confettiRaw, [0, 0.08, 0.7, 1], [0, 1, 1, 0]);
189
- const particleSize = 9 * s;
190
- const originX = width / 2;
191
- const originY = pillTop - 6 * s;
192
- const tint = CONFETTI_COLORS[CONFETTI_TINT_INDEX[i]];
193
- return /* @__PURE__ */ jsx(
194
- "div",
195
- {
196
- style: {
197
- position: "absolute",
198
- left: originX - particleSize / 2,
199
- top: originY - particleSize / 2 * 1.6,
200
- width: particleSize,
201
- height: particleSize * 1.6,
202
- backgroundColor: tint,
203
- borderRadius: 1 * s,
204
- transform: `translate(${dx}px, ${dy}px) rotate(${rot}deg)`,
205
- opacity: op,
206
- pointerEvents: "none",
207
- boxShadow: `0 0 ${4 * s}px ${tint}66`
208
- }
209
- },
210
- `confetti-${i}`
211
- );
212
- }),
213
- /* @__PURE__ */ jsx(
214
- "div",
215
- {
216
- style: {
217
- position: "absolute",
218
- top: pillTop,
219
- left: 0,
220
- right: 0,
221
- display: "flex",
222
- justifyContent: "center"
223
- },
224
- children: /* @__PURE__ */ jsx(
225
- "div",
226
- {
227
- style: {
228
- fontSize: labelFontSize,
229
- fontWeight: 700,
230
- color: solutionColor,
231
- letterSpacing: 3 * s,
232
- textTransform: "uppercase",
233
- whiteSpace: "nowrap",
234
- opacity: solutionLabelOpacity,
235
- transform: `scale(${solutionPillScale})`,
236
- transformOrigin: "center center",
237
- fontFamily: font,
238
- backgroundColor: "rgba(0,0,0,0.3)",
239
- border: "1px solid rgba(255,255,255,0.15)",
240
- borderRadius: 100 * s,
241
- padding: `${14 * s}px ${36 * s}px`,
242
- textShadow: "0 1px 6px rgba(0,0,0,0.1)"
243
- },
244
- children: solutionLabel
245
- }
246
- )
247
- }
248
- ),
249
- /* @__PURE__ */ jsx(
250
- "div",
251
- {
252
- style: {
253
- position: "absolute",
254
- top: textTop,
255
- left: 0,
256
- right: 0,
257
- fontSize: mainSize,
258
- fontWeight: 800,
259
- color: textColor,
260
- textAlign: "center",
261
- padding: `0 ${60 * s}px`,
262
- lineHeight: 1.2,
263
- letterSpacing: -1,
264
- opacity: solutionTextOpacity,
265
- transform: `translateY(${solutionTextRiseY}px) scale(${solutionTextScale})`,
266
- fontFamily: font,
267
- textShadow: "0 2px 12px rgba(0,0,0,0.15)"
268
- },
269
- children: solutionText
270
- }
271
- )
272
- ]
273
- }
274
- )
275
- ] });
276
- };
277
-
278
- // src/visual-system/scene-templates/infographic-problem-solution.tsx
279
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
280
- var InfographicProblemSolutionTemplate = ({
281
- variables,
282
- style,
283
- progress,
284
- beatIntensity,
285
- width,
286
- height,
287
- sceneDuration,
288
- backgroundEffect,
289
- isPlaying = true
290
- }) => {
291
- const { foreground, font } = resolveTokens(style);
292
- const textColor = foreground;
293
- const problemText = String(variables.problemText || "");
294
- const solutionText = String(variables.solutionText || "");
295
- return /* @__PURE__ */ jsxs2(
296
- "div",
297
- {
298
- style: {
299
- width,
300
- height,
301
- backgroundColor: "var(--vanillasky-template-surface, #000)",
302
- position: "relative",
303
- overflow: "hidden",
304
- fontFamily: font
305
- },
306
- children: [
307
- /* @__PURE__ */ jsx2(
308
- SceneBackground,
309
- {
310
- style,
311
- progress,
312
- sceneDuration,
313
- width,
314
- height,
315
- ...getMediaBackgroundProps(variables),
316
- backgroundEffect,
317
- seed: `${problemText}${solutionText}`,
318
- isPlaying,
319
- beatIntensity
320
- }
321
- ),
322
- /* @__PURE__ */ jsx2(
323
- ProblemSolution,
324
- {
325
- progress,
326
- width,
327
- height,
328
- problemLabel: String(variables.problemLabel || "THE PROBLEM"),
329
- problemText,
330
- solutionLabel: String(variables.solutionLabel || "THE SOLUTION"),
331
- solutionText,
332
- textColor,
333
- font,
334
- beatIntensity
335
- }
336
- )
337
- ]
338
- }
339
- );
340
- };
341
- export {
342
- InfographicProblemSolutionTemplate
343
- };