Skip to content

🎥 Make videos programmatically with React

refine

Jonny Burger8e8f1d14b0f5
diff --git a/packages/brand/src/LogoWithTitle.tsx b/packages/brand/src/LogoWithTitle.tsx
deleted file mode 100644
index d440fb7456..0000000000
--- a/packages/brand/src/LogoWithTitle.tsx
+++ /dev/null
@@ -1,31 +0,0 @@
-import styled from 'styled-components';
-import {Logo} from './Logo';
-
-const Title = styled.div`
- font-size: 210px;
- font-weight: 700;
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
- Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
-`;
-
-export const LogoWithTitle: React.FC<{
- yOffset: number;
-}> = ({yOffset}) => {
- return (
- <div
- style={{
- flex: 1,
- display: 'flex',
- backgroundColor: 'white',
- flexDirection: 'row',
- alignItems: 'center',
- fontFamily: 'Helvetica',
- }}
- >
- <Logo size={1100} />
- <div style={{flex: 1}}>
- <Title style={{transform: `translateY(${yOffset}px)`}}>Remotion</Title>
- </div>
- </div>
- );
-};
diff --git a/packages/brand/src/Root.tsx b/packages/brand/src/Root.tsx
index 91c79f7de8..2eeb751f5d 100644
--- a/packages/brand/src/Root.tsx
+++ b/packages/brand/src/Root.tsx
@@ -1,193 +1,82 @@
import './index.css';
-import type { VideoMetadata} from '@remotion/media-utils';
-import {getVideoMetadata} from '@remotion/media-utils';
-import {useEffect, useState} from 'react';
-import {
- Composition,
- continueRender,
- delayRender,
- Folder,
- staticFile,
-} from 'remotion';
+import {Composition, Folder, staticFile} from 'remotion';
import {AnimatedBanner} from './animated-logo/AnimatedBanner';
import {AnimatedLogo} from './animated-logo/AnimatedLogo';
import {AnimatedLogoStringer} from './animated-logo/AnimatedLogoStinger';
import {AnimatedMaster} from './animated-logo/AnimatedMaster';
-import {Arcs} from './animated-logo/Arcs';
import {ExplodingLogo} from './animated-logo/ExplodingLogo';
-import {FilmRoll} from './animated-logo/film-roll';
import {Banner} from './Brand/Banner';
import {Comp} from './Brand/Composition';
import {TriangleDemo} from './Brand/TriangleToSquare';
-import {EmailSignature} from './EmailSignature';
import {
- FlyingCardsLeft,
- flyingCardsLeftSchema,
-} from './FlyingCardsLeft/FlyingCardsLeft';
-import {LogoCollab, logoCollabSchema} from './LogoCollab/LogoCollab';
+ WhatIsRemotion,
+ whatIsRemotionCalculateMetadata,
+ whatIsRemotionSchema,
+} from './Compose/WhatIsRemotion';
+import {EmailSignature} from './EmailSignature';
import {Logo} from './Logo';
-import {LogoWithTitle} from './LogoWithTitle';
+import {LogoCollab, logoCollabSchema} from './LogoCollab/LogoCollab';
import {
RulesEnumeration,
rulesEnumerationSchema,
} from './RulesEnumeration/RulesEnumeration';
import {ProductHuntLogo} from './ScalingLogo';
-import {ShowcaseVideo} from './showcase-video';
-import {StepGuide, stepGuideSchema} from './StepGuide/StepGuide';
+import {FlyingCardBottom} from './video-elements/FlyingCardBottom';
+import {FlyingCards as VibeSkillsFlyingCards} from './video-elements/FlyingCards';
+import {VibeSkillsFlyingCardsLeft} from './video-elements/FlyingCardsLeft';
+import {Prompt, PromptSchema} from './video-elements/Prompt';
+import {
+ FlyingCardsLeft,
+ flyingCardsLeftSchema,
+} from './video-elements/flying-cards-left';
import {LowerReference} from './video-elements/lower-reference';
import {MoneyBurn} from './video-elements/money-burn';
-import {NumberedChapter} from './video-elements/numbered-chapter';
-import {UpperReference} from './video-elements/upper-reference';
-import {UpperThird} from './video-elements/UpperThird';
-import {FlyingCardBottom} from './vibe-skills/FlyingCardBottom';
-import {FlyingCards as VibeSkillsFlyingCards} from './vibe-skills/FlyingCards';
-import {VibeSkillsFlyingCardsLeft} from './vibe-skills/FlyingCardsLeft';
-import {Prompt, PromptSchema} from './vibe-skills/Prompt';
import {
- WhatIsRemotion,
- whatIsRemotionCalculateMetadata,
- whatIsRemotionSchema,
-} from './Compose/WhatIsRemotion';
-
-const muxId = 'EV00V02hvNnfTYYYsTKtIzb7MfMAsZkSXQfDP001V1yC7I';
+ NumberedChapter,
+ numberedChapterSchema,
+} from './video-elements/numbered-chapter';
+import {StepGuide, stepGuideSchema} from './video-elements/step-guide';
+import {UpperReference} from './video-elements/upper-reference';
+import {UpperThird, upperThirdSchema} from './video-elements/UpperThird';
export const RemotionRoot: React.FC = () => {
- const [handle] = useState(() => delayRender());
- const [videoMetadata, setVideoMetadata] = useState<VideoMetadata | null>(
- null,
- );
-
- useEffect(() => {
- getVideoMetadata(`https://stream.mux.com/${muxId}/high.mp4`)
- .then((data) => {
- setVideoMetadata(data);
- continueRender(handle);
- })
- .catch((err) => {
- // eslint-disable-next-line no-console
- console.log('could not get video metadata', err);
- });
- }, [handle]);
-
return (
<>
- <Folder name="brand-assets">
+ <Folder name="static-logo">
<Composition
- id="StepGuide"
- component={StepGuide}
- schema={stepGuideSchema}
- defaultProps={{
- stepNumber: 1,
- titleLine1: 'Setting up the project',
- titleLine2: '',
- assetSrc:
- 'https://images.unsplash.com/photo-1611162617474-5b21e879e113?w=600&h=800&fit=crop',
- assetPosition: 'left' as const,
- }}
- durationInFrames={90}
+ component={Logo}
+ width={820}
+ height={820}
fps={30}
- width={1920}
- height={1080}
- />
- <Composition
- id="LogoCollab"
- component={LogoCollab}
- schema={logoCollabSchema}
+ durationInFrames={1}
+ id="Logo"
defaultProps={{
- partnerLogoUrl: staticFile('logo/external/opencode.svg'),
- theme: 'light' as const,
- partnerLogoScale: 1,
- remotionLogoScale: 2.6,
- partnerLogoX: -36,
- remotionLogoX: -8,
+ size: 1100,
}}
- durationInFrames={90}
- fps={30}
- width={1920}
- height={1080}
/>
<Composition
- id="RulesEnumeration"
- component={RulesEnumeration}
- schema={rulesEnumerationSchema}
- defaultProps={{
- heading: 'AI Best Practices',
- rules: [
- {
- title: 'Tell the agent to use Remotion Best Practices skill',
- description:
- 'Be explicit, so that the agent picks it up correctly.',
- },
- {
- title: 'Do one thing at a time',
- description:
- 'Do not ask for 5 or 10 changes in one message. Otherwise, the AI gets confused.',
- },
- {
- title: 'Use Remotion documentation',
- description:
- 'You can copy the page or add .md to the end of the URL to get a Markdown version and feed it to your AI agent.',
- },
- ],
- theme: 'light' as const,
- }}
- durationInFrames={120}
+ component={Logo}
+ width={820}
+ height={820}
fps={30}
- width={1920}
- height={1080}
- />
- <Composition
- id="FlyingCardsLeft"
- component={FlyingCardsLeft}
- schema={flyingCardsLeftSchema}
+ durationInFrames={1}
+ id="LogoWhite"
defaultProps={{
- cards: ['Jonny Burger', '@JNYBGR'],
+ color: 'white',
+ size: 1100,
}}
- durationInFrames={90}
- fps={30}
- width={1920}
- height={1080}
/>
- </Folder>
- <Folder name="vibe-skills">
<Composition
- id="Prompt"
- component={Prompt}
- durationInFrames={210}
- fps={30}
+ component={ExplodingLogo}
width={1920}
height={1080}
- schema={PromptSchema}
+ fps={30}
+ durationInFrames={200}
+ id="ExplodingLogo"
defaultProps={{
- prompt:
- 'the homepage "/" should show the username field, and once you submit, you get redirected to the "/[username]" route, where you can download the video. Use the components from the existing page. on the user page fetch from the following API: https://github-contributions-api.jogruber.de/v4/[username] and only once fetched show the player.',
- thinkingIndex: 40,
+ theme: 'light',
}}
/>
- <Composition
- id="VibeSkillsFlyingCards"
- component={VibeSkillsFlyingCards}
- durationInFrames={150}
- fps={30}
- width={1920}
- height={1080}
- />
- <Composition
- id="VibeSkillsFlyingCardsLeft"
- component={VibeSkillsFlyingCardsLeft}
- durationInFrames={150}
- fps={30}
- width={1920}
- height={1080}
- />
- <Composition
- id="FlyingCardBottom"
- component={FlyingCardBottom}
- durationInFrames={150}
- fps={30}
- width={1920}
- height={1080}
- />
</Folder>
<Composition
id="WhatIsRemotion"
@@ -207,29 +96,7 @@ export const RemotionRoot: React.FC = () => {
durationInFrames={90}
id="scaling-logo"
/>
- <Composition
- component={ShowcaseVideo}
- width={1080}
- height={1080}
- fps={30}
- durationInFrames={Math.floor(
- (videoMetadata?.durationInSeconds ?? 1) * 30,
- )}
- id="showcase-video"
- defaultProps={{
- muxId,
- videoMetadata,
- }}
- />
<Folder name="animated-logo">
- <Composition
- component={FilmRoll}
- width={1080}
- height={1080}
- fps={30}
- durationInFrames={450}
- id="film-roll"
- />
<Composition
component={AnimatedLogo}
width={1080}
@@ -279,14 +146,6 @@ export const RemotionRoot: React.FC = () => {
durationInFrames={80}
id="animated-logo-stinger"
/>
- <Composition
- component={Arcs}
- width={1080}
- height={1080}
- fps={30}
- durationInFrames={450}
- id="arcs"
- />
<Composition
component={AnimatedMaster}
width={1080}
@@ -296,54 +155,25 @@ export const RemotionRoot: React.FC = () => {
id="animated-master"
/>
</Folder>
- <Folder name="static-logo">
- <Composition
- component={Logo}
- width={820}
- height={820}
- fps={30}
- durationInFrames={1}
- id="Logo"
- defaultProps={{
- size: 1100,
- }}
- />
+ <Folder name="video-elements">
<Composition
- component={Logo}
- width={820}
- height={820}
- fps={30}
- durationInFrames={1}
- id="LogoWhite"
+ id="StepGuide"
+ component={StepGuide}
+ schema={stepGuideSchema}
defaultProps={{
- color: 'white',
- size: 1100,
+ stepNumber: 1,
+ titleLine1: 'Setting up the project',
+ titleLine2: '',
+ assetSrc:
+ 'https://images.unsplash.com/photo-1611162617474-5b21e879e113?w=600&h=800&fit=crop',
+ assetPosition: 'left' as const,
}}
- />
- <Composition
- component={LogoWithTitle}
- width={2100}
- height={1080}
+ durationInFrames={90}
fps={30}
- durationInFrames={1}
- id="LogoWithTitle"
- defaultProps={{
- yOffset: 0,
- }}
- />
- <Composition
- component={ExplodingLogo}
width={1920}
height={1080}
- fps={30}
- durationInFrames={200}
- id="ExplodingLogo"
- defaultProps={{
- theme: 'light',
- }}
/>
- </Folder>
- <Folder name="video-elements">
+
<Composition
id="lower-third-reference"
component={LowerReference}
@@ -363,6 +193,11 @@ export const RemotionRoot: React.FC = () => {
<Composition
id="upper-third"
component={UpperThird}
+ schema={upperThirdSchema}
+ defaultProps={{
+ title: 'Title',
+ subtitle: 'remotion.dev',
+ }}
durationInFrames={5 * 30}
fps={30}
width={1920}
@@ -371,6 +206,11 @@ export const RemotionRoot: React.FC = () => {
<Composition
id="numbered-chapter"
component={NumberedChapter}
+ schema={numberedChapterSchema}
+ defaultProps={{
+ chapterNumber: 1,
+ chapterTitle: 'Chapter Title',
+ }}
durationInFrames={36}
fps={30}
width={1920}
@@ -384,6 +224,47 @@ export const RemotionRoot: React.FC = () => {
width={1920}
height={1080}
/>
+ <Composition
+ id="Prompt"
+ component={Prompt}
+ durationInFrames={210}
+ fps={30}
+ width={1920}
+ height={1080}
+ schema={PromptSchema}
+ defaultProps={{
+ prompt: 'Use Remotion Best Practices.',
+ thinkingIndex: 40,
+ }}
+ />
+ <Composition
+ id="FlyingCardsRight"
+ component={VibeSkillsFlyingCards}
+ durationInFrames={150}
+ fps={30}
+ width={1920}
+ height={1080}
+ />
+ <Composition
+ id="FlyingCardsLeft"
+ component={FlyingCardsLeft}
+ schema={flyingCardsLeftSchema}
+ defaultProps={{
+ cards: ['Jonny Burger', '@JNYBGR'],
+ }}
+ durationInFrames={90}
+ fps={30}
+ width={1920}
+ height={1080}
+ />
+ <Composition
+ id="FlyingCardBottom"
+ component={FlyingCardBottom}
+ durationInFrames={150}
+ fps={30}
+ width={1920}
+ height={1080}
+ />
</Folder>
<Folder name="recorder">
<Composition
@@ -440,6 +321,55 @@ export const RemotionRoot: React.FC = () => {
defaultProps={{theme: 'light'}}
/>
</Folder>
+ <Folder name="brand-assets">
+ <Composition
+ id="LogoCollab"
+ component={LogoCollab}
+ schema={logoCollabSchema}
+ defaultProps={{
+ partnerLogoUrl: staticFile('logo/external/opencode.svg'),
+ theme: 'light' as const,
+ partnerLogoScale: 1,
+ remotionLogoScale: 2.6,
+ partnerLogoX: -36,
+ remotionLogoX: -8,
+ }}
+ durationInFrames={90}
+ fps={30}
+ width={1920}
+ height={1080}
+ />
+ <Composition
+ id="RulesEnumeration"
+ component={RulesEnumeration}
+ schema={rulesEnumerationSchema}
+ defaultProps={{
+ heading: 'AI Best Practices',
+ rules: [
+ {
+ title: 'Tell the agent to use Remotion Best Practices skill',
+ description:
+ 'Be explicit, so that the agent picks it up correctly.',
+ },
+ {
+ title: 'Do one thing at a time',
+ description:
+ 'Do not ask for 5 or 10 changes in one message. Otherwise, the AI gets confused.',
+ },
+ {
+ title: 'Use Remotion documentation',
+ description:
+ 'You can copy the page or add .md to the end of the URL to get a Markdown version and feed it to your AI agent.',
+ },
+ ],
+ theme: 'light' as const,
+ }}
+ durationInFrames={120}
+ fps={30}
+ width={1920}
+ height={1080}
+ />
+ </Folder>
</>
);
};
diff --git a/packages/brand/src/animated-logo/AnimatedMaster.tsx b/packages/brand/src/animated-logo/AnimatedMaster.tsx
index 28031d1a02..c056a71fec 100644
--- a/packages/brand/src/animated-logo/AnimatedMaster.tsx
+++ b/packages/brand/src/animated-logo/AnimatedMaster.tsx
@@ -1,18 +1,10 @@
import React from 'react';
import {AbsoluteFill, Sequence} from 'remotion';
import {AnimatedLogo} from './AnimatedLogo';
-import {Arcs} from './Arcs';
-import {FilmRoll} from './film-roll';
export const AnimatedMaster: React.FC = () => {
return (
<AbsoluteFill>
- <AbsoluteFill>
- <FilmRoll />
- </AbsoluteFill>
- <Sequence from={55}>
- <Arcs />
- </Sequence>
<Sequence from={108}>
<AnimatedLogo theme="light" />
</Sequence>
diff --git a/packages/brand/src/animated-logo/Arcs.tsx b/packages/brand/src/animated-logo/Arcs.tsx
deleted file mode 100644
index 8c57405914..0000000000
--- a/packages/brand/src/animated-logo/Arcs.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-import {evolvePath, reversePath} from '@remotion/paths';
-import {interpolate, spring, useCurrentFrame, useVideoConfig} from 'remotion';
-import {extendViewbox} from './extend-viewbox';
-
-const d = reversePath(
- 'M211.39 188.036C202.512 188.518 195.358 189.927 188.148 192.67C184.552 194.023 178.658 196.97 175.415 199.009C161.847 207.516 151.505 220.305 146.112 235.189C145.037 238.136 142.127 247.533 140.255 254.001C127.781 297.243 120.701 344.524 119.181 394.568C118.94 402.538 118.94 421.517 119.181 429.357C120.2 462.534 123.37 492.486 129.115 523.031C131.451 535.394 135.195 552.001 137.363 559.545C141.793 574.873 150.838 587.921 163.701 597.485C172.319 603.898 182.106 608.198 192.949 610.311C198.175 611.33 205.07 611.794 210.149 611.46C217.173 610.997 231.111 609.125 242.436 607.104C293.48 598.004 340.632 581.712 383.392 558.395C410.471 543.623 433.621 527.628 455.955 508.222C478.215 488.909 497.194 468.132 513.894 444.815C517.768 439.422 519.714 436.271 521.66 432.304C526.665 422.073 529.018 411.898 529 400.518C529 389.916 526.998 380.5 522.68 370.862C520.604 366.21 518.62 362.874 514.172 356.535C497.788 333.2 479.605 312.867 457.438 293.109C423.074 262.49 382.261 237.376 336.685 218.785C326.806 214.763 317.075 211.223 305.361 207.387C280.562 199.287 249.868 192.262 223.901 188.759C219.824 188.203 214.282 187.888 211.39 188.036Z'
-);
-
-export const Arcs: React.FC = () => {
- const frame = useCurrentFrame();
- const {fps} = useVideoConfig();
-
- const progress = spring({
- frame,
- fps,
- config: {
- damping: 200,
- },
- durationInFrames: 80,
- });
- const viewBox = extendViewbox('118.94 187.888 410.078 423.906', 1.25);
- const {strokeDasharray, strokeDashoffset} = evolvePath(progress, d);
-
- const totalScale = spring({
- fps,
- frame: frame - 40,
- config: {
- damping: 200,
- },
- durationInFrames: 30,
- });
-
- return (
- <svg
- style={{
- transform: `scale(${
- interpolate(totalScale, [0, 1], [1.15, 2.8]) +
- interpolate(frame, [0, 250], [0, 1])
- })`,
- width: '100%',
- left: '18%',
- top: '28%',
- position: 'absolute',
- }}
- viewBox={viewBox}
- >
- <path
- strokeDasharray={strokeDasharray}
- strokeDashoffset={strokeDashoffset}
- d={d}
- stroke="#0B84F3"
- fill="none"
- strokeWidth={35}
- style={{
- transformBox: 'fill-box',
- transformOrigin: 'center center',
- transform: 'rotate(120deg)',
- }}
- strokeLinecap="round"
- />
- </svg>
- );
-};
diff --git a/packages/brand/src/animated-logo/film-roll.tsx b/packages/brand/src/animated-logo/film-roll.tsx
deleted file mode 100644
index 3b0ee908d6..0000000000
--- a/packages/brand/src/animated-logo/film-roll.tsx
+++ /dev/null
@@ -1,137 +0,0 @@
-import React from 'react';
-import {
- AbsoluteFill,
- interpolate,
- spring,
- useCurrentFrame,
- useVideoConfig,
-} from 'remotion';
-import {springB, springD} from './springs';
-
-const strokeWidth = 56;
-const filmRollDots = 5;
-const r = 130;
-
-export const FilmRoll: React.FC = () => {
- const frame = useCurrentFrame();
- const {fps} = useVideoConfig();
-
- const innerSpr = spring({
- fps,
- frame: frame - springB.delay,
- config: springB.config,
- });
-
- const spr2 = spring({
- fps,
- frame: frame - springD.delay - 20,
- config: springD.config,
- });
-
- const devolve = spring({
- fps,
- frame: frame - springD.delay - 30,
- config: springD.config,
- });
-
- const secondR = interpolate(devolve, [0, 1], [0, r - strokeWidth]);
-
- const dotScale = Math.max(0, 1 - devolve);
-
- const toMove = 700;
- const right = interpolate(innerSpr, [0, 1], [toMove, 0]);
- const circumference = r * 2 * Math.PI;
- const rotations = toMove / circumference;
-
- const rotate =
- interpolate(innerSpr, [0, 1], [0, -rotations * Math.PI * 2]) +
- interpolate(spr2, [0, 1], [0, rotations * Math.PI * 2]) +
- interpolate(devolve, [0, 1], [0, (rotations * Math.PI) / 2]);
-
- const scale = devolve * 10 + 1 + interpolate(frame, [0, 100], [0.8, 1.2]);
-
- return (
- <AbsoluteFill style={{scale: String(scale)}}>
- <AbsoluteFill>
- <svg
- style={{
- backgroundColor: 'white',
- }}
- viewBox="0 0 1080 1080"
- >
- <path
- d={`M ${540 + right} ${540 + r - strokeWidth / 2} L ${
- 1080 - spr2 * 540
- } ${540 + r - strokeWidth / 2}`}
- strokeWidth={strokeWidth}
- stroke="black"
- />
- </svg>
- </AbsoluteFill>
- <AbsoluteFill>
- <svg
- viewBox="0 0 1080 1080"
- style={{
- transform: `translateX(${right}px) rotate(${rotate}rad) `,
- }}
- >
- <g
- width={1080}
- height={1080}
- style={{
- transformBox: 'fill-box',
- transformOrigin: 'center center',
- mask: 'url(#cirmask)',
- }}
- >
- <mask id="cirmask">
- <circle cx="540" cy="540" r={r} fill="white" />
- </mask>
- <circle
- cx="540"
- cy="540"
- r={r}
- fill="black"
- style={{
- transformBox: 'fill-box',
- transformOrigin: 'center center',
- }}
- />
- <circle
- cx="540"
- cy="540"
- r={secondR}
- fill="white"
- style={{
- transformBox: 'fill-box',
- transformOrigin: 'center center',
- }}
- />
- {new Array(filmRollDots).fill(true).map((_f, i) => {
- return (
- // eslint-disable-next-line react/no-array-index-key
- <circle key={`dot-${i}`}
- cx="540"
- cy="540"
- r={24}
- fill="white"
- style={{
- transformBox: 'fill-box',
- transformOrigin: 'center center',
- transform: `translateX(${
- Math.sin((i / filmRollDots) * Math.PI * 2) *
- (70 + (1 - dotScale) * 100)
- }px) translateY(${
- Math.cos((i / filmRollDots) * Math.PI * 2) *
- (70 + (1 - dotScale) * 100)
- }px) `,
- }}
- />
- );
- })}
- </g>
- </svg>{' '}
- </AbsoluteFill>
- </AbsoluteFill>
- );
-};
diff --git a/packages/brand/src/showcase-video/index.tsx b/packages/brand/src/showcase-video/index.tsx
deleted file mode 100644
index 30bcd5a532..0000000000
--- a/packages/brand/src/showcase-video/index.tsx
+++ /dev/null
@@ -1,88 +0,0 @@
-import type {VideoMetadata} from '@remotion/media-utils';
-import {useVideoConfig, Video} from 'remotion';
-
-export type Size = {
- width: number;
- height: number;
- left: number;
- top: number;
-};
-
-export const calculateScale = ({
- previewSize,
- compositionWidth,
- compositionHeight,
- canvasSize,
-}: {
- previewSize: 'auto';
- compositionWidth: number;
- compositionHeight: number;
- canvasSize: Size;
-}) => {
- const heightRatio = canvasSize.height / compositionHeight;
- const widthRatio = canvasSize.width / compositionWidth;
-
- const ratio = Math.min(heightRatio, widthRatio);
-
- const scale = previewSize === 'auto' ? ratio : Number(previewSize);
- const correction = 0 - (1 - scale) / 2;
- const xCorrection = correction * compositionWidth;
- const yCorrection = correction * compositionHeight;
- const width = compositionWidth * scale;
- const height = compositionHeight * scale;
- const centerX = canvasSize.width / 2 - width / 2;
- const centerY = canvasSize.height / 2 - height / 2;
- return {
- centerX,
- centerY,
- xCorrection,
- yCorrection,
- scale,
- };
-};
-
-const margin = 100;
-
-export const ShowcaseVideo: React.FC<{
- muxId: string;
- videoMetadata: VideoMetadata | null;
-}> = ({muxId, videoMetadata}) => {
- const {width, height} = useVideoConfig();
-
- if (!videoMetadata) {
- return null;
- }
-
- const data = calculateScale({
- previewSize: 'auto',
- canvasSize: {
- height: height - margin,
- width: width - margin,
- left: 0,
- top: 0,
- },
- compositionHeight: videoMetadata.height,
- compositionWidth: videoMetadata.width,
- });
-
- return (
- <div
- style={{
- backgroundColor: 'white',
- flex: 1,
- justifyContent: 'center',
- alignItems: 'center',
- display: 'flex',
- }}
- >
- <Video
- style={{
- width: videoMetadata.width * data.scale,
- height: videoMetadata.height * data.scale,
- boxShadow: '0 0 30px rgba(0, 0, 0, 0.1)',
- }}
- src={`https://stream.mux.com/${muxId}/high.mp4`}
- />
- </div>
- );
-};
diff --git a/packages/brand/src/vibe-skills/FlyingCardBottom.tsx b/packages/brand/src/video-elements/FlyingCardBottom.tsx
similarity index 100%
rename from packages/brand/src/vibe-skills/FlyingCardBottom.tsx
rename to packages/brand/src/video-elements/FlyingCardBottom.tsx
diff --git a/packages/brand/src/vibe-skills/FlyingCards.tsx b/packages/brand/src/video-elements/FlyingCards.tsx
similarity index 100%
rename from packages/brand/src/vibe-skills/FlyingCards.tsx
rename to packages/brand/src/video-elements/FlyingCards.tsx
diff --git a/packages/brand/src/vibe-skills/FlyingCardsLeft.tsx b/packages/brand/src/video-elements/FlyingCardsLeft.tsx
similarity index 100%
rename from packages/brand/src/vibe-skills/FlyingCardsLeft.tsx
rename to packages/brand/src/video-elements/FlyingCardsLeft.tsx
diff --git a/packages/brand/src/vibe-skills/Prompt.tsx b/packages/brand/src/video-elements/Prompt.tsx
similarity index 100%
rename from packages/brand/src/vibe-skills/Prompt.tsx
rename to packages/brand/src/video-elements/Prompt.tsx
diff --git a/packages/brand/src/vibe-skills/Thinking.tsx b/packages/brand/src/video-elements/Thinking.tsx
similarity index 100%
rename from packages/brand/src/vibe-skills/Thinking.tsx
rename to packages/brand/src/video-elements/Thinking.tsx
diff --git a/packages/brand/src/video-elements/UpperThird.tsx b/packages/brand/src/video-elements/UpperThird.tsx
index 6e81b674ef..a70e0b3476 100644
--- a/packages/brand/src/video-elements/UpperThird.tsx
+++ b/packages/brand/src/video-elements/UpperThird.tsx
@@ -7,9 +7,17 @@ import {
useCurrentFrame,
useVideoConfig,
} from 'remotion';
+import {z} from 'zod';
import {BLUE} from '../colors';
-export const UpperThird: React.FC = () => {
+export const upperThirdSchema = z.object({
+ title: z.string(),
+ subtitle: z.string(),
+});
+
+type UpperThirdProps = z.infer<typeof upperThirdSchema>;
+
+export const UpperThird: React.FC<UpperThirdProps> = ({title, subtitle}) => {
const frame = useCurrentFrame();
const {fps, durationInFrames} = useVideoConfig();
const xOffset = noise2D('noisex', 0, frame / 160) * 50;
@@ -54,25 +62,26 @@ export const UpperThird: React.FC = () => {
>
<h1
style={{
- fontFamily: 'SF Pro Display',
+ fontFamily: 'GT Planar',
+ fontWeight: 700,
fontSize: '5em',
marginTop: 0,
marginBottom: 0,
color: '#000',
}}
>
- React Summit
+ {title}
</h1>
<h1
style={{
- fontFamily: 'SF Pro Display',
+ fontFamily: 'GT Planar',
fontSize: '1.8em',
marginTop: 0,
marginBottom: 0,
color: BLUE,
}}
>
- reactsummit.com
+ {subtitle}
</h1>
</AbsoluteFill>
</AbsoluteFill>
diff --git a/packages/brand/src/FlyingCardsLeft/FlyingCardsLeft.tsx b/packages/brand/src/video-elements/flying-cards-left.tsx
similarity index 100%
rename from packages/brand/src/FlyingCardsLeft/FlyingCardsLeft.tsx
rename to packages/brand/src/video-elements/flying-cards-left.tsx
diff --git a/packages/brand/src/vibe-skills/messages.ts b/packages/brand/src/video-elements/messages.ts
similarity index 100%
rename from packages/brand/src/vibe-skills/messages.ts
rename to packages/brand/src/video-elements/messages.ts
diff --git a/packages/brand/src/video-elements/numbered-chapter/index.tsx b/packages/brand/src/video-elements/numbered-chapter/index.tsx
index 628a7fb307..8f57528cc8 100644
--- a/packages/brand/src/video-elements/numbered-chapter/index.tsx
+++ b/packages/brand/src/video-elements/numbered-chapter/index.tsx
@@ -6,12 +6,23 @@ import {
useCurrentFrame,
useVideoConfig,
} from 'remotion';
+import {z} from 'zod';
import {BLUE} from '../../colors';
import {loadFont} from '../../load-font';
loadFont();
-export const NumberedChapter: React.FC = () => {
+export const numberedChapterSchema = z.object({
+ chapterNumber: z.number(),
+ chapterTitle: z.string(),
+});
+
+type NumberedChapterProps = z.infer<typeof numberedChapterSchema>;
+
+export const NumberedChapter: React.FC<NumberedChapterProps> = ({
+ chapterNumber,
+ chapterTitle,
+}) => {
const {fps} = useVideoConfig();
const frame = useCurrentFrame();
const jump1 = spring({
@@ -52,27 +63,30 @@ export const NumberedChapter: React.FC = () => {
color: 'white',
backgroundColor: BLUE,
fontSize: 80,
- fontWeight: 'bold',
+ fontWeight: 900,
borderRadius: '50%',
fontFamily: 'GT Planar',
+ fontFeatureSettings: "'ss03' 1",
scale: String(jump1),
translate: `0 ${-jump2 * 50}px`,
}}
>
- 5
+ {chapterNumber}
</div>
</AbsoluteFill>
<AbsoluteFill
style={{
justifyContent: 'center',
alignItems: 'center',
- fontFamily: 'Variable',
+ fontFamily: 'GT Planar',
+ fontWeight: 700,
fontSize: 40,
+ fontFeatureSettings: "'ss03' 1",
translate: `0 ${-jump2 * 100 + 220}px`,
opacity: jump2,
}}
>
- <h2>Transformations</h2>
+ <h2>{chapterTitle}</h2>
</AbsoluteFill>
</AbsoluteFill>
);
diff --git a/packages/brand/src/StepGuide/StepGuide.tsx b/packages/brand/src/video-elements/step-guide.tsx
similarity index 100%
rename from packages/brand/src/StepGuide/StepGuide.tsx
rename to packages/brand/src/video-elements/step-guide.tsx
diff --git a/packages/example/src/Compose/AtRemotionButton.tsx b/packages/example/src/Compose/AtRemotionButton.tsx
deleted file mode 100644
index e31feabe7d..0000000000
--- a/packages/example/src/Compose/AtRemotionButton.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import {AbsoluteFill} from 'remotion';
-
-export const AtRemotionButton: React.FC<{progress: number}> = () => {
- return (
- <AbsoluteFill className="bg-white justify-center items-center border-2 border-solid border-white rounded-full">
- <div
- className="text-black text-[42px] font-brand"
- style={{
- fontFamily: 'Helvetica',
- fontWeight: 'bold',
- }}
- >
- Follow @JNYBGR
- </div>
- </AbsoluteFill>
- );
-};
diff --git a/packages/example/src/Compose/WhatIsRemotion.tsx b/packages/example/src/Compose/WhatIsRemotion.tsx
deleted file mode 100644
index 3087b9ae3a..0000000000
--- a/packages/example/src/Compose/WhatIsRemotion.tsx
+++ /dev/null
@@ -1,397 +0,0 @@
-import React from 'react';
-import {
- AbsoluteFill,
- CalculateMetadataFunction,
- Easing,
- interpolate,
- measureSpring,
- OffthreadVideo,
- Sequence,
- spring,
- staticFile,
- useCurrentFrame,
- useVideoConfig,
-} from 'remotion';
-import {z} from 'zod';
-import {ExtrudeDiv} from '../3DContext/Div3D';
-import {
- RotateY,
- Scale,
- TranslateX,
- TranslateY,
- TranslateZ,
-} from '../3DContext/transformation-context';
-import {Captions} from './Captions';
-import {CodeFrame} from './CodeFrame';
-import {EndCard} from './EndCard';
-import {LabelOpacityContext, useLabelOpacity} from './LabelOpacity';
-import {Rotations} from './Rotations';
-
-const height = 700;
-const width = (height / 16) * 9;
-const cornerRadius = 10;
-const depth = 60;
-const animationStart = 55;
-
-const Label: React.FC<React.HTMLAttributes<HTMLDivElement>> = (rest) => {
- const opacity = useLabelOpacity();
- return (
- <div
- className="text-white "
- style={{
- fontFamily: 'GT Planar',
- height: '100%',
- display: 'flex',
- flexDirection: 'column',
- justifyContent: 'center',
- paddingLeft: 20,
- fontSize: 24,
- opacity,
- }}
- {...rest}
- />
- );
-};
-
-const getActualLayerWidth = (progress: number) => {
- return {
- width: interpolate(progress, [0, 1], [width * 1.5, width]),
- height: interpolate(progress, [0, 1], [height, height]),
- };
-};
-
-const VideoLayers: React.FC<{
- label: string;
- delay: number;
- footage?: boolean;
- bRoll?: boolean;
- boxWidth: number;
- boxHeight: number;
- codeFrame?: boolean;
- endCard?: boolean;
-}> = ({
- label,
- delay,
- footage,
- boxHeight,
- boxWidth,
- codeFrame,
- bRoll,
- endCard,
-}) => {
- return (
- <Rotations zIndexHack={false} delay={delay}>
- <ExtrudeDiv
- width={boxWidth}
- height={boxHeight}
- depth={depth}
- cornerRadius={10}
- backFace={
- <AbsoluteFill
- className="bg-gray-700"
- style={{
- borderRadius: cornerRadius,
- border: '3px solid black',
- }}
- >
- {codeFrame && <CodeFrame />}
- </AbsoluteFill>
- }
- bottomFace={<Label>{label}</Label>}
- >
- <div
- style={{
- borderRadius: cornerRadius,
- overflow: 'hidden',
- fontFamily: 'GT Planar',
- backgroundColor: 'black',
- border: '3px solid black',
- }}
- className="text-black flex justify-center items-center font-sans text-2xl font-bold flex-1"
- >
- <div
- style={{
- backgroundColor: 'black',
- width: '100%',
- height: '100%',
- overflow: 'hidden',
- }}
- >
- {footage ? (
- <Sequence from={animationStart} layout="none">
- <OffthreadVideo
- muted
- style={{width: '100%', height: '100%', objectFit: 'cover'}}
- src={staticFile('video.mp4')}
- ></OffthreadVideo>
- </Sequence>
- ) : null}
- {bRoll ? (
- <Sequence from={animationStart} layout="none">
- <OffthreadVideo
- muted
- style={{width: '100%', height: '100%', objectFit: 'cover'}}
- src={staticFile('spiral_.mp4')}
- ></OffthreadVideo>
- </Sequence>
- ) : null}
- {endCard ? (
- <AbsoluteFill
- className="bg-white"
- style={{borderRadius: cornerRadius, border: '3px solid black'}}
- ></AbsoluteFill>
- ) : null}
- </div>
- </div>
- </ExtrudeDiv>
- </Rotations>
- );
-};
-
-const CaptionLayers: React.FC<{
- delay: number;
-}> = ({delay: delay}) => {
- return (
- <Rotations zIndexHack delay={1 + delay}>
- <ExtrudeDiv
- width={300}
- height={60}
- depth={depth}
- cornerRadius={10}
- bottomFace={<Label>&lt;Captions /&gt;</Label>}
- backFace={
- <AbsoluteFill
- className="bg-black"
- style={{borderRadius: cornerRadius, overflow: 'hidden'}}
- ></AbsoluteFill>
- }
- >
- <div
- style={{
- borderRadius: cornerRadius,
- overflow: 'hidden',
- fontFamily: 'GT Planar',
- backgroundColor: 'white',
- border: '3px solid black',
- }}
- className="text-black flex justify-center items-center font-sans text-2xl font-bold flex-1"
- >
- <Sequence from={animationStart}>
- <Captions></Captions>
- </Sequence>
- </div>
- </ExtrudeDiv>
- </Rotations>
- );
-};
-
-export const whatIsRemotionSchema = z.object({
- fade: z.boolean(),
- whiteBackground: z.boolean(),
- reel: z.boolean(),
-});
-
-export const whatIsRemotionCalculateMetadata: CalculateMetadataFunction<
- z.infer<typeof whatIsRemotionSchema>
-> = ({props}) => {
- return {
- height: props.reel ? 1920 : 1080,
- durationInFrames: props.reel ? 276 : 273,
- props,
- };
-};
-
-export const WhatIsRemotion = ({
- fade,
- whiteBackground,
- reel,
-}: z.infer<typeof whatIsRemotionSchema>) => {
- const frame = useCurrentFrame();
- const {fps} = useVideoConfig();
- const bRollEnter = spring({
- fps,
- frame,
- config: {
- damping: 200,
- },
- delay: 50 + animationStart,
- durationInFrames: 25,
- durationRestThreshold: 0.0001,
- });
- const bRollExit = spring({
- fps,
- frame,
- config: {
- damping: 200,
- },
- delay: 90 + animationStart,
- durationInFrames: 25,
- durationRestThreshold: 0.0001,
- });
-
- const endCard = interpolate(
- frame,
- [120 + animationStart, 145 + animationStart],
- [0, 1],
- {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- easing: Easing.bezier(0.42, 0, 0.58, 1),
- },
- );
-
- const layerDownProgress =
- interpolate(bRollEnter, [0, 0.5], [0, 1], {
- extrapolateRight: 'clamp',
- }) -
- interpolate(bRollExit, [0.5, 1], [0, 1], {
- extrapolateLeft: 'clamp',
- });
-
- const firstX = interpolate(endCard, [0.7, 1], [0, -1500], {
- extrapolateLeft: 'clamp',
- });
- const secondX = interpolate(endCard, [0, 1], [1500, 0], {
- extrapolateLeft: 'clamp',
- });
-
- const liftCaptions = interpolate(endCard, [0, 1], [0, -2000]);
-
- const outAnimation = spring({
- fps,
- frame,
- config: {
- damping: 200,
- },
- delay: 250,
- durationInFrames: 20,
- });
-
- const spr = spring({
- fps,
- frame,
- delay: animationStart,
- config: {
- damping: 200,
- },
- durationInFrames: measureSpring({fps, config: {}}),
- });
- const actual = getActualLayerWidth(spr);
-
- const outActual = getActualLayerWidth(1 - outAnimation);
-
- return (
- <AbsoluteFill
- style={{
- backgroundColor: whiteBackground ? 'white' : undefined,
- }}
- className="flex justify-center items-center"
- >
- <Scale factor={reel ? 1.3 : 1.1}>
- <AbsoluteFill
- style={{
- maskImage:
- frame > 100 && fade
- ? 'linear-gradient( -98deg, transparent 5%, red 15%, red 80%, transparent 90%)'
- : 'none',
- }}
- >
- <TranslateX px={firstX}>
- <TranslateZ px={1.5 * depth * layerDownProgress}>
- <VideoLayers
- footage
- codeFrame
- delay={animationStart}
- boxHeight={actual.height}
- boxWidth={actual.width}
- label="<Video />"
- />
- </TranslateZ>
- </TranslateX>
- </AbsoluteFill>
- <AbsoluteFill
- style={{
- maskImage: fade
- ? 'linear-gradient( -7deg, transparent 6%, red 15%, red 84%, transparent 94%)'
- : 'none',
- }}
- >
- <TranslateY
- px={interpolate(
- bRollEnter + bRollExit,
- [0, 1, 2],
- [1900, 0, -1900],
- )}
- >
- <VideoLayers
- bRoll
- boxWidth={width}
- boxHeight={height}
- delay={animationStart}
- label="<BRoll />"
- />
- </TranslateY>
- </AbsoluteFill>
- <AbsoluteFill
- style={{
- maskImage:
- frame > 100 && fade
- ? 'linear-gradient( -98deg, transparent 10%, red 18%, red 80%, transparent 90%)'
- : 'none',
- }}
- >
- {endCard > 0 && (
- <TranslateX px={secondX}>
- <RotateY radians={Math.PI * outAnimation}>
- <LabelOpacityContext.Provider value={1 - outAnimation}>
- <VideoLayers
- boxHeight={outActual.height}
- boxWidth={outActual.width}
- delay={animationStart}
- label="<EndCard />"
- endCard
- ></VideoLayers>
- </LabelOpacityContext.Provider>
- </RotateY>
- </TranslateX>
- )}
- <AbsoluteFill
- style={{
- maskImage: fade
- ? 'linear-gradient(to bottom, transparent , black 10%)'
- : undefined,
- }}
- >
- <TranslateX px={secondX}>
- <AbsoluteFill
- style={{
- justifyContent: 'center',
- alignItems: 'center',
- }}
- >
- <Sequence layout="none" from={100}>
- <div
- style={{
- width: width,
- height: height,
- position: 'relative',
- }}
- >
- {endCard ? (
- <EndCard cornerRadius={cornerRadius}></EndCard>
- ) : null}
- </div>
- </Sequence>
- </AbsoluteFill>
- </TranslateX>
- </AbsoluteFill>
- </AbsoluteFill>
- <TranslateY px={190}>
- <TranslateZ px={-depth * 2 + liftCaptions}>
- <CaptionLayers delay={animationStart} />
- </TranslateZ>
- </TranslateY>
- </Scale>
- </AbsoluteFill>
- );
-};
diff --git a/packages/example/src/Root.tsx b/packages/example/src/Root.tsx
index 1f76d00c01..c5e0ca9cd7 100644
--- a/packages/example/src/Root.tsx
+++ b/packages/example/src/Root.tsx
@@ -121,11 +121,6 @@ import {AnimatedImages} from './AnimatedImage/Avif';
import Amplify from './AudioTesting/Amplify';
import {BrowserTest} from './BrowserTest';
import {CTAEndCard} from './CallToAction';
-import {
- WhatIsRemotion,
- whatIsRemotionCalculateMetadata,
- whatIsRemotionSchema,
-} from './Compose/WhatIsRemotion';
import {EdgeBlur} from './EdgeBlur/EdgeBlur';
import {Empty} from './Empty';
import {JumpCuts, SAMPLE_SECTIONS, calculateMetadataJumpCuts} from './JumpCuts';
@@ -1712,16 +1707,6 @@ export const Index: React.FC = () => {
fps={30}
durationInFrames={1000}
/>
- <Composition
- id="WhatIsRemotion"
- component={WhatIsRemotion}
- width={1080}
- fps={30}
- durationInFrames={273}
- schema={whatIsRemotionSchema}
- defaultProps={{fade: false, whiteBackground: false, reel: false}}
- calculateMetadata={whatIsRemotionCalculateMetadata}
- />
<Composition
id="3DContext"
component={ThreeDContext}