🎥 Make videos programmatically with React
nice
JonnyBurger318c7c156b87
diff --git a/packages/create-video/src/templates.ts b/packages/create-video/src/templates.tsindex 25aae4b2f0..b094abf81d 100644--- a/packages/create-video/src/templates.ts+++ b/packages/create-video/src/templates.ts@@ -44,8 +44,7 @@ export type Template = {| 'tiktok'| 'code-hike'| 'render-server'- | 'recorder'- | 'editor-starter';+ | 'recorder';defaultBranch: string;featuredOnHomePage: string | null;previewURL: string | null;@@ -384,7 +383,7 @@ export const FEATURED_TEMPLATES: Template[] = [repoName: 'template-prompt-to-video',description: 'Create a story with images and voiceover from a prompt',longerDescription:- 'A template that turns prompts into short videos with a script, images and voiceover.',+ 'A template that turns prompts into short videos with a script, images and voiceover. Uses OpenAI and ElevenLabs to generate the content.',promoVideo: {muxId: 'FGl01Rw6c5YOjBCTdVhn5wrmVaRWDOjDeT28iY3Sv47w',height: 1920,diff --git a/packages/docs/src/components/IconForTemplate.tsx b/packages/docs/src/components/IconForTemplate.tsxindex e08ee9dc59..333f5a7f37 100644--- a/packages/docs/src/components/IconForTemplate.tsx+++ b/packages/docs/src/components/IconForTemplate.tsx@@ -7,6 +7,7 @@ import {JSIcon} from './icons/js';import {MusicIcon} from './icons/music';import {NextIcon} from './icons/next';import {OverlayIcon} from './icons/overlay';+import {PromptToVideoIcon} from './icons/prompt-to-video';import {Recorder} from './icons/recorder';import {RemixIcon} from './icons/remix';import {RenderServerIcon} from './icons/render-server';@@ -165,11 +166,9 @@ export const IconForTemplate: React.FC<{return <CodeHike style={{height: scale * 36}} />;}- return (- <Blank- style={{- height: scale * 40,- }}- />- );+ if (template.cliId === 'prompt-to-video') {+ return <PromptToVideoIcon style={{height: scale * 36}} />;+ }++ throw new Error(`Unknown template: ${template.cliId satisfies never}`);};diff --git a/packages/docs/src/components/icons/prompt-to-video.tsx b/packages/docs/src/components/icons/prompt-to-video.tsxnew file mode 100644index 0000000000..085403758a--- /dev/null+++ b/packages/docs/src/components/icons/prompt-to-video.tsx@@ -0,0 +1,13 @@+import type {SVGProps} from 'react';+import React from 'react';++export const PromptToVideoIcon: React.FC<SVGProps<SVGSVGElement>> = (props) => {+ return (+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" {...props}>+ <path+ d="M278.5 15.6C275 6.2 266 0 256 0s-19 6.2-22.5 15.6L174.2 174.2 15.6 233.5C6.2 237 0 246 0 256s6.2 19 15.6 22.5l158.6 59.4 59.4 158.6C237 505.8 246 512 256 512s19-6.2 22.5-15.6l59.4-158.6 158.6-59.4C505.8 275 512 266 512 256s-6.2-19-15.6-22.5L337.8 174.2 278.5 15.6z"+ fill="currentColor"+ />+ </svg>+ );+};diff --git a/packages/promo-pages/src/components/homepage/IconForTemplate.tsx b/packages/promo-pages/src/components/homepage/IconForTemplate.tsxindex f1e3b8b70a..22e8ce61cd 100644--- a/packages/promo-pages/src/components/homepage/IconForTemplate.tsx+++ b/packages/promo-pages/src/components/homepage/IconForTemplate.tsx@@ -7,8 +7,10 @@ import {JSIcon} from '../icons/js';import {MusicIcon} from '../icons/music';import {NextIcon} from '../icons/next';import {OverlayIcon} from '../icons/overlay';+import {PromptToVideoIcon} from '../icons/prompt-to-video';import {Recorder} from '../icons/recorder';import {ReactRouterIcon} from '../icons/remix';+import {RenderServerIcon} from '../icons/render-server';import {SkiaIcon} from '../icons/skia';import {Stargazer} from '../icons/stargazer';import {StillIcon} from '../icons/still';@@ -136,6 +138,10 @@ export const IconForTemplate: React.FC<{return <OverlayIcon style={{height: scale * 42}} />;}+ if (template.cliId === 'render-server') {+ return <RenderServerIcon style={{height: scale * 36}} />;+ }+if (template.cliId === 'recorder') {return <Recorder style={{height: scale * 36}} />;}@@ -160,11 +166,9 @@ export const IconForTemplate: React.FC<{return <CodeHike style={{height: scale * 36}} />;}- return (- <Blank- style={{- height: scale * 40,- }}- />- );+ if (template.cliId === 'prompt-to-video') {+ return <PromptToVideoIcon style={{height: scale * 36}} />;+ }++ throw new Error(`Unknown template: ${template.cliId satisfies never}`);};diff --git a/packages/promo-pages/src/components/icons/prompt-to-video.tsx b/packages/promo-pages/src/components/icons/prompt-to-video.tsxnew file mode 100644index 0000000000..8fa47af59d--- /dev/null+++ b/packages/promo-pages/src/components/icons/prompt-to-video.tsx@@ -0,0 +1,12 @@+import type {SVGProps} from 'react';++export const PromptToVideoIcon: React.FC<SVGProps<SVGSVGElement>> = (props) => {+ return (+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" {...props}>+ <path+ d="M278.5 15.6C275 6.2 266 0 256 0s-19 6.2-22.5 15.6L174.2 174.2 15.6 233.5C6.2 237 0 246 0 256s6.2 19 15.6 22.5l158.6 59.4 59.4 158.6C237 505.8 246 512 256 512s19-6.2 22.5-15.6l59.4-158.6 158.6-59.4C505.8 275 512 266 512 256s-6.2-19-15.6-22.5L337.8 174.2 278.5 15.6z"+ fill="currentColor"+ />+ </svg>+ );+};diff --git a/packages/promo-pages/src/components/icons/render-server.tsx b/packages/promo-pages/src/components/icons/render-server.tsxnew file mode 100644index 0000000000..7b027f2e8c--- /dev/null+++ b/packages/promo-pages/src/components/icons/render-server.tsx@@ -0,0 +1,20 @@+import type {SVGProps} from 'react';+import React from 'react';++export const RenderServerIcon: React.FC<SVGProps<SVGSVGElement>> = (props) => {+ return (+ <svg+ {...props}+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ strokeWidth="1.5"+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ <rect width="18" height="18" x="3" y="3" rx="2" />+ <path d="m10 8 4 4-4 4" />+ </svg>+ );+};diff --git a/packages/promo-pages/tsconfig.json b/packages/promo-pages/tsconfig.jsonindex 5ccdf28bc9..62d9180c96 100644--- a/packages/promo-pages/tsconfig.json+++ b/packages/promo-pages/tsconfig.json@@ -17,6 +17,9 @@},{"path": "../player"+ },+ {+ "path": "../create-video"}]}