@contractspec/lib.video-gen 2.7.17 → 2.7.19
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 +16 -16
|
@@ -1,495 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
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/social-clip.tsx
|
|
312
|
-
import {
|
|
313
|
-
AbsoluteFill,
|
|
314
|
-
interpolate as interpolate3,
|
|
315
|
-
Sequence,
|
|
316
|
-
useCurrentFrame as useCurrentFrame4,
|
|
317
|
-
useVideoConfig as useVideoConfig4
|
|
318
|
-
} from "remotion";
|
|
319
|
-
import { jsxDEV as jsxDEV4 } from "react/jsx-dev-runtime";
|
|
320
|
-
var SocialClip = ({
|
|
321
|
-
hook,
|
|
322
|
-
message,
|
|
323
|
-
points = [],
|
|
324
|
-
cta = "Learn more",
|
|
325
|
-
ctaUrl = "contractspec.dev",
|
|
326
|
-
accentColor
|
|
327
|
-
}) => {
|
|
328
|
-
const { durationInFrames, width, height } = useVideoConfig4();
|
|
329
|
-
const theme = defaultVideoTheme;
|
|
330
|
-
const accent = accentColor ?? theme.colors.accent;
|
|
331
|
-
const isPortrait = height > width;
|
|
332
|
-
const HOOK_DURATION = 75;
|
|
333
|
-
const MESSAGE_START = 60;
|
|
334
|
-
const POINTS_START = MESSAGE_START + 60;
|
|
335
|
-
const CTA_START = durationInFrames - 90;
|
|
336
|
-
return /* @__PURE__ */ jsxDEV4(AbsoluteFill, {
|
|
337
|
-
children: [
|
|
338
|
-
/* @__PURE__ */ jsxDEV4(BrandFrame, {
|
|
339
|
-
variant: "gradient",
|
|
340
|
-
showBranding: true,
|
|
341
|
-
children: /* @__PURE__ */ jsxDEV4("div", {
|
|
342
|
-
style: {
|
|
343
|
-
flex: 1,
|
|
344
|
-
display: "flex",
|
|
345
|
-
flexDirection: "column",
|
|
346
|
-
justifyContent: "center",
|
|
347
|
-
alignItems: "center",
|
|
348
|
-
gap: isPortrait ? 48 : 32,
|
|
349
|
-
textAlign: "center",
|
|
350
|
-
padding: isPortrait ? "0 20px" : 0
|
|
351
|
-
},
|
|
352
|
-
children: [
|
|
353
|
-
/* @__PURE__ */ jsxDEV4(Sequence, {
|
|
354
|
-
from: 0,
|
|
355
|
-
durationInFrames: HOOK_DURATION + 30,
|
|
356
|
-
children: /* @__PURE__ */ jsxDEV4("div", {
|
|
357
|
-
style: { width: "100%" },
|
|
358
|
-
children: /* @__PURE__ */ jsxDEV4(AnimatedText, {
|
|
359
|
-
text: hook,
|
|
360
|
-
variant: "title",
|
|
361
|
-
enterAt: 5,
|
|
362
|
-
exitAt: HOOK_DURATION,
|
|
363
|
-
color: "#ffffff",
|
|
364
|
-
align: "center"
|
|
365
|
-
}, undefined, false, undefined, this)
|
|
366
|
-
}, undefined, false, undefined, this)
|
|
367
|
-
}, undefined, false, undefined, this),
|
|
368
|
-
/* @__PURE__ */ jsxDEV4(Sequence, {
|
|
369
|
-
from: MESSAGE_START,
|
|
370
|
-
children: /* @__PURE__ */ jsxDEV4("div", {
|
|
371
|
-
style: { width: "100%" },
|
|
372
|
-
children: /* @__PURE__ */ jsxDEV4(AnimatedText, {
|
|
373
|
-
text: message,
|
|
374
|
-
variant: isPortrait ? "subheading" : "heading",
|
|
375
|
-
enterAt: 0,
|
|
376
|
-
color: "#ffffff",
|
|
377
|
-
align: "center"
|
|
378
|
-
}, undefined, false, undefined, this)
|
|
379
|
-
}, undefined, false, undefined, this)
|
|
380
|
-
}, undefined, false, undefined, this),
|
|
381
|
-
points.length > 0 && /* @__PURE__ */ jsxDEV4(Sequence, {
|
|
382
|
-
from: POINTS_START,
|
|
383
|
-
children: /* @__PURE__ */ jsxDEV4("div", {
|
|
384
|
-
style: {
|
|
385
|
-
display: "flex",
|
|
386
|
-
flexDirection: "column",
|
|
387
|
-
gap: 16,
|
|
388
|
-
alignItems: isPortrait ? "flex-start" : "center",
|
|
389
|
-
width: "100%",
|
|
390
|
-
maxWidth: isPortrait ? "100%" : "80%",
|
|
391
|
-
marginTop: 16
|
|
392
|
-
},
|
|
393
|
-
children: points.map((point, i) => /* @__PURE__ */ jsxDEV4(PointItem, {
|
|
394
|
-
text: point,
|
|
395
|
-
index: i,
|
|
396
|
-
startFrame: i * 15,
|
|
397
|
-
accent
|
|
398
|
-
}, point, false, undefined, this))
|
|
399
|
-
}, undefined, false, undefined, this)
|
|
400
|
-
}, undefined, false, undefined, this),
|
|
401
|
-
/* @__PURE__ */ jsxDEV4(Sequence, {
|
|
402
|
-
from: CTA_START,
|
|
403
|
-
children: /* @__PURE__ */ jsxDEV4(CTABlock, {
|
|
404
|
-
cta,
|
|
405
|
-
url: ctaUrl,
|
|
406
|
-
accent
|
|
407
|
-
}, undefined, false, undefined, this)
|
|
408
|
-
}, undefined, false, undefined, this)
|
|
409
|
-
]
|
|
410
|
-
}, undefined, true, undefined, this)
|
|
411
|
-
}, undefined, false, undefined, this),
|
|
412
|
-
/* @__PURE__ */ jsxDEV4(ProgressBar, {
|
|
413
|
-
color: accent
|
|
414
|
-
}, undefined, false, undefined, this)
|
|
415
|
-
]
|
|
416
|
-
}, undefined, true, undefined, this);
|
|
417
|
-
};
|
|
418
|
-
var PointItem = ({ text, startFrame, accent }) => {
|
|
419
|
-
const frame = useCurrentFrame4();
|
|
420
|
-
const opacity = interpolate3(frame, [startFrame, startFrame + 12], [0, 1], {
|
|
421
|
-
extrapolateLeft: "clamp",
|
|
422
|
-
extrapolateRight: "clamp"
|
|
423
|
-
});
|
|
424
|
-
const translateX = interpolate3(frame, [startFrame, startFrame + 15], [-30, 0], {
|
|
425
|
-
extrapolateLeft: "clamp",
|
|
426
|
-
extrapolateRight: "clamp",
|
|
427
|
-
easing: videoEasing.entrance
|
|
428
|
-
});
|
|
429
|
-
return /* @__PURE__ */ jsxDEV4("div", {
|
|
430
|
-
style: {
|
|
431
|
-
opacity,
|
|
432
|
-
transform: `translateX(${translateX}px)`,
|
|
433
|
-
display: "flex",
|
|
434
|
-
alignItems: "center",
|
|
435
|
-
gap: 16,
|
|
436
|
-
fontSize: 28,
|
|
437
|
-
color: "#ffffff"
|
|
438
|
-
},
|
|
439
|
-
children: [
|
|
440
|
-
/* @__PURE__ */ jsxDEV4("div", {
|
|
441
|
-
style: {
|
|
442
|
-
width: 8,
|
|
443
|
-
height: 8,
|
|
444
|
-
borderRadius: "50%",
|
|
445
|
-
backgroundColor: accent,
|
|
446
|
-
flexShrink: 0
|
|
447
|
-
}
|
|
448
|
-
}, undefined, false, undefined, this),
|
|
449
|
-
text
|
|
450
|
-
]
|
|
451
|
-
}, undefined, true, undefined, this);
|
|
452
|
-
};
|
|
453
|
-
var CTABlock = ({ cta, url, accent }) => {
|
|
454
|
-
const frame = useCurrentFrame4();
|
|
455
|
-
const opacity = interpolate3(frame, [0, 15], [0, 1], {
|
|
456
|
-
extrapolateLeft: "clamp",
|
|
457
|
-
extrapolateRight: "clamp"
|
|
458
|
-
});
|
|
459
|
-
const scale = interpolate3(frame, [0, 18], [0.9, 1], {
|
|
460
|
-
extrapolateLeft: "clamp",
|
|
461
|
-
extrapolateRight: "clamp",
|
|
462
|
-
easing: videoEasing.emphasis
|
|
463
|
-
});
|
|
464
|
-
return /* @__PURE__ */ jsxDEV4("div", {
|
|
465
|
-
style: {
|
|
466
|
-
opacity,
|
|
467
|
-
transform: `scale(${scale})`,
|
|
468
|
-
display: "flex",
|
|
469
|
-
flexDirection: "column",
|
|
470
|
-
alignItems: "center",
|
|
471
|
-
gap: 12,
|
|
472
|
-
marginTop: 24
|
|
473
|
-
},
|
|
474
|
-
children: [
|
|
475
|
-
/* @__PURE__ */ jsxDEV4("div", {
|
|
476
|
-
style: {
|
|
477
|
-
backgroundColor: accent,
|
|
478
|
-
color: "#ffffff",
|
|
479
|
-
padding: "16px 48px",
|
|
480
|
-
borderRadius: 12,
|
|
481
|
-
fontSize: 28,
|
|
482
|
-
fontWeight: 600
|
|
483
|
-
},
|
|
484
|
-
children: cta
|
|
485
|
-
}, undefined, false, undefined, this),
|
|
486
|
-
/* @__PURE__ */ jsxDEV4("div", {
|
|
487
|
-
style: { color: "rgba(255,255,255,0.5)", fontSize: 20 },
|
|
488
|
-
children: url
|
|
489
|
-
}, undefined, false, undefined, this)
|
|
490
|
-
]
|
|
491
|
-
}, undefined, true, undefined, this);
|
|
492
|
-
};
|
|
493
|
-
export {
|
|
494
|
-
SocialClip
|
|
495
|
-
};
|
|
2
|
+
var HG=import.meta.require;import{Easing as z}from"remotion";var U={entrance:z.out(z.exp),exit:z.in(z.exp),emphasis:z.out(z.back(1.4)),linear:z.linear,gentle:z.bezier(0.25,0.1,0.25,1),spring:z.out(z.back(1.7))},B={sceneTransition:20,textEntrance:15,textExit:12,codeTypingPerChar:2,sectionPause:30,emphasisPause:15,brandReveal:25,minScene:60,shortScene:60,mediumScene:120,longScene:240},LG={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 P}from"@contractspec/lib.design-system";var g={canvasBackground:P.colors.background,codeBackground:"#1e1e2e",terminalBackground:"#0d1117",terminalForeground:"#c9d1d9",highlight:P.colors.accent,gradientStart:P.colors.primary,gradientEnd:P.colors.accent},D={...P,video:g};var j={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 v(G,H){let J=H/1920;return{...G,fontSize:Math.round(G.fontSize*J),letterSpacing:G.letterSpacing?Math.round(G.letterSpacing*J*10)/10:void 0}}import{interpolate as Z,useCurrentFrame as c,useVideoConfig as d}from"remotion";import{jsx as l}from"react/jsx-runtime";var S=({text:G,variant:H="body",style:J,enterAt:L=0,exitAt:N,color:Q="#ffffff",align:W="left"})=>{let X=c(),{width:q}=d(),M=j[H],$={...v(M,q),...J},R=Z(X,[L,L+B.textEntrance],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}),_=Z(R,[0,1],[0,1],{easing:U.entrance}),w=Z(R,[0,1],[30,0],{easing:U.entrance}),I=1,V=0;if(N!==void 0){let T=Z(X,[N,N+B.textExit],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"});I=Z(T,[0,1],[1,0],{easing:U.exit}),V=Z(T,[0,1],[0,-20],{easing:U.exit})}let b=_*I,m=w+V;return l("div",{style:{fontSize:$.fontSize,lineHeight:$.lineHeight,fontWeight:$.fontWeight,letterSpacing:$.letterSpacing,color:Q,textAlign:W,opacity:b,transform:`translateY(${m}px)`,willChange:"opacity, transform"},children:G})};import{VIDEO_FORMATS as k}from"@contractspec/lib.contracts-integrations/integrations/providers/video";var _G=30,C={horizontal:120,vertical:80,contentWidth:1680,contentHeight:920};function y(G){let H=G.width/1920,J=G.height/1080;return{horizontal:Math.round(C.horizontal*H),vertical:Math.round(C.vertical*J),contentWidth:Math.round(C.contentWidth*H),contentHeight:Math.round(C.contentHeight*J)}}var YG={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 IG(){return[k.landscape,k.square,k.portrait]}import{interpolate as h,useCurrentFrame as o,useVideoConfig as n}from"remotion";import{jsx as E,jsxs as s}from"react/jsx-runtime";var f=({styleOverrides:G,showBranding:H=!0,animateEntrance:J=!0,variant:L="gradient",children:N})=>{let Q=o(),{width:W,height:X}=n(),q=D,M=y({type:"custom",width:W,height:X}),Y=G?.primaryColor??q.colors.primary,$=G?.accentColor??q.colors.accent,R=G?.darkMode??!0,_;switch(L){case"solid":_=R?"#0a0a0a":q.colors.background;break;case"gradient":_=R?"linear-gradient(135deg, #0a0a14 0%, #0f172a 50%, #0a0a14 100%)":`linear-gradient(135deg, ${q.colors.background} 0%, ${q.colors.muted} 100%)`;break;case"dark":_="#000000";break}let w=J?h(Q,[0,15],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:U.entrance}):1,I=H?h(Q,[B.brandReveal,B.brandReveal+15],[0,0.3],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}):0;return s("div",{style:{width:W,height:X,background:_,position:"relative",overflow:"hidden",opacity:w},children:[L==="gradient"&&E("div",{style:{position:"absolute",top:"-20%",right:"-10%",width:"50%",height:"50%",background:`radial-gradient(circle, ${Y}15 0%, transparent 70%)`,borderRadius:"50%",pointerEvents:"none"}}),E("div",{style:{position:"absolute",left:M.horizontal,top:M.vertical,width:M.contentWidth,height:M.contentHeight,display:"flex",flexDirection:"column"},children:N}),H&&E("div",{style:{position:"absolute",bottom:M.vertical/2,right:M.horizontal,opacity:I,color:R?"#ffffff":"#000000",fontSize:Math.round(16*(W/1920)),fontWeight:500,letterSpacing:1},children:"ContractSpec"})]})};import{useCurrentFrame as r,useVideoConfig as i}from"remotion";import{jsx as p}from"react/jsx-runtime";var u=({height:G=4,color:H=D.colors.primary,backgroundColor:J="rgba(255,255,255,0.1)",position:L="bottom"})=>{let N=r(),{durationInFrames:Q,width:W}=i(),X=N/Q;return p("div",{style:{position:"absolute",[L]:0,left:0,width:W,height:G,backgroundColor:J,zIndex:100},children:p("div",{style:{width:`${X*100}%`,height:"100%",backgroundColor:H,transition:"none"}})})};import{AbsoluteFill as a,interpolate as F,Sequence as A,useCurrentFrame as x,useVideoConfig as t}from"remotion";import{jsx as K,jsxs as O}from"react/jsx-runtime";var yG=({hook:G,message:H,points:J=[],cta:L="Learn more",ctaUrl:N="contractspec.dev",accentColor:Q})=>{let{durationInFrames:W,width:X,height:q}=t(),Y=Q??D.colors.accent,$=q>X,R=75,_=60,w=120,I=W-90;return O(a,{children:[K(f,{variant:"gradient",showBranding:!0,children:O("div",{style:{flex:1,display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",gap:$?48:32,textAlign:"center",padding:$?"0 20px":0},children:[K(A,{from:0,durationInFrames:105,children:K("div",{style:{width:"100%"},children:K(S,{text:G,variant:"title",enterAt:5,exitAt:75,color:"#ffffff",align:"center"})})}),K(A,{from:60,children:K("div",{style:{width:"100%"},children:K(S,{text:H,variant:$?"subheading":"heading",enterAt:0,color:"#ffffff",align:"center"})})}),J.length>0&&K(A,{from:120,children:K("div",{style:{display:"flex",flexDirection:"column",gap:16,alignItems:$?"flex-start":"center",width:"100%",maxWidth:$?"100%":"80%",marginTop:16},children:J.map((V,b)=>K(e,{text:V,index:b,startFrame:b*15,accent:Y},V))})}),K(A,{from:I,children:K(GG,{cta:L,url:N,accent:Y})})]})}),K(u,{color:Y})]})},e=({text:G,startFrame:H,accent:J})=>{let L=x(),N=F(L,[H,H+12],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}),Q=F(L,[H,H+15],[-30,0],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:U.entrance});return O("div",{style:{opacity:N,transform:`translateX(${Q}px)`,display:"flex",alignItems:"center",gap:16,fontSize:28,color:"#ffffff"},children:[K("div",{style:{width:8,height:8,borderRadius:"50%",backgroundColor:J,flexShrink:0}}),G]})},GG=({cta:G,url:H,accent:J})=>{let L=x(),N=F(L,[0,15],[0,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp"}),Q=F(L,[0,18],[0.9,1],{extrapolateLeft:"clamp",extrapolateRight:"clamp",easing:U.emphasis});return O("div",{style:{opacity:N,transform:`scale(${Q})`,display:"flex",flexDirection:"column",alignItems:"center",gap:12,marginTop:24},children:[K("div",{style:{backgroundColor:J,color:"#ffffff",padding:"16px 48px",borderRadius:12,fontSize:28,fontWeight:600},children:G}),K("div",{style:{color:"rgba(255,255,255,0.5)",fontSize:20},children:H})]})};export{yG as SocialClip};
|