@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 06:00 UTC

main
tsx 59 lines 1.79 KB
Raw
1 import { Composition } from "remotion";
2 import { deck, loopDeck } from "../deck.ts";
3 import { VIDEO } from "../shared/types.ts";
4 import { calculateIntroMetadata, Intro, IntroLive } from "./intro/Intro.tsx";
5 import { calculateSceneMetadata, Scene } from "./scene/Scene.tsx";
6 import { Slide } from "./slides/Slide.tsx";
7
8 /** One composition per deck item; composition ids are the deck ids. */
9 export const Root = () => (
10 <>
11 {/* `pnpm dev`: the intro, hot-reloaded as intro/steps.ts and snippets change. */}
12 <Composition
13 id="intro-live"
14 component={IntroLive}
15 durationInFrames={VIDEO.fps * 180}
16 fps={VIDEO.fps}
17 width={VIDEO.width}
18 height={VIDEO.height}
19 />
20 {[...deck, ...loopDeck].map((item) =>
21 item.kind === "intro" ? (
22 <Composition
23 key={item.id}
24 id={item.id}
25 component={Intro}
26 calculateMetadata={calculateIntroMetadata}
27 durationInFrames={1}
28 fps={VIDEO.fps}
29 width={VIDEO.width}
30 height={VIDEO.height}
31 defaultProps={{ source: item.id }}
32 />
33 ) : item.kind === "slide" ? (
34 <Composition
35 key={item.id}
36 id={item.id}
37 component={Slide}
38 durationInFrames={Math.round((item.seconds ?? 2) * VIDEO.fps)}
39 fps={VIDEO.fps}
40 width={VIDEO.width}
41 height={VIDEO.height}
42 defaultProps={{ layout: item.layout, props: item.props }}
43 />
44 ) : (
45 <Composition
46 key={item.id}
47 id={item.id}
48 component={Scene}
49 calculateMetadata={calculateSceneMetadata}
50 durationInFrames={1}
51 fps={VIDEO.fps}
52 width={VIDEO.width}
53 height={VIDEO.height}
54 defaultProps={{ id: item.id }}
55 />
56 ),
57 )}
58 </>
59 );