🎥 Make videos programmatically with React
Add GT Planar motion blur slide-in showcase
JonnyBurgercc1237194af6
diff --git a/bun.lock b/bun.lockindex 95b917d6c2..483a2a0332 100644--- a/bun.lock+++ b/bun.lock@@ -122,6 +122,7 @@"@remotion/mac-cursors": "workspace:*","@remotion/media": "workspace:*","@remotion/media-utils": "workspace:*",+ "@remotion/motion-blur": "workspace:*","@remotion/noise": "workspace:*","@remotion/paths": "workspace:*","@remotion/rough-notation": "workspace:*",diff --git a/packages/brand/package.json b/packages/brand/package.jsonindex 713c8d298e..5c1587c4be 100644--- a/packages/brand/package.json+++ b/packages/brand/package.json@@ -31,6 +31,7 @@"@remotion/mac-cursors": "workspace:*","@remotion/media": "workspace:*","@remotion/media-utils": "workspace:*",+ "@remotion/motion-blur": "workspace:*","@remotion/noise": "workspace:*","@remotion/paths": "workspace:*","@remotion/rough-notation": "workspace:*",diff --git a/packages/brand/src/Root.tsx b/packages/brand/src/Root.tsxindex cd68421072..ec67773d21 100644--- a/packages/brand/src/Root.tsx+++ b/packages/brand/src/Root.tsx@@ -124,6 +124,7 @@ import {htmlInCanvasAllEffectsDefaultProps,htmlInCanvasAllEffectsSchema,} from './Showcase/HtmlInCanvasAllEffects';+import {MotionBlurSlideIn} from './Showcase/MotionBlurSlideIn';import {Skills2AnnouncementComposition,skills2AnnouncementSchema,@@ -447,6 +448,15 @@ export const RemotionRoot: React.FC = () => {</Folder><Folder name="Showcases">+ <Composition+ id="MotionBlurSlideIn"+ component={MotionBlurSlideIn}+ width={1920}+ height={1080}+ fps={30}+ durationInFrames={60}+ defaultProps={{text: 'Remotion'}}+ /><Compositionid="SoundEffectShowcases"component={SfxShowcase}diff --git a/packages/brand/src/Showcase/MotionBlurSlideIn.tsx b/packages/brand/src/Showcase/MotionBlurSlideIn.tsxnew file mode 100644index 0000000000..cbac348981--- /dev/null+++ b/packages/brand/src/Showcase/MotionBlurSlideIn.tsx@@ -0,0 +1,63 @@+import {loadFont} from '@remotion/fonts';+import {HtmlInCanvasMotionBlur} from '@remotion/motion-blur';+import React from 'react';+import {+ AbsoluteFill,+ Easing,+ interpolate,+ staticFile,+ useCurrentFrame,+ useVideoConfig,+} from 'remotion';++loadFont({+ family: 'GT Planar',+ url: staticFile('GT Planar/GT-Planar-Bold.woff2'),+ weight: '700',+});++const SlidingTitle: React.FC<{readonly text: string}> = ({text}) => {+ const frame = useCurrentFrame();++ return (+ <AbsoluteFill style={{alignItems: 'center', justifyContent: 'center'}}>+ <div+ style={{+ color: '#15151e',+ fontFamily: 'GT Planar',+ fontSize: 240,+ fontWeight: 700,+ letterSpacing: -12,+ lineHeight: 1,+ whiteSpace: 'nowrap',+ translate: interpolate(frame, [0, 18], ['-1700px 0px', '0px 0px'], {+ extrapolateLeft: 'clamp',+ extrapolateRight: 'clamp',+ easing: Easing.bezier(0.22, 1, 0.36, 1),+ }),+ }}+ >+ {text}+ </div>+ </AbsoluteFill>+ );+};++export const MotionBlurSlideIn: React.FC<{readonly text: string}> = ({+ text,+}) => {+ const {width, height} = useVideoConfig();++ return (+ <AbsoluteFill style={{backgroundColor: 'white'}}>+ <HtmlInCanvasMotionBlur+ width={width}+ height={height}+ shutterAngle={360}+ samples={24}+ >+ <SlidingTitle text={text} />+ </HtmlInCanvasMotionBlur>+ </AbsoluteFill>+ );+};