@contractspec/lib.video-gen 2.7.16 → 2.7.18
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 +1 -645
- package/dist/browser/compositions/index.js +1 -1133
- package/dist/browser/compositions/primitives/animated-text.js +1 -144
- package/dist/browser/compositions/primitives/brand-frame.js +1 -181
- package/dist/browser/compositions/primitives/code-block.js +1 -226
- package/dist/browser/compositions/primitives/index.js +1 -656
- package/dist/browser/compositions/primitives/progress-bar.js +1 -59
- package/dist/browser/compositions/primitives/terminal.js +1 -265
- package/dist/browser/compositions/primitives/transition.js +1 -98
- package/dist/browser/compositions/social-clip.js +1 -500
- package/dist/browser/compositions/terminal-demo.js +1 -558
- package/dist/browser/design/index.js +1 -155
- package/dist/browser/design/layouts.js +1 -50
- package/dist/browser/design/motion.js +1 -43
- package/dist/browser/design/tokens.js +1 -28
- package/dist/browser/design/typography.js +1 -61
- package/dist/browser/docs/compositions.docblock.js +1 -182
- package/dist/browser/docs/design.docblock.js +2 -17
- package/dist/browser/docs/generators.docblock.js +2 -24
- package/dist/browser/docs/rendering.docblock.js +2 -24
- package/dist/browser/docs/video-gen.docblock.js +2 -17
- package/dist/browser/generators/index.js +7 -769
- package/dist/browser/generators/scene-planner.js +7 -651
- package/dist/browser/generators/script-generator.js +7 -599
- package/dist/browser/generators/video-generator.js +7 -768
- package/dist/browser/i18n/catalogs/en.js +3 -135
- package/dist/browser/i18n/catalogs/es.js +3 -135
- package/dist/browser/i18n/catalogs/fr.js +3 -135
- package/dist/browser/i18n/catalogs/index.js +7 -387
- package/dist/browser/i18n/index.js +7 -459
- package/dist/browser/i18n/keys.js +1 -54
- package/dist/browser/i18n/locale.js +1 -21
- package/dist/browser/i18n/messages.js +7 -399
- package/dist/browser/index.js +7 -1903
- package/dist/browser/player/demo-player.js +1 -1136
- package/dist/browser/player/index.js +1 -1136
- package/dist/browser/remotion/Root.js +2 -1172
- package/dist/browser/remotion/index.js +2 -1173
- package/dist/browser/renderers/config.js +1 -40
- package/dist/browser/renderers/index.js +1 -160
- package/dist/browser/renderers/local.js +1 -156
- package/dist/browser/types.js +1 -13
- package/dist/compositions/api-overview.js +1 -639
- package/dist/compositions/index.js +1 -1127
- package/dist/compositions/primitives/animated-text.js +1 -138
- package/dist/compositions/primitives/brand-frame.js +1 -175
- package/dist/compositions/primitives/code-block.js +1 -220
- package/dist/compositions/primitives/index.js +1 -650
- package/dist/compositions/primitives/progress-bar.js +1 -53
- package/dist/compositions/primitives/terminal.js +1 -259
- package/dist/compositions/primitives/transition.js +1 -92
- package/dist/compositions/social-clip.js +1 -494
- package/dist/compositions/terminal-demo.js +1 -552
- package/dist/design/index.js +1 -149
- package/dist/design/layouts.js +1 -44
- package/dist/design/motion.js +1 -37
- package/dist/design/tokens.js +1 -22
- package/dist/design/typography.js +1 -55
- package/dist/docs/compositions.docblock.js +1 -182
- package/dist/docs/design.docblock.js +2 -17
- package/dist/docs/generators.docblock.js +2 -24
- package/dist/docs/rendering.docblock.js +2 -24
- package/dist/docs/video-gen.docblock.js +2 -17
- package/dist/generators/index.js +7 -763
- package/dist/generators/scene-planner.js +7 -645
- package/dist/generators/script-generator.js +7 -593
- package/dist/generators/video-generator.js +7 -762
- package/dist/i18n/catalogs/en.js +3 -129
- package/dist/i18n/catalogs/es.js +3 -129
- package/dist/i18n/catalogs/fr.js +3 -129
- package/dist/i18n/catalogs/index.js +7 -381
- package/dist/i18n/index.js +7 -453
- package/dist/i18n/keys.js +1 -48
- package/dist/i18n/locale.js +1 -15
- package/dist/i18n/messages.js +7 -393
- package/dist/index.js +7 -1897
- package/dist/node/compositions/api-overview.js +1 -640
- package/dist/node/compositions/index.js +1 -1128
- package/dist/node/compositions/primitives/animated-text.js +1 -139
- package/dist/node/compositions/primitives/brand-frame.js +1 -176
- package/dist/node/compositions/primitives/code-block.js +1 -221
- package/dist/node/compositions/primitives/index.js +1 -651
- package/dist/node/compositions/primitives/progress-bar.js +1 -54
- package/dist/node/compositions/primitives/terminal.js +1 -260
- package/dist/node/compositions/primitives/transition.js +1 -93
- package/dist/node/compositions/social-clip.js +1 -495
- package/dist/node/compositions/terminal-demo.js +1 -553
- package/dist/node/design/index.js +1 -150
- package/dist/node/design/layouts.js +1 -45
- package/dist/node/design/motion.js +1 -38
- package/dist/node/design/tokens.js +1 -23
- package/dist/node/design/typography.js +1 -56
- package/dist/node/docs/compositions.docblock.js +1 -182
- package/dist/node/docs/design.docblock.js +2 -17
- package/dist/node/docs/generators.docblock.js +2 -24
- package/dist/node/docs/rendering.docblock.js +2 -24
- package/dist/node/docs/video-gen.docblock.js +2 -17
- package/dist/node/generators/index.js +7 -764
- package/dist/node/generators/scene-planner.js +7 -646
- package/dist/node/generators/script-generator.js +7 -594
- package/dist/node/generators/video-generator.js +7 -763
- package/dist/node/i18n/catalogs/en.js +3 -130
- package/dist/node/i18n/catalogs/es.js +3 -130
- package/dist/node/i18n/catalogs/fr.js +3 -130
- package/dist/node/i18n/catalogs/index.js +7 -382
- package/dist/node/i18n/index.js +7 -454
- package/dist/node/i18n/keys.js +1 -49
- package/dist/node/i18n/locale.js +1 -16
- package/dist/node/i18n/messages.js +7 -394
- package/dist/node/index.js +7 -1898
- package/dist/node/player/demo-player.js +1 -1131
- package/dist/node/player/index.js +1 -1131
- package/dist/node/remotion/Root.js +2 -1167
- package/dist/node/remotion/index.js +2 -1168
- package/dist/node/renderers/config.js +1 -35
- package/dist/node/renderers/index.js +1 -155
- package/dist/node/renderers/local.js +1 -151
- package/dist/node/types.js +1 -8
- package/dist/player/demo-player.js +1 -1130
- package/dist/player/index.js +1 -1130
- package/dist/remotion/Root.js +2 -1166
- package/dist/remotion/index.js +2 -1167
- package/dist/renderers/config.js +1 -34
- package/dist/renderers/index.js +1 -154
- package/dist/renderers/local.js +1 -150
- package/dist/types.js +1 -7
- package/package.json +18 -18
|
@@ -1,553 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
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/typography.ts
|
|
52
|
-
var videoTypography = {
|
|
53
|
-
title: {
|
|
54
|
-
fontSize: 72,
|
|
55
|
-
lineHeight: 1.1,
|
|
56
|
-
fontWeight: 700,
|
|
57
|
-
letterSpacing: -1
|
|
58
|
-
},
|
|
59
|
-
heading: {
|
|
60
|
-
fontSize: 56,
|
|
61
|
-
lineHeight: 1.2,
|
|
62
|
-
fontWeight: 600,
|
|
63
|
-
letterSpacing: -0.5
|
|
64
|
-
},
|
|
65
|
-
subheading: {
|
|
66
|
-
fontSize: 40,
|
|
67
|
-
lineHeight: 1.25,
|
|
68
|
-
fontWeight: 500
|
|
69
|
-
},
|
|
70
|
-
body: {
|
|
71
|
-
fontSize: 32,
|
|
72
|
-
lineHeight: 1.5,
|
|
73
|
-
fontWeight: 400
|
|
74
|
-
},
|
|
75
|
-
code: {
|
|
76
|
-
fontSize: 28,
|
|
77
|
-
lineHeight: 1.6,
|
|
78
|
-
fontWeight: 400
|
|
79
|
-
},
|
|
80
|
-
caption: {
|
|
81
|
-
fontSize: 24,
|
|
82
|
-
lineHeight: 1.4,
|
|
83
|
-
fontWeight: 400
|
|
84
|
-
},
|
|
85
|
-
label: {
|
|
86
|
-
fontSize: 20,
|
|
87
|
-
lineHeight: 1.3,
|
|
88
|
-
fontWeight: 600,
|
|
89
|
-
letterSpacing: 1
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
function scaleTypography(style, targetWidth) {
|
|
93
|
-
const scale = targetWidth / 1920;
|
|
94
|
-
return {
|
|
95
|
-
...style,
|
|
96
|
-
fontSize: Math.round(style.fontSize * scale),
|
|
97
|
-
letterSpacing: style.letterSpacing ? Math.round(style.letterSpacing * scale * 10) / 10 : undefined
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// src/compositions/primitives/animated-text.tsx
|
|
102
|
-
import { interpolate, useCurrentFrame, useVideoConfig } from "remotion";
|
|
103
|
-
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
104
|
-
var AnimatedText = ({
|
|
105
|
-
text,
|
|
106
|
-
variant = "body",
|
|
107
|
-
style: styleOverride,
|
|
108
|
-
enterAt = 0,
|
|
109
|
-
exitAt,
|
|
110
|
-
color = "#ffffff",
|
|
111
|
-
align = "left"
|
|
112
|
-
}) => {
|
|
113
|
-
const frame = useCurrentFrame();
|
|
114
|
-
const { width } = useVideoConfig();
|
|
115
|
-
const baseStyle = videoTypography[variant];
|
|
116
|
-
const scaled = scaleTypography(baseStyle, width);
|
|
117
|
-
const finalStyle = { ...scaled, ...styleOverride };
|
|
118
|
-
const enterProgress = interpolate(frame, [enterAt, enterAt + videoDurations.textEntrance], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
|
|
119
|
-
const enterOpacity = interpolate(enterProgress, [0, 1], [0, 1], {
|
|
120
|
-
easing: videoEasing.entrance
|
|
121
|
-
});
|
|
122
|
-
const enterTranslateY = interpolate(enterProgress, [0, 1], [30, 0], {
|
|
123
|
-
easing: videoEasing.entrance
|
|
124
|
-
});
|
|
125
|
-
let exitOpacity = 1;
|
|
126
|
-
let exitTranslateY = 0;
|
|
127
|
-
if (exitAt !== undefined) {
|
|
128
|
-
const exitProgress = interpolate(frame, [exitAt, exitAt + videoDurations.textExit], [0, 1], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
|
|
129
|
-
exitOpacity = interpolate(exitProgress, [0, 1], [1, 0], {
|
|
130
|
-
easing: videoEasing.exit
|
|
131
|
-
});
|
|
132
|
-
exitTranslateY = interpolate(exitProgress, [0, 1], [0, -20], {
|
|
133
|
-
easing: videoEasing.exit
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
const opacity = enterOpacity * exitOpacity;
|
|
137
|
-
const translateY = enterTranslateY + exitTranslateY;
|
|
138
|
-
return /* @__PURE__ */ jsxDEV("div", {
|
|
139
|
-
style: {
|
|
140
|
-
fontSize: finalStyle.fontSize,
|
|
141
|
-
lineHeight: finalStyle.lineHeight,
|
|
142
|
-
fontWeight: finalStyle.fontWeight,
|
|
143
|
-
letterSpacing: finalStyle.letterSpacing,
|
|
144
|
-
color,
|
|
145
|
-
textAlign: align,
|
|
146
|
-
opacity,
|
|
147
|
-
transform: `translateY(${translateY}px)`,
|
|
148
|
-
willChange: "opacity, transform"
|
|
149
|
-
},
|
|
150
|
-
children: text
|
|
151
|
-
}, undefined, false, undefined, this);
|
|
152
|
-
};
|
|
153
|
-
|
|
154
|
-
// src/design/layouts.ts
|
|
155
|
-
import { VIDEO_FORMATS } from "@contractspec/lib.contracts-integrations/integrations/providers/video";
|
|
156
|
-
var DEFAULT_FPS = 30;
|
|
157
|
-
var videoSafeZone = {
|
|
158
|
-
horizontal: 120,
|
|
159
|
-
vertical: 80,
|
|
160
|
-
contentWidth: 1680,
|
|
161
|
-
contentHeight: 920
|
|
162
|
-
};
|
|
163
|
-
function scaleSafeZone(format) {
|
|
164
|
-
const scaleX = format.width / 1920;
|
|
165
|
-
const scaleY = format.height / 1080;
|
|
166
|
-
return {
|
|
167
|
-
horizontal: Math.round(videoSafeZone.horizontal * scaleX),
|
|
168
|
-
vertical: Math.round(videoSafeZone.vertical * scaleY),
|
|
169
|
-
contentWidth: Math.round(videoSafeZone.contentWidth * scaleX),
|
|
170
|
-
contentHeight: Math.round(videoSafeZone.contentHeight * scaleY)
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
var videoPositions = {
|
|
174
|
-
center: { x: 960, y: 540 },
|
|
175
|
-
topLeft: { x: 120, y: 80 },
|
|
176
|
-
topRight: { x: 1800, y: 80 },
|
|
177
|
-
bottomLeft: { x: 120, y: 1000 },
|
|
178
|
-
bottomRight: { x: 1800, y: 1000 },
|
|
179
|
-
bottomCenter: { x: 960, y: 960 }
|
|
180
|
-
};
|
|
181
|
-
function getAllFormatVariants() {
|
|
182
|
-
return [
|
|
183
|
-
VIDEO_FORMATS.landscape,
|
|
184
|
-
VIDEO_FORMATS.square,
|
|
185
|
-
VIDEO_FORMATS.portrait
|
|
186
|
-
];
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// src/compositions/primitives/brand-frame.tsx
|
|
190
|
-
import { interpolate as interpolate2, useCurrentFrame as useCurrentFrame2, useVideoConfig as useVideoConfig2 } from "remotion";
|
|
191
|
-
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
192
|
-
var BrandFrame = ({
|
|
193
|
-
styleOverrides,
|
|
194
|
-
showBranding = true,
|
|
195
|
-
animateEntrance = true,
|
|
196
|
-
variant = "gradient",
|
|
197
|
-
children
|
|
198
|
-
}) => {
|
|
199
|
-
const frame = useCurrentFrame2();
|
|
200
|
-
const { width, height } = useVideoConfig2();
|
|
201
|
-
const theme = defaultVideoTheme;
|
|
202
|
-
const safeZone = scaleSafeZone({ type: "custom", width, height });
|
|
203
|
-
const primaryColor = styleOverrides?.primaryColor ?? theme.colors.primary;
|
|
204
|
-
const _accentColor = styleOverrides?.accentColor ?? theme.colors.accent;
|
|
205
|
-
const isDark = styleOverrides?.darkMode ?? true;
|
|
206
|
-
let background;
|
|
207
|
-
switch (variant) {
|
|
208
|
-
case "solid":
|
|
209
|
-
background = isDark ? "#0a0a0a" : theme.colors.background;
|
|
210
|
-
break;
|
|
211
|
-
case "gradient":
|
|
212
|
-
background = isDark ? `linear-gradient(135deg, #0a0a14 0%, #0f172a 50%, #0a0a14 100%)` : `linear-gradient(135deg, ${theme.colors.background} 0%, ${theme.colors.muted} 100%)`;
|
|
213
|
-
break;
|
|
214
|
-
case "dark":
|
|
215
|
-
background = "#000000";
|
|
216
|
-
break;
|
|
217
|
-
}
|
|
218
|
-
const entranceOpacity = animateEntrance ? interpolate2(frame, [0, 15], [0, 1], {
|
|
219
|
-
extrapolateLeft: "clamp",
|
|
220
|
-
extrapolateRight: "clamp",
|
|
221
|
-
easing: videoEasing.entrance
|
|
222
|
-
}) : 1;
|
|
223
|
-
const brandOpacity = showBranding ? interpolate2(frame, [videoDurations.brandReveal, videoDurations.brandReveal + 15], [0, 0.3], {
|
|
224
|
-
extrapolateLeft: "clamp",
|
|
225
|
-
extrapolateRight: "clamp"
|
|
226
|
-
}) : 0;
|
|
227
|
-
return /* @__PURE__ */ jsxDEV2("div", {
|
|
228
|
-
style: {
|
|
229
|
-
width,
|
|
230
|
-
height,
|
|
231
|
-
background,
|
|
232
|
-
position: "relative",
|
|
233
|
-
overflow: "hidden",
|
|
234
|
-
opacity: entranceOpacity
|
|
235
|
-
},
|
|
236
|
-
children: [
|
|
237
|
-
variant === "gradient" && /* @__PURE__ */ jsxDEV2("div", {
|
|
238
|
-
style: {
|
|
239
|
-
position: "absolute",
|
|
240
|
-
top: "-20%",
|
|
241
|
-
right: "-10%",
|
|
242
|
-
width: "50%",
|
|
243
|
-
height: "50%",
|
|
244
|
-
background: `radial-gradient(circle, ${primaryColor}15 0%, transparent 70%)`,
|
|
245
|
-
borderRadius: "50%",
|
|
246
|
-
pointerEvents: "none"
|
|
247
|
-
}
|
|
248
|
-
}, undefined, false, undefined, this),
|
|
249
|
-
/* @__PURE__ */ jsxDEV2("div", {
|
|
250
|
-
style: {
|
|
251
|
-
position: "absolute",
|
|
252
|
-
left: safeZone.horizontal,
|
|
253
|
-
top: safeZone.vertical,
|
|
254
|
-
width: safeZone.contentWidth,
|
|
255
|
-
height: safeZone.contentHeight,
|
|
256
|
-
display: "flex",
|
|
257
|
-
flexDirection: "column"
|
|
258
|
-
},
|
|
259
|
-
children
|
|
260
|
-
}, undefined, false, undefined, this),
|
|
261
|
-
showBranding && /* @__PURE__ */ jsxDEV2("div", {
|
|
262
|
-
style: {
|
|
263
|
-
position: "absolute",
|
|
264
|
-
bottom: safeZone.vertical / 2,
|
|
265
|
-
right: safeZone.horizontal,
|
|
266
|
-
opacity: brandOpacity,
|
|
267
|
-
color: isDark ? "#ffffff" : "#000000",
|
|
268
|
-
fontSize: Math.round(16 * (width / 1920)),
|
|
269
|
-
fontWeight: 500,
|
|
270
|
-
letterSpacing: 1
|
|
271
|
-
},
|
|
272
|
-
children: "ContractSpec"
|
|
273
|
-
}, undefined, false, undefined, this)
|
|
274
|
-
]
|
|
275
|
-
}, undefined, true, undefined, this);
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
// src/compositions/primitives/progress-bar.tsx
|
|
279
|
-
import { useCurrentFrame as useCurrentFrame3, useVideoConfig as useVideoConfig3 } from "remotion";
|
|
280
|
-
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
281
|
-
var ProgressBar = ({
|
|
282
|
-
height = 4,
|
|
283
|
-
color = defaultVideoTheme.colors.primary,
|
|
284
|
-
backgroundColor = "rgba(255,255,255,0.1)",
|
|
285
|
-
position = "bottom"
|
|
286
|
-
}) => {
|
|
287
|
-
const frame = useCurrentFrame3();
|
|
288
|
-
const { durationInFrames, width } = useVideoConfig3();
|
|
289
|
-
const progress = frame / durationInFrames;
|
|
290
|
-
return /* @__PURE__ */ jsxDEV3("div", {
|
|
291
|
-
style: {
|
|
292
|
-
position: "absolute",
|
|
293
|
-
[position]: 0,
|
|
294
|
-
left: 0,
|
|
295
|
-
width,
|
|
296
|
-
height,
|
|
297
|
-
backgroundColor,
|
|
298
|
-
zIndex: 100
|
|
299
|
-
},
|
|
300
|
-
children: /* @__PURE__ */ jsxDEV3("div", {
|
|
301
|
-
style: {
|
|
302
|
-
width: `${progress * 100}%`,
|
|
303
|
-
height: "100%",
|
|
304
|
-
backgroundColor: color,
|
|
305
|
-
transition: "none"
|
|
306
|
-
}
|
|
307
|
-
}, undefined, false, undefined, this)
|
|
308
|
-
}, undefined, false, undefined, this);
|
|
309
|
-
};
|
|
310
|
-
|
|
311
|
-
// src/compositions/primitives/terminal.tsx
|
|
312
|
-
import { interpolate as interpolate3, useCurrentFrame as useCurrentFrame4, useVideoConfig as useVideoConfig4 } from "remotion";
|
|
313
|
-
import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
|
|
314
|
-
var LINE_TYPE_COLORS = {
|
|
315
|
-
command: "#c9d1d9",
|
|
316
|
-
output: "#8b949e",
|
|
317
|
-
error: "#f85149",
|
|
318
|
-
success: "#3fb950",
|
|
319
|
-
comment: "#6e7681"
|
|
320
|
-
};
|
|
321
|
-
var Terminal = ({
|
|
322
|
-
lines,
|
|
323
|
-
startAt = 0,
|
|
324
|
-
prompt = "$ ",
|
|
325
|
-
title = "Terminal",
|
|
326
|
-
backgroundColor = defaultVideoColors.terminalBackground,
|
|
327
|
-
typingSpeed = videoDurations.codeTypingPerChar
|
|
328
|
-
}) => {
|
|
329
|
-
const frame = useCurrentFrame4();
|
|
330
|
-
const { width } = useVideoConfig4();
|
|
331
|
-
const codeStyle = scaleTypography(videoTypography.code, width);
|
|
332
|
-
const lineTimings = [];
|
|
333
|
-
let currentFrame = startAt;
|
|
334
|
-
for (const line of lines) {
|
|
335
|
-
const delay = line.delay ?? 10;
|
|
336
|
-
const lineStart = currentFrame + delay;
|
|
337
|
-
if (line.type === "command") {
|
|
338
|
-
const typeDuration = line.text.length * typingSpeed;
|
|
339
|
-
lineTimings.push({
|
|
340
|
-
startFrame: lineStart,
|
|
341
|
-
endFrame: lineStart + typeDuration
|
|
342
|
-
});
|
|
343
|
-
currentFrame = lineStart + typeDuration;
|
|
344
|
-
} else {
|
|
345
|
-
lineTimings.push({ startFrame: lineStart, endFrame: lineStart + 5 });
|
|
346
|
-
currentFrame = lineStart + 5;
|
|
347
|
-
}
|
|
348
|
-
}
|
|
349
|
-
const opacity = interpolate3(frame, [startAt, startAt + 10], [0, 1], {
|
|
350
|
-
extrapolateLeft: "clamp",
|
|
351
|
-
extrapolateRight: "clamp",
|
|
352
|
-
easing: videoEasing.entrance
|
|
353
|
-
});
|
|
354
|
-
return /* @__PURE__ */ jsxDEV4("div", {
|
|
355
|
-
style: {
|
|
356
|
-
backgroundColor,
|
|
357
|
-
borderRadius: 16,
|
|
358
|
-
overflow: "hidden",
|
|
359
|
-
opacity,
|
|
360
|
-
boxShadow: "0 8px 32px rgba(0,0,0,0.3)"
|
|
361
|
-
},
|
|
362
|
-
children: [
|
|
363
|
-
/* @__PURE__ */ jsxDEV4("div", {
|
|
364
|
-
style: {
|
|
365
|
-
display: "flex",
|
|
366
|
-
alignItems: "center",
|
|
367
|
-
padding: "12px 20px",
|
|
368
|
-
backgroundColor: "rgba(255,255,255,0.05)",
|
|
369
|
-
gap: 8
|
|
370
|
-
},
|
|
371
|
-
children: [
|
|
372
|
-
/* @__PURE__ */ jsxDEV4("div", {
|
|
373
|
-
style: { display: "flex", gap: 8 },
|
|
374
|
-
children: [
|
|
375
|
-
/* @__PURE__ */ jsxDEV4("div", {
|
|
376
|
-
style: {
|
|
377
|
-
width: 12,
|
|
378
|
-
height: 12,
|
|
379
|
-
borderRadius: "50%",
|
|
380
|
-
backgroundColor: "#ff5f57"
|
|
381
|
-
}
|
|
382
|
-
}, undefined, false, undefined, this),
|
|
383
|
-
/* @__PURE__ */ jsxDEV4("div", {
|
|
384
|
-
style: {
|
|
385
|
-
width: 12,
|
|
386
|
-
height: 12,
|
|
387
|
-
borderRadius: "50%",
|
|
388
|
-
backgroundColor: "#febc2e"
|
|
389
|
-
}
|
|
390
|
-
}, undefined, false, undefined, this),
|
|
391
|
-
/* @__PURE__ */ jsxDEV4("div", {
|
|
392
|
-
style: {
|
|
393
|
-
width: 12,
|
|
394
|
-
height: 12,
|
|
395
|
-
borderRadius: "50%",
|
|
396
|
-
backgroundColor: "#28c840"
|
|
397
|
-
}
|
|
398
|
-
}, undefined, false, undefined, this)
|
|
399
|
-
]
|
|
400
|
-
}, undefined, true, undefined, this),
|
|
401
|
-
/* @__PURE__ */ jsxDEV4("div", {
|
|
402
|
-
style: {
|
|
403
|
-
flex: 1,
|
|
404
|
-
textAlign: "center",
|
|
405
|
-
color: "#484f58",
|
|
406
|
-
fontSize: codeStyle.fontSize * 0.7,
|
|
407
|
-
fontFamily: "monospace"
|
|
408
|
-
},
|
|
409
|
-
children: title
|
|
410
|
-
}, undefined, false, undefined, this)
|
|
411
|
-
]
|
|
412
|
-
}, undefined, true, undefined, this),
|
|
413
|
-
/* @__PURE__ */ jsxDEV4("div", {
|
|
414
|
-
style: { padding: "24px 32px", minHeight: 200 },
|
|
415
|
-
children: lines.map((line, i) => {
|
|
416
|
-
const timing = lineTimings[i];
|
|
417
|
-
if (!timing || frame < timing.startFrame)
|
|
418
|
-
return null;
|
|
419
|
-
const isCommand = line.type === "command";
|
|
420
|
-
const lineColor = LINE_TYPE_COLORS[line.type];
|
|
421
|
-
let visibleText = line.text;
|
|
422
|
-
if (isCommand) {
|
|
423
|
-
const typingProgress = interpolate3(frame, [timing.startFrame, timing.endFrame], [0, line.text.length], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
|
|
424
|
-
visibleText = line.text.slice(0, Math.floor(typingProgress));
|
|
425
|
-
}
|
|
426
|
-
const lineOpacity = isCommand ? 1 : interpolate3(frame, [timing.startFrame, timing.startFrame + 5], [0, 1], {
|
|
427
|
-
extrapolateLeft: "clamp",
|
|
428
|
-
extrapolateRight: "clamp"
|
|
429
|
-
});
|
|
430
|
-
const isTyping = isCommand && frame >= timing.startFrame && frame <= timing.endFrame;
|
|
431
|
-
const showCursor = isTyping && frame % 16 < 10;
|
|
432
|
-
return /* @__PURE__ */ jsxDEV4("div", {
|
|
433
|
-
style: {
|
|
434
|
-
fontFamily: "'SF Mono', 'Fira Code', 'JetBrains Mono', monospace",
|
|
435
|
-
fontSize: codeStyle.fontSize,
|
|
436
|
-
lineHeight: 1.8,
|
|
437
|
-
color: lineColor,
|
|
438
|
-
opacity: lineOpacity,
|
|
439
|
-
whiteSpace: "pre-wrap"
|
|
440
|
-
},
|
|
441
|
-
children: [
|
|
442
|
-
isCommand && /* @__PURE__ */ jsxDEV4("span", {
|
|
443
|
-
style: { color: "#3fb950" },
|
|
444
|
-
children: prompt
|
|
445
|
-
}, undefined, false, undefined, this),
|
|
446
|
-
line.type === "comment" && /* @__PURE__ */ jsxDEV4("span", {
|
|
447
|
-
style: { color: LINE_TYPE_COLORS.comment },
|
|
448
|
-
children: "# "
|
|
449
|
-
}, undefined, false, undefined, this),
|
|
450
|
-
visibleText,
|
|
451
|
-
showCursor && /* @__PURE__ */ jsxDEV4("span", {
|
|
452
|
-
style: {
|
|
453
|
-
backgroundColor: "#c9d1d9",
|
|
454
|
-
width: "2px",
|
|
455
|
-
display: "inline-block",
|
|
456
|
-
height: "1.2em",
|
|
457
|
-
verticalAlign: "text-bottom"
|
|
458
|
-
},
|
|
459
|
-
children: " "
|
|
460
|
-
}, undefined, false, undefined, this)
|
|
461
|
-
]
|
|
462
|
-
}, `${i}-${line.text.slice(0, 20)}`, true, undefined, this);
|
|
463
|
-
})
|
|
464
|
-
}, undefined, false, undefined, this)
|
|
465
|
-
]
|
|
466
|
-
}, undefined, true, undefined, this);
|
|
467
|
-
};
|
|
468
|
-
|
|
469
|
-
// src/compositions/terminal-demo.tsx
|
|
470
|
-
import { AbsoluteFill, Sequence, useVideoConfig as useVideoConfig5 } from "remotion";
|
|
471
|
-
import { jsxDEV as jsxDEV5 } from "react/jsx-dev-runtime";
|
|
472
|
-
var TerminalDemo = ({
|
|
473
|
-
title,
|
|
474
|
-
subtitle,
|
|
475
|
-
lines,
|
|
476
|
-
terminalTitle = "Terminal",
|
|
477
|
-
prompt = "$ ",
|
|
478
|
-
summary
|
|
479
|
-
}) => {
|
|
480
|
-
const { durationInFrames } = useVideoConfig5();
|
|
481
|
-
const theme = defaultVideoTheme;
|
|
482
|
-
const TERMINAL_START = 40;
|
|
483
|
-
const SUMMARY_START = durationInFrames - 90;
|
|
484
|
-
return /* @__PURE__ */ jsxDEV5(AbsoluteFill, {
|
|
485
|
-
children: [
|
|
486
|
-
/* @__PURE__ */ jsxDEV5(BrandFrame, {
|
|
487
|
-
variant: "dark",
|
|
488
|
-
showBranding: true,
|
|
489
|
-
children: /* @__PURE__ */ jsxDEV5("div", {
|
|
490
|
-
style: {
|
|
491
|
-
flex: 1,
|
|
492
|
-
display: "flex",
|
|
493
|
-
flexDirection: "column",
|
|
494
|
-
gap: 24
|
|
495
|
-
},
|
|
496
|
-
children: [
|
|
497
|
-
/* @__PURE__ */ jsxDEV5("div", {
|
|
498
|
-
children: [
|
|
499
|
-
/* @__PURE__ */ jsxDEV5(AnimatedText, {
|
|
500
|
-
text: title,
|
|
501
|
-
variant: "heading",
|
|
502
|
-
enterAt: 5,
|
|
503
|
-
color: "#ffffff"
|
|
504
|
-
}, undefined, false, undefined, this),
|
|
505
|
-
subtitle && /* @__PURE__ */ jsxDEV5("div", {
|
|
506
|
-
style: { marginTop: 8 },
|
|
507
|
-
children: /* @__PURE__ */ jsxDEV5(AnimatedText, {
|
|
508
|
-
text: subtitle,
|
|
509
|
-
variant: "body",
|
|
510
|
-
enterAt: 15,
|
|
511
|
-
color: theme.colors.mutedForeground
|
|
512
|
-
}, undefined, false, undefined, this)
|
|
513
|
-
}, undefined, false, undefined, this)
|
|
514
|
-
]
|
|
515
|
-
}, undefined, true, undefined, this),
|
|
516
|
-
/* @__PURE__ */ jsxDEV5(Sequence, {
|
|
517
|
-
from: TERMINAL_START,
|
|
518
|
-
children: /* @__PURE__ */ jsxDEV5("div", {
|
|
519
|
-
style: { flex: 1 },
|
|
520
|
-
children: /* @__PURE__ */ jsxDEV5(Terminal, {
|
|
521
|
-
lines,
|
|
522
|
-
startAt: 0,
|
|
523
|
-
prompt,
|
|
524
|
-
title: terminalTitle
|
|
525
|
-
}, undefined, false, undefined, this)
|
|
526
|
-
}, undefined, false, undefined, this)
|
|
527
|
-
}, undefined, false, undefined, this),
|
|
528
|
-
summary && /* @__PURE__ */ jsxDEV5(Sequence, {
|
|
529
|
-
from: SUMMARY_START,
|
|
530
|
-
children: /* @__PURE__ */ jsxDEV5("div", {
|
|
531
|
-
style: {
|
|
532
|
-
marginTop: "auto",
|
|
533
|
-
paddingTop: 24
|
|
534
|
-
},
|
|
535
|
-
children: /* @__PURE__ */ jsxDEV5(AnimatedText, {
|
|
536
|
-
text: summary,
|
|
537
|
-
variant: "subheading",
|
|
538
|
-
enterAt: 0,
|
|
539
|
-
color: theme.colors.accent,
|
|
540
|
-
align: "center"
|
|
541
|
-
}, undefined, false, undefined, this)
|
|
542
|
-
}, undefined, false, undefined, this)
|
|
543
|
-
}, undefined, false, undefined, this)
|
|
544
|
-
]
|
|
545
|
-
}, undefined, true, undefined, this)
|
|
546
|
-
}, undefined, false, undefined, this),
|
|
547
|
-
/* @__PURE__ */ jsxDEV5(ProgressBar, {}, undefined, false, undefined, this)
|
|
548
|
-
]
|
|
549
|
-
}, undefined, true, undefined, this);
|
|
550
|
-
};
|
|
551
|
-
export {
|
|
552
|
-
TerminalDemo
|
|
553
|
-
};
|
|
1
|
+
import{createRequire as a}from"node:module";var qG=a(import.meta.url);import{Easing as R}from"remotion";var Y={entrance:R.out(R.exp),exit:R.in(R.exp),emphasis:R.out(R.back(1.4)),linear:R.linear,gentle:R.bezier(0.25,0.1,0.25,1),spring:R.out(R.back(1.7))},_={sceneTransition:20,textEntrance:15,textExit:12,codeTypingPerChar:2,sectionPause:30,emphasisPause:15,brandReveal:25,minScene:60,shortScene:60,mediumScene:120,longScene:240},XG={fade:{type:"fade",durationInFrames:20},slideLeft:{type:"slide-left",durationInFrames:20},slideRight:{type:"slide-right",durationInFrames:20},wipe:{type:"wipe",durationInFrames:15},none:{type:"none",durationInFrames:0}};import{defaultTokens as w}from"@contractspec/lib.design-system";var j={canvasBackground:w.colors.background,codeBackground:"#1e1e2e",terminalBackground:"#0d1117",terminalForeground:"#c9d1d9",highlight:w.colors.accent,gradientStart:w.colors.primary,gradientEnd:w.colors.accent},D={...w,video:j};var b={title:{fontSize:72,lineHeight:1.1,fontWeight:700,letterSpacing:-1},heading:{fontSize:56,lineHeight:1.2,fontWeight:600,letterSpacing:-0.5},subheading:{fontSize:40,lineHeight:1.25,fontWeight:500},body:{fontSize:32,lineHeight:1.5,fontWeight:400},code:{fontSize:28,lineHeight:1.6,fontWeight:400},caption:{fontSize:24,lineHeight:1.4,fontWeight:400},label:{fontSize:20,lineHeight:1.3,fontWeight:600,letterSpacing:1}};function A(G,J){let $=J/1920;return{...G,fontSize:Math.round(G.fontSize*$),letterSpacing:G.letterSpacing?Math.round(G.letterSpacing*$*10)/10:void 0}}import{interpolate as V,useCurrentFrame as r,useVideoConfig as n}from"remotion";import{jsx as i}from"react/jsx-runtime";var O=({text:G,variant:J="body",style:$,enterAt:N=0,exitAt:W,color:X="#ffffff",align:Q="left"})=>{let U=r(),{width:L}=n(),z=b[J],P={...A(z,L),...$},K=V(U,[N,N+_.textEntrance],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}),M=V(K,[0,1],[0,1],{easing:Y.entrance}),H=V(K,[0,1],[30,0],{easing:Y.entrance}),q=1,F=0;if(W!==void 0){let T=V(U,[W,W+_.textExit],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"});q=V(T,[0,1],[1,0],{easing:Y.exit}),F=V(T,[0,1],[0,-20],{easing:Y.exit})}let k=M*q,S=H+F;return i("div",{style:{fontSize:P.fontSize,lineHeight:P.lineHeight,fontWeight:P.fontWeight,letterSpacing:P.letterSpacing,color:X,textAlign:Q,opacity:k,transform:`translateY(${S}px)`,willChange:"opacity, transform"},children:G})};import{VIDEO_FORMATS as v}from"@contractspec/lib.contracts-integrations/integrations/providers/video";var VG=30,C={horizontal:120,vertical:80,contentWidth:1680,contentHeight:920};function x(G){let J=G.width/1920,$=G.height/1080;return{horizontal:Math.round(C.horizontal*J),vertical:Math.round(C.vertical*$),contentWidth:Math.round(C.contentWidth*J),contentHeight:Math.round(C.contentHeight*$)}}var wG={center:{x:960,y:540},topLeft:{x:120,y:80},topRight:{x:1800,y:80},bottomLeft:{x:120,y:1000},bottomRight:{x:1800,y:1000},bottomCenter:{x:960,y:960}};function FG(){return[v.landscape,v.square,v.portrait]}import{interpolate as p,useCurrentFrame as t,useVideoConfig as e}from"remotion";import{jsx as h,jsxs as GG}from"react/jsx-runtime";var u=({styleOverrides:G,showBranding:J=!0,animateEntrance:$=!0,variant:N="gradient",children:W})=>{let X=t(),{width:Q,height:U}=e(),L=D,z=x({type:"custom",width:Q,height:U}),Z=G?.primaryColor??L.colors.primary,P=G?.accentColor??L.colors.accent,K=G?.darkMode??!0,M;switch(N){case"solid":M=K?"#0a0a0a":L.colors.background;break;case"gradient":M=K?"linear-gradient(135deg, #0a0a14 0%, #0f172a 50%, #0a0a14 100%)":`linear-gradient(135deg, ${L.colors.background} 0%, ${L.colors.muted} 100%)`;break;case"dark":M="#000000";break}let H=$?p(X,[0,15],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:Y.entrance}):1,q=J?p(X,[_.brandReveal,_.brandReveal+15],[0,0.3],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}):0;return GG("div",{style:{width:Q,height:U,background:M,position:"relative",overflow:"hidden",opacity:H},children:[N==="gradient"&&h("div",{style:{position:"absolute",top:"-20%",right:"-10%",width:"50%",height:"50%",background:`radial-gradient(circle, ${Z}15 0%, transparent 70%)`,borderRadius:"50%",pointerEvents:"none"}}),h("div",{style:{position:"absolute",left:z.horizontal,top:z.vertical,width:z.contentWidth,height:z.contentHeight,display:"flex",flexDirection:"column"},children:W}),J&&h("div",{style:{position:"absolute",bottom:z.vertical/2,right:z.horizontal,opacity:q,color:K?"#ffffff":"#000000",fontSize:Math.round(16*(Q/1920)),fontWeight:500,letterSpacing:1},children:"ContractSpec"})]})};import{useCurrentFrame as HG,useVideoConfig as JG}from"remotion";import{jsx as c}from"react/jsx-runtime";var g=({height:G=4,color:J=D.colors.primary,backgroundColor:$="rgba(255,255,255,0.1)",position:N="bottom"})=>{let W=HG(),{durationInFrames:X,width:Q}=JG(),U=W/X;return c("div",{style:{position:"absolute",[N]:0,left:0,width:Q,height:G,backgroundColor:$,zIndex:100},children:c("div",{style:{width:`${U*100}%`,height:"100%",backgroundColor:J,transition:"none"}})})};import{interpolate as f,useCurrentFrame as KG,useVideoConfig as QG}from"remotion";import{jsx as B,jsxs as E}from"react/jsx-runtime";var d={command:"#c9d1d9",output:"#8b949e",error:"#f85149",success:"#3fb950",comment:"#6e7681"},m=({lines:G,startAt:J=0,prompt:$="$ ",title:N="Terminal",backgroundColor:W=j.terminalBackground,typingSpeed:X=_.codeTypingPerChar})=>{let Q=KG(),{width:U}=QG(),L=A(b.code,U),z=[],Z=J;for(let K of G){let M=K.delay??10,H=Z+M;if(K.type==="command"){let q=K.text.length*X;z.push({startFrame:H,endFrame:H+q}),Z=H+q}else z.push({startFrame:H,endFrame:H+5}),Z=H+5}let P=f(Q,[J,J+10],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:Y.entrance});return E("div",{style:{backgroundColor:W,borderRadius:16,overflow:"hidden",opacity:P,boxShadow:"0 8px 32px rgba(0,0,0,0.3)"},children:[E("div",{style:{display:"flex",alignItems:"center",padding:"12px 20px",backgroundColor:"rgba(255,255,255,0.05)",gap:8},children:[E("div",{style:{display:"flex",gap:8},children:[B("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#ff5f57"}}),B("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#febc2e"}}),B("div",{style:{width:12,height:12,borderRadius:"50%",backgroundColor:"#28c840"}})]}),B("div",{style:{flex:1,textAlign:"center",color:"#484f58",fontSize:L.fontSize*0.7,fontFamily:"monospace"},children:N})]}),B("div",{style:{padding:"24px 32px",minHeight:200},children:G.map((K,M)=>{let H=z[M];if(!H||Q<H.startFrame)return null;let q=K.type==="command",F=d[K.type],k=K.text;if(q){let s=f(Q,[H.startFrame,H.endFrame],[0,K.text.length],{extrapolateLeft:"clamp",extrapolateRight:"clamp"});k=K.text.slice(0,Math.floor(s))}let S=q?1:f(Q,[H.startFrame,H.startFrame+5],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}),o=q&&Q>=H.startFrame&&Q<=H.endFrame&&Q%16<10;return E("div",{style:{fontFamily:"'SF Mono', 'Fira Code', 'JetBrains Mono', monospace",fontSize:L.fontSize,lineHeight:1.8,color:F,opacity:S,whiteSpace:"pre-wrap"},children:[q&&B("span",{style:{color:"#3fb950"},children:$}),K.type==="comment"&&B("span",{style:{color:d.comment},children:"# "}),k,o&&B("span",{style:{backgroundColor:"#c9d1d9",width:"2px",display:"inline-block",height:"1.2em",verticalAlign:"text-bottom"},children:" "})]},`${M}-${K.text.slice(0,20)}`)})})]})};import{AbsoluteFill as $G,Sequence as l,useVideoConfig as zG}from"remotion";import{jsx as I,jsxs as y}from"react/jsx-runtime";var aG=({title:G,subtitle:J,lines:$,terminalTitle:N="Terminal",prompt:W="$ ",summary:X})=>{let{durationInFrames:Q}=zG(),U=D,L=40,z=Q-90;return y($G,{children:[I(u,{variant:"dark",showBranding:!0,children:y("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:24},children:[y("div",{children:[I(O,{text:G,variant:"heading",enterAt:5,color:"#ffffff"}),J&&I("div",{style:{marginTop:8},children:I(O,{text:J,variant:"body",enterAt:15,color:U.colors.mutedForeground})})]}),I(l,{from:40,children:I("div",{style:{flex:1},children:I(m,{lines:$,startAt:0,prompt:W,title:N})})}),X&&I(l,{from:z,children:I("div",{style:{marginTop:"auto",paddingTop:24},children:I(O,{text:X,variant:"subheading",enterAt:0,color:U.colors.accent,align:"center"})})})]})}),I(g,{})]})};export{aG as TerminalDemo};
|