🎥 Make videos programmatically with React
`@remotion/promo-pages`: Add creator homepage strip (#8830)
Jonny Burger2432aada3d54
diff --git a/.agents/skills/homepage-video-assets/SKILL.md b/.agents/skills/homepage-video-assets/SKILL.mdnew file mode 100644index 0000000000..f679541ea2--- /dev/null+++ b/.agents/skills/homepage-video-assets/SKILL.md@@ -0,0 +1,95 @@+---+name: homepage-video-assets+description: Use when rendering or replacing Remotion homepage creator strip videos, especially transparent Chrome WebM and Safari MP4 assets copied into both promo-pages and docs.+---++# Homepage Video Assets++Use this workflow for homepage creator strip assets such as:++- `homepage-assets-master`+- `editing-vp9-chrome` / `editing-safari`+- `what-is-remotion`++## Workflow++1. Render a fresh transparent ProRes 4444 master from `packages/brand`.++```bash+cd packages/brand+bunx remotion render <composition-id> /tmp/<asset>-master.mov \+ --codec=prores \+ --prores-profile=4444 \+ --pixel-format=yuva444p10le \+ --image-format=png \+ --timeout=120000 \+ --overwrite+```++2. Convert from the ProRes master, not from a previous WebM/MOV.++Chrome WebM:++```bash+ffmpeg -y -i /tmp/<asset>-master.mov \+ -vf scale=540:540 \+ -c:v libvpx \+ -pix_fmt yuva420p \+ -auto-alt-ref 0 \+ -an /tmp/<chrome-name>.webm+```++Safari MP4:++```bash+ffmpeg -y -i /tmp/<asset>-master.mov \+ -vf scale=540:540 \+ -c:v prores_ks \+ -profile:v 4 \+ -pix_fmt yuva444p10le \+ -an /tmp/<asset>-540-prores.mov++avconvert \+ --source /tmp/<asset>-540-prores.mov \+ --preset PresetHEVCHighestQualityWithAlpha \+ --output /tmp/<safari-name>.mp4 \+ --replace+```++3. Copy both outputs into both app folders:++```bash+cp /tmp/<chrome-name>.webm ../promo-pages/public/img/<chrome-name>.webm+cp /tmp/<safari-name>.mp4 ../promo-pages/public/img/<safari-name>.mp4+cp /tmp/<chrome-name>.webm ../docs/static/img/<chrome-name>.webm+cp /tmp/<safari-name>.mp4 ../docs/static/img/<safari-name>.mp4+```++## Verification++Verify the ProRes master has real alpha before converting, and verify the Safari MP4 exists in both folders:++```bash+ffmpeg -i /tmp/<asset>-master.mov+ffmpeg -i ../promo-pages/public/img/<safari-name>.mp4+ffmpeg -y -i /tmp/<asset>-master.mov \+ -vf alphaextract -frames:v 1 /tmp/<asset>-alpha.png+```++The master should report `prores (4444)` and a `yuva...` pixel format. `alphaextract` should succeed, and the alpha image should not be fully opaque. A common failure mode is `alphaextract` succeeding but every sampled pixel is opaque; in that case, the master was rendered with a black/opaque background or a stale opaque master was reused.++Verify every copied Chrome WebM and Safari MP4 is exactly `540x540`:++```bash+for f in \+ ../promo-pages/public/img/<chrome-name>.webm \+ ../promo-pages/public/img/<safari-name>.mp4 \+ ../docs/static/img/<chrome-name>.webm \+ ../docs/static/img/<safari-name>.mp4; do+ ffmpeg -i "$f"+done+```++The Safari MP4 should look like the known-good file shape: `major_brand: mp42`, `compatible_brands: isommp41mp42`, `Video: hevc (Main) (hvc1)`, `540x540`, and `handler_name: Core Media Video`. If it reports `h264 (avc1)` or dimensions such as `960x540`, it is the wrong file and will render differently in Safari.++Do not add ProRes `.mov` files to the homepage PR; they are too large. Safari should use the small `.mp4` fallback. Chrome should use the transparent `.webm`.diff --git a/packages/brand/src/Compose/Captions.tsx b/packages/brand/src/Compose/Captions.tsxindex e92970e5ed..b05bbbda52 100644--- a/packages/brand/src/Compose/Captions.tsx+++ b/packages/brand/src/Compose/Captions.tsx@@ -82,6 +82,8 @@ export const Captions: React.FC = () => {justifyContent: 'center',alignItems: 'center',width: '100%',+ height: '100%',+ textAlign: 'center',}}>{tikTokCaptions.pages.map((page) => {diff --git a/packages/brand/src/Compose/WhatIsRemotion.tsx b/packages/brand/src/Compose/WhatIsRemotion.tsxindex 66bcc7fee7..1068e59830 100644--- a/packages/brand/src/Compose/WhatIsRemotion.tsx+++ b/packages/brand/src/Compose/WhatIsRemotion.tsx@@ -2,20 +2,20 @@ import React from 'react';import type {CalculateMetadataFunction} from 'remotion';import {Easing,- interpolate,Interactive,Internals,+ interpolate,measureSpring,OffthreadVideo,Sequence,spring,staticFile,+ useCurrentFrame,+ useVideoConfig,type InteractiveBaseProps,type InteractiveTransformProps,type InteractivitySchema,type SequenceControls,- useCurrentFrame,- useVideoConfig,} from 'remotion';import {z} from 'zod';import {ExtrudeDiv} from '../3DContext/Div3D';@@ -538,6 +538,7 @@ export const WhatIsRemotion = ({style={{position: 'absolute',inset: 0,+ display: 'flex',justifyContent: 'center',alignItems: 'center',}}diff --git a/packages/brand/src/HomepageAssets/CodingPrompt.tsx b/packages/brand/src/HomepageAssets/CodingPrompt.tsxindex ea2f978899..90aeb4a1e9 100644--- a/packages/brand/src/HomepageAssets/CodingPrompt.tsx+++ b/packages/brand/src/HomepageAssets/CodingPrompt.tsx@@ -3,10 +3,12 @@ import React from 'react';import {AbsoluteFill,Easing,+ Interactive,interpolate,staticFile,useCurrentFrame,} from 'remotion';+import {z} from 'zod';import {ExtrudeDiv} from '../3DContext/Div3D';import {RotateX,@@ -21,13 +23,13 @@ const width = 1080;const height = 600;const depth = 95;const cornerRadius = 42;-const promptLines = ['Animate from', 'LA to NY'] as const;const thinking = 'Thinking';+const responseTokens = ['Do', 'ne', '.'] as const;const fontFamily = 'GT Planar';const shineLoopInFrames = 60;-const sendStartFrame = 16;-const promptTravelDurationInFrames = 28;-const thinkingStartFrame = 58;+const sendStartFrame = 12;+const thinkingStartFrame = 42;+const responseStartFrame = 131;loadFont({family: fontFamily,@@ -35,37 +37,29 @@ loadFont({weight: '500',});+export const codingPromptSchema = z.object({+ promptLine1: z.string(),+ promptLine2: z.string(),+});++export type CodingPromptProps = z.infer<typeof codingPromptSchema>;+const FrontFace: React.FC<{+ readonly promptLine1: string;+ readonly promptLine2: string;readonly shineProgress: number;readonly frame: number;-}> = ({shineProgress, frame}) => {+}> = ({promptLine1, promptLine2, shineProgress, frame}) => {const shinePosition = 140 - shineProgress * 180;- const sendProgress = Easing.out(Easing.cubic)(- interpolate(- frame,- [sendStartFrame, sendStartFrame + promptTravelDurationInFrames],- [0, 1],- {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'},- ),- );- const promptBubbleTop = interpolate(sendProgress, [0, 1], [378, 56]);- const promptBubbleScale = interpolate(sendProgress, [0, 1], [0.86, 1]);- const promptBubbleOpacity = interpolate(- frame,- [sendStartFrame - 4, sendStartFrame + 8],- [0, 1],- {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'},- );- const inputPromptOpacity = interpolate(- frame,- [sendStartFrame, sendStartFrame + 12],- [1, 0],- {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'},- );const thinkingOpacity = interpolate(frame,- [thinkingStartFrame, thinkingStartFrame + 12],- [0, 1],+ [+ thinkingStartFrame,+ thinkingStartFrame + 12,+ responseStartFrame - 12,+ responseStartFrame,+ ],+ [0, 1, 1, 0],{extrapolateLeft: 'clamp', extrapolateRight: 'clamp'},);const thinkingTranslateY = interpolate(@@ -96,11 +90,26 @@ const FrontFace: React.FC<{position: 'relative',}}>- <div+ <Interactive.Div+ name="Sent prompt bubble"style={{position: 'absolute',right: 56,- top: promptBubbleTop,+ top: 56,+ translate: interpolate(frame, [12, 28], ['0px 322px', '0px 0px'], {+ easing: [+ Easing.spring({+ damping: 200,+ mass: 1,+ stiffness: 100,+ allowTail: true,+ durationRestThreshold: 0.02,+ overshootClamping: false,+ }),+ ],+ extrapolateLeft: 'clamp',+ extrapolateRight: 'clamp',+ }),color: '#332f2a',fontSize: 58,backgroundColor: '#ffffff',@@ -113,16 +122,34 @@ const FrontFace: React.FC<{boxShadow: '0 10px 0 rgba(5, 5, 5, 0.08)',boxSizing: 'border-box',textAlign: 'right',- opacity: promptBubbleOpacity,- transform: `scale(${promptBubbleScale})`,+ opacity: interpolate(frame, [12, 24], [0, 1], {+ extrapolateLeft: 'clamp',+ extrapolateRight: 'clamp',+ }),+ scale: interpolate(frame, [12, 28], [0.86, 1], {+ easing: [+ Easing.spring({+ damping: 200,+ mass: 1,+ stiffness: 100,+ allowTail: true,+ durationRestThreshold: 0.02,+ overshootClamping: false,+ }),+ ],+ extrapolateLeft: 'clamp',+ extrapolateRight: 'clamp',+ }),transformOrigin: '100% 100%',}}>- {promptLines.map((line) => {- return <div key={line}>{line}</div>;- })}- </div>-+ <Interactive.Div name="Sent prompt line 1">+ {promptLine1}+ </Interactive.Div>+ <Interactive.Div name="Sent prompt line 2">+ {promptLine2}+ </Interactive.Div>+ </Interactive.Div><divstyle={{position: 'absolute',@@ -154,6 +181,35 @@ const FrontFace: React.FC<{{thinking}</span></div>+ <div+ style={{+ position: 'absolute',+ left: 56,+ top: 252,+ color: '#332f2a',+ fontSize: 64,+ fontWeight: 500,+ lineHeight: 1.18,+ }}+ >+ {responseTokens.map((token, index) => {+ const tokenOpacity = interpolate(+ frame,+ [+ responseStartFrame + index * 3 - 1,+ responseStartFrame + index * 3,+ ],+ [0, 1],+ {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'},+ );++ return (+ <span key={token} style={{opacity: tokenOpacity}}>+ {token}+ </span>+ );+ })}+ </div><divstyle={{position: 'absolute',@@ -171,18 +227,7 @@ const FrontFace: React.FC<{boxShadow: '0 10px 0 rgba(5, 5, 5, 0.08)',}}>- <div- style={{- flex: 1,- color: '#332f2a',- fontSize: 42,- fontWeight: 500,- opacity: inputPromptOpacity,- whiteSpace: 'nowrap',- }}- >- {promptLines.join(' ')}- </div>+ <div style={{flex: 1}} /><divstyle={{width: 68,@@ -215,7 +260,10 @@ const FrontFace: React.FC<{);};-export const CodingPrompt: React.FC = () => {+export const CodingPrompt: React.FC<CodingPromptProps> = ({+ promptLine1,+ promptLine2,+}) => {const frame = useCurrentFrame();const shineFrame = Math.max(0, frame - thinkingStartFrame);const shineProgress = (shineFrame % shineLoopInFrames) / shineLoopInFrames;@@ -242,8 +290,17 @@ export const CodingPrompt: React.FC = () => {}}/>}+ style={{+ scale: 0.955,+ translate: '-105.3px 39px',+ }}>- <FrontFace shineProgress={shineProgress} frame={frame} />+ <FrontFace+ promptLine1={promptLine1}+ promptLine2={promptLine2}+ shineProgress={shineProgress}+ frame={frame}+ /></ExtrudeDiv></RotateX></RotateY>diff --git a/packages/brand/src/HomepageAssets/Map.tsx b/packages/brand/src/HomepageAssets/Map.tsxindex 60db4f5ae2..1c9997dd21 100644--- a/packages/brand/src/HomepageAssets/Map.tsx+++ b/packages/brand/src/HomepageAssets/Map.tsx@@ -150,6 +150,10 @@ export const Map: React.FC<{}}/>}+ style={{+ scale: 0.907,+ translate: '-37.2px -1px',+ }}><FrontFace lineStartFrame={lineStartFrame} /></ExtrudeDiv>diff --git a/packages/brand/src/HomepageAssets/Master.tsx b/packages/brand/src/HomepageAssets/Master.tsxindex a2a936ff99..2d1837c7a1 100644--- a/packages/brand/src/HomepageAssets/Master.tsx+++ b/packages/brand/src/HomepageAssets/Master.tsx@@ -1,31 +1,94 @@import React from 'react';-import {Sequence} from 'remotion';-import {CodingPrompt} from './CodingPrompt';+import {+ AbsoluteFill,+ Easing,+ Freeze,+ interpolate,+ Sequence,+ useCurrentFrame,+} from 'remotion';+import type {CodingPromptProps} from './CodingPrompt';+import {CodingPrompt, codingPromptSchema} from './CodingPrompt';import {Map} from './Map';+export const homepageAssetMasterSchema = codingPromptSchema;export const homepageAssetMasterDurationInFrames = 240;const masterFlightCurveStartFrame = 86;+const resetStartFrame = 196;+const resetDurationInFrames = 24;-export const HomepageAssetMaster: React.FC = () => {+const MapLayer: React.FC = () => {+ return (+ <Sequence+ durationInFrames={247}+ style={{+ translate: '-60.5px -168.7px',+ scale: 0.742,+ }}+ >+ <Map lineStartFrame={masterFlightCurveStartFrame} />+ </Sequence>+ );+};++const CodingPromptLayer: React.FC<CodingPromptProps> = ({+ promptLine1,+ promptLine2,+}) => {+ return (+ <Sequence+ durationInFrames={247}+ style={{+ translate: '88.5px 170.7px',+ scale: 0.665,+ }}+ >+ <CodingPrompt promptLine1={promptLine1} promptLine2={promptLine2} />+ </Sequence>+ );+};++const Scene: React.FC<CodingPromptProps> = ({promptLine1, promptLine2}) => {return (<>+ <MapLayer />+ <CodingPromptLayer+ promptLine1={promptLine1}+ promptLine2={promptLine2}+ />+ </>+ );+};++export const HomepageAssetMaster: React.FC<CodingPromptProps> = ({+ promptLine1,+ promptLine2,+}) => {+ const frame = useCurrentFrame();+ const resetProgress = Easing.bezier(0.645, 0.045, 0.355, 1)(+ interpolate(+ frame,+ [resetStartFrame, resetStartFrame + resetDurationInFrames],+ [0, 1],+ {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'},+ ),+ );++ return (+ <>+ <AbsoluteFill>+ <Scene promptLine1={promptLine1} promptLine2={promptLine2} />+ </AbsoluteFill><Sequence- durationInFrames={247}- style={{- translate: '-60.5px -168.7px',- scale: 0.742,- }}- >- <Map lineStartFrame={masterFlightCurveStartFrame} />- </Sequence>- <Sequence- durationInFrames={247}+ from={resetStartFrame}+ durationInFrames={homepageAssetMasterDurationInFrames - resetStartFrame}style={{- translate: '88.5px 170.7px',- scale: 0.665,+ opacity: resetProgress,}}>- <CodingPrompt />+ <Freeze frame={0}>+ <Scene promptLine1={promptLine1} promptLine2={promptLine2} />+ </Freeze></Sequence></>);diff --git a/packages/brand/src/Root.tsx b/packages/brand/src/Root.tsxindex 06476e0688..9bad858f1a 100644--- a/packages/brand/src/Root.tsx+++ b/packages/brand/src/Root.tsx@@ -54,11 +54,12 @@ import {zigzagLinearBlurShowcaseDurationInFrames,} from './effects/ZigzagLinearBlurShowcase';import {EmailSignature} from './EmailSignature';-import {CodingPrompt} from './HomepageAssets/CodingPrompt';+import {CodingPrompt, codingPromptSchema} from './HomepageAssets/CodingPrompt';import {FolderTreeComposition} from './HomepageAssets/FolderTree';import {Map} from './HomepageAssets/Map';import {HomepageAssetMaster,+ homepageAssetMasterSchema,homepageAssetMasterDurationInFrames,} from './HomepageAssets/Master';import {NpmIniVideo} from './HomepageAssets/NpmInitVideo/NpmInitVideo';@@ -191,6 +192,11 @@ export const RemotionRoot: React.FC = () => {fps={30}width={1920}height={1080}+ schema={codingPromptSchema}+ defaultProps={{+ promptLine1: 'Animate from',+ promptLine2: 'LA to NY',+ }}/><Compositionid="map"@@ -207,6 +213,11 @@ export const RemotionRoot: React.FC = () => {fps={30}width={1080}height={1080}+ schema={homepageAssetMasterSchema}+ defaultProps={{+ promptLine1: 'Animate from',+ promptLine2: 'LA to NY',+ }}/><Compositionid="WhatIsRemotion"diff --git a/packages/docs/docs/getting-started.mdx b/packages/docs/docs/getting-started.mdxindex 30b938830c..89261eb7c8 100644--- a/packages/docs/docs/getting-started.mdx+++ b/packages/docs/docs/getting-started.mdx@@ -33,9 +33,14 @@ Click [here](/docs/ai/coding-agents) for more detailed beginner instructions.import Tabs from '@theme/Tabs';import TabItem from '@theme/TabItem';+## Templates++Choose the [template](/templates) that is most suitable for you.+For your first project, we recommend the [Hello World](/templates/hello-world) template.+## Wizard-Customize the creation of a Remotion project by selecting a specific [template](/templates), enable or disable Tailwind and Agent Skills.+Customize the creation of a Remotion project by selecting a package manager, a template and whether to enable Tailwind and Agent Skills.<TabsdefaultValue="npm"@@ -82,8 +87,7 @@ Bun as a runtime is mostly supported. [Read more here](/docs/bun).</TabItem></Tabs>-Choose the [template](/templates) that is most suitable for you.-For your first project, we recommend the [Hello World](/templates/hello-world) template.+After the project has been scaffolded, start the local development server:<TabsdefaultValue="npm"diff --git a/packages/docs/docusaurus.config.ts b/packages/docs/docusaurus.config.tsindex 1ccf8a674c..fb786638d1 100644--- a/packages/docs/docusaurus.config.ts+++ b/packages/docs/docusaurus.config.ts@@ -91,6 +91,7 @@ const config: Config = {label: 'Resources',position: 'left',items: [+ {to: '/templates', label: 'Templates'},{to: 'https://remotion.dev/prompts', label: 'Prompts'},{to: 'learn', label: 'Learn'},{@@ -101,7 +102,6 @@ const config: Config = {{to: 'showcase', label: 'Showcase'},{to: 'https://remotion.dev/convert', label: 'Convert a video'},{to: '/docs/support', label: 'Support'},- {to: '/templates', label: 'Templates'},],},{diff --git a/packages/docs/sidebars.ts b/packages/docs/sidebars.tsindex 4291492caf..3f952c4b2e 100644--- a/packages/docs/sidebars.ts+++ b/packages/docs/sidebars.ts@@ -1024,6 +1024,11 @@ const sidebars: SidebarsConfig = {'preview',],},+ {+ type: 'link',+ label: 'Templates',+ href: '/templates',+ },{type: 'category',label: 'Designing visuals',diff --git a/packages/docs/src/components/video-player.css b/packages/docs/src/components/video-player.cssindex 45a886e49f..a009c8da3d 100644--- a/packages/docs/src/components/video-player.css+++ b/packages/docs/src/components/video-player.css@@ -17,7 +17,7 @@width: 100%;height: 100%;}-video {+.video-container video {display: block;max-width: 100%;cursor: pointer;diff --git a/packages/docs/src/helpers/system-prompt.ts b/packages/docs/src/helpers/system-prompt.tsindex a27623eac1..fba8aaa0ff 100644--- a/packages/docs/src/helpers/system-prompt.ts+++ b/packages/docs/src/helpers/system-prompt.ts@@ -170,11 +170,11 @@ export const MyComp: React.FC = () => {\`\`\`A Sequence has a "from" prop that specifies the frame number where the element should appear.-A Sequence has a "trimBefore" prop that trims the start of the child timeline by a number of frames.+The "from" prop can be negative, in which case the Sequence will start immediately but cut off the first "from" frames.A Sequence has a "durationInFrames" prop that specifies how long the element should appear.-If a child component of Sequence calls "useCurrentFrame()", the enumeration starts from the first frame the Sequence appears and starts at "trimBefore".+If a child component of Sequence calls "useCurrentFrame()", the enumeration starts from the first frame the Sequence appears and starts at 0.\`\`\`tsximport {Sequence} from 'remotion';diff --git a/packages/docs/static/img/editing-safari.mp4 b/packages/docs/static/img/editing-safari.mp4index 1a34c31d4f..d2552c1cf1 100644Binary files a/packages/docs/static/img/editing-safari.mp4 and b/packages/docs/static/img/editing-safari.mp4 differdiff --git a/packages/docs/static/img/editing-vp9-chrome.webm b/packages/docs/static/img/editing-vp9-chrome.webmindex 75cc21e036..55386228d8 100644Binary files a/packages/docs/static/img/editing-vp9-chrome.webm and b/packages/docs/static/img/editing-vp9-chrome.webm differdiff --git a/packages/docs/static/img/homepage-assets-master.mp4 b/packages/docs/static/img/homepage-assets-master.mp4new file mode 100644index 0000000000..648e1d579bBinary files /dev/null and b/packages/docs/static/img/homepage-assets-master.mp4 differdiff --git a/packages/docs/static/img/homepage-assets-master.webm b/packages/docs/static/img/homepage-assets-master.webmnew file mode 100644index 0000000000..743286b2bdBinary files /dev/null and b/packages/docs/static/img/homepage-assets-master.webm differdiff --git a/packages/docs/static/img/what-is-remotion.mp4 b/packages/docs/static/img/what-is-remotion.mp4new file mode 100644index 0000000000..b2c3b589f0Binary files /dev/null and b/packages/docs/static/img/what-is-remotion.mp4 differdiff --git a/packages/docs/static/img/what-is-remotion.webm b/packages/docs/static/img/what-is-remotion.webmnew file mode 100644index 0000000000..308903d9baBinary files /dev/null and b/packages/docs/static/img/what-is-remotion.webm differdiff --git a/packages/promo-pages/public/img/editing-safari.mp4 b/packages/promo-pages/public/img/editing-safari.mp4index 1a34c31d4f..d2552c1cf1 100644Binary files a/packages/promo-pages/public/img/editing-safari.mp4 and b/packages/promo-pages/public/img/editing-safari.mp4 differdiff --git a/packages/promo-pages/public/img/editing-vp9-chrome.webm b/packages/promo-pages/public/img/editing-vp9-chrome.webmindex 75cc21e036..55386228d8 100644Binary files a/packages/promo-pages/public/img/editing-vp9-chrome.webm and b/packages/promo-pages/public/img/editing-vp9-chrome.webm differdiff --git a/packages/promo-pages/public/img/homepage-assets-master.mp4 b/packages/promo-pages/public/img/homepage-assets-master.mp4new file mode 100644index 0000000000..648e1d579bBinary files /dev/null and b/packages/promo-pages/public/img/homepage-assets-master.mp4 differdiff --git a/packages/promo-pages/public/img/homepage-assets-master.webm b/packages/promo-pages/public/img/homepage-assets-master.webmnew file mode 100644index 0000000000..743286b2bdBinary files /dev/null and b/packages/promo-pages/public/img/homepage-assets-master.webm differdiff --git a/packages/promo-pages/public/img/what-is-remotion.mp4 b/packages/promo-pages/public/img/what-is-remotion.mp4new file mode 100644index 0000000000..b2c3b589f0Binary files /dev/null and b/packages/promo-pages/public/img/what-is-remotion.mp4 differdiff --git a/packages/promo-pages/public/img/what-is-remotion.webm b/packages/promo-pages/public/img/what-is-remotion.webmnew file mode 100644index 0000000000..308903d9baBinary files /dev/null and b/packages/promo-pages/public/img/what-is-remotion.webm differdiff --git a/packages/promo-pages/src/components/Homepage.tsx b/packages/promo-pages/src/components/Homepage.tsxindex 789c53ac89..ec47e407d8 100644--- a/packages/promo-pages/src/components/Homepage.tsx+++ b/packages/promo-pages/src/components/Homepage.tsx@@ -6,18 +6,20 @@ import {BackgroundAnimation} from './homepage/BackgroundAnimation';import CommunityStats from './homepage/CommunityStats';import {Demo} from './homepage/Demo';import EvaluateRemotionSection from './homepage/EvaluateRemotion';-import {IfYouKnowReact} from './homepage/IfYouKnowReact';import type {ColorMode} from './homepage/layout/use-color-mode';import {ColorModeProvider} from './homepage/layout/use-color-mode';+import {MakeVideosAgentically} from './homepage/MakeVideosAgentically';+import {MakeVideosInteractively} from './homepage/MakeVideosInteractively';+import {MakeVideosProgrammatically} from './homepage/MakeVideosProgrammatically';import {NewsletterButton} from './homepage/NewsletterButton';-import {ParameterizeAndEdit} from './homepage/ParameterizeAndEdit';import {Pricing} from './homepage/Pricing';-import {RealMP4Videos} from './homepage/RealMp4Videos';import TrustedByBanner from './homepage/TrustedByBanner';import {BuiltWithRemotionShowcase} from './homepage/VideoAppsShowcase';import {SectionTitle} from './homepage/VideoAppsTitle';import {WriteInReact} from './homepage/WriteInReact';+const makeVideosRowClassName = 'mt-4 md:mt-6 flex flex-col lg:flex-row gap-10';+export const NewLanding: React.FC<{readonly colorMode: ColorMode;readonly setColorMode: (colorMode: ColorMode) => void;@@ -36,9 +38,19 @@ export const NewLanding: React.FC<{<div className="max-w-[500px] lg:max-w-[1000px] m-auto pl-5 pr-5 overflow-x-clip md:overflow-x-visible relative"><WriteInReact /><br />- <IfYouKnowReact />- <ParameterizeAndEdit />- <RealMP4Videos />+ <div className={makeVideosRowClassName}>+ <MakeVideosAgentically+ videoSrc="/img/homepage-assets-master.webm"+ fallbackVideoSrc="/img/homepage-assets-master.mp4"+ />+ <MakeVideosInteractively />+ <MakeVideosProgrammatically+ links={[+ {label: 'API Docs', href: '/docs/api'},+ {label: 'Resources', href: '/docs/resources'},+ ]}+ />+ </div><br /><br /><br />diff --git a/packages/promo-pages/src/components/homepage/ChooseTemplate.tsx b/packages/promo-pages/src/components/homepage/ChooseTemplate.tsxdeleted file mode 100644index 9cbcbd04e1..0000000000--- a/packages/promo-pages/src/components/homepage/ChooseTemplate.tsx+++ /dev/null@@ -1,54 +0,0 @@-import {CreateVideoInternals} from 'create-video';-import React from 'react';-import {IconForTemplate} from './IconForTemplate';-import {MoreTemplatesButton} from './MoreTemplatesButton';-import {TemplateIcon} from './TemplateIcon';--export const ChooseTemplate: React.FC = () => {- return (- <div- style={{- display: 'flex',- flexDirection: 'column',- }}- >- <div- style={{- position: 'relative',- textAlign: 'center',- }}- >- <div- className="no-scroll-bar"- style={{- display: 'inline-flex',- flexDirection: 'row',- justifyContent: 'space-around',- borderRadius: 50,- alignItems: 'center',- padding: 8,- width: '100%',- maxWidth: '550px',- }}- >- {CreateVideoInternals.FEATURED_TEMPLATES.filter(- (f) => f.featuredOnHomePage,- ).map((template) => {- return (- <a- key={template.cliId}- className="text-inherit no-underline"- href={`/templates/${template.cliId}`}- >- <TemplateIcon label={template.featuredOnHomePage!}>- <IconForTemplate scale={0.7} template={template} />- </TemplateIcon>- </a>- );- })}- <MoreTemplatesButton />- </div>- </div>- </div>- );-};diff --git a/packages/promo-pages/src/components/homepage/CommunityStatsItems.tsx b/packages/promo-pages/src/components/homepage/CommunityStatsItems.tsxindex 70f7edff0b..6f3400dcc3 100644--- a/packages/promo-pages/src/components/homepage/CommunityStatsItems.tsx+++ b/packages/promo-pages/src/components/homepage/CommunityStatsItems.tsx@@ -66,7 +66,7 @@ export const InstallsPerMonth: React.FC = () => {}}><StatItemContent- content="3M+"+ content="4M+"width="100px"fontSize="2.5rem"fontWeight="bold"@@ -90,7 +90,7 @@ export const InstallsPerMonth: React.FC = () => {/></div><StatItemContent- content="installs"+ content="installs per month"width="75%"fontSize="1.0rem"fontWeight="bold"diff --git a/packages/promo-pages/src/components/homepage/Demo/DisplayedEmoji.tsx b/packages/promo-pages/src/components/homepage/Demo/DisplayedEmoji.tsxindex c0c3c26c8f..514be2f04d 100644--- a/packages/promo-pages/src/components/homepage/Demo/DisplayedEmoji.tsx+++ b/packages/promo-pages/src/components/homepage/Demo/DisplayedEmoji.tsx@@ -5,7 +5,7 @@ import {type LottieAnimationData,} from '@remotion/lottie';import React, {useEffect, useMemo, useState} from 'react';-import {useDelayRender, useVideoConfig} from 'remotion';+import {useDelayRender, useRemotionEnvironment, useVideoConfig} from 'remotion';type Data = {duration: number;@@ -21,6 +21,7 @@ export const DisplayedEmoji: React.FC<{typeof document !== 'undefined',);const {delayRender, continueRender, cancelRender} = useDelayRender();+ const {isRendering} = useRemotionEnvironment();const src = useMemo(() => {if (emoji === 'melting') {@@ -51,9 +52,15 @@ export const DisplayedEmoji: React.FC<{continueRender(handle);}).catch((err) => {- cancelRender(err);+ if (isRendering) {+ cancelRender(err);+ }++ // eslint-disable-next-line no-console+ console.warn('Could not load emoji animation', err);+ continueRender(handle);});- }, [handle, src, continueRender, cancelRender]);+ }, [handle, src, continueRender, cancelRender, isRendering]);useEffect(() => {if (typeof document !== 'undefined') {diff --git a/packages/promo-pages/src/components/homepage/MakeVideosAgentically.tsx b/packages/promo-pages/src/components/homepage/MakeVideosAgentically.tsxnew file mode 100644index 0000000000..ac3f1de48d--- /dev/null+++ b/packages/promo-pages/src/components/homepage/MakeVideosAgentically.tsx@@ -0,0 +1,87 @@+import React, {useEffect, useRef} from 'react';+import {MakeVideosLinks, type MakeVideosLink} from './MakeVideosLinks';++export const MakeVideosAgentically: React.FC<{+ readonly title?: React.ReactNode;+ readonly description?: React.ReactNode;+ readonly showLinks?: boolean;+ readonly links?: readonly MakeVideosLink[];+ readonly showVideo?: boolean;+ readonly videoSrc?: string;+ readonly fallbackVideoSrc?: string;+}> = ({+ title = (+ <>+ <span className="text-[var(--subtitle)]">Make videos</span>+ <br /> agentically+ </>+ ),+ description = 'Turn your idea into a video using your coding agent.',+ showLinks = true,+ links = [+ {label: 'Agent Skills', href: '/docs/ai/skills'},+ {label: 'Prompts', href: '/prompts'},+ ],+ showVideo = true,+ videoSrc = '/img/render-progress.webm',+ fallbackVideoSrc = '/img/render-progress.mp4',+}) => {+ const ref = useRef<HTMLDivElement>(null);+ const videoRef = useRef<HTMLVideoElement>(null);++ useEffect(() => {+ const {current} = ref;+ if (!current) {+ return;+ }++ const callback = (data: IntersectionObserverEntry[]) => {+ if (data[0].isIntersecting) {+ videoRef.current?.play();+ }+ };++ const observer = new IntersectionObserver(callback, {+ root: null,+ threshold: 0.5,+ });+ observer.observe(current);++ return () => observer.unobserve(current);+ }, []);++ return (+ <div ref={ref} className={'flex min-w-0 basis-0 flex-col flex-1'}>+ <div className="flex aspect-square w-full items-start">+ {showVideo ? (+ <video+ ref={videoRef}+ muted+ autoPlay+ playsInline+ loop+ preload="metadata"+ style={{+ width: 400,+ maxWidth: '100%',+ maxHeight: '100%',+ borderRadius: 7,+ overflow: 'hidden',+ }}+ className="cursor-default! relative object-contain"+ >+ <source src={fallbackVideoSrc} type="video/mp4" />+ <source src={videoSrc} type="video/webm" />+ </video>+ ) : null}+ </div>+ <div className="font-brand">+ <h2 className="text-2xl fontbrand leading-[1.1] font-medium">+ {title}+ </h2>+ <p className="leading-relaxed">{description}</p>+ {showLinks ? <MakeVideosLinks links={links} /> : null}+ </div>+ </div>+ );+};diff --git a/packages/promo-pages/src/components/homepage/MakeVideosInteractively.tsx b/packages/promo-pages/src/components/homepage/MakeVideosInteractively.tsxnew file mode 100644index 0000000000..2c2e3735f8--- /dev/null+++ b/packages/promo-pages/src/components/homepage/MakeVideosInteractively.tsx@@ -0,0 +1,66 @@+import React, {useRef} from 'react';+import {MakeVideosLinks, type MakeVideosLink} from './MakeVideosLinks';++export const MakeVideosInteractively: React.FC<{+ readonly title?: React.ReactNode;+ readonly description?: React.ReactNode;+ readonly showLinks?: boolean;+ readonly links?: readonly MakeVideosLink[];+ readonly showVideo?: boolean;+ readonly videoSrc?: string;+ readonly fallbackVideoSrc?: string;+}> = ({+ title = (+ <>+ <span className="text-[var(--subtitle)]">Make videos</span>+ <br /> interactively+ </>+ ),+ description = 'Edit and animate using drag and drop and save back to code.',+ showLinks = true,+ links = [{label: 'Remotion Studio', href: '/docs/studio'}],+ showVideo = true,+ videoSrc = '/img/editing-vp9-chrome.webm',+ fallbackVideoSrc = '/img/editing-safari.mp4',+}) => {+ const ref = useRef<HTMLDivElement>(null);++ return (+ <div+ ref={ref}+ className={+ 'flex min-w-0 basis-0 flex-col justify-start items-start lg:mt-0 flex-1'+ }+ >+ <div className="flex aspect-square w-full items-start">+ {showVideo ? (+ <video+ autoPlay+ muted+ playsInline+ loop+ preload="metadata"+ style={{+ width: 500,+ maxWidth: '100%',+ maxHeight: '100%',+ borderRadius: 7,+ overflow: 'hidden',+ }}+ className="object-contain"+ >+ <source src={fallbackVideoSrc} type="video/mp4" />+ <source src={videoSrc} type="video/webm" />+ </video>+ ) : null}+ </div>+ <div className="font-brand">+ <h2 className="text-2xl fontbrand leading-[1.1] font-medium">+ {title}+ </h2>+ <p className="leading-relaxed">{description}</p>+ {showLinks ? <MakeVideosLinks links={links} /> : null}+ </div>+ </div>+ );+};diff --git a/packages/promo-pages/src/components/homepage/MakeVideosLinks.tsx b/packages/promo-pages/src/components/homepage/MakeVideosLinks.tsxnew file mode 100644index 0000000000..720e74290a--- /dev/null+++ b/packages/promo-pages/src/components/homepage/MakeVideosLinks.tsx@@ -0,0 +1,56 @@+import React from 'react';++const icon: React.CSSProperties = {+ height: 16,+ marginLeft: 10,+};++export type MakeVideosLink = {+ readonly label: string;+ readonly href: string;+};++export const MakeVideosLinkItem: React.FC<MakeVideosLink> = ({href, label}) => {+ return (+ <a+ className="no-underline text-[var(--subtitle)] font-brand font-medium text-sm inline-flex flex-row items-center"+ href={href}+ >+ {label}+ <svg+ style={icon}+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 448 512"+ >+ <path+ fill="currentColor"+ d="M438.6 278.6l-160 160C272.4 444.9 264.2 448 256 448s-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L338.8 288H32C14.33 288 .0016 273.7 .0016 256S14.33 224 32 224h306.8l-105.4-105.4c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l160 160C451.1 245.9 451.1 266.1 438.6 278.6z"+ />+ </svg>+ </a>+ );+};++export const MakeVideosLinks: React.FC<{+ readonly links: readonly MakeVideosLink[];+}> = ({links}) => {+ if (links.length === 0) {+ return null;+ }++ return (+ <>+ <div className="h-4" />+ <div className="leading-6">+ {links.map((link) => {+ return (+ <React.Fragment key={link.href}>+ <MakeVideosLinkItem {...link} />+ <br />+ </React.Fragment>+ );+ })}+ </div>+ </>+ );+};diff --git a/packages/promo-pages/src/components/homepage/MakeVideosProgrammatically.tsx b/packages/promo-pages/src/components/homepage/MakeVideosProgrammatically.tsxnew file mode 100644index 0000000000..cc4689591f--- /dev/null+++ b/packages/promo-pages/src/components/homepage/MakeVideosProgrammatically.tsx@@ -0,0 +1,52 @@+import React from 'react';+import {MakeVideosLinks, type MakeVideosLink} from './MakeVideosLinks';++export const MakeVideosProgrammatically: React.FC<{+ readonly title?: React.ReactNode;+ readonly description?: React.ReactNode;+ readonly showLinks?: boolean;+ readonly links?: readonly MakeVideosLink[];+ readonly showVideo?: boolean;+ readonly videoSrc?: string;+ readonly fallbackVideoSrc?: string;+}> = ({+ title = (+ <>+ <span className="text-[var(--subtitle)]">Make videos</span>+ <br /> programmatically+ </>+ ),+ description = 'Connect data and manage complexity with code.',+ showLinks = true,+ links = [],+ showVideo = true,+ videoSrc = '/img/what-is-remotion.webm',+ fallbackVideoSrc = '/img/what-is-remotion.mp4',+}) => {+ return (+ <div className={'flex min-w-0 basis-0 flex-col flex-1'}>+ <div className="flex aspect-square w-full items-start">+ {showVideo ? (+ <video+ muted+ autoPlay+ playsInline+ loop+ preload="metadata"+ className="relative max-h-full max-w-full cursor-default! object-contain lg:mb-0 lg:mt-0"+ >+ <source src={fallbackVideoSrc} type="video/mp4" />+ <source src={videoSrc} type="video/webm" />+ </video>+ ) : null}+ </div>+ <div className="font-brand">+ <h2 className="text-2xl fontbrand leading-[1.1] font-medium">+ {title}+ </h2>+ <p className="leading-relaxed">{description}</p>+ {showLinks ? <MakeVideosLinks links={links} /> : null}+ </div>+ </div>+ );+};diff --git a/packages/promo-pages/src/components/homepage/MoreTemplatesButton.tsx b/packages/promo-pages/src/components/homepage/MoreTemplatesButton.tsxdeleted file mode 100644index f1d771b4a6..0000000000--- a/packages/promo-pages/src/components/homepage/MoreTemplatesButton.tsx+++ /dev/null@@ -1,31 +0,0 @@-import {Button} from '@remotion/design';-import React from 'react';-import {useMobileLayout} from './layout/use-mobile-layout';--const icon: React.CSSProperties = {- height: 16,- marginLeft: 10,-};--export const MoreTemplatesButton: React.FC = () => {- const mobileLayout = useMobileLayout();-- return (- <Button- href="/templates"- className="right-0 border-2 rounded-full text-inherit px-4 py-2 fontbrand font-semibold text-sm flex flex-row items-center h-10"- >- {mobileLayout ? 'Templates' : 'Find a template'}- <svg- style={icon}- xmlns="http://www.w3.org/2000/svg"- viewBox="0 0 448 512"- >- <path- fill="currentColor"- d="M438.6 278.6l-160 160C272.4 444.9 264.2 448 256 448s-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L338.8 288H32C14.33 288 .0016 273.7 .0016 256S14.33 224 32 224h306.8l-105.4-105.4c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l160 160C451.1 245.9 451.1 266.1 438.6 278.6z"- />- </svg>- </Button>- );-};diff --git a/packages/promo-pages/src/components/homepage/WriteInReact.tsx b/packages/promo-pages/src/components/homepage/WriteInReact.tsxindex 0bdd9177c0..0a3362b1d4 100644--- a/packages/promo-pages/src/components/homepage/WriteInReact.tsx+++ b/packages/promo-pages/src/components/homepage/WriteInReact.tsx@@ -1,5 +1,4 @@import React from 'react';-import {ChooseTemplate} from './ChooseTemplate';import {GetStarted} from './GetStartedStrip';export const WriteInReact: React.FC = () => {@@ -28,7 +27,6 @@ export const WriteInReact: React.FC = () => {</div><br /><br />- <ChooseTemplate /></div>);};diff --git a/packages/promo-pages/src/components/homepage/video-player.css b/packages/promo-pages/src/components/homepage/video-player.cssindex fc6fea19d5..3ce9121d6c 100644--- a/packages/promo-pages/src/components/homepage/video-player.css+++ b/packages/promo-pages/src/components/homepage/video-player.css@@ -17,7 +17,7 @@width: 100%;height: 100%;}-video {+.video-container video {display: block;max-width: 100%;cursor: pointer;