@contractspec/lib.video-gen 1.42.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.
- package/dist/browser/compositions/api-overview.js +645 -0
- package/dist/browser/compositions/index.js +1133 -0
- package/dist/browser/compositions/primitives/animated-text.js +144 -0
- package/dist/browser/compositions/primitives/brand-frame.js +181 -0
- package/dist/browser/compositions/primitives/code-block.js +226 -0
- package/dist/browser/compositions/primitives/index.js +656 -0
- package/dist/browser/compositions/primitives/progress-bar.js +59 -0
- package/dist/browser/compositions/primitives/terminal.js +265 -0
- package/dist/browser/compositions/primitives/transition.js +98 -0
- package/dist/browser/compositions/social-clip.js +500 -0
- package/dist/browser/compositions/terminal-demo.js +558 -0
- package/dist/browser/design/index.js +155 -0
- package/dist/browser/design/layouts.js +50 -0
- package/dist/browser/design/motion.js +43 -0
- package/dist/browser/design/tokens.js +28 -0
- package/dist/browser/design/typography.js +61 -0
- package/dist/browser/docs/compositions.docblock.js +182 -0
- package/dist/browser/docs/design.docblock.js +187 -0
- package/dist/browser/docs/generators.docblock.js +187 -0
- package/dist/browser/docs/rendering.docblock.js +197 -0
- package/dist/browser/docs/video-gen.docblock.js +141 -0
- package/dist/browser/generators/index.js +416 -0
- package/dist/browser/generators/scene-planner.js +205 -0
- package/dist/browser/generators/script-generator.js +147 -0
- package/dist/browser/generators/video-generator.js +414 -0
- package/dist/browser/index.js +1550 -0
- package/dist/browser/player/demo-player.js +1136 -0
- package/dist/browser/player/index.js +1136 -0
- package/dist/browser/remotion/Root.js +1189 -0
- package/dist/browser/remotion/index.js +1190 -0
- package/dist/browser/renderers/config.js +40 -0
- package/dist/browser/renderers/index.js +160 -0
- package/dist/browser/renderers/local.js +156 -0
- package/dist/browser/types.js +13 -0
- package/dist/compositions/api-overview.d.ts +16 -0
- package/dist/compositions/api-overview.js +640 -0
- package/dist/compositions/index.d.ts +7 -0
- package/dist/compositions/index.js +1128 -0
- package/dist/compositions/primitives/animated-text.d.ts +22 -0
- package/dist/compositions/primitives/animated-text.js +139 -0
- package/dist/compositions/primitives/brand-frame.d.ts +14 -0
- package/dist/compositions/primitives/brand-frame.js +176 -0
- package/dist/compositions/primitives/code-block.d.ts +18 -0
- package/dist/compositions/primitives/code-block.js +221 -0
- package/dist/compositions/primitives/index.d.ts +12 -0
- package/dist/compositions/primitives/index.js +651 -0
- package/dist/compositions/primitives/progress-bar.d.ts +12 -0
- package/dist/compositions/primitives/progress-bar.js +54 -0
- package/dist/compositions/primitives/terminal.d.ts +24 -0
- package/dist/compositions/primitives/terminal.js +260 -0
- package/dist/compositions/primitives/transition.d.ts +14 -0
- package/dist/compositions/primitives/transition.js +93 -0
- package/dist/compositions/social-clip.d.ts +16 -0
- package/dist/compositions/social-clip.js +495 -0
- package/dist/compositions/terminal-demo.d.ts +17 -0
- package/dist/compositions/terminal-demo.js +553 -0
- package/dist/design/index.d.ts +4 -0
- package/dist/design/index.js +150 -0
- package/dist/design/layouts.d.ts +69 -0
- package/dist/design/layouts.js +45 -0
- package/dist/design/motion.d.ts +72 -0
- package/dist/design/motion.js +38 -0
- package/dist/design/tokens.d.ts +31 -0
- package/dist/design/tokens.js +23 -0
- package/dist/design/typography.d.ts +61 -0
- package/dist/design/typography.js +56 -0
- package/dist/docs/compositions.docblock.d.ts +1 -0
- package/dist/docs/compositions.docblock.js +183 -0
- package/dist/docs/design.docblock.d.ts +1 -0
- package/dist/docs/design.docblock.js +188 -0
- package/dist/docs/generators.docblock.d.ts +1 -0
- package/dist/docs/generators.docblock.js +188 -0
- package/dist/docs/rendering.docblock.d.ts +1 -0
- package/dist/docs/rendering.docblock.js +198 -0
- package/dist/docs/video-gen.docblock.d.ts +1 -0
- package/dist/docs/video-gen.docblock.js +142 -0
- package/dist/generators/index.d.ts +5 -0
- package/dist/generators/index.js +411 -0
- package/dist/generators/scene-planner.d.ts +23 -0
- package/dist/generators/scene-planner.js +200 -0
- package/dist/generators/script-generator.d.ts +49 -0
- package/dist/generators/script-generator.js +142 -0
- package/dist/generators/video-generator.d.ts +20 -0
- package/dist/generators/video-generator.js +409 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1545 -0
- package/dist/node/compositions/api-overview.js +640 -0
- package/dist/node/compositions/index.js +1128 -0
- package/dist/node/compositions/primitives/animated-text.js +139 -0
- package/dist/node/compositions/primitives/brand-frame.js +176 -0
- package/dist/node/compositions/primitives/code-block.js +221 -0
- package/dist/node/compositions/primitives/index.js +651 -0
- package/dist/node/compositions/primitives/progress-bar.js +54 -0
- package/dist/node/compositions/primitives/terminal.js +260 -0
- package/dist/node/compositions/primitives/transition.js +93 -0
- package/dist/node/compositions/social-clip.js +495 -0
- package/dist/node/compositions/terminal-demo.js +553 -0
- package/dist/node/design/index.js +150 -0
- package/dist/node/design/layouts.js +45 -0
- package/dist/node/design/motion.js +38 -0
- package/dist/node/design/tokens.js +23 -0
- package/dist/node/design/typography.js +56 -0
- package/dist/node/docs/compositions.docblock.js +182 -0
- package/dist/node/docs/design.docblock.js +187 -0
- package/dist/node/docs/generators.docblock.js +187 -0
- package/dist/node/docs/rendering.docblock.js +197 -0
- package/dist/node/docs/video-gen.docblock.js +141 -0
- package/dist/node/generators/index.js +411 -0
- package/dist/node/generators/scene-planner.js +200 -0
- package/dist/node/generators/script-generator.js +142 -0
- package/dist/node/generators/video-generator.js +409 -0
- package/dist/node/index.js +1545 -0
- package/dist/node/player/demo-player.js +1131 -0
- package/dist/node/player/index.js +1131 -0
- package/dist/node/remotion/Root.js +1184 -0
- package/dist/node/remotion/index.js +1185 -0
- package/dist/node/renderers/config.js +35 -0
- package/dist/node/renderers/index.js +155 -0
- package/dist/node/renderers/local.js +151 -0
- package/dist/node/types.js +8 -0
- package/dist/player/demo-player.d.ts +55 -0
- package/dist/player/demo-player.js +1131 -0
- package/dist/player/index.d.ts +2 -0
- package/dist/player/index.js +1131 -0
- package/dist/remotion/Root.d.ts +2 -0
- package/dist/remotion/Root.js +1184 -0
- package/dist/remotion/index.d.ts +1 -0
- package/dist/remotion/index.js +1185 -0
- package/dist/renderers/config.d.ts +28 -0
- package/dist/renderers/config.js +35 -0
- package/dist/renderers/index.d.ts +3 -0
- package/dist/renderers/index.js +155 -0
- package/dist/renderers/local.d.ts +17 -0
- package/dist/renderers/local.js +151 -0
- package/dist/types.d.ts +63 -0
- package/dist/types.js +8 -0
- package/package.json +637 -0
|
@@ -0,0 +1,1131 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var __require = import.meta.require;
|
|
3
|
+
|
|
4
|
+
// src/design/motion.ts
|
|
5
|
+
import { Easing } from "remotion";
|
|
6
|
+
var videoEasing = {
|
|
7
|
+
entrance: Easing.out(Easing.exp),
|
|
8
|
+
exit: Easing.in(Easing.exp),
|
|
9
|
+
emphasis: Easing.out(Easing.back(1.4)),
|
|
10
|
+
linear: Easing.linear,
|
|
11
|
+
gentle: Easing.bezier(0.25, 0.1, 0.25, 1),
|
|
12
|
+
spring: Easing.out(Easing.back(1.7))
|
|
13
|
+
};
|
|
14
|
+
var videoDurations = {
|
|
15
|
+
sceneTransition: 20,
|
|
16
|
+
textEntrance: 15,
|
|
17
|
+
textExit: 12,
|
|
18
|
+
codeTypingPerChar: 2,
|
|
19
|
+
sectionPause: 30,
|
|
20
|
+
emphasisPause: 15,
|
|
21
|
+
brandReveal: 25,
|
|
22
|
+
minScene: 60,
|
|
23
|
+
shortScene: 60,
|
|
24
|
+
mediumScene: 120,
|
|
25
|
+
longScene: 240
|
|
26
|
+
};
|
|
27
|
+
var videoTransitions = {
|
|
28
|
+
fade: { type: "fade", durationInFrames: 20 },
|
|
29
|
+
slideLeft: { type: "slide-left", durationInFrames: 20 },
|
|
30
|
+
slideRight: { type: "slide-right", durationInFrames: 20 },
|
|
31
|
+
wipe: { type: "wipe", durationInFrames: 15 },
|
|
32
|
+
none: { type: "none", durationInFrames: 0 }
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
// src/design/tokens.ts
|
|
36
|
+
import { defaultTokens } from "@contractspec/lib.design-system";
|
|
37
|
+
var defaultVideoColors = {
|
|
38
|
+
canvasBackground: defaultTokens.colors.background,
|
|
39
|
+
codeBackground: "#1e1e2e",
|
|
40
|
+
terminalBackground: "#0d1117",
|
|
41
|
+
terminalForeground: "#c9d1d9",
|
|
42
|
+
highlight: defaultTokens.colors.accent,
|
|
43
|
+
gradientStart: defaultTokens.colors.primary,
|
|
44
|
+
gradientEnd: defaultTokens.colors.accent
|
|
45
|
+
};
|
|
46
|
+
var defaultVideoTheme = {
|
|
47
|
+
...defaultTokens,
|
|
48
|
+
video: defaultVideoColors
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// src/design/layouts.ts
|
|
52
|
+
import { VIDEO_FORMATS } from "@contractspec/lib.contracts-integrations/integrations/providers/video";
|
|
53
|
+
var DEFAULT_FPS = 30;
|
|
54
|
+
var videoSafeZone = {
|
|
55
|
+
horizontal: 120,
|
|
56
|
+
vertical: 80,
|
|
57
|
+
contentWidth: 1680,
|
|
58
|
+
contentHeight: 920
|
|
59
|
+
};
|
|
60
|
+
function scaleSafeZone(format) {
|
|
61
|
+
const scaleX = format.width / 1920;
|
|
62
|
+
const scaleY = format.height / 1080;
|
|
63
|
+
return {
|
|
64
|
+
horizontal: Math.round(videoSafeZone.horizontal * scaleX),
|
|
65
|
+
vertical: Math.round(videoSafeZone.vertical * scaleY),
|
|
66
|
+
contentWidth: Math.round(videoSafeZone.contentWidth * scaleX),
|
|
67
|
+
contentHeight: Math.round(videoSafeZone.contentHeight * scaleY)
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
var videoPositions = {
|
|
71
|
+
center: { x: 960, y: 540 },
|
|
72
|
+
topLeft: { x: 120, y: 80 },
|
|
73
|
+
topRight: { x: 1800, y: 80 },
|
|
74
|
+
bottomLeft: { x: 120, y: 1000 },
|
|
75
|
+
bottomRight: { x: 1800, y: 1000 },
|
|
76
|
+
bottomCenter: { x: 960, y: 960 }
|
|
77
|
+
};
|
|
78
|
+
function getAllFormatVariants() {
|
|
79
|
+
return [
|
|
80
|
+
VIDEO_FORMATS.landscape,
|
|
81
|
+
VIDEO_FORMATS.square,
|
|
82
|
+
VIDEO_FORMATS.portrait
|
|
83
|
+
];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// src/compositions/primitives/brand-frame.tsx
|
|
87
|
+
import { interpolate, useCurrentFrame, useVideoConfig } from "remotion";
|
|
88
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
89
|
+
var BrandFrame = ({
|
|
90
|
+
styleOverrides,
|
|
91
|
+
showBranding = true,
|
|
92
|
+
animateEntrance = true,
|
|
93
|
+
variant = "gradient",
|
|
94
|
+
children
|
|
95
|
+
}) => {
|
|
96
|
+
const frame = useCurrentFrame();
|
|
97
|
+
const { width, height } = useVideoConfig();
|
|
98
|
+
const theme = defaultVideoTheme;
|
|
99
|
+
const safeZone = scaleSafeZone({ type: "custom", width, height });
|
|
100
|
+
const primaryColor = styleOverrides?.primaryColor ?? theme.colors.primary;
|
|
101
|
+
const _accentColor = styleOverrides?.accentColor ?? theme.colors.accent;
|
|
102
|
+
const isDark = styleOverrides?.darkMode ?? true;
|
|
103
|
+
let background;
|
|
104
|
+
switch (variant) {
|
|
105
|
+
case "solid":
|
|
106
|
+
background = isDark ? "#0a0a0a" : theme.colors.background;
|
|
107
|
+
break;
|
|
108
|
+
case "gradient":
|
|
109
|
+
background = isDark ? `linear-gradient(135deg, #0a0a14 0%, #0f172a 50%, #0a0a14 100%)` : `linear-gradient(135deg, ${theme.colors.background} 0%, ${theme.colors.muted} 100%)`;
|
|
110
|
+
break;
|
|
111
|
+
case "dark":
|
|
112
|
+
background = "#000000";
|
|
113
|
+
break;
|
|
114
|
+
}
|
|
115
|
+
const entranceOpacity = animateEntrance ? interpolate(frame, [0, 15], [0, 1], {
|
|
116
|
+
extrapolateLeft: "clamp",
|
|
117
|
+
extrapolateRight: "clamp",
|
|
118
|
+
easing: videoEasing.entrance
|
|
119
|
+
}) : 1;
|
|
120
|
+
const brandOpacity = showBranding ? interpolate(frame, [videoDurations.brandReveal, videoDurations.brandReveal + 15], [0, 0.3], {
|
|
121
|
+
extrapolateLeft: "clamp",
|
|
122
|
+
extrapolateRight: "clamp"
|
|
123
|
+
}) : 0;
|
|
124
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
125
|
+
style: {
|
|
126
|
+
width,
|
|
127
|
+
height,
|
|
128
|
+
background,
|
|
129
|
+
position: "relative",
|
|
130
|
+
overflow: "hidden",
|
|
131
|
+
opacity: entranceOpacity
|
|
132
|
+
},
|
|
133
|
+
children: [
|
|
134
|
+
variant === "gradient" && /* @__PURE__ */ jsxDEV("div", {
|
|
135
|
+
style: {
|
|
136
|
+
position: "absolute",
|
|
137
|
+
top: "-20%",
|
|
138
|
+
right: "-10%",
|
|
139
|
+
width: "50%",
|
|
140
|
+
height: "50%",
|
|
141
|
+
background: `radial-gradient(circle, ${primaryColor}15 0%, transparent 70%)`,
|
|
142
|
+
borderRadius: "50%",
|
|
143
|
+
pointerEvents: "none"
|
|
144
|
+
}
|
|
145
|
+
}, undefined, false, undefined, this),
|
|
146
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
147
|
+
style: {
|
|
148
|
+
position: "absolute",
|
|
149
|
+
left: safeZone.horizontal,
|
|
150
|
+
top: safeZone.vertical,
|
|
151
|
+
width: safeZone.contentWidth,
|
|
152
|
+
height: safeZone.contentHeight,
|
|
153
|
+
display: "flex",
|
|
154
|
+
flexDirection: "column"
|
|
155
|
+
},
|
|
156
|
+
children
|
|
157
|
+
}, undefined, false, undefined, this),
|
|
158
|
+
showBranding && /* @__PURE__ */ jsxDEV("div", {
|
|
159
|
+
style: {
|
|
160
|
+
position: "absolute",
|
|
161
|
+
bottom: safeZone.vertical / 2,
|
|
162
|
+
right: safeZone.horizontal,
|
|
163
|
+
opacity: brandOpacity,
|
|
164
|
+
color: isDark ? "#ffffff" : "#000000",
|
|
165
|
+
fontSize: Math.round(16 * (width / 1920)),
|
|
166
|
+
fontWeight: 500,
|
|
167
|
+
letterSpacing: 1
|
|
168
|
+
},
|
|
169
|
+
children: "ContractSpec"
|
|
170
|
+
}, undefined, false, undefined, this)
|
|
171
|
+
]
|
|
172
|
+
}, undefined, true, undefined, this);
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
// src/design/typography.ts
|
|
176
|
+
var videoTypography = {
|
|
177
|
+
title: {
|
|
178
|
+
fontSize: 72,
|
|
179
|
+
lineHeight: 1.1,
|
|
180
|
+
fontWeight: 700,
|
|
181
|
+
letterSpacing: -1
|
|
182
|
+
},
|
|
183
|
+
heading: {
|
|
184
|
+
fontSize: 56,
|
|
185
|
+
lineHeight: 1.2,
|
|
186
|
+
fontWeight: 600,
|
|
187
|
+
letterSpacing: -0.5
|
|
188
|
+
},
|
|
189
|
+
subheading: {
|
|
190
|
+
fontSize: 40,
|
|
191
|
+
lineHeight: 1.25,
|
|
192
|
+
fontWeight: 500
|
|
193
|
+
},
|
|
194
|
+
body: {
|
|
195
|
+
fontSize: 32,
|
|
196
|
+
lineHeight: 1.5,
|
|
197
|
+
fontWeight: 400
|
|
198
|
+
},
|
|
199
|
+
code: {
|
|
200
|
+
fontSize: 28,
|
|
201
|
+
lineHeight: 1.6,
|
|
202
|
+
fontWeight: 400
|
|
203
|
+
},
|
|
204
|
+
caption: {
|
|
205
|
+
fontSize: 24,
|
|
206
|
+
lineHeight: 1.4,
|
|
207
|
+
fontWeight: 400
|
|
208
|
+
},
|
|
209
|
+
label: {
|
|
210
|
+
fontSize: 20,
|
|
211
|
+
lineHeight: 1.3,
|
|
212
|
+
fontWeight: 600,
|
|
213
|
+
letterSpacing: 1
|
|
214
|
+
}
|
|
215
|
+
};
|
|
216
|
+
function scaleTypography(style, targetWidth) {
|
|
217
|
+
const scale = targetWidth / 1920;
|
|
218
|
+
return {
|
|
219
|
+
...style,
|
|
220
|
+
fontSize: Math.round(style.fontSize * scale),
|
|
221
|
+
letterSpacing: style.letterSpacing ? Math.round(style.letterSpacing * scale * 10) / 10 : undefined
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
// src/compositions/primitives/animated-text.tsx
|
|
226
|
+
import { interpolate as interpolate2, useCurrentFrame as useCurrentFrame2, useVideoConfig as useVideoConfig2 } from "remotion";
|
|
227
|
+
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
228
|
+
var AnimatedText = ({
|
|
229
|
+
text,
|
|
230
|
+
variant = "body",
|
|
231
|
+
style: styleOverride,
|
|
232
|
+
enterAt = 0,
|
|
233
|
+
exitAt,
|
|
234
|
+
color = "#ffffff",
|
|
235
|
+
align = "left"
|
|
236
|
+
}) => {
|
|
237
|
+
const frame = useCurrentFrame2();
|
|
238
|
+
const { width } = useVideoConfig2();
|
|
239
|
+
const baseStyle = videoTypography[variant];
|
|
240
|
+
const scaled = scaleTypography(baseStyle, width);
|
|
241
|
+
const finalStyle = { ...scaled, ...styleOverride };
|
|
242
|
+
const enterProgress = interpolate2(frame, [enterAt, enterAt + videoDurations.textEntrance], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
|
|
243
|
+
const enterOpacity = interpolate2(enterProgress, [0, 1], [0, 1], {
|
|
244
|
+
easing: videoEasing.entrance
|
|
245
|
+
});
|
|
246
|
+
const enterTranslateY = interpolate2(enterProgress, [0, 1], [30, 0], {
|
|
247
|
+
easing: videoEasing.entrance
|
|
248
|
+
});
|
|
249
|
+
let exitOpacity = 1;
|
|
250
|
+
let exitTranslateY = 0;
|
|
251
|
+
if (exitAt !== undefined) {
|
|
252
|
+
const exitProgress = interpolate2(frame, [exitAt, exitAt + videoDurations.textExit], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
|
|
253
|
+
exitOpacity = interpolate2(exitProgress, [0, 1], [1, 0], {
|
|
254
|
+
easing: videoEasing.exit
|
|
255
|
+
});
|
|
256
|
+
exitTranslateY = interpolate2(exitProgress, [0, 1], [0, -20], {
|
|
257
|
+
easing: videoEasing.exit
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
const opacity = enterOpacity * exitOpacity;
|
|
261
|
+
const translateY = enterTranslateY + exitTranslateY;
|
|
262
|
+
return /* @__PURE__ */ jsxDEV2("div", {
|
|
263
|
+
style: {
|
|
264
|
+
fontSize: finalStyle.fontSize,
|
|
265
|
+
lineHeight: finalStyle.lineHeight,
|
|
266
|
+
fontWeight: finalStyle.fontWeight,
|
|
267
|
+
letterSpacing: finalStyle.letterSpacing,
|
|
268
|
+
color,
|
|
269
|
+
textAlign: align,
|
|
270
|
+
opacity,
|
|
271
|
+
transform: `translateY(${translateY}px)`,
|
|
272
|
+
willChange: "opacity, transform"
|
|
273
|
+
},
|
|
274
|
+
children: text
|
|
275
|
+
}, undefined, false, undefined, this);
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
// src/compositions/primitives/code-block.tsx
|
|
279
|
+
import { interpolate as interpolate3, useCurrentFrame as useCurrentFrame3, useVideoConfig as useVideoConfig3 } from "remotion";
|
|
280
|
+
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
281
|
+
var CodeBlock = ({
|
|
282
|
+
code,
|
|
283
|
+
language = "typescript",
|
|
284
|
+
startAt = 0,
|
|
285
|
+
typeAnimation = true,
|
|
286
|
+
backgroundColor = defaultVideoColors.codeBackground,
|
|
287
|
+
textColor = "#abb2bf",
|
|
288
|
+
filename
|
|
289
|
+
}) => {
|
|
290
|
+
const frame = useCurrentFrame3();
|
|
291
|
+
const { width } = useVideoConfig3();
|
|
292
|
+
const codeStyle = scaleTypography(videoTypography.code, width);
|
|
293
|
+
const totalChars = code.length;
|
|
294
|
+
const typingDuration = totalChars * videoDurations.codeTypingPerChar;
|
|
295
|
+
const charsVisible = typeAnimation ? Math.floor(interpolate3(frame, [startAt, startAt + typingDuration], [0, totalChars], {
|
|
296
|
+
extrapolateLeft: "clamp",
|
|
297
|
+
extrapolateRight: "clamp"
|
|
298
|
+
})) : totalChars;
|
|
299
|
+
const visibleCode = code.slice(0, charsVisible);
|
|
300
|
+
const opacity = interpolate3(frame, [startAt, startAt + 10], [0, 1], {
|
|
301
|
+
extrapolateLeft: "clamp",
|
|
302
|
+
extrapolateRight: "clamp",
|
|
303
|
+
easing: videoEasing.entrance
|
|
304
|
+
});
|
|
305
|
+
const showCursor = typeAnimation && charsVisible < totalChars && frame % 16 < 10;
|
|
306
|
+
return /* @__PURE__ */ jsxDEV3("div", {
|
|
307
|
+
style: {
|
|
308
|
+
backgroundColor,
|
|
309
|
+
borderRadius: 16,
|
|
310
|
+
padding: 0,
|
|
311
|
+
opacity,
|
|
312
|
+
overflow: "hidden",
|
|
313
|
+
boxShadow: "0 8px 32px rgba(0,0,0,0.3)"
|
|
314
|
+
},
|
|
315
|
+
children: [
|
|
316
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
317
|
+
style: {
|
|
318
|
+
display: "flex",
|
|
319
|
+
alignItems: "center",
|
|
320
|
+
padding: "12px 20px",
|
|
321
|
+
backgroundColor: "rgba(0,0,0,0.2)",
|
|
322
|
+
gap: 8
|
|
323
|
+
},
|
|
324
|
+
children: [
|
|
325
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
326
|
+
style: { display: "flex", gap: 8 },
|
|
327
|
+
children: [
|
|
328
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
329
|
+
style: {
|
|
330
|
+
width: 12,
|
|
331
|
+
height: 12,
|
|
332
|
+
borderRadius: "50%",
|
|
333
|
+
backgroundColor: "#ff5f57"
|
|
334
|
+
}
|
|
335
|
+
}, undefined, false, undefined, this),
|
|
336
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
337
|
+
style: {
|
|
338
|
+
width: 12,
|
|
339
|
+
height: 12,
|
|
340
|
+
borderRadius: "50%",
|
|
341
|
+
backgroundColor: "#febc2e"
|
|
342
|
+
}
|
|
343
|
+
}, undefined, false, undefined, this),
|
|
344
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
345
|
+
style: {
|
|
346
|
+
width: 12,
|
|
347
|
+
height: 12,
|
|
348
|
+
borderRadius: "50%",
|
|
349
|
+
backgroundColor: "#28c840"
|
|
350
|
+
}
|
|
351
|
+
}, undefined, false, undefined, this)
|
|
352
|
+
]
|
|
353
|
+
}, undefined, true, undefined, this),
|
|
354
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
355
|
+
style: {
|
|
356
|
+
flex: 1,
|
|
357
|
+
textAlign: "center",
|
|
358
|
+
color: "#666",
|
|
359
|
+
fontSize: codeStyle.fontSize * 0.7,
|
|
360
|
+
fontFamily: "monospace"
|
|
361
|
+
},
|
|
362
|
+
children: filename ?? language
|
|
363
|
+
}, undefined, false, undefined, this)
|
|
364
|
+
]
|
|
365
|
+
}, undefined, true, undefined, this),
|
|
366
|
+
/* @__PURE__ */ jsxDEV3("div", {
|
|
367
|
+
style: { padding: "24px 32px" },
|
|
368
|
+
children: /* @__PURE__ */ jsxDEV3("pre", {
|
|
369
|
+
style: {
|
|
370
|
+
margin: 0,
|
|
371
|
+
fontFamily: "'SF Mono', 'Fira Code', 'JetBrains Mono', monospace",
|
|
372
|
+
fontSize: codeStyle.fontSize,
|
|
373
|
+
lineHeight: codeStyle.lineHeight,
|
|
374
|
+
color: textColor,
|
|
375
|
+
whiteSpace: "pre-wrap",
|
|
376
|
+
wordBreak: "break-word"
|
|
377
|
+
},
|
|
378
|
+
children: [
|
|
379
|
+
visibleCode,
|
|
380
|
+
showCursor && /* @__PURE__ */ jsxDEV3("span", {
|
|
381
|
+
style: {
|
|
382
|
+
backgroundColor: textColor,
|
|
383
|
+
width: "2px",
|
|
384
|
+
display: "inline-block",
|
|
385
|
+
height: "1.2em",
|
|
386
|
+
verticalAlign: "text-bottom"
|
|
387
|
+
},
|
|
388
|
+
children: "\xA0"
|
|
389
|
+
}, undefined, false, undefined, this)
|
|
390
|
+
]
|
|
391
|
+
}, undefined, true, undefined, this)
|
|
392
|
+
}, undefined, false, undefined, this)
|
|
393
|
+
]
|
|
394
|
+
}, undefined, true, undefined, this);
|
|
395
|
+
};
|
|
396
|
+
|
|
397
|
+
// src/compositions/primitives/progress-bar.tsx
|
|
398
|
+
import { useCurrentFrame as useCurrentFrame4, useVideoConfig as useVideoConfig4 } from "remotion";
|
|
399
|
+
import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
|
|
400
|
+
var ProgressBar = ({
|
|
401
|
+
height = 4,
|
|
402
|
+
color = defaultVideoTheme.colors.primary,
|
|
403
|
+
backgroundColor = "rgba(255,255,255,0.1)",
|
|
404
|
+
position = "bottom"
|
|
405
|
+
}) => {
|
|
406
|
+
const frame = useCurrentFrame4();
|
|
407
|
+
const { durationInFrames, width } = useVideoConfig4();
|
|
408
|
+
const progress = frame / durationInFrames;
|
|
409
|
+
return /* @__PURE__ */ jsxDEV4("div", {
|
|
410
|
+
style: {
|
|
411
|
+
position: "absolute",
|
|
412
|
+
[position]: 0,
|
|
413
|
+
left: 0,
|
|
414
|
+
width,
|
|
415
|
+
height,
|
|
416
|
+
backgroundColor,
|
|
417
|
+
zIndex: 100
|
|
418
|
+
},
|
|
419
|
+
children: /* @__PURE__ */ jsxDEV4("div", {
|
|
420
|
+
style: {
|
|
421
|
+
width: `${progress * 100}%`,
|
|
422
|
+
height: "100%",
|
|
423
|
+
backgroundColor: color,
|
|
424
|
+
transition: "none"
|
|
425
|
+
}
|
|
426
|
+
}, undefined, false, undefined, this)
|
|
427
|
+
}, undefined, false, undefined, this);
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
// src/compositions/api-overview.tsx
|
|
431
|
+
import {
|
|
432
|
+
AbsoluteFill,
|
|
433
|
+
Sequence,
|
|
434
|
+
interpolate as interpolate4,
|
|
435
|
+
useCurrentFrame as useCurrentFrame5,
|
|
436
|
+
useVideoConfig as useVideoConfig5
|
|
437
|
+
} from "remotion";
|
|
438
|
+
import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
|
|
439
|
+
var ApiOverview = ({
|
|
440
|
+
specName,
|
|
441
|
+
method = "POST",
|
|
442
|
+
endpoint = "/api/users",
|
|
443
|
+
specCode,
|
|
444
|
+
generatedOutputs = [
|
|
445
|
+
"REST Endpoint",
|
|
446
|
+
"GraphQL Mutation",
|
|
447
|
+
"Prisma Model",
|
|
448
|
+
"TypeScript SDK",
|
|
449
|
+
"MCP Tool",
|
|
450
|
+
"OpenAPI Spec"
|
|
451
|
+
],
|
|
452
|
+
tagline = "One spec. Every surface."
|
|
453
|
+
}) => {
|
|
454
|
+
const { durationInFrames } = useVideoConfig5();
|
|
455
|
+
const theme = defaultVideoTheme;
|
|
456
|
+
const INTRO_END = 60;
|
|
457
|
+
const CODE_START = 45;
|
|
458
|
+
const CODE_END = INTRO_END + 150;
|
|
459
|
+
const OUTPUTS_START = CODE_END - 30;
|
|
460
|
+
const TAGLINE_START = durationInFrames - 90;
|
|
461
|
+
return /* @__PURE__ */ jsxDEV5(AbsoluteFill, {
|
|
462
|
+
children: [
|
|
463
|
+
/* @__PURE__ */ jsxDEV5(BrandFrame, {
|
|
464
|
+
variant: "gradient",
|
|
465
|
+
showBranding: true,
|
|
466
|
+
children: [
|
|
467
|
+
/* @__PURE__ */ jsxDEV5(Sequence, {
|
|
468
|
+
from: 0,
|
|
469
|
+
durationInFrames: CODE_END,
|
|
470
|
+
children: /* @__PURE__ */ jsxDEV5("div", {
|
|
471
|
+
style: {
|
|
472
|
+
flex: 1,
|
|
473
|
+
display: "flex",
|
|
474
|
+
flexDirection: "column",
|
|
475
|
+
gap: 16
|
|
476
|
+
},
|
|
477
|
+
children: [
|
|
478
|
+
/* @__PURE__ */ jsxDEV5("div", {
|
|
479
|
+
style: { display: "flex", alignItems: "center", gap: 16 },
|
|
480
|
+
children: [
|
|
481
|
+
/* @__PURE__ */ jsxDEV5(MethodBadge, {
|
|
482
|
+
method,
|
|
483
|
+
enterAt: 10
|
|
484
|
+
}, undefined, false, undefined, this),
|
|
485
|
+
/* @__PURE__ */ jsxDEV5(AnimatedText, {
|
|
486
|
+
text: endpoint,
|
|
487
|
+
variant: "subheading",
|
|
488
|
+
enterAt: 15,
|
|
489
|
+
color: theme.colors.mutedForeground
|
|
490
|
+
}, undefined, false, undefined, this)
|
|
491
|
+
]
|
|
492
|
+
}, undefined, true, undefined, this),
|
|
493
|
+
/* @__PURE__ */ jsxDEV5(AnimatedText, {
|
|
494
|
+
text: specName,
|
|
495
|
+
variant: "title",
|
|
496
|
+
enterAt: 5,
|
|
497
|
+
color: "#ffffff"
|
|
498
|
+
}, undefined, false, undefined, this),
|
|
499
|
+
/* @__PURE__ */ jsxDEV5("div", {
|
|
500
|
+
style: { flex: 1, marginTop: 24 },
|
|
501
|
+
children: /* @__PURE__ */ jsxDEV5(CodeBlock, {
|
|
502
|
+
code: specCode,
|
|
503
|
+
language: "typescript",
|
|
504
|
+
filename: `${specName.toLowerCase()}.contract.ts`,
|
|
505
|
+
startAt: CODE_START,
|
|
506
|
+
typeAnimation: true
|
|
507
|
+
}, undefined, false, undefined, this)
|
|
508
|
+
}, undefined, false, undefined, this)
|
|
509
|
+
]
|
|
510
|
+
}, undefined, true, undefined, this)
|
|
511
|
+
}, undefined, false, undefined, this),
|
|
512
|
+
/* @__PURE__ */ jsxDEV5(Sequence, {
|
|
513
|
+
from: OUTPUTS_START,
|
|
514
|
+
durationInFrames: durationInFrames - OUTPUTS_START,
|
|
515
|
+
children: /* @__PURE__ */ jsxDEV5("div", {
|
|
516
|
+
style: {
|
|
517
|
+
flex: 1,
|
|
518
|
+
display: "flex",
|
|
519
|
+
flexDirection: "column",
|
|
520
|
+
justifyContent: "center",
|
|
521
|
+
alignItems: "center",
|
|
522
|
+
gap: 24
|
|
523
|
+
},
|
|
524
|
+
children: [
|
|
525
|
+
/* @__PURE__ */ jsxDEV5(AnimatedText, {
|
|
526
|
+
text: "Generates:",
|
|
527
|
+
variant: "heading",
|
|
528
|
+
enterAt: 0,
|
|
529
|
+
color: "#ffffff",
|
|
530
|
+
align: "center"
|
|
531
|
+
}, undefined, false, undefined, this),
|
|
532
|
+
/* @__PURE__ */ jsxDEV5("div", {
|
|
533
|
+
style: {
|
|
534
|
+
display: "flex",
|
|
535
|
+
flexWrap: "wrap",
|
|
536
|
+
gap: 16,
|
|
537
|
+
justifyContent: "center",
|
|
538
|
+
maxWidth: "80%",
|
|
539
|
+
marginTop: 32
|
|
540
|
+
},
|
|
541
|
+
children: generatedOutputs.map((output, i) => /* @__PURE__ */ jsxDEV5(OutputChip, {
|
|
542
|
+
label: output,
|
|
543
|
+
index: i,
|
|
544
|
+
startFrame: 20 + i * 8
|
|
545
|
+
}, output, false, undefined, this))
|
|
546
|
+
}, undefined, false, undefined, this),
|
|
547
|
+
/* @__PURE__ */ jsxDEV5(Sequence, {
|
|
548
|
+
from: TAGLINE_START - OUTPUTS_START,
|
|
549
|
+
children: /* @__PURE__ */ jsxDEV5("div", {
|
|
550
|
+
style: { marginTop: 48 },
|
|
551
|
+
children: /* @__PURE__ */ jsxDEV5(AnimatedText, {
|
|
552
|
+
text: tagline,
|
|
553
|
+
variant: "heading",
|
|
554
|
+
enterAt: 0,
|
|
555
|
+
color: theme.colors.accent,
|
|
556
|
+
align: "center"
|
|
557
|
+
}, undefined, false, undefined, this)
|
|
558
|
+
}, undefined, false, undefined, this)
|
|
559
|
+
}, undefined, false, undefined, this)
|
|
560
|
+
]
|
|
561
|
+
}, undefined, true, undefined, this)
|
|
562
|
+
}, undefined, false, undefined, this)
|
|
563
|
+
]
|
|
564
|
+
}, undefined, true, undefined, this),
|
|
565
|
+
/* @__PURE__ */ jsxDEV5(ProgressBar, {}, undefined, false, undefined, this)
|
|
566
|
+
]
|
|
567
|
+
}, undefined, true, undefined, this);
|
|
568
|
+
};
|
|
569
|
+
var MethodBadge = ({
|
|
570
|
+
method,
|
|
571
|
+
enterAt
|
|
572
|
+
}) => {
|
|
573
|
+
const frame = useCurrentFrame5();
|
|
574
|
+
const opacity = interpolate4(frame, [enterAt, enterAt + 10], [0, 1], {
|
|
575
|
+
extrapolateLeft: "clamp",
|
|
576
|
+
extrapolateRight: "clamp",
|
|
577
|
+
easing: videoEasing.entrance
|
|
578
|
+
});
|
|
579
|
+
const scale = interpolate4(frame, [enterAt, enterAt + 12], [0.8, 1], {
|
|
580
|
+
extrapolateLeft: "clamp",
|
|
581
|
+
extrapolateRight: "clamp",
|
|
582
|
+
easing: videoEasing.emphasis
|
|
583
|
+
});
|
|
584
|
+
const methodColors = {
|
|
585
|
+
GET: "#61afef",
|
|
586
|
+
POST: "#98c379",
|
|
587
|
+
PUT: "#e5c07b",
|
|
588
|
+
PATCH: "#d19a66",
|
|
589
|
+
DELETE: "#e06c75"
|
|
590
|
+
};
|
|
591
|
+
return /* @__PURE__ */ jsxDEV5("div", {
|
|
592
|
+
style: {
|
|
593
|
+
opacity,
|
|
594
|
+
transform: `scale(${scale})`,
|
|
595
|
+
backgroundColor: methodColors[method] ?? "#61afef",
|
|
596
|
+
color: "#000",
|
|
597
|
+
padding: "8px 20px",
|
|
598
|
+
borderRadius: 8,
|
|
599
|
+
fontSize: 24,
|
|
600
|
+
fontWeight: 700,
|
|
601
|
+
fontFamily: "monospace",
|
|
602
|
+
letterSpacing: 1
|
|
603
|
+
},
|
|
604
|
+
children: method
|
|
605
|
+
}, undefined, false, undefined, this);
|
|
606
|
+
};
|
|
607
|
+
var OutputChip = ({ label, startFrame }) => {
|
|
608
|
+
const frame = useCurrentFrame5();
|
|
609
|
+
const opacity = interpolate4(frame, [startFrame, startFrame + 12], [0, 1], {
|
|
610
|
+
extrapolateLeft: "clamp",
|
|
611
|
+
extrapolateRight: "clamp"
|
|
612
|
+
});
|
|
613
|
+
const translateY = interpolate4(frame, [startFrame, startFrame + 15], [20, 0], {
|
|
614
|
+
extrapolateLeft: "clamp",
|
|
615
|
+
extrapolateRight: "clamp",
|
|
616
|
+
easing: videoEasing.emphasis
|
|
617
|
+
});
|
|
618
|
+
const scale = interpolate4(frame, [startFrame, startFrame + 15], [0.9, 1], {
|
|
619
|
+
extrapolateLeft: "clamp",
|
|
620
|
+
extrapolateRight: "clamp",
|
|
621
|
+
easing: videoEasing.emphasis
|
|
622
|
+
});
|
|
623
|
+
return /* @__PURE__ */ jsxDEV5("div", {
|
|
624
|
+
style: {
|
|
625
|
+
opacity,
|
|
626
|
+
transform: `translateY(${translateY}px) scale(${scale})`,
|
|
627
|
+
backgroundColor: "rgba(255,255,255,0.08)",
|
|
628
|
+
border: "1px solid rgba(255,255,255,0.15)",
|
|
629
|
+
color: "#ffffff",
|
|
630
|
+
padding: "16px 32px",
|
|
631
|
+
borderRadius: 12,
|
|
632
|
+
fontSize: 28,
|
|
633
|
+
fontWeight: 500
|
|
634
|
+
},
|
|
635
|
+
children: label
|
|
636
|
+
}, undefined, false, undefined, this);
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
// src/compositions/primitives/terminal.tsx
|
|
640
|
+
import { interpolate as interpolate5, useCurrentFrame as useCurrentFrame6, useVideoConfig as useVideoConfig6 } from "remotion";
|
|
641
|
+
import { jsxDEV as jsxDEV6 } from "react/jsx-dev-runtime";
|
|
642
|
+
var LINE_TYPE_COLORS = {
|
|
643
|
+
command: "#c9d1d9",
|
|
644
|
+
output: "#8b949e",
|
|
645
|
+
error: "#f85149",
|
|
646
|
+
success: "#3fb950",
|
|
647
|
+
comment: "#6e7681"
|
|
648
|
+
};
|
|
649
|
+
var Terminal = ({
|
|
650
|
+
lines,
|
|
651
|
+
startAt = 0,
|
|
652
|
+
prompt = "$ ",
|
|
653
|
+
title = "Terminal",
|
|
654
|
+
backgroundColor = defaultVideoColors.terminalBackground,
|
|
655
|
+
typingSpeed = videoDurations.codeTypingPerChar
|
|
656
|
+
}) => {
|
|
657
|
+
const frame = useCurrentFrame6();
|
|
658
|
+
const { width } = useVideoConfig6();
|
|
659
|
+
const codeStyle = scaleTypography(videoTypography.code, width);
|
|
660
|
+
const lineTimings = [];
|
|
661
|
+
let currentFrame = startAt;
|
|
662
|
+
for (const line of lines) {
|
|
663
|
+
const delay = line.delay ?? 10;
|
|
664
|
+
const lineStart = currentFrame + delay;
|
|
665
|
+
if (line.type === "command") {
|
|
666
|
+
const typeDuration = line.text.length * typingSpeed;
|
|
667
|
+
lineTimings.push({
|
|
668
|
+
startFrame: lineStart,
|
|
669
|
+
endFrame: lineStart + typeDuration
|
|
670
|
+
});
|
|
671
|
+
currentFrame = lineStart + typeDuration;
|
|
672
|
+
} else {
|
|
673
|
+
lineTimings.push({ startFrame: lineStart, endFrame: lineStart + 5 });
|
|
674
|
+
currentFrame = lineStart + 5;
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
const opacity = interpolate5(frame, [startAt, startAt + 10], [0, 1], {
|
|
678
|
+
extrapolateLeft: "clamp",
|
|
679
|
+
extrapolateRight: "clamp",
|
|
680
|
+
easing: videoEasing.entrance
|
|
681
|
+
});
|
|
682
|
+
return /* @__PURE__ */ jsxDEV6("div", {
|
|
683
|
+
style: {
|
|
684
|
+
backgroundColor,
|
|
685
|
+
borderRadius: 16,
|
|
686
|
+
overflow: "hidden",
|
|
687
|
+
opacity,
|
|
688
|
+
boxShadow: "0 8px 32px rgba(0,0,0,0.3)"
|
|
689
|
+
},
|
|
690
|
+
children: [
|
|
691
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
692
|
+
style: {
|
|
693
|
+
display: "flex",
|
|
694
|
+
alignItems: "center",
|
|
695
|
+
padding: "12px 20px",
|
|
696
|
+
backgroundColor: "rgba(255,255,255,0.05)",
|
|
697
|
+
gap: 8
|
|
698
|
+
},
|
|
699
|
+
children: [
|
|
700
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
701
|
+
style: { display: "flex", gap: 8 },
|
|
702
|
+
children: [
|
|
703
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
704
|
+
style: {
|
|
705
|
+
width: 12,
|
|
706
|
+
height: 12,
|
|
707
|
+
borderRadius: "50%",
|
|
708
|
+
backgroundColor: "#ff5f57"
|
|
709
|
+
}
|
|
710
|
+
}, undefined, false, undefined, this),
|
|
711
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
712
|
+
style: {
|
|
713
|
+
width: 12,
|
|
714
|
+
height: 12,
|
|
715
|
+
borderRadius: "50%",
|
|
716
|
+
backgroundColor: "#febc2e"
|
|
717
|
+
}
|
|
718
|
+
}, undefined, false, undefined, this),
|
|
719
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
720
|
+
style: {
|
|
721
|
+
width: 12,
|
|
722
|
+
height: 12,
|
|
723
|
+
borderRadius: "50%",
|
|
724
|
+
backgroundColor: "#28c840"
|
|
725
|
+
}
|
|
726
|
+
}, undefined, false, undefined, this)
|
|
727
|
+
]
|
|
728
|
+
}, undefined, true, undefined, this),
|
|
729
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
730
|
+
style: {
|
|
731
|
+
flex: 1,
|
|
732
|
+
textAlign: "center",
|
|
733
|
+
color: "#484f58",
|
|
734
|
+
fontSize: codeStyle.fontSize * 0.7,
|
|
735
|
+
fontFamily: "monospace"
|
|
736
|
+
},
|
|
737
|
+
children: title
|
|
738
|
+
}, undefined, false, undefined, this)
|
|
739
|
+
]
|
|
740
|
+
}, undefined, true, undefined, this),
|
|
741
|
+
/* @__PURE__ */ jsxDEV6("div", {
|
|
742
|
+
style: { padding: "24px 32px", minHeight: 200 },
|
|
743
|
+
children: lines.map((line, i) => {
|
|
744
|
+
const timing = lineTimings[i];
|
|
745
|
+
if (!timing || frame < timing.startFrame)
|
|
746
|
+
return null;
|
|
747
|
+
const isCommand = line.type === "command";
|
|
748
|
+
const lineColor = LINE_TYPE_COLORS[line.type];
|
|
749
|
+
let visibleText = line.text;
|
|
750
|
+
if (isCommand) {
|
|
751
|
+
const typingProgress = interpolate5(frame, [timing.startFrame, timing.endFrame], [0, line.text.length], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
|
|
752
|
+
visibleText = line.text.slice(0, Math.floor(typingProgress));
|
|
753
|
+
}
|
|
754
|
+
const lineOpacity = isCommand ? 1 : interpolate5(frame, [timing.startFrame, timing.startFrame + 5], [0, 1], {
|
|
755
|
+
extrapolateLeft: "clamp",
|
|
756
|
+
extrapolateRight: "clamp"
|
|
757
|
+
});
|
|
758
|
+
const isTyping = isCommand && frame >= timing.startFrame && frame <= timing.endFrame;
|
|
759
|
+
const showCursor = isTyping && frame % 16 < 10;
|
|
760
|
+
return /* @__PURE__ */ jsxDEV6("div", {
|
|
761
|
+
style: {
|
|
762
|
+
fontFamily: "'SF Mono', 'Fira Code', 'JetBrains Mono', monospace",
|
|
763
|
+
fontSize: codeStyle.fontSize,
|
|
764
|
+
lineHeight: 1.8,
|
|
765
|
+
color: lineColor,
|
|
766
|
+
opacity: lineOpacity,
|
|
767
|
+
whiteSpace: "pre-wrap"
|
|
768
|
+
},
|
|
769
|
+
children: [
|
|
770
|
+
isCommand && /* @__PURE__ */ jsxDEV6("span", {
|
|
771
|
+
style: { color: "#3fb950" },
|
|
772
|
+
children: prompt
|
|
773
|
+
}, undefined, false, undefined, this),
|
|
774
|
+
line.type === "comment" && /* @__PURE__ */ jsxDEV6("span", {
|
|
775
|
+
style: { color: LINE_TYPE_COLORS.comment },
|
|
776
|
+
children: "# "
|
|
777
|
+
}, undefined, false, undefined, this),
|
|
778
|
+
visibleText,
|
|
779
|
+
showCursor && /* @__PURE__ */ jsxDEV6("span", {
|
|
780
|
+
style: {
|
|
781
|
+
backgroundColor: "#c9d1d9",
|
|
782
|
+
width: "2px",
|
|
783
|
+
display: "inline-block",
|
|
784
|
+
height: "1.2em",
|
|
785
|
+
verticalAlign: "text-bottom"
|
|
786
|
+
},
|
|
787
|
+
children: "\xA0"
|
|
788
|
+
}, undefined, false, undefined, this)
|
|
789
|
+
]
|
|
790
|
+
}, `${i}-${line.text.slice(0, 20)}`, true, undefined, this);
|
|
791
|
+
})
|
|
792
|
+
}, undefined, false, undefined, this)
|
|
793
|
+
]
|
|
794
|
+
}, undefined, true, undefined, this);
|
|
795
|
+
};
|
|
796
|
+
|
|
797
|
+
// src/compositions/social-clip.tsx
|
|
798
|
+
import {
|
|
799
|
+
AbsoluteFill as AbsoluteFill2,
|
|
800
|
+
Sequence as Sequence2,
|
|
801
|
+
interpolate as interpolate6,
|
|
802
|
+
useCurrentFrame as useCurrentFrame7,
|
|
803
|
+
useVideoConfig as useVideoConfig7
|
|
804
|
+
} from "remotion";
|
|
805
|
+
import { jsxDEV as jsxDEV7 } from "react/jsx-dev-runtime";
|
|
806
|
+
var SocialClip = ({
|
|
807
|
+
hook,
|
|
808
|
+
message,
|
|
809
|
+
points = [],
|
|
810
|
+
cta = "Learn more",
|
|
811
|
+
ctaUrl = "contractspec.dev",
|
|
812
|
+
accentColor
|
|
813
|
+
}) => {
|
|
814
|
+
const { durationInFrames, width, height } = useVideoConfig7();
|
|
815
|
+
const theme = defaultVideoTheme;
|
|
816
|
+
const accent = accentColor ?? theme.colors.accent;
|
|
817
|
+
const isPortrait = height > width;
|
|
818
|
+
const HOOK_DURATION = 75;
|
|
819
|
+
const MESSAGE_START = 60;
|
|
820
|
+
const POINTS_START = MESSAGE_START + 60;
|
|
821
|
+
const CTA_START = durationInFrames - 90;
|
|
822
|
+
return /* @__PURE__ */ jsxDEV7(AbsoluteFill2, {
|
|
823
|
+
children: [
|
|
824
|
+
/* @__PURE__ */ jsxDEV7(BrandFrame, {
|
|
825
|
+
variant: "gradient",
|
|
826
|
+
showBranding: true,
|
|
827
|
+
children: /* @__PURE__ */ jsxDEV7("div", {
|
|
828
|
+
style: {
|
|
829
|
+
flex: 1,
|
|
830
|
+
display: "flex",
|
|
831
|
+
flexDirection: "column",
|
|
832
|
+
justifyContent: "center",
|
|
833
|
+
alignItems: "center",
|
|
834
|
+
gap: isPortrait ? 48 : 32,
|
|
835
|
+
textAlign: "center",
|
|
836
|
+
padding: isPortrait ? "0 20px" : 0
|
|
837
|
+
},
|
|
838
|
+
children: [
|
|
839
|
+
/* @__PURE__ */ jsxDEV7(Sequence2, {
|
|
840
|
+
from: 0,
|
|
841
|
+
durationInFrames: HOOK_DURATION + 30,
|
|
842
|
+
children: /* @__PURE__ */ jsxDEV7("div", {
|
|
843
|
+
style: { width: "100%" },
|
|
844
|
+
children: /* @__PURE__ */ jsxDEV7(AnimatedText, {
|
|
845
|
+
text: hook,
|
|
846
|
+
variant: "title",
|
|
847
|
+
enterAt: 5,
|
|
848
|
+
exitAt: HOOK_DURATION,
|
|
849
|
+
color: "#ffffff",
|
|
850
|
+
align: "center"
|
|
851
|
+
}, undefined, false, undefined, this)
|
|
852
|
+
}, undefined, false, undefined, this)
|
|
853
|
+
}, undefined, false, undefined, this),
|
|
854
|
+
/* @__PURE__ */ jsxDEV7(Sequence2, {
|
|
855
|
+
from: MESSAGE_START,
|
|
856
|
+
children: /* @__PURE__ */ jsxDEV7("div", {
|
|
857
|
+
style: { width: "100%" },
|
|
858
|
+
children: /* @__PURE__ */ jsxDEV7(AnimatedText, {
|
|
859
|
+
text: message,
|
|
860
|
+
variant: isPortrait ? "subheading" : "heading",
|
|
861
|
+
enterAt: 0,
|
|
862
|
+
color: "#ffffff",
|
|
863
|
+
align: "center"
|
|
864
|
+
}, undefined, false, undefined, this)
|
|
865
|
+
}, undefined, false, undefined, this)
|
|
866
|
+
}, undefined, false, undefined, this),
|
|
867
|
+
points.length > 0 && /* @__PURE__ */ jsxDEV7(Sequence2, {
|
|
868
|
+
from: POINTS_START,
|
|
869
|
+
children: /* @__PURE__ */ jsxDEV7("div", {
|
|
870
|
+
style: {
|
|
871
|
+
display: "flex",
|
|
872
|
+
flexDirection: "column",
|
|
873
|
+
gap: 16,
|
|
874
|
+
alignItems: isPortrait ? "flex-start" : "center",
|
|
875
|
+
width: "100%",
|
|
876
|
+
maxWidth: isPortrait ? "100%" : "80%",
|
|
877
|
+
marginTop: 16
|
|
878
|
+
},
|
|
879
|
+
children: points.map((point, i) => /* @__PURE__ */ jsxDEV7(PointItem, {
|
|
880
|
+
text: point,
|
|
881
|
+
index: i,
|
|
882
|
+
startFrame: i * 15,
|
|
883
|
+
accent
|
|
884
|
+
}, point, false, undefined, this))
|
|
885
|
+
}, undefined, false, undefined, this)
|
|
886
|
+
}, undefined, false, undefined, this),
|
|
887
|
+
/* @__PURE__ */ jsxDEV7(Sequence2, {
|
|
888
|
+
from: CTA_START,
|
|
889
|
+
children: /* @__PURE__ */ jsxDEV7(CTABlock, {
|
|
890
|
+
cta,
|
|
891
|
+
url: ctaUrl,
|
|
892
|
+
accent
|
|
893
|
+
}, undefined, false, undefined, this)
|
|
894
|
+
}, undefined, false, undefined, this)
|
|
895
|
+
]
|
|
896
|
+
}, undefined, true, undefined, this)
|
|
897
|
+
}, undefined, false, undefined, this),
|
|
898
|
+
/* @__PURE__ */ jsxDEV7(ProgressBar, {
|
|
899
|
+
color: accent
|
|
900
|
+
}, undefined, false, undefined, this)
|
|
901
|
+
]
|
|
902
|
+
}, undefined, true, undefined, this);
|
|
903
|
+
};
|
|
904
|
+
var PointItem = ({ text, startFrame, accent }) => {
|
|
905
|
+
const frame = useCurrentFrame7();
|
|
906
|
+
const opacity = interpolate6(frame, [startFrame, startFrame + 12], [0, 1], {
|
|
907
|
+
extrapolateLeft: "clamp",
|
|
908
|
+
extrapolateRight: "clamp"
|
|
909
|
+
});
|
|
910
|
+
const translateX = interpolate6(frame, [startFrame, startFrame + 15], [-30, 0], {
|
|
911
|
+
extrapolateLeft: "clamp",
|
|
912
|
+
extrapolateRight: "clamp",
|
|
913
|
+
easing: videoEasing.entrance
|
|
914
|
+
});
|
|
915
|
+
return /* @__PURE__ */ jsxDEV7("div", {
|
|
916
|
+
style: {
|
|
917
|
+
opacity,
|
|
918
|
+
transform: `translateX(${translateX}px)`,
|
|
919
|
+
display: "flex",
|
|
920
|
+
alignItems: "center",
|
|
921
|
+
gap: 16,
|
|
922
|
+
fontSize: 28,
|
|
923
|
+
color: "#ffffff"
|
|
924
|
+
},
|
|
925
|
+
children: [
|
|
926
|
+
/* @__PURE__ */ jsxDEV7("div", {
|
|
927
|
+
style: {
|
|
928
|
+
width: 8,
|
|
929
|
+
height: 8,
|
|
930
|
+
borderRadius: "50%",
|
|
931
|
+
backgroundColor: accent,
|
|
932
|
+
flexShrink: 0
|
|
933
|
+
}
|
|
934
|
+
}, undefined, false, undefined, this),
|
|
935
|
+
text
|
|
936
|
+
]
|
|
937
|
+
}, undefined, true, undefined, this);
|
|
938
|
+
};
|
|
939
|
+
var CTABlock = ({ cta, url, accent }) => {
|
|
940
|
+
const frame = useCurrentFrame7();
|
|
941
|
+
const opacity = interpolate6(frame, [0, 15], [0, 1], {
|
|
942
|
+
extrapolateLeft: "clamp",
|
|
943
|
+
extrapolateRight: "clamp"
|
|
944
|
+
});
|
|
945
|
+
const scale = interpolate6(frame, [0, 18], [0.9, 1], {
|
|
946
|
+
extrapolateLeft: "clamp",
|
|
947
|
+
extrapolateRight: "clamp",
|
|
948
|
+
easing: videoEasing.emphasis
|
|
949
|
+
});
|
|
950
|
+
return /* @__PURE__ */ jsxDEV7("div", {
|
|
951
|
+
style: {
|
|
952
|
+
opacity,
|
|
953
|
+
transform: `scale(${scale})`,
|
|
954
|
+
display: "flex",
|
|
955
|
+
flexDirection: "column",
|
|
956
|
+
alignItems: "center",
|
|
957
|
+
gap: 12,
|
|
958
|
+
marginTop: 24
|
|
959
|
+
},
|
|
960
|
+
children: [
|
|
961
|
+
/* @__PURE__ */ jsxDEV7("div", {
|
|
962
|
+
style: {
|
|
963
|
+
backgroundColor: accent,
|
|
964
|
+
color: "#ffffff",
|
|
965
|
+
padding: "16px 48px",
|
|
966
|
+
borderRadius: 12,
|
|
967
|
+
fontSize: 28,
|
|
968
|
+
fontWeight: 600
|
|
969
|
+
},
|
|
970
|
+
children: cta
|
|
971
|
+
}, undefined, false, undefined, this),
|
|
972
|
+
/* @__PURE__ */ jsxDEV7("div", {
|
|
973
|
+
style: { color: "rgba(255,255,255,0.5)", fontSize: 20 },
|
|
974
|
+
children: url
|
|
975
|
+
}, undefined, false, undefined, this)
|
|
976
|
+
]
|
|
977
|
+
}, undefined, true, undefined, this);
|
|
978
|
+
};
|
|
979
|
+
|
|
980
|
+
// src/compositions/terminal-demo.tsx
|
|
981
|
+
import { AbsoluteFill as AbsoluteFill3, Sequence as Sequence3, useVideoConfig as useVideoConfig8 } from "remotion";
|
|
982
|
+
import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
|
|
983
|
+
var TerminalDemo = ({
|
|
984
|
+
title,
|
|
985
|
+
subtitle,
|
|
986
|
+
lines,
|
|
987
|
+
terminalTitle = "Terminal",
|
|
988
|
+
prompt = "$ ",
|
|
989
|
+
summary
|
|
990
|
+
}) => {
|
|
991
|
+
const { durationInFrames } = useVideoConfig8();
|
|
992
|
+
const theme = defaultVideoTheme;
|
|
993
|
+
const TERMINAL_START = 40;
|
|
994
|
+
const SUMMARY_START = durationInFrames - 90;
|
|
995
|
+
return /* @__PURE__ */ jsxDEV8(AbsoluteFill3, {
|
|
996
|
+
children: [
|
|
997
|
+
/* @__PURE__ */ jsxDEV8(BrandFrame, {
|
|
998
|
+
variant: "dark",
|
|
999
|
+
showBranding: true,
|
|
1000
|
+
children: /* @__PURE__ */ jsxDEV8("div", {
|
|
1001
|
+
style: {
|
|
1002
|
+
flex: 1,
|
|
1003
|
+
display: "flex",
|
|
1004
|
+
flexDirection: "column",
|
|
1005
|
+
gap: 24
|
|
1006
|
+
},
|
|
1007
|
+
children: [
|
|
1008
|
+
/* @__PURE__ */ jsxDEV8("div", {
|
|
1009
|
+
children: [
|
|
1010
|
+
/* @__PURE__ */ jsxDEV8(AnimatedText, {
|
|
1011
|
+
text: title,
|
|
1012
|
+
variant: "heading",
|
|
1013
|
+
enterAt: 5,
|
|
1014
|
+
color: "#ffffff"
|
|
1015
|
+
}, undefined, false, undefined, this),
|
|
1016
|
+
subtitle && /* @__PURE__ */ jsxDEV8("div", {
|
|
1017
|
+
style: { marginTop: 8 },
|
|
1018
|
+
children: /* @__PURE__ */ jsxDEV8(AnimatedText, {
|
|
1019
|
+
text: subtitle,
|
|
1020
|
+
variant: "body",
|
|
1021
|
+
enterAt: 15,
|
|
1022
|
+
color: theme.colors.mutedForeground
|
|
1023
|
+
}, undefined, false, undefined, this)
|
|
1024
|
+
}, undefined, false, undefined, this)
|
|
1025
|
+
]
|
|
1026
|
+
}, undefined, true, undefined, this),
|
|
1027
|
+
/* @__PURE__ */ jsxDEV8(Sequence3, {
|
|
1028
|
+
from: TERMINAL_START,
|
|
1029
|
+
children: /* @__PURE__ */ jsxDEV8("div", {
|
|
1030
|
+
style: { flex: 1 },
|
|
1031
|
+
children: /* @__PURE__ */ jsxDEV8(Terminal, {
|
|
1032
|
+
lines,
|
|
1033
|
+
startAt: 0,
|
|
1034
|
+
prompt,
|
|
1035
|
+
title: terminalTitle
|
|
1036
|
+
}, undefined, false, undefined, this)
|
|
1037
|
+
}, undefined, false, undefined, this)
|
|
1038
|
+
}, undefined, false, undefined, this),
|
|
1039
|
+
summary && /* @__PURE__ */ jsxDEV8(Sequence3, {
|
|
1040
|
+
from: SUMMARY_START,
|
|
1041
|
+
children: /* @__PURE__ */ jsxDEV8("div", {
|
|
1042
|
+
style: {
|
|
1043
|
+
marginTop: "auto",
|
|
1044
|
+
paddingTop: 24
|
|
1045
|
+
},
|
|
1046
|
+
children: /* @__PURE__ */ jsxDEV8(AnimatedText, {
|
|
1047
|
+
text: summary,
|
|
1048
|
+
variant: "subheading",
|
|
1049
|
+
enterAt: 0,
|
|
1050
|
+
color: theme.colors.accent,
|
|
1051
|
+
align: "center"
|
|
1052
|
+
}, undefined, false, undefined, this)
|
|
1053
|
+
}, undefined, false, undefined, this)
|
|
1054
|
+
}, undefined, false, undefined, this)
|
|
1055
|
+
]
|
|
1056
|
+
}, undefined, true, undefined, this)
|
|
1057
|
+
}, undefined, false, undefined, this),
|
|
1058
|
+
/* @__PURE__ */ jsxDEV8(ProgressBar, {}, undefined, false, undefined, this)
|
|
1059
|
+
]
|
|
1060
|
+
}, undefined, true, undefined, this);
|
|
1061
|
+
};
|
|
1062
|
+
|
|
1063
|
+
// src/player/demo-player.tsx
|
|
1064
|
+
import { useMemo } from "react";
|
|
1065
|
+
import { Player } from "@remotion/player";
|
|
1066
|
+
import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
|
|
1067
|
+
var COMPOSITIONS = {
|
|
1068
|
+
ApiOverview: {
|
|
1069
|
+
component: ApiOverview,
|
|
1070
|
+
durationInFrames: 450,
|
|
1071
|
+
fps: 30,
|
|
1072
|
+
width: 1920,
|
|
1073
|
+
height: 1080
|
|
1074
|
+
},
|
|
1075
|
+
SocialClip: {
|
|
1076
|
+
component: SocialClip,
|
|
1077
|
+
durationInFrames: 300,
|
|
1078
|
+
fps: 30,
|
|
1079
|
+
width: 1920,
|
|
1080
|
+
height: 1080
|
|
1081
|
+
},
|
|
1082
|
+
TerminalDemo: {
|
|
1083
|
+
component: TerminalDemo,
|
|
1084
|
+
durationInFrames: 600,
|
|
1085
|
+
fps: 30,
|
|
1086
|
+
width: 1920,
|
|
1087
|
+
height: 1080
|
|
1088
|
+
}
|
|
1089
|
+
};
|
|
1090
|
+
function DemoPlayer({
|
|
1091
|
+
compositionId,
|
|
1092
|
+
inputProps,
|
|
1093
|
+
controls = true,
|
|
1094
|
+
autoPlay = false,
|
|
1095
|
+
loop = false,
|
|
1096
|
+
width = "100%",
|
|
1097
|
+
height,
|
|
1098
|
+
style,
|
|
1099
|
+
className,
|
|
1100
|
+
clickToPlay = true,
|
|
1101
|
+
doubleClickToFullscreen = true
|
|
1102
|
+
}) {
|
|
1103
|
+
const composition = COMPOSITIONS[compositionId];
|
|
1104
|
+
const playerStyle = useMemo(() => ({
|
|
1105
|
+
width,
|
|
1106
|
+
height: height ?? "auto",
|
|
1107
|
+
borderRadius: 12,
|
|
1108
|
+
overflow: "hidden",
|
|
1109
|
+
...style
|
|
1110
|
+
}), [width, height, style]);
|
|
1111
|
+
return /* @__PURE__ */ jsxDEV9("div", {
|
|
1112
|
+
className,
|
|
1113
|
+
children: /* @__PURE__ */ jsxDEV9(Player, {
|
|
1114
|
+
component: composition.component,
|
|
1115
|
+
durationInFrames: composition.durationInFrames,
|
|
1116
|
+
fps: composition.fps,
|
|
1117
|
+
compositionWidth: composition.width,
|
|
1118
|
+
compositionHeight: composition.height,
|
|
1119
|
+
inputProps,
|
|
1120
|
+
controls,
|
|
1121
|
+
autoPlay,
|
|
1122
|
+
loop,
|
|
1123
|
+
style: playerStyle,
|
|
1124
|
+
clickToPlay,
|
|
1125
|
+
doubleClickToFullscreen
|
|
1126
|
+
}, undefined, false, undefined, this)
|
|
1127
|
+
}, undefined, false, undefined, this);
|
|
1128
|
+
}
|
|
1129
|
+
export {
|
|
1130
|
+
DemoPlayer
|
|
1131
|
+
};
|