devrel-toolkit 0.1.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/README.md +63 -0
- package/dist/__tests__/cli.test.d.ts +2 -0
- package/dist/__tests__/cli.test.d.ts.map +1 -0
- package/dist/__tests__/cli.test.js +47 -0
- package/dist/__tests__/cli.test.js.map +1 -0
- package/dist/__tests__/components.test.d.ts +2 -0
- package/dist/__tests__/components.test.d.ts.map +1 -0
- package/dist/__tests__/components.test.js +73 -0
- package/dist/__tests__/components.test.js.map +1 -0
- package/dist/__tests__/d-id-client.test.d.ts +2 -0
- package/dist/__tests__/d-id-client.test.d.ts.map +1 -0
- package/dist/__tests__/d-id-client.test.js +116 -0
- package/dist/__tests__/d-id-client.test.js.map +1 -0
- package/dist/__tests__/render-integration.test.d.ts +2 -0
- package/dist/__tests__/render-integration.test.d.ts.map +1 -0
- package/dist/__tests__/render-integration.test.js +26 -0
- package/dist/__tests__/render-integration.test.js.map +1 -0
- package/dist/__tests__/schema.test.d.ts +2 -0
- package/dist/__tests__/schema.test.d.ts.map +1 -0
- package/dist/__tests__/schema.test.js +173 -0
- package/dist/__tests__/schema.test.js.map +1 -0
- package/dist/__tests__/timing.test.d.ts +2 -0
- package/dist/__tests__/timing.test.d.ts.map +1 -0
- package/dist/__tests__/timing.test.js +69 -0
- package/dist/__tests__/timing.test.js.map +1 -0
- package/dist/cli/d-id.d.ts +3 -0
- package/dist/cli/d-id.d.ts.map +1 -0
- package/dist/cli/d-id.js +53 -0
- package/dist/cli/d-id.js.map +1 -0
- package/dist/cli/doctor.d.ts +3 -0
- package/dist/cli/doctor.d.ts.map +1 -0
- package/dist/cli/doctor.js +134 -0
- package/dist/cli/doctor.js.map +1 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +21 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/install-skill.d.ts +3 -0
- package/dist/cli/install-skill.d.ts.map +1 -0
- package/dist/cli/install-skill.js +50 -0
- package/dist/cli/install-skill.js.map +1 -0
- package/dist/cli/render.d.ts +4 -0
- package/dist/cli/render.d.ts.map +1 -0
- package/dist/cli/render.js +134 -0
- package/dist/cli/render.js.map +1 -0
- package/dist/cli/setup.d.ts +3 -0
- package/dist/cli/setup.d.ts.map +1 -0
- package/dist/cli/setup.js +60 -0
- package/dist/cli/setup.js.map +1 -0
- package/dist/compositor/DemoVideo.d.ts +4 -0
- package/dist/compositor/DemoVideo.d.ts.map +1 -0
- package/dist/compositor/DemoVideo.js +64 -0
- package/dist/compositor/DemoVideo.js.map +1 -0
- package/dist/compositor/Root.d.ts +3 -0
- package/dist/compositor/Root.d.ts.map +1 -0
- package/dist/compositor/Root.js +30 -0
- package/dist/compositor/Root.js.map +1 -0
- package/dist/compositor/components/AvatarPiP.d.ts +10 -0
- package/dist/compositor/components/AvatarPiP.d.ts.map +1 -0
- package/dist/compositor/components/AvatarPiP.js +52 -0
- package/dist/compositor/components/AvatarPiP.js.map +1 -0
- package/dist/compositor/components/BrowserFrame.d.ts +18 -0
- package/dist/compositor/components/BrowserFrame.d.ts.map +1 -0
- package/dist/compositor/components/BrowserFrame.js +97 -0
- package/dist/compositor/components/BrowserFrame.js.map +1 -0
- package/dist/compositor/components/Cursor.d.ts +13 -0
- package/dist/compositor/components/Cursor.d.ts.map +1 -0
- package/dist/compositor/components/Cursor.js +65 -0
- package/dist/compositor/components/Cursor.js.map +1 -0
- package/dist/compositor/components/Highlight.d.ts +9 -0
- package/dist/compositor/components/Highlight.d.ts.map +1 -0
- package/dist/compositor/components/Highlight.js +83 -0
- package/dist/compositor/components/Highlight.js.map +1 -0
- package/dist/compositor/components/IntroOutro.d.ts +10 -0
- package/dist/compositor/components/IntroOutro.d.ts.map +1 -0
- package/dist/compositor/components/IntroOutro.js +48 -0
- package/dist/compositor/components/IntroOutro.js.map +1 -0
- package/dist/compositor/components/SceneTransition.d.ts +9 -0
- package/dist/compositor/components/SceneTransition.d.ts.map +1 -0
- package/dist/compositor/components/SceneTransition.js +35 -0
- package/dist/compositor/components/SceneTransition.js.map +1 -0
- package/dist/compositor/components/Subtitles.d.ts +9 -0
- package/dist/compositor/components/Subtitles.d.ts.map +1 -0
- package/dist/compositor/components/Subtitles.js +45 -0
- package/dist/compositor/components/Subtitles.js.map +1 -0
- package/dist/compositor/index.d.ts +2 -0
- package/dist/compositor/index.d.ts.map +1 -0
- package/dist/compositor/index.js +4 -0
- package/dist/compositor/index.js.map +1 -0
- package/dist/compositor/timing.d.ts +16 -0
- package/dist/compositor/timing.d.ts.map +1 -0
- package/dist/compositor/timing.js +39 -0
- package/dist/compositor/timing.js.map +1 -0
- package/dist/d-id/client.d.ts +50 -0
- package/dist/d-id/client.d.ts.map +1 -0
- package/dist/d-id/client.js +114 -0
- package/dist/d-id/client.js.map +1 -0
- package/dist/d-id/generate.d.ts +9 -0
- package/dist/d-id/generate.d.ts.map +1 -0
- package/dist/d-id/generate.js +81 -0
- package/dist/d-id/generate.js.map +1 -0
- package/dist/utils/config.d.ts +14 -0
- package/dist/utils/config.d.ts.map +1 -0
- package/dist/utils/config.js +34 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/schema.d.ts +273 -0
- package/dist/utils/schema.d.ts.map +1 -0
- package/dist/utils/schema.js +98 -0
- package/dist/utils/schema.js.map +1 -0
- package/package.json +54 -0
- package/remotion.config.ts +4 -0
- package/skills/make-demo/SKILL.md +282 -0
- package/skills/make-demo/references/demo-script-schema.md +47 -0
- package/skills/make-demo/references/render-props-schema.md +49 -0
- package/skills/make-demo/references/toolkit-commands.md +23 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { AbsoluteFill, interpolate, useVideoConfig } from "remotion";
|
|
4
|
+
import { Audio } from "@remotion/media";
|
|
5
|
+
import { TransitionSeries, linearTiming } from "@remotion/transitions";
|
|
6
|
+
import { fade } from "@remotion/transitions/fade";
|
|
7
|
+
import { slide } from "@remotion/transitions/slide";
|
|
8
|
+
import { BrowserFrame } from "./components/BrowserFrame.js";
|
|
9
|
+
import { Highlight } from "./components/Highlight.js";
|
|
10
|
+
import { AvatarPiP } from "./components/AvatarPiP.js";
|
|
11
|
+
import { Subtitles } from "./components/Subtitles.js";
|
|
12
|
+
import { Cursor } from "./components/Cursor.js";
|
|
13
|
+
import { IntroOutroCard } from "./components/IntroOutro.js";
|
|
14
|
+
const INTRO_OUTRO_DEFAULT_SECONDS = 3;
|
|
15
|
+
const TRANSITION_DURATION_FRAMES = 15; // 0.5s at 30fps
|
|
16
|
+
function getPresentation(type) {
|
|
17
|
+
switch (type) {
|
|
18
|
+
case "fade":
|
|
19
|
+
return fade();
|
|
20
|
+
case "slide":
|
|
21
|
+
return slide({ direction: "from-right" });
|
|
22
|
+
case "cut":
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export const DemoVideo = (props) => {
|
|
27
|
+
const { scenes, fps, avatarPosition = "bottom-right", avatarSize = 280, showSubtitles = true, intro, outro, backgroundMusic, } = props;
|
|
28
|
+
if (scenes.length === 0 && !intro && !outro) {
|
|
29
|
+
return _jsx(AbsoluteFill, { style: { backgroundColor: "#000" } });
|
|
30
|
+
}
|
|
31
|
+
const introFrames = intro
|
|
32
|
+
? Math.ceil((intro.durationSeconds ?? INTRO_OUTRO_DEFAULT_SECONDS) * fps)
|
|
33
|
+
: 0;
|
|
34
|
+
const outroFrames = outro
|
|
35
|
+
? Math.ceil((outro.durationSeconds ?? INTRO_OUTRO_DEFAULT_SECONDS) * fps)
|
|
36
|
+
: 0;
|
|
37
|
+
const transitionFrames = Math.ceil(TRANSITION_DURATION_FRAMES * (fps / 30));
|
|
38
|
+
return (_jsxs(AbsoluteFill, { style: { backgroundColor: "#000" }, children: [backgroundMusic && _jsx(BackgroundMusic, { src: backgroundMusic }), _jsxs(TransitionSeries, { children: [intro && (_jsxs(_Fragment, { children: [_jsx(TransitionSeries.Sequence, { durationInFrames: introFrames, premountFor: Math.ceil(fps * 0.5), children: _jsx(IntroOutroCard, { data: intro, type: "intro", durationFrames: introFrames }) }), scenes.length > 0 && (_jsx(TransitionSeries.Transition, { presentation: fade(), timing: linearTiming({ durationInFrames: transitionFrames }) }))] })), scenes.map((scene, index) => {
|
|
39
|
+
const sceneDurationFrames = Math.ceil(scene.avatarDuration * fps);
|
|
40
|
+
const nextScene = scenes[index + 1];
|
|
41
|
+
return (_jsxs(React.Fragment, { children: [_jsx(TransitionSeries.Sequence, { durationInFrames: sceneDurationFrames, premountFor: Math.ceil(fps * 0.5), children: _jsx(SceneContent, { scene: scene, durationFrames: sceneDurationFrames, avatarPosition: avatarPosition, avatarSize: avatarSize, showSubtitles: showSubtitles }) }), (nextScene || outro) && scene.transition !== "cut" && nextScene?.transition !== "cut" && (_jsx(TransitionSeries.Transition, { presentation: getPresentation(nextScene?.transition ?? "fade") ?? fade(), timing: linearTiming({ durationInFrames: transitionFrames }) }))] }, scene.id));
|
|
42
|
+
}), outro && (_jsx(TransitionSeries.Sequence, { durationInFrames: outroFrames, premountFor: Math.ceil(fps * 0.5), children: _jsx(IntroOutroCard, { data: outro, type: "outro", durationFrames: outroFrames }) }))] })] }));
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Scene content — renders all layers for a single scene.
|
|
46
|
+
*/
|
|
47
|
+
const SceneContent = ({ scene, durationFrames, avatarPosition, avatarSize, showSubtitles }) => {
|
|
48
|
+
return (_jsxs(AbsoluteFill, { children: [_jsx(BrowserFrame, { screenshotPath: scene.screenshotPath, url: scene.url, zoom: scene.zoom, durationFrames: durationFrames }), scene.highlights.length > 0 && (_jsx(Highlight, { highlights: scene.highlights, durationFrames: durationFrames })), scene.cursorPath && scene.cursorPath.length > 0 && (_jsx(Cursor, { cursorPath: scene.cursorPath, durationFrames: durationFrames })), scene.avatarClipPath && (_jsx(AvatarPiP, { clipPath: scene.avatarClipPath, position: avatarPosition, size: avatarSize, durationFrames: durationFrames })), showSubtitles && scene.narration && (_jsx(Subtitles, { text: scene.narration, durationFrames: durationFrames, visible: true }))] }));
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Background music with fade in/out and low volume.
|
|
52
|
+
* Uses @remotion/media Audio with volume callback.
|
|
53
|
+
*/
|
|
54
|
+
const BackgroundMusic = ({ src }) => {
|
|
55
|
+
const { fps, durationInFrames } = useVideoConfig();
|
|
56
|
+
const fadeIn = Math.ceil(2 * fps);
|
|
57
|
+
const fadeOut = Math.ceil(2 * fps);
|
|
58
|
+
const total = durationInFrames;
|
|
59
|
+
return (_jsx(Audio, { src: src, volume: (f) => interpolate(f, [0, fadeIn, total - fadeOut, total], [0, 0.15, 0.15, 0], {
|
|
60
|
+
extrapolateLeft: "clamp",
|
|
61
|
+
extrapolateRight: "clamp",
|
|
62
|
+
}) }));
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=DemoVideo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DemoVideo.js","sourceRoot":"","sources":["../../src/compositor/DemoVideo.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAY,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/E,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAGpD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC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ts","sourceRoot":"","sources":["../../src/compositor/Root.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAsChC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Composition } from "remotion";
|
|
3
|
+
import { DemoVideo } from "./DemoVideo.js";
|
|
4
|
+
import { calculateTotalFrames } from "./timing.js";
|
|
5
|
+
export const RemotionRoot = () => {
|
|
6
|
+
const defaultProps = {
|
|
7
|
+
resolution: { width: 1920, height: 1080 },
|
|
8
|
+
fps: 30,
|
|
9
|
+
scenes: [],
|
|
10
|
+
avatarPosition: "bottom-right",
|
|
11
|
+
avatarSize: 280,
|
|
12
|
+
showSubtitles: true,
|
|
13
|
+
};
|
|
14
|
+
return (_jsx(_Fragment, { children: _jsx(Composition, { id: "DemoVideo", component: DemoVideo, durationInFrames: Math.max(1, calculateTotalFrames(defaultProps)), fps: defaultProps.fps, width: defaultProps.resolution.width, height: defaultProps.resolution.height, defaultProps: defaultProps, calculateMetadata: ({ props }) => {
|
|
15
|
+
const introDur = props.intro
|
|
16
|
+
? Math.ceil((props.intro.durationSeconds ?? 3) * props.fps)
|
|
17
|
+
: 0;
|
|
18
|
+
const outroDur = props.outro
|
|
19
|
+
? Math.ceil((props.outro.durationSeconds ?? 3) * props.fps)
|
|
20
|
+
: 0;
|
|
21
|
+
const total = introDur + calculateTotalFrames(props) + outroDur;
|
|
22
|
+
return {
|
|
23
|
+
durationInFrames: Math.max(1, total),
|
|
24
|
+
fps: props.fps,
|
|
25
|
+
width: props.resolution.width,
|
|
26
|
+
height: props.resolution.height,
|
|
27
|
+
};
|
|
28
|
+
} }) }));
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=Root.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Root.js","sourceRoot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AC3D,CAAC,CAAC,CAAC,CAAC;gBACN,MAAM,KAAK,GAAG,QAAQ,GAAG,oBAAoB,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC;gBAChE,OAAO;oBACL,gBAAgB,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,CAAC;oBACpC,GAAG,EAAE,KAAK,CAAC,GAAG;oBACd,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,KAAK;oBAC7B,MAAM,EAAE,KAAK,CAAC,UAAU,CAAC,MAAM;iBAChC,CAAC;YACJ,CAAC,GACD,GACD,CACJ,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface AvatarPiPProps {
|
|
3
|
+
clipPath?: string;
|
|
4
|
+
position: "bottom-right" | "bottom-left" | "top-right" | "top-left";
|
|
5
|
+
size: number;
|
|
6
|
+
durationFrames: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const AvatarPiP: React.FC<AvatarPiPProps>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=AvatarPiP.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AvatarPiP.d.ts","sourceRoot":"","sources":["../../../src/compositor/components/AvatarPiP.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,UAAU,cAAc;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,cAAc,GAAG,aAAa,GAAG,WAAW,GAAG,UAAU,CAAC;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;CACxB;AA0BD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAoD9C,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { interpolate, spring, useCurrentFrame, useVideoConfig, } from "remotion";
|
|
3
|
+
import { Video } from "@remotion/media";
|
|
4
|
+
const MARGIN = 24;
|
|
5
|
+
function getPositionStyle(position, size) {
|
|
6
|
+
const base = {
|
|
7
|
+
position: "absolute",
|
|
8
|
+
width: size,
|
|
9
|
+
height: size,
|
|
10
|
+
};
|
|
11
|
+
switch (position) {
|
|
12
|
+
case "bottom-right":
|
|
13
|
+
return { ...base, bottom: MARGIN, right: MARGIN };
|
|
14
|
+
case "bottom-left":
|
|
15
|
+
return { ...base, bottom: MARGIN, left: MARGIN };
|
|
16
|
+
case "top-right":
|
|
17
|
+
return { ...base, top: MARGIN + 40, right: MARGIN }; // +40 for browser chrome
|
|
18
|
+
case "top-left":
|
|
19
|
+
return { ...base, top: MARGIN + 40, left: MARGIN };
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export const AvatarPiP = ({ clipPath, position, size, durationFrames, }) => {
|
|
23
|
+
const frame = useCurrentFrame();
|
|
24
|
+
const { fps } = useVideoConfig();
|
|
25
|
+
if (!clipPath)
|
|
26
|
+
return null;
|
|
27
|
+
// Entrance: scale from 0 → 1 with spring
|
|
28
|
+
const entranceScale = spring({
|
|
29
|
+
fps,
|
|
30
|
+
frame: frame - 5,
|
|
31
|
+
config: { damping: 20, stiffness: 200 },
|
|
32
|
+
durationInFrames: 25,
|
|
33
|
+
});
|
|
34
|
+
// Exit: fade out in last 15 frames
|
|
35
|
+
const exitOpacity = interpolate(frame, [durationFrames - 15, durationFrames], [1, 0], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
|
|
36
|
+
const opacity = exitOpacity;
|
|
37
|
+
const scale = entranceScale;
|
|
38
|
+
return (_jsx("div", { style: {
|
|
39
|
+
...getPositionStyle(position, size),
|
|
40
|
+
borderRadius: 20,
|
|
41
|
+
overflow: "hidden",
|
|
42
|
+
transform: `scale(${scale})`,
|
|
43
|
+
opacity,
|
|
44
|
+
boxShadow: "0 4px 20px rgba(0, 0, 0, 0.3)",
|
|
45
|
+
border: "3px solid rgba(255, 255, 255, 0.8)",
|
|
46
|
+
}, children: _jsx(Video, { src: clipPath, style: {
|
|
47
|
+
width: "100%",
|
|
48
|
+
height: "100%",
|
|
49
|
+
objectFit: "cover",
|
|
50
|
+
} }) }));
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=AvatarPiP.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AvatarPiP.js","sourceRoot":"","sources":["../../../src/compositor/components/AvatarPiP.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,WAAW,EACX,MAAM,EACN,eAAe,EACf,cAAc,GACf,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AASxC,MAAM,MAAM,GAAG,EAAE,CAAC;AAElB,SAAS,gBAAgB,CACvB,QAAoC,EACpC,IAAY;IAEZ,MAAM,IAAI,GAAwB;QAChC,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,IAAI;QACX,MAAM,EAAE,IAAI;KACb,CAAC;IAEF,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,cAAc;YACjB,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QACpD,KAAK,aAAa;YAChB,OAAO,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QACnD,KAAK,WAAW;YACd,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,yBAAyB;QAChF,KAAK,UAAU;YACb,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACvD,CAAC;AACH,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAA6B,CAAC,EAClD,QAAQ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|
+
url?: string;
|
|
5
|
+
zoom?: {
|
|
6
|
+
bbox: {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
width: number;
|
|
10
|
+
height: number;
|
|
11
|
+
};
|
|
12
|
+
level: number;
|
|
13
|
+
};
|
|
14
|
+
durationFrames: number;
|
|
15
|
+
}
|
|
16
|
+
export declare const BrowserFrame: React.FC<BrowserFrameProps>;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=BrowserFrame.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowserFrame.d.ts","sourceRoot":"","sources":["../../../src/compositor/components/BrowserFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,UAAU,iBAAiB;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE;QACL,IAAI,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QAC9D,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAiJpD,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AbsoluteFill, Img, interpolate, spring, useCurrentFrame, useVideoConfig, } from "remotion";
|
|
3
|
+
export const BrowserFrame = ({ screenshotPath, url, zoom, durationFrames, }) => {
|
|
4
|
+
const frame = useCurrentFrame();
|
|
5
|
+
const { fps, width, height } = useVideoConfig();
|
|
6
|
+
// Chrome bar height
|
|
7
|
+
const chromeHeight = 40;
|
|
8
|
+
// Calculate zoom animation
|
|
9
|
+
let scale = 1;
|
|
10
|
+
let translateX = 0;
|
|
11
|
+
let translateY = 0;
|
|
12
|
+
if (zoom) {
|
|
13
|
+
const { bbox, level } = zoom;
|
|
14
|
+
// Zoom in: start at frame 15, ease in with spring
|
|
15
|
+
const zoomIn = spring({
|
|
16
|
+
fps,
|
|
17
|
+
frame: frame - 15,
|
|
18
|
+
config: { damping: 200 },
|
|
19
|
+
durationInFrames: 30,
|
|
20
|
+
});
|
|
21
|
+
// Zoom out: ease out before scene ends
|
|
22
|
+
const zoomOut = spring({
|
|
23
|
+
fps,
|
|
24
|
+
frame: frame - (durationFrames - 20),
|
|
25
|
+
config: { damping: 200 },
|
|
26
|
+
durationInFrames: 20,
|
|
27
|
+
});
|
|
28
|
+
const zoomProgress = zoomIn - zoomOut;
|
|
29
|
+
scale = interpolate(zoomProgress, [0, 1], [1, level], {
|
|
30
|
+
extrapolateLeft: "clamp",
|
|
31
|
+
extrapolateRight: "clamp",
|
|
32
|
+
});
|
|
33
|
+
// Center the zoom on the target bbox
|
|
34
|
+
const centerX = bbox.x + bbox.width / 2;
|
|
35
|
+
const centerY = bbox.y + bbox.height / 2;
|
|
36
|
+
const offsetX = width / 2 - centerX;
|
|
37
|
+
const offsetY = (height - chromeHeight) / 2 - centerY;
|
|
38
|
+
translateX = interpolate(zoomProgress, [0, 1], [0, offsetX], {
|
|
39
|
+
extrapolateLeft: "clamp",
|
|
40
|
+
extrapolateRight: "clamp",
|
|
41
|
+
});
|
|
42
|
+
translateY = interpolate(zoomProgress, [0, 1], [0, offsetY], {
|
|
43
|
+
extrapolateLeft: "clamp",
|
|
44
|
+
extrapolateRight: "clamp",
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return (_jsxs(AbsoluteFill, { children: [_jsxs("div", { style: {
|
|
48
|
+
height: chromeHeight,
|
|
49
|
+
backgroundColor: "#e8e8e8",
|
|
50
|
+
display: "flex",
|
|
51
|
+
alignItems: "center",
|
|
52
|
+
paddingLeft: 12,
|
|
53
|
+
gap: 6,
|
|
54
|
+
}, children: [_jsx("div", { style: {
|
|
55
|
+
width: 12,
|
|
56
|
+
height: 12,
|
|
57
|
+
borderRadius: "50%",
|
|
58
|
+
backgroundColor: "#ff5f57",
|
|
59
|
+
} }), _jsx("div", { style: {
|
|
60
|
+
width: 12,
|
|
61
|
+
height: 12,
|
|
62
|
+
borderRadius: "50%",
|
|
63
|
+
backgroundColor: "#febc2e",
|
|
64
|
+
} }), _jsx("div", { style: {
|
|
65
|
+
width: 12,
|
|
66
|
+
height: 12,
|
|
67
|
+
borderRadius: "50%",
|
|
68
|
+
backgroundColor: "#28c840",
|
|
69
|
+
} }), _jsx("div", { style: {
|
|
70
|
+
marginLeft: 16,
|
|
71
|
+
flex: 1,
|
|
72
|
+
marginRight: 16,
|
|
73
|
+
height: 26,
|
|
74
|
+
backgroundColor: "#fff",
|
|
75
|
+
borderRadius: 6,
|
|
76
|
+
display: "flex",
|
|
77
|
+
alignItems: "center",
|
|
78
|
+
paddingLeft: 10,
|
|
79
|
+
fontSize: 13,
|
|
80
|
+
color: "#666",
|
|
81
|
+
fontFamily: "system-ui, sans-serif",
|
|
82
|
+
}, children: url ?? "" })] }), _jsx("div", { style: {
|
|
83
|
+
flex: 1,
|
|
84
|
+
overflow: "hidden",
|
|
85
|
+
position: "relative",
|
|
86
|
+
}, children: _jsx("div", { style: {
|
|
87
|
+
width: "100%",
|
|
88
|
+
height: "100%",
|
|
89
|
+
transform: `scale(${scale}) translate(${translateX / scale}px, ${translateY / scale}px)`,
|
|
90
|
+
transformOrigin: "center center",
|
|
91
|
+
}, children: _jsx(Img, { src: screenshotPath, style: {
|
|
92
|
+
width: "100%",
|
|
93
|
+
height: "100%",
|
|
94
|
+
objectFit: "cover",
|
|
95
|
+
} }) }) })] }));
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=BrowserFrame.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowserFrame.js","sourceRoot":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cACE,KAAK,EAAE;4BACL,KAAK,EAAE,EAAE;4BACT,MAAM,EAAE,EAAE;4BACV,YAAY,EAAE,KAAK;4BACnB,eAAe,EAAE,SAAS;yBAC3B,GACD,EAEF,cACE,KAAK,EAAE;4BACL,UAAU,EAAE,EAAE;4BACd,IAAI,EAAE,CAAC;4BACP,WAAW,EAAE,EAAE;4BACf,MAAM,EAAE,EAAE;4BACV,eAAe,EAAE,MAAM;4BACvB,YAAY,EAAE,CAAC;4BACf,OAAO,EAAE,MAAM;4BACf,UAAU,EAAE,QAAQ;4BACpB,WAAW,EAAE,EAAE;4BACf,QAAQ,EAAE,EAAE;4BACZ,KAAK,EAAE,MAAM;4BACb,UAAU,EAAE,uBAAuB;yBACpC,YAEA,GAAG,IAAI,EAAE,GACN,IACF,EAGN,cACE,KAAK,EAAE;oBACL,IAAI,EAAE,CAAC;oBACP,QAAQ,EAAE,QAAQ;oBAClB,QAAQ,EAAE,UAAU;iBACrB,YAED,cACE,KAAK,EAAE;wBACL,KAAK,EAAE,MAAM;wBACb,MAAM,EAAE,MAAM;wBACd,SAAS,EAAE,SAAS,KAAK,eAAe,UAAU,GAAG,KAAK,OAAO,UAAU,GAAG,KAAK,KAAK;wBACxF,eAAe,EAAE,eAAe;qBACjC,YAED,KAAC,GAAG,IACF,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE;4BACL,KAAK,EAAE,MAAM;4BACb,MAAM,EAAE,MAAM;4BACd,SAAS,EAAE,OAAO;yBACnB,GACD,GACE,GACF,IACO,CAChB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface CursorPoint {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
timestamp: number;
|
|
6
|
+
}
|
|
7
|
+
interface CursorProps {
|
|
8
|
+
cursorPath?: CursorPoint[];
|
|
9
|
+
durationFrames: number;
|
|
10
|
+
}
|
|
11
|
+
export declare const Cursor: React.FC<CursorProps>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=Cursor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cursor.d.ts","sourceRoot":"","sources":["../../../src/compositor/components/Cursor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,UAAU,WAAW;IACnB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,WAAW;IACnB,UAAU,CAAC,EAAE,WAAW,EAAE,CAAC;IAC3B,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA8FxC,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { spring, useCurrentFrame, useVideoConfig, } from "remotion";
|
|
3
|
+
export const Cursor = ({ cursorPath, durationFrames }) => {
|
|
4
|
+
const frame = useCurrentFrame();
|
|
5
|
+
const { fps } = useVideoConfig();
|
|
6
|
+
if (!cursorPath || cursorPath.length === 0)
|
|
7
|
+
return null;
|
|
8
|
+
// Find the two points we're between based on timestamp
|
|
9
|
+
const currentTime = (frame / fps) * 1000; // ms
|
|
10
|
+
let prevPoint = cursorPath[0];
|
|
11
|
+
let nextPoint = cursorPath[0];
|
|
12
|
+
for (let i = 0; i < cursorPath.length - 1; i++) {
|
|
13
|
+
if (currentTime >= cursorPath[i].timestamp &&
|
|
14
|
+
currentTime <= cursorPath[i + 1].timestamp) {
|
|
15
|
+
prevPoint = cursorPath[i];
|
|
16
|
+
nextPoint = cursorPath[i + 1];
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
if (currentTime > cursorPath[i].timestamp) {
|
|
20
|
+
prevPoint = cursorPath[i];
|
|
21
|
+
nextPoint = cursorPath[i];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
// Smooth bezier interpolation between points
|
|
25
|
+
const segmentDuration = nextPoint.timestamp - prevPoint.timestamp;
|
|
26
|
+
const segmentProgress = segmentDuration > 0
|
|
27
|
+
? (currentTime - prevPoint.timestamp) / segmentDuration
|
|
28
|
+
: 1;
|
|
29
|
+
// Ease the progress for smoother motion
|
|
30
|
+
const easedProgress = Math.min(1, Math.max(0, segmentProgress));
|
|
31
|
+
const smoothProgress = easedProgress * easedProgress * (3 - 2 * easedProgress); // smoothstep
|
|
32
|
+
const x = prevPoint.x + (nextPoint.x - prevPoint.x) * smoothProgress;
|
|
33
|
+
const y = prevPoint.y + (nextPoint.y - prevPoint.y) * smoothProgress;
|
|
34
|
+
// Click effect: show ripple when cursor is at a waypoint (frame-based detection)
|
|
35
|
+
const isAtWaypoint = cursorPath.some((p) => {
|
|
36
|
+
const waypointFrame = Math.round((p.timestamp / 1000) * fps);
|
|
37
|
+
return Math.abs(frame - waypointFrame) < 2;
|
|
38
|
+
});
|
|
39
|
+
const clickScale = isAtWaypoint
|
|
40
|
+
? spring({
|
|
41
|
+
fps,
|
|
42
|
+
frame: frame % 15,
|
|
43
|
+
config: { damping: 50, stiffness: 200 },
|
|
44
|
+
durationInFrames: 15,
|
|
45
|
+
})
|
|
46
|
+
: 0;
|
|
47
|
+
return (_jsxs("div", { style: { position: "absolute", left: 0, top: 0, width: "100%", height: "100%", pointerEvents: "none" }, children: [clickScale > 0 && (_jsx("div", { style: {
|
|
48
|
+
position: "absolute",
|
|
49
|
+
left: x - 20,
|
|
50
|
+
top: y - 20,
|
|
51
|
+
width: 40,
|
|
52
|
+
height: 40,
|
|
53
|
+
borderRadius: "50%",
|
|
54
|
+
border: "2px solid rgba(66, 133, 244, 0.6)",
|
|
55
|
+
transform: `scale(${1 + clickScale})`,
|
|
56
|
+
opacity: 1 - clickScale,
|
|
57
|
+
} })), _jsx("svg", { style: {
|
|
58
|
+
position: "absolute",
|
|
59
|
+
left: x - 2,
|
|
60
|
+
top: y - 2,
|
|
61
|
+
width: 24,
|
|
62
|
+
height: 24,
|
|
63
|
+
}, viewBox: "0 0 24 24", children: _jsx("path", { d: "M5 3l14 8-7 2-3 7z", fill: "#fff", stroke: "#000", strokeWidth: "1.5", strokeLinejoin: "round" }) })] }));
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=Cursor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Cursor.js","sourceRoot":"","sources":["../../../src/compositor/components/Cursor.tsx"],"names":[],"mappings":";AACA,OAAO,EAEL,MAAM,EACN,eAAe,EACf,cAAc,GACf,MAAM,UAAU,CAAC;AAalB,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAAE,UAAU,EAAE,cAAc,EAAE,EAAE,EAAE;IAC9E,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAChC,MAAM,EAAE,GAAG,EAAE,GAAG,cAAc,EAAE,CAAC;IAEjC,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAExD,uDAAuD;IACvD,MAAM,WAAW,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,KAAK;IAC/C,IAAI,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IAC9B,IAAI,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;IAE9B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/C,IACE,WAAW,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS;YACtC,WAAW,IAAI,UAAU,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,EAC1C,CAAC;YACD,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;YAC1B,SAAS,GAAG,UA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|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { RenderHighlight } from "../../utils/schema.js";
|
|
3
|
+
interface HighlightProps {
|
|
4
|
+
highlights: RenderHighlight[];
|
|
5
|
+
durationFrames: number;
|
|
6
|
+
}
|
|
7
|
+
export declare const Highlight: React.FC<HighlightProps>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=Highlight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Highlight.d.ts","sourceRoot":"","sources":["../../../src/compositor/components/Highlight.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,UAAU,cAAc;IACtB,UAAU,EAAE,eAAe,EAAE,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;CACxB;AAoJD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAY9C,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AbsoluteFill, interpolate, spring, useCurrentFrame, useVideoConfig, } from "remotion";
|
|
3
|
+
const DEFAULT_COLOR = "#4A90D9";
|
|
4
|
+
const HighlightBox = ({ highlight, index }) => {
|
|
5
|
+
const frame = useCurrentFrame();
|
|
6
|
+
const { fps } = useVideoConfig();
|
|
7
|
+
const { bbox, style, color = DEFAULT_COLOR } = highlight;
|
|
8
|
+
// Stagger entrance: each highlight appears 10 frames after the previous
|
|
9
|
+
const delay = 20 + index * 10;
|
|
10
|
+
const progress = spring({
|
|
11
|
+
fps,
|
|
12
|
+
frame: frame - delay,
|
|
13
|
+
config: style === "underline" ? { damping: 200 } : { damping: 20, stiffness: 200 },
|
|
14
|
+
durationInFrames: 20,
|
|
15
|
+
});
|
|
16
|
+
if (progress <= 0)
|
|
17
|
+
return null;
|
|
18
|
+
const baseStyle = {
|
|
19
|
+
position: "absolute",
|
|
20
|
+
left: bbox.x,
|
|
21
|
+
top: bbox.y,
|
|
22
|
+
width: bbox.width,
|
|
23
|
+
height: bbox.height,
|
|
24
|
+
pointerEvents: "none",
|
|
25
|
+
};
|
|
26
|
+
switch (style) {
|
|
27
|
+
case "box": {
|
|
28
|
+
// Animated border that draws in
|
|
29
|
+
const borderWidth = 3;
|
|
30
|
+
const pathLength = 2 * (bbox.width + bbox.height);
|
|
31
|
+
const dashOffset = interpolate(progress, [0, 1], [pathLength, 0]);
|
|
32
|
+
return (_jsx("svg", { style: {
|
|
33
|
+
...baseStyle,
|
|
34
|
+
overflow: "visible",
|
|
35
|
+
}, viewBox: `0 0 ${bbox.width} ${bbox.height}`, children: _jsx("rect", { x: borderWidth / 2, y: borderWidth / 2, width: bbox.width - borderWidth, height: bbox.height - borderWidth, rx: 8, ry: 8, fill: "none", stroke: color, strokeWidth: borderWidth, strokeDasharray: pathLength, strokeDashoffset: dashOffset }) }));
|
|
36
|
+
}
|
|
37
|
+
case "glow": {
|
|
38
|
+
// Pulsing glow effect
|
|
39
|
+
const pulse = Math.sin(frame * 0.15) * 0.3 + 0.7;
|
|
40
|
+
const glowOpacity = progress * pulse;
|
|
41
|
+
return (_jsx("div", { style: {
|
|
42
|
+
...baseStyle,
|
|
43
|
+
borderRadius: 8,
|
|
44
|
+
boxShadow: `0 0 20px 6px ${color}`,
|
|
45
|
+
opacity: glowOpacity,
|
|
46
|
+
border: `2px solid ${color}`,
|
|
47
|
+
} }));
|
|
48
|
+
}
|
|
49
|
+
case "arrow": {
|
|
50
|
+
// Animated arrow pointing to element from top-right
|
|
51
|
+
const arrowSize = 40;
|
|
52
|
+
const opacity = progress;
|
|
53
|
+
return (_jsxs("svg", { style: {
|
|
54
|
+
position: "absolute",
|
|
55
|
+
left: bbox.x + bbox.width + 5,
|
|
56
|
+
top: bbox.y - arrowSize - 5,
|
|
57
|
+
width: arrowSize + 20,
|
|
58
|
+
height: arrowSize + 20,
|
|
59
|
+
overflow: "visible",
|
|
60
|
+
opacity,
|
|
61
|
+
}, children: [_jsx("defs", { children: _jsx("marker", { id: `arrowhead-${bbox.x}-${bbox.y}`, markerWidth: "10", markerHeight: "7", refX: "0", refY: "3.5", orient: "auto", children: _jsx("polygon", { points: "0 0, 10 3.5, 0 7", fill: color }) }) }), _jsx("line", { x1: arrowSize, y1: 0, x2: 0, y2: arrowSize, stroke: color, strokeWidth: 3, markerEnd: `url(#arrowhead-${bbox.x}-${bbox.y})`, strokeDasharray: 60, strokeDashoffset: interpolate(progress, [0, 1], [60, 0]) })] }));
|
|
62
|
+
}
|
|
63
|
+
case "underline": {
|
|
64
|
+
// Animated underline beneath element
|
|
65
|
+
const lineWidth = interpolate(progress, [0, 1], [0, bbox.width]);
|
|
66
|
+
return (_jsx("div", { style: {
|
|
67
|
+
position: "absolute",
|
|
68
|
+
left: bbox.x,
|
|
69
|
+
top: bbox.y + bbox.height + 4,
|
|
70
|
+
width: lineWidth,
|
|
71
|
+
height: 4,
|
|
72
|
+
backgroundColor: color,
|
|
73
|
+
borderRadius: 2,
|
|
74
|
+
} }));
|
|
75
|
+
}
|
|
76
|
+
default:
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
export const Highlight = ({ highlights }) => {
|
|
81
|
+
return (_jsx(AbsoluteFill, { style: { pointerEvents: "none" }, children: highlights.map((highlight, index) => (_jsx(HighlightBox, { highlight: highlight, index: index }, index))) }));
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=Highlight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Highlight.js","sourceRoot":"","sources":["../../../src/compositor/components/Highlight.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,MAAM,EACN,eAAe,EACf,cAAc,GACf,MAAM,UAAU,CAAC;AAGlB,MAAM,aAAa,GAAG,SAAS,CAAC;AAOhC,MAAM,YAA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BACT,eAAe,EAAE,KAAK;oBACtB,YAAY,EAAE,CAAC;iBAChB,GACD,CACH,CAAC;QACJ,CAAC;QAED;YACE,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAA6B,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE;IACpE,OAAO,CACL,KAAC,YAAY,IAAC,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,YAC3C,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,EAAE,CAAC,CACpC,KAAC,YAAY,IAEX,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,KAAK,IAFP,KAAK,CAGV,CACH,CAAC,GACW,CAChB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { IntroOutro } from "../../utils/schema.js";
|
|
3
|
+
interface IntroOutroProps {
|
|
4
|
+
data: IntroOutro;
|
|
5
|
+
type: "intro" | "outro";
|
|
6
|
+
durationFrames: number;
|
|
7
|
+
}
|
|
8
|
+
export declare const IntroOutroCard: React.FC<IntroOutroProps>;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=IntroOutro.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntroOutro.d.ts","sourceRoot":"","sources":["../../../src/compositor/components/IntroOutro.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,UAAU,eAAe;IACvB,IAAI,EAAE,UAAU,CAAC;IACjB,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAiFpD,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AbsoluteFill, Img, interpolate, spring, useCurrentFrame, useVideoConfig, } from "remotion";
|
|
3
|
+
export const IntroOutroCard = ({ data, type, durationFrames }) => {
|
|
4
|
+
const frame = useCurrentFrame();
|
|
5
|
+
const { fps } = useVideoConfig();
|
|
6
|
+
// Title entrance
|
|
7
|
+
const titleScale = spring({
|
|
8
|
+
fps,
|
|
9
|
+
frame: frame - 10,
|
|
10
|
+
config: { damping: 200 },
|
|
11
|
+
durationInFrames: 30,
|
|
12
|
+
});
|
|
13
|
+
// Subtitle fade in
|
|
14
|
+
const subtitleOpacity = interpolate(frame, [25, 40], [0, 1], {
|
|
15
|
+
extrapolateLeft: "clamp",
|
|
16
|
+
extrapolateRight: "clamp",
|
|
17
|
+
});
|
|
18
|
+
// Exit fade — uses the passed-in durationFrames (not total composition duration)
|
|
19
|
+
const exitOpacity = interpolate(frame, [durationFrames - 15, durationFrames], [1, 0], { extrapolateLeft: "clamp", extrapolateRight: "clamp" });
|
|
20
|
+
return (_jsxs(AbsoluteFill, { style: {
|
|
21
|
+
backgroundColor: "#0a0a0a",
|
|
22
|
+
justifyContent: "center",
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
opacity: exitOpacity,
|
|
25
|
+
}, children: [data.logoPath && (_jsx(Img, { src: data.logoPath, style: {
|
|
26
|
+
width: 80,
|
|
27
|
+
height: 80,
|
|
28
|
+
marginBottom: 24,
|
|
29
|
+
opacity: subtitleOpacity,
|
|
30
|
+
} })), _jsx("div", { style: {
|
|
31
|
+
fontSize: 64,
|
|
32
|
+
fontWeight: 700,
|
|
33
|
+
color: "#fff",
|
|
34
|
+
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
35
|
+
transform: `scale(${titleScale})`,
|
|
36
|
+
textAlign: "center",
|
|
37
|
+
maxWidth: "80%",
|
|
38
|
+
}, children: data.title }), data.subtitle && (_jsx("div", { style: {
|
|
39
|
+
fontSize: 28,
|
|
40
|
+
color: "rgba(255, 255, 255, 0.7)",
|
|
41
|
+
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
42
|
+
marginTop: 16,
|
|
43
|
+
opacity: subtitleOpacity,
|
|
44
|
+
textAlign: "center",
|
|
45
|
+
maxWidth: "70%",
|
|
46
|
+
}, children: data.subtitle }))] }));
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=IntroOutro.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IntroOutro.js","sourceRoot":"","sources":["../../../src/compositor/components/IntroOutro.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,YAAY,EACZ,GAAG,EACH,WAAW,EACX,MAAM,EACN,eAAe,EACf,cAAc,GACf,MAAM,UAAU,CAAC;AASlB,MAAM,CAAC,MAAM,cAAc,GAA8B,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,EAAE;IAC1F,MAAM,KAAK,GAAG,eAAe,EAAE,CAAC;IAChC,MAAM,EAAE,GAAG,EAAE,GAAG,cAAc,EAAE,CAAC;IAEjC,iBAAiB;IACjB,MAAM,UAAU,GAAG,MAAM,CAAC;QACxB,GAAG;QACH,KAAK,EAAE,KAAK,GAAG,EAAE;QACjB,MAAM,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE;QACxB,gBAAgB,EAAE,EAAE;KACrB,CAAC,CAAC;IAEH,mBAAmB;IACnB,MAAM,eAAe,GAAG,WAAW,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE;QAC3D,eAAe,EAAE,OAAO;QACxB,gBAAgB,EAAE,OAAO;KAC1B,CAAC,CAAC;IAEH,iFAAiF;IACjF,MAAM,WAAW,GAAG,WAAW,CAC7B,KAAK,EACL,CAAC,cAAc,GAAG,EAAE,EAAE,cAAc,CAAC,EACrC,CAAC,CAAC,EAAE,CAAC,CAAC,EACN,EAAE,eAAe,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAE,CACxD,CAAC;IAEF,OAAO,CACL,MAAC,YAAY,IACX,KAAK,EAAE;YACL,eAAe,EAAE,SAAS;YAC1B,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,OAAO,EAAE,WAAW;SACrB,aAGA,IAAI,CAAC,QAAQ,IAAI,CAChB,KAAC,GAAG,IACF,GAAG,EAAE,IAAI,CAAC,QAAQ,EAClB,KAAK,EAAE;oBACL,KAAK,EAAE,EAAE;oBACT,MAAM,EAAE,EAAE;oBACV,YAAY,EAAE,EAAE;oBAChB,OAAO,EAAE,eAAe;iBACzB,GACD,CACH,EAGD,cACE,KAAK,EAAE;oBACL,QAAQ,EAAE,EAAE;oBACZ,UAAU,EAAE,GAAG;oBACf,KAAK,EAAE,MAAM;oBACb,UAAU,EAAE,sCAAsC;oBAClD,SAAS,EAAE,SAAS,UAAU,GAAG;oBACjC,SAAS,EAAE,QAAQ;oBACnB,QAAQ,EAAE,KAAK;iBAChB,YAEA,IAAI,CAAC,KAAK,GACP,EAGL,IAAI,CAAC,QAAQ,IAAI,CAChB,cACE,KAAK,EAAE;oBACL,QAAQ,EAAE,EAAE;oBACZ,KAAK,EAAE,0BAA0B;oBACjC,UAAU,EAAE,sCAAsC;oBAClD,SAAS,EAAE,EAAE;oBACb,OAAO,EAAE,eAAe;oBACxB,SAAS,EAAE,QAAQ;oBACnB,QAAQ,EAAE,KAAK;iBAChB,YAEA,IAAI,CAAC,QAAQ,GACV,CACP,IACY,CAChB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface SceneTransitionProps {
|
|
3
|
+
type: "fade" | "slide" | "cut";
|
|
4
|
+
durationFrames: number;
|
|
5
|
+
direction: "in" | "out";
|
|
6
|
+
}
|
|
7
|
+
export declare const SceneTransition: React.FC<SceneTransitionProps>;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=SceneTransition.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SceneTransition.d.ts","sourceRoot":"","sources":["../../../src/compositor/components/SceneTransition.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,UAAU,oBAAoB;IAC5B,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC;CACzB;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAgD1D,CAAC"}
|