Skip to content

🎥 Make videos programmatically with React

add credits for webmonch

JonnyBurger752a94ba7384
diff --git a/packages/create-video/src/templates.ts b/packages/create-video/src/templates.ts
index b094abf81d..3700e95108 100644
--- a/packages/create-video/src/templates.ts
+++ b/packages/create-video/src/templates.ts
@@ -50,6 +50,7 @@ export type Template = {
previewURL: string | null;
templateInMonorepo: string;
allowEnableTailwind: boolean;
+ contributedBy: string | null;
} & DynamicTemplate;
type Truthy<T> = T extends false | '' | 0 | null | undefined ? never : T;
@@ -79,6 +80,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: 'https://remotion-helloworld.vercel.app/?/HelloWorld',
templateInMonorepo: 'template-helloworld',
allowEnableTailwind: true,
+ contributedBy: null,
},
{
homePageLabel: 'Next.js (App dir)',
@@ -100,6 +102,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: 'https://next.remotion.dev',
templateInMonorepo: 'template-next-app',
allowEnableTailwind: false,
+ contributedBy: null,
},
{
homePageLabel: 'Next.js (App dir + TailwindCSS)',
@@ -121,6 +124,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: 'https://next.remotion.dev',
templateInMonorepo: 'template-next-app-tailwind',
allowEnableTailwind: false,
+ contributedBy: null,
},
{
homePageLabel: 'Next.js (Pages dir)',
@@ -142,6 +146,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: 'https://next.remotion.dev',
templateInMonorepo: 'template-next-pages',
allowEnableTailwind: false,
+ contributedBy: null,
},
{
@@ -164,6 +169,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: 'https://template-empty.vercel.app/?/MyComp',
templateInMonorepo: 'template-blank',
allowEnableTailwind: true,
+ contributedBy: null,
},
{
homePageLabel: 'Recorder',
@@ -185,6 +191,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: null,
templateInMonorepo: 'template-recorder',
allowEnableTailwind: false,
+ contributedBy: null,
},
{
homePageLabel: 'JavaScript',
@@ -207,6 +214,7 @@ export const FEATURED_TEMPLATES: Template[] = [
'https://template-helloworld-javascript.vercel.app/?/HelloWorld',
templateInMonorepo: 'template-javascript',
allowEnableTailwind: true,
+ contributedBy: null,
},
{
homePageLabel: 'Render Server (Express.js)',
@@ -228,6 +236,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: null,
templateInMonorepo: 'template-render-server',
allowEnableTailwind: false,
+ contributedBy: null,
},
{
homePageLabel: 'React Router 7',
@@ -249,6 +258,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: null,
templateInMonorepo: 'template-react-router',
allowEnableTailwind: false,
+ contributedBy: null,
},
{
homePageLabel: '3D',
@@ -270,6 +280,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: 'https://template-three-remotion.vercel.app/',
templateInMonorepo: 'template-three',
allowEnableTailwind: false,
+ contributedBy: null,
},
{
homePageLabel: 'Stills',
@@ -291,6 +302,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: 'https://template-still.vercel.app/?/PreviewCard',
templateInMonorepo: 'template-still',
allowEnableTailwind: false,
+ contributedBy: null,
},
{
homePageLabel: 'Text-To-Speech (Azure)',
@@ -312,6 +324,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: null,
templateInMonorepo: 'template-tts-azure',
allowEnableTailwind: false,
+ contributedBy: null,
},
{
homePageLabel: 'Text-To-Speech (Google)',
@@ -333,6 +346,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: null,
templateInMonorepo: 'template-tts-google',
allowEnableTailwind: false,
+ contributedBy: null,
},
{
homePageLabel: 'Audiogram',
@@ -354,6 +368,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: 'https://template-audiogram-1nrh.vercel.app',
templateInMonorepo: 'template-audiogram',
allowEnableTailwind: true,
+ contributedBy: null,
},
{
homePageLabel: 'Music Visualization',
@@ -375,6 +390,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: null,
templateInMonorepo: 'template-music-visualization',
allowEnableTailwind: true,
+ contributedBy: null,
},
{
homePageLabel: 'Prompt to Video',
@@ -396,6 +412,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: null,
templateInMonorepo: 'template-prompt-to-video',
allowEnableTailwind: true,
+ contributedBy: 'webmonch',
},
{
homePageLabel: 'Skia',
@@ -416,6 +433,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: null,
templateInMonorepo: 'template-skia',
allowEnableTailwind: false,
+ contributedBy: null,
},
{
homePageLabel: 'Overlay',
@@ -442,6 +460,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: null,
templateInMonorepo: 'template-overlay',
allowEnableTailwind: true,
+ contributedBy: null,
},
{
homePageLabel: 'Code Hike',
@@ -466,6 +485,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: 'https://template-code-hike.vercel.app/',
templateInMonorepo: 'template-code-hike',
allowEnableTailwind: false,
+ contributedBy: null,
},
{
homePageLabel: 'Stargazer',
@@ -487,6 +507,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: null,
templateInMonorepo: 'template-stargazer',
allowEnableTailwind: true,
+ contributedBy: null,
},
{
homePageLabel: 'TikTok',
@@ -508,6 +529,7 @@ export const FEATURED_TEMPLATES: Template[] = [
previewURL: null,
templateInMonorepo: 'template-tiktok',
allowEnableTailwind: true,
+ contributedBy: null,
},
].filter(truthy);
diff --git a/packages/promo-pages/src/components/template-modal-content.tsx b/packages/promo-pages/src/components/template-modal-content.tsx
index 089e91ca44..59968cc258 100644
--- a/packages/promo-pages/src/components/template-modal-content.tsx
+++ b/packages/promo-pages/src/components/template-modal-content.tsx
@@ -461,7 +461,14 @@ export const TemplateModalContent: React.FC<{
) : null}
</div>
</div>
- <div className="flex flex-row w-full">
+ <div
+ className={cn(
+ 'flex flex-row w-full',
+ template.contributedBy !== null && mobileLayout
+ ? 'flex-col'
+ : 'flex-row',
+ )}
+ >
<div
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{
@@ -473,13 +480,42 @@ export const TemplateModalContent: React.FC<{
)}
/>
<div
- style={{width: RESERVED_FOR_SIDEBAR}}
+ style={{width: mobileLayout ? '100%' : RESERVED_FOR_SIDEBAR}}
className={cn(
- mobileLayout ? 'hidden' : 'flex',
- 'items-center justify-end px-8 text-brand dark:text-white gap-2',
+ mobileLayout && template.contributedBy === null
+ ? 'hidden'
+ : 'flex',
+ template.contributedBy !== null && mobileLayout
+ ? 'border-t-2 border-black w-full py-4 justify-start px-5'
+ : 'pl-5 pr-8 justify-end ',
+ 'items-center text-brand dark:text-white gap-2',
)}
>
- <Triangle className="h-7" />
+ {template.contributedBy ? (
+ <div
+ className={cn(
+ 'flex flex-row pt-1 pb-1 pr-4 gap-2 text-text font-brand items-center',
+ )}
+ >
+ <img
+ src={`https://github.com/${template.contributedBy}.png`}
+ className="w-6 h-6 rounded-full"
+ />
+ <div className="text-text leading-tight">
+ Thanks to{' '}
+ <a
+ href={`https://github.com/${template.contributedBy}`}
+ target="_blank"
+ className="text-inherit underline"
+ >
+ {template.contributedBy}
+ </a>{' '}
+ for contributing this template!
+ </div>
+ </div>
+ ) : (
+ <Triangle className="h-7" />
+ )}
</div>
</div>
</Card>
diff --git a/packages/template-prompt-to-video/README.md b/packages/template-prompt-to-video/README.md
index 6d105b0247..698db8dd74 100644
--- a/packages/template-prompt-to-video/README.md
+++ b/packages/template-prompt-to-video/README.md
@@ -114,3 +114,7 @@ Don't send pull requests here, this is only a mirror.
## License
Note that for some entities a company license is needed. [Read the terms here](https://github.com/remotion-dev/remotion/blob/main/LICENSE.md).
+
+## Credits
+
+Thanks to [@webmonch](https://github.com/webmonch) for contributing this template!