Skip to content

🎥 Make videos programmatically with React

remotion.dev/brand: Refresh homepage creator videos (#10201)

Jonny Burger6536a6c0d401
diff --git a/packages/brand/src/Applications.tsx b/packages/brand/src/Applications.tsx
index 9f38c5ff5f..2255933d01 100644
--- a/packages/brand/src/Applications.tsx
+++ b/packages/brand/src/Applications.tsx
@@ -57,7 +57,11 @@ export function Applications() {
),
}}
>
- <ApplicationSimpleApp kineticTypeFrame={frame >= 167 ? 0 : frame} />
+ <ApplicationSimpleApp
+ kineticTypeColor="#374151"
+ kineticTypeFrame={frame >= 167 ? 0 : frame}
+ kineticTypeSpeed={1.5}
+ />
</Sequence>
<Sequence
durationInFrames={180}
diff --git a/packages/brand/src/Applications/SimpleApp.tsx b/packages/brand/src/Applications/SimpleApp.tsx
index 77faa4911a..6c2dc5597c 100644
--- a/packages/brand/src/Applications/SimpleApp.tsx
+++ b/packages/brand/src/Applications/SimpleApp.tsx
@@ -3,9 +3,13 @@ import {ExtrudeDiv} from '../3DContext/Div3D';
import {KineticType} from './KineticType';
export function ApplicationSimpleApp({
+ kineticTypeColor = '#4290f5',
kineticTypeFrame,
+ kineticTypeSpeed = 1,
}: {
+ readonly kineticTypeColor?: string;
readonly kineticTypeFrame?: number;
+ readonly kineticTypeSpeed?: number;
}) {
const frame = useCurrentFrame();
const titleFrame = kineticTypeFrame ?? frame;
@@ -31,7 +35,7 @@ export function ApplicationSimpleApp({
/>
}
cornerRadius={30}
- depth={46}
+ depth={120}
height={590}
name="Simple application"
rotationX={-Math.PI / 24}
@@ -57,36 +61,35 @@ export function ApplicationSimpleApp({
<div
style={{
alignItems: 'center',
- borderBottom: '2px solid #e5e7eb',
display: 'flex',
height: 72,
justifyContent: 'space-between',
padding: '0 26px',
}}
>
- <div style={{display: 'flex', gap: 9}}>
+ <div style={{display: 'flex', gap: 13.5}}>
<div
style={{
backgroundColor: '#ff5f57',
borderRadius: '50%',
- height: 16,
- width: 16,
+ height: 24,
+ width: 24,
}}
/>
<div
style={{
backgroundColor: '#febc2e',
borderRadius: '50%',
- height: 16,
- width: 16,
+ height: 24,
+ width: 24,
}}
/>
<div
style={{
backgroundColor: '#28c840',
borderRadius: '50%',
- height: 16,
- width: 16,
+ height: 24,
+ width: 24,
}}
/>
</div>
@@ -97,13 +100,13 @@ export function ApplicationSimpleApp({
display: 'flex',
flexDirection: 'column',
gap: 22,
- padding: 28,
+ padding: '12px 28px 28px',
}}
>
<div
style={{
alignItems: 'center',
- backgroundColor: '#111827',
+ backgroundColor: '#e5e7eb',
borderRadius: 18,
display: 'flex',
height: 332,
@@ -112,10 +115,10 @@ export function ApplicationSimpleApp({
}}
>
<KineticType
- frame={titleFrame}
+ frame={titleFrame * kineticTypeSpeed}
style={{
alignItems: 'center',
- color: '#ffffff',
+ color: kineticTypeColor,
fontSize: 64,
fontWeight: 500,
gap: 8,
diff --git a/packages/brand/src/Applications/VideoEditor.tsx b/packages/brand/src/Applications/VideoEditor.tsx
index 886d5da4f7..b4c4968aa3 100644
--- a/packages/brand/src/Applications/VideoEditor.tsx
+++ b/packages/brand/src/Applications/VideoEditor.tsx
@@ -31,7 +31,7 @@ export function ApplicationVideoEditor({
/>
}
cornerRadius={30}
- depth={46}
+ depth={120}
height={724}
name="Video editor"
rotationX={-Math.PI / 24}
@@ -81,105 +81,27 @@ export function ApplicationVideoEditor({
>
<div
style={{
- background:
- 'linear-gradient(180deg, #91d5f2 0%, #d9edf4 58%, #f0b46e 59%, #d76d4e 100%)',
+ backgroundColor: '#f3f4f6',
+ backgroundImage:
+ 'conic-gradient(#d1d5db 25%, transparent 0 50%, #d1d5db 0 75%, transparent 0)',
+ backgroundSize: '32px 32px',
inset: 0,
position: 'absolute',
}}
- >
- <div
- style={{
- backgroundColor: '#fff4c7',
- borderRadius: '50%',
- boxShadow: '0 0 24px #fff4c7',
- height: 48,
- position: 'absolute',
- right: 34,
- top: 34,
- width: 48,
- }}
- />
- <div
- style={{
- background: 'linear-gradient(145deg, #356d67, #173f43)',
- clipPath: 'polygon(0 100%, 44% 14%, 100% 100%)',
- height: 122,
- left: -18,
- position: 'absolute',
- top: 96,
- width: 210,
- }}
- />
- <div
- style={{
- background: 'linear-gradient(145deg, #4d8580, #24545a)',
- clipPath: 'polygon(0 100%, 62% 18%, 100% 100%)',
- height: 108,
- position: 'absolute',
- right: -24,
- top: 116,
- width: 180,
- }}
- />
- </div>
- <div
- style={{
- backgroundColor: 'white',
- boxShadow: '0 7px 18px rgba(4, 18, 28, 0.28)',
- padding: 5,
- position: 'absolute',
- right: 20,
- top: 62,
- transform: 'rotate(4deg)',
- width: 96,
- }}
- >
- <div
- style={{
- background:
- 'linear-gradient(150deg, #f7c76f 0%, #f28872 48%, #7a65b6 49%, #443d78 100%)',
- height: 72,
- position: 'relative',
- }}
- >
- <div
- style={{
- backgroundColor: '#ffe4a6',
- borderRadius: '50%',
- height: 22,
- left: 12,
- position: 'absolute',
- top: 10,
- width: 22,
- }}
- />
- </div>
- <div
- style={{
- color: '#39404a',
- fontSize: 8,
- fontWeight: 700,
- letterSpacing: 0.9,
- padding: '5px 1px 1px',
- }}
- >
- IMAGE
- </div>
- </div>
+ />
<div
style={{
bottom: 32,
- color: 'white',
+ color: '#374151',
fontSize: 30,
fontWeight: 700,
left: 25,
letterSpacing: -1.2,
lineHeight: 0.88,
position: 'absolute',
- textShadow: '0 2px 10px rgba(6, 20, 28, 0.4)',
}}
>
- <KineticType frame={titleFrame} />
+ <KineticType frame={titleFrame * 1.5} />
<div
style={{
border: '2px solid #0b84f3',
@@ -223,6 +145,7 @@ export function ApplicationVideoEditor({
display: 'flex',
flexDirection: 'column',
gap: 8,
+ height: 85,
left: 18,
position: 'absolute',
right: 18,
@@ -230,7 +153,6 @@ export function ApplicationVideoEditor({
>
<div
style={{
- backgroundColor: '#252930',
borderRadius: 5,
height: 23,
position: 'relative',
@@ -250,7 +172,6 @@ export function ApplicationVideoEditor({
</div>
<div
style={{
- backgroundColor: '#252930',
borderRadius: 5,
height: 23,
position: 'relative',
@@ -258,7 +179,7 @@ export function ApplicationVideoEditor({
>
<div
style={{
- backgroundColor: '#8b5cf6',
+ backgroundColor: '#0b84f3',
borderRadius: 4,
height: '100%',
left: '18%',
@@ -268,30 +189,10 @@ export function ApplicationVideoEditor({
}}
/>
</div>
- <div
- style={{
- backgroundColor: '#252930',
- borderRadius: 5,
- height: 23,
- position: 'relative',
- }}
- >
- <div
- style={{
- backgroundColor: '#2fbf71',
- borderRadius: 4,
- height: '100%',
- left: '0%',
- opacity: 0.9,
- position: 'absolute',
- width: '84%',
- }}
- />
- </div>
<div
style={{
bottom: 0,
- left: `${interpolate(titleFrame, [0, 65], [45, 82], {
+ left: `${interpolate(titleFrame, [0, 65], [5, 82], {
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
})}%`,
@@ -342,48 +243,67 @@ export function ApplicationVideoEditor({
>
<div
style={{
- backgroundColor: '#252930',
- borderBottom: '1px solid #343942',
borderRadius: 8,
- color: '#f4f6f8',
- fontSize: 15,
- padding: '12px 10px',
+ padding: '12px 0',
}}
>
- Position
+ <div
+ style={{
+ backgroundColor: '#d1d5db',
+ borderRadius: 999,
+ height: 9,
+ opacity: 0.35,
+ width: '68%',
+ }}
+ />
</div>
<div
style={{
- borderBottom: '1px solid #343942',
borderRadius: 0,
- color: '#a6adb8',
- fontSize: 15,
- padding: '12px 10px',
+ padding: '12px 0',
}}
>
- Typography
+ <div
+ style={{
+ backgroundColor: '#d1d5db',
+ borderRadius: 999,
+ height: 9,
+ opacity: 0.3,
+ width: '82%',
+ }}
+ />
</div>
<div
style={{
- borderBottom: '1px solid #343942',
borderRadius: 0,
- color: '#a6adb8',
- fontSize: 15,
- padding: '12px 10px',
+ padding: '12px 0',
}}
>
- Effects
+ <div
+ style={{
+ backgroundColor: '#d1d5db',
+ borderRadius: 999,
+ height: 9,
+ opacity: 0.3,
+ width: '54%',
+ }}
+ />
</div>
<div
style={{
- borderBottom: '1px solid #343942',
borderRadius: 0,
- color: '#a6adb8',
- fontSize: 15,
- padding: '12px 10px',
+ padding: '12px 0',
}}
>
- Animation
+ <div
+ style={{
+ backgroundColor: '#d1d5db',
+ borderRadius: 999,
+ height: 9,
+ opacity: 0.3,
+ width: '72%',
+ }}
+ />
</div>
<div
style={{
@@ -396,46 +316,34 @@ export function ApplicationVideoEditor({
style={{
backgroundColor: '#252930',
borderRadius: 7,
- color: '#a6adb8',
- fontSize: 12,
+ height: 14,
padding: '9px 7px',
}}
- >
- X 312
- </div>
+ />
<div
style={{
backgroundColor: '#252930',
borderRadius: 7,
- color: '#a6adb8',
- fontSize: 12,
+ height: 14,
padding: '9px 7px',
}}
- >
- Y 148
- </div>
+ />
<div
style={{
backgroundColor: '#252930',
borderRadius: 7,
- color: '#a6adb8',
- fontSize: 12,
+ height: 14,
padding: '9px 7px',
}}
- >
- W 456
- </div>
+ />
<div
style={{
backgroundColor: '#252930',
borderRadius: 7,
- color: '#a6adb8',
- fontSize: 12,
+ height: 14,
padding: '9px 7px',
}}
- >
- H 128
- </div>
+ />
</div>
</div>
</div>
diff --git a/packages/brand/src/HomepageAssets/RenderProgress.tsx b/packages/brand/src/HomepageAssets/RenderProgress.tsx
index f4cbdcfca4..2d6cebfbb5 100644
--- a/packages/brand/src/HomepageAssets/RenderProgress.tsx
+++ b/packages/brand/src/HomepageAssets/RenderProgress.tsx
@@ -18,11 +18,11 @@ const spacing = 900;
const initialY = 50 * 7.5;
export const renderProgressDurationInFrames = 268;
const rotationReferenceDurationInFrames = 1200;
-const phrases = ['video.mp4', 'thumb.png', 'sound.wav', 'doc.pdf'] as const;
+const phrases = ['video.mp4', 'thumb.png', 'sound.wav', 'funny.gif'] as const;
const cycleOffsets = [-1, 0, 1] as const;
-const progressStartFrame = -60;
+const progressStartFrame = -54;
const fadeInDurationInFrames = 6;
-const fadeOutStartFrame = 82;
+const fadeOutStartFrame = 92;
const fadeOutDurationInFrames = 6;
const modulo = (value: number, by: number) => {
diff --git a/packages/brand/src/HomepageAssets/RenderProgress/make-button.ts b/packages/brand/src/HomepageAssets/RenderProgress/make-button.ts
index 78c8f195f0..9102c49a1c 100644
--- a/packages/brand/src/HomepageAssets/RenderProgress/make-button.ts
+++ b/packages/brand/src/HomepageAssets/RenderProgress/make-button.ts
@@ -18,13 +18,22 @@ import {MatrixTransform4D, rotateX, translateZ, Vector4D} from '../matrix';
import {makeRoundedProgress} from './make-rounded-progress';
const outerCornerRadius = 30 * 7.5;
-const padding = 0;
+const padding = 8 * 7.5;
const outerWidth = 300 * 7.5;
const outerHeight = 100 * 7.5;
-const progressDurationInFrames = 40;
-const progressStartOffsetInFrames = 30;
+const progressDurationInFrames = 34;
+const progressStartOffsetInFrames = 24;
const flipDelayInFrames = 10;
+const videoFileIconPath =
+ 'M96 96c-17.7 0-32 14.3-32 32l0 256c0 17.7 14.3 32 32 32l256 0c17.7 0 32-14.3 32-32l0-256c0-17.7-14.3-32-32-32L96 96zM32 128c0-35.3 28.7-64 64-64l256 0c35.3 0 64 28.7 64 64l0 256c0 35.3-28.7 64-64 64L96 448c-35.3 0-64-28.7-64-64l0-256zm432 84l0-40 73.6-55.2c4.2-3.1 9.2-4.8 14.4-4.8 13.3 0 24 10.7 24 24l0 240c0 13.3-10.7 24-24 24-5.2 0-10.2-1.7-14.4-4.8l-73.6-55.2 0-40 80 60 0-208-80 60z';
+const imageFileIconPath =
+ 'M324.9 157.8c-11.38-17.38-39.89-17.31-51.23-.063L200.5 268.5l-16.4-22.6c-11.4-16.8-38.2-16-49.7 0l-64.52 89.16c-6.797 9.406-7.75 21.72-2.547 32C72.53 377.5 83.05 384 94.75 384h322.5c11.41 0 21.8-6.281 27.14-16.38a30.922 30.922 0 0 0-1.516-31.56L324.9 157.8zM95.8 352l62.39-87.38 29.91 41.34c3.1 4.24 8.3 7.24 13.3 6.64 5.25-.125 10.12-2.781 13.02-7.188l83.83-129.9L415 352H95.8zM447.1 32h-384C28.65 32-.01 60.65-.01 96v320c0 35.35 28.65 64 63.1 64h384c35.35 0 64-28.65 64-64V96c.01-35.35-27.79-64-63.99-64zM480 416c0 17.64-14.36 32-32 32H64c-17.64 0-32-14.36-32-32V96c0-17.64 14.36-32 32-32h384c17.64 0 32 14.36 32 32v320zM144 192c26.5 0 48-21.5 48-48s-21.5-48-48-48-48 21.5-48 48 21.5 48 48 48zm0-64c8.822 0 15.1 7.178 15.1 16s-6.3 16-15.1 16-16-7.2-16-16 7.2-16 16-16z';
+const audioFileIconPath =
+ 'M480 16l0-19.9-19.5 4.3-288 64-12.5 2.8 0 273.2c-17-12.7-39.4-20.4-64-20.4-53 0-96 35.8-96 80s43 80 96 80 96-35.8 96-80l0-187.2 256-56.9 0 120.4c-17-12.7-39.4-20.4-64-20.4-53 0-96 35.8-96 80s43 80 96 80 96-35.8 96-80l0-320zM448 336c0 26.5-28.7 48-64 48s-64-21.5-64-48 28.7-48 64-48 64 21.5 64 48zM160 400c0 26.5-28.7 48-64 48s-64-21.5-64-48 28.7-48 64-48 64 21.5 64 48zM448 123.2l-256 56.9 0-87.2 256-56.9 0 87.2z';
+const genericFileIconPath =
+ 'M0 64C0 28.65 28.65 0 64 0h156.1c12.7 0 25 5.057 34 14.06L369.9 129.9c9 9 14.1 21.3 14.1 34V448c0 35.3-28.7 64-64 64H64c-35.35 0-64-28.7-64-64V64zm352 128H240c-26.5 0-48-21.5-48-48V32H64c-17.67 0-32 14.33-32 32v384c0 17.7 14.33 32 32 32h256c17.7 0 32-14.3 32-32V192zm-4.7-39.4L231.4 36.69c-2-2.07-4.6-3.51-7.4-4.21V144c0 8.8 7.2 16 16 16h111.5c-.7-2.8-2.1-5.4-4.2-7.4z';
+
export const getButton = ({
font,
phrase,
@@ -86,7 +95,7 @@ export const getButton = ({
const extruded = extrudeElement({
backFaceColor: 'white',
sideColor: 'black',
- frontFaceColor: 'black',
+ frontFaceColor: 'white',
depth,
points: parsePath(centerPath(rect.path)),
strokeWidth: 30,
@@ -150,35 +159,46 @@ export const getButton = ({
faceTransformations,
);
- const folderPath = resetPath(
- scalePath(
- 'M0 96C0 60.7 28.7 32 64 32H196.1c19.1 0 37.4 7.6 50.9 21.1L289.9 96H448c35.3 0 64 28.7 64 64V416c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V96zM64 80c-8.8 0-16 7.2-16 16V416c0 8.8 7.2 16 16 16H448c8.8 0 16-7.2 16-16V160c0-8.8-7.2-16-16-16H286.6c-10.6 0-20.8-4.2-28.3-11.7L213.1 87c-4.5-4.5-10.6-7-17-7H64z',
- 0.07 * 7.5,
- 0.07 * 7.5,
- ),
+ let sourceFileIconPath = genericFileIconPath;
+ if (phrase.endsWith('.mp4')) {
+ sourceFileIconPath = videoFileIconPath;
+ } else if (phrase.endsWith('.png') || phrase.endsWith('.gif')) {
+ sourceFileIconPath = imageFileIconPath;
+ } else if (phrase.endsWith('.wav')) {
+ sourceFileIconPath = audioFileIconPath;
+ }
+
+ const fileIconPath = resetPath(
+ scalePath(sourceFileIconPath, 0.07 * 7.5, 0.07 * 7.5),
+ );
+ const fileIconBoundingBox = getBoundingBox(fileIconPath);
+ const fileIconWidth = fileIconBoundingBox.x2 - fileIconBoundingBox.x1;
+ const fileIconHeight = fileIconBoundingBox.y2 - fileIconBoundingBox.y1;
+ const rightAlignedFileIconPath = translatePath(
+ fileIconPath,
+ boxWidth / 2 - 20 * 7.5 - fileIconWidth,
+ -fileIconHeight / 2,
);
- const folderFace = transformElement(
+ const fileIconFace = transformElement(
makeElement(
{
- points: turnInto3D(
- parsePath(translatePath(folderPath, 95 * 7.5, -15 * 7.5)),
- ),
+ points: turnInto3D(parsePath(rightAlignedFileIconPath)),
color: 'black',
centerPoint: [0, 0, 0, 1] as Vector4D,
strokeWidth: 0,
strokeColor: 'black',
- description: 'folder',
+ description: 'file icon',
crispEdges: false,
},
[0, 0, 0, 1],
- 'folder',
+ 'file-icon',
),
faceTransformations,
);
const projected = transformElements(
- [extruded, progressFace, textFace, folderFace],
+ [extruded, progressFace, textFace, fileIconFace],
[rotateX(rotation), ...transformations],
);
diff --git a/packages/brand/src/HomepageAssets/RenderProgress/make-rounded-progress.ts b/packages/brand/src/HomepageAssets/RenderProgress/make-rounded-progress.ts
index 959e80f00e..76d741d16f 100644
--- a/packages/brand/src/HomepageAssets/RenderProgress/make-rounded-progress.ts
+++ b/packages/brand/src/HomepageAssets/RenderProgress/make-rounded-progress.ts
@@ -185,8 +185,8 @@ export const makeRoundedProgress = ({
parsePath(
translatePath(
serializeInstructions(paths),
- -width / 2 + 1,
- -height / 2 + 1,
+ -width / 2 + padding,
+ -height / 2 + padding,
),
),
);
diff --git a/packages/docs/static/img/applications.mp4 b/packages/docs/static/img/applications.mp4
index 5bc6a2a60a..837d8f96bb 100644
Binary files a/packages/docs/static/img/applications.mp4 and b/packages/docs/static/img/applications.mp4 differ
diff --git a/packages/docs/static/img/applications.webm b/packages/docs/static/img/applications.webm
index b6bd462119..c71b1e2124 100644
Binary files a/packages/docs/static/img/applications.webm and b/packages/docs/static/img/applications.webm differ
diff --git a/packages/docs/static/img/render-progress.mp4 b/packages/docs/static/img/render-progress.mp4
index 800d854fc4..406da23168 100644
Binary files a/packages/docs/static/img/render-progress.mp4 and b/packages/docs/static/img/render-progress.mp4 differ
diff --git a/packages/docs/static/img/render-progress.webm b/packages/docs/static/img/render-progress.webm
index e037b77b87..f579ed9186 100644
Binary files a/packages/docs/static/img/render-progress.webm and b/packages/docs/static/img/render-progress.webm differ
diff --git a/packages/promo-pages/public/img/applications.mp4 b/packages/promo-pages/public/img/applications.mp4
index 5bc6a2a60a..837d8f96bb 100644
Binary files a/packages/promo-pages/public/img/applications.mp4 and b/packages/promo-pages/public/img/applications.mp4 differ
diff --git a/packages/promo-pages/public/img/applications.webm b/packages/promo-pages/public/img/applications.webm
index b6bd462119..c71b1e2124 100644
Binary files a/packages/promo-pages/public/img/applications.webm and b/packages/promo-pages/public/img/applications.webm differ
diff --git a/packages/promo-pages/public/img/render-progress.mp4 b/packages/promo-pages/public/img/render-progress.mp4
index 800d854fc4..406da23168 100644
Binary files a/packages/promo-pages/public/img/render-progress.mp4 and b/packages/promo-pages/public/img/render-progress.mp4 differ
diff --git a/packages/promo-pages/public/img/render-progress.webm b/packages/promo-pages/public/img/render-progress.webm
index e037b77b87..f579ed9186 100644
Binary files a/packages/promo-pages/public/img/render-progress.webm and b/packages/promo-pages/public/img/render-progress.webm differ