Skip to content

πŸŽ₯ Make videos programmatically with React

Remove unused WhatsNew demo helpers blocking CI

Jonny Burgerefeaaa0d6fd9
diff --git a/packages/example/src/WhatsNew/scenes/Intro.tsx b/packages/example/src/WhatsNew/scenes/Intro.tsx
index e1265e6524..8abb9a28fb 100644
--- a/packages/example/src/WhatsNew/scenes/Intro.tsx
+++ b/packages/example/src/WhatsNew/scenes/Intro.tsx
@@ -5,11 +5,10 @@ import {
Interactive,
Easing,
interpolate,
- Sequence,
Series,
useCurrentFrame,
} from 'remotion';
-import {easeInOut, pop, rise} from '../anim';
+import {pop, rise} from '../anim';
import {Backdrop} from '../components/Background';
import {PunchyCaptions} from '../components/Captions';
import {
@@ -22,7 +21,6 @@ import {
SpeakerIcon,
TriangleIcon,
} from '../components/icons';
-import {RemotionLogo} from '../components/Logo';
import {
getCaptionPlacement,
Punch,
@@ -34,67 +32,6 @@ import {accents, colors} from '../theme';
const layout: LayoutKeyframe[] = [{at: 0, layout: 'full'}];
-const TitleCard: React.FC = () => {
- const frame = useCurrentFrame();
- const p = pop(frame, 0, 11);
- const logoSpin = interpolate(frame, [72, 92], [0, 360], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- easing: easeInOut,
- });
- const sub = rise(frame, 60, 16);
- return (
- <div
- style={{
- position: 'absolute',
- left: 70,
- top: 300,
- transformOrigin: '0% 50%',
- opacity: Math.min(1, p * 2),
- scale: 0.45 + 0.55 * p,
- rotate: `${-3 - 7 * (1 - p)}deg`,
- display: 'flex',
- alignItems: 'center',
- gap: 28,
- padding: '28px 46px 32px 30px',
- backgroundColor: colors.paper,
- borderRadius: 40,
- boxShadow: '0 30px 80px rgba(10,16,32,0.35)',
- }}
- >
- <RemotionLogo size={112} style={{rotate: `${logoSpin}deg`}} />
- <div>
- <div
- style={{
- fontFamily: display,
- fontWeight: 700,
- fontSize: 88,
- lineHeight: 0.95,
- letterSpacing: '-0.035em',
- color: colors.ink,
- }}
- >
- What&apos;s new
- </div>
- <div
- style={{
- fontFamily: display,
- fontWeight: 700,
- fontSize: 52,
- letterSpacing: '-0.02em',
- color: colors.blue,
- marginTop: 8,
- opacity: sub,
- translate: `${(1 - sub) * -24}px 0px`,
- }}
- >
- in Remotion
- </div>
- </div>
- </div>
- );
-};
-
type Topic = {
readonly title: string;
readonly accent: string;
diff --git a/packages/example/src/WhatsNew/scenes/LightLeaks.tsx b/packages/example/src/WhatsNew/scenes/LightLeaks.tsx
index c0bdf3a0f4..678bfed154 100644
--- a/packages/example/src/WhatsNew/scenes/LightLeaks.tsx
+++ b/packages/example/src/WhatsNew/scenes/LightLeaks.tsx
@@ -1,390 +1,21 @@
-import {lightLeak} from '@remotion/effects/light-leak';
import {Audio, Video} from '@remotion/media';
import React from 'react';
-import {
- Track,
- Interactive,
- interpolate,
- Sequence,
- Series,
- Solid,
- useCurrentFrame,
-} from 'remotion';
-import {pop, rise} from '../anim';
+import {Track, Interactive, Series, useCurrentFrame} from 'remotion';
import {Backdrop} from '../components/Background';
import {PunchyCaptions} from '../components/Captions';
-import {FileIcon, SparkIcon} from '../components/icons';
-import {LightLeakFx} from '../components/LightLeakFx';
import {
getCaptionPlacement,
Punch,
Stage,
type LayoutKeyframe,
} from '../components/Stage';
-import {
- ChapterSticker,
- Chip,
- CodeLines,
- Label,
- Panel,
- Pop,
- syntax,
- Window,
-} from '../components/ui';
-import {leakGrid} from '../effects/leak-grid';
-import {display, mono} from '../fonts';
-import {accents, colors} from '../theme';
+import {accents} from '../theme';
const layout: LayoutKeyframe[] = [
{at: 0, layout: 'full'},
{at: 132, layout: 'split'},
];
-const LeakTile: React.FC<{
- readonly seed: number;
- readonly width: number;
- readonly height: number;
- readonly hueShift: number;
- readonly progress: number;
-}> = ({seed, width, height, hueShift, progress}) => (
- <div
- style={{
- width,
- height,
- borderRadius: 20,
- overflow: 'hidden',
- backgroundColor: '#140F0B',
- boxShadow: '0 14px 34px rgba(10,16,32,0.22)',
- }}
- >
- <Solid
- width={width}
- height={height}
- effects={[lightLeak({seed, hueShift, progress})]}
- />
- </div>
-);
-
-const NativeComponent: React.FC = () => {
- const frame = useCurrentFrame();
- return (
- <Panel>
- <Pop from="up">
- <LeakTile
- seed={3}
- width={800}
- height={300}
- hueShift={20}
- progress={interpolate(frame, [0, 90], [0.15, 0.7])}
- />
- </Pop>
- <Pop from="up" delay={6}>
- <Window title="MyVideo.tsx" width={800} fontSize={30}>
- <CodeLines
- start={10}
- speed={1.6}
- lines={[
- [
- ['<', syntax.punct],
- ['Solid', syntax.tag],
- ],
- [
- [' effects', syntax.attr],
- ['={[', syntax.punct],
- ],
- [
- [' lightLeak', syntax.fn],
- ['({', syntax.punct],
- [' seed', syntax.plain],
- [': ', syntax.punct],
- ['3', syntax.number],
- [', ', syntax.punct],
- ['hueShift', syntax.plain],
- [': ', syntax.punct],
- ['20', syntax.number],
- [' })', syntax.punct],
- ],
- [[' ]}', syntax.punct]],
- [['/>', syntax.punct]],
- ]}
- />
- </Window>
- </Pop>
- </Panel>
- );
-};
-
-const Variations: React.FC = () => {
- const frame = useCurrentFrame();
- // Word timings relative to this sequence (starts at scene frame 226).
- const hueShift = interpolate(frame, [150, 222], [0, 360], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- });
- const seedCounter = Math.floor(
- interpolate(frame, [80, 124], [8, 9999], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- }),
- );
- const hueBar = rise(frame, 140, 14);
-
- return (
- <Panel style={{gap: 26}}>
- <Solid
- width={838}
- height={586}
- style={{margin: '-20px 0'}}
- effects={[
- leakGrid({
- seed: 1,
- seedOffset: frame > 80 && frame < 124 ? frame : 0,
- hueShift,
- hueSpread: 40 * (hueShift / 360),
- progress: 0.45,
- progressWobble: 0.18,
- phase: frame / 14,
- appear: new Array(9).fill(0).map((_, i) => pop(frame, 14 + i * 4)),
- }),
- ]}
- />
- <div style={{display: 'flex', gap: 18, alignItems: 'center'}}>
- <Pop delay={40}>
- <Chip
- fontSize={30}
- background={colors.ink}
- color={colors.paper}
- icon={<SparkIcon size={32} color={accents.lightLeaks} />}
- >
- Procedurally generated
- </Chip>
- </Pop>
- <Pop delay={72}>
- <Chip fontSize={30} style={{fontFamily: mono, fontWeight: 600}}>
- seed: {frame < 80 ? 8 : seedCounter}
- {frame >= 124 ? 'β€¦βˆž' : ''}
- </Chip>
- </Pop>
- </div>
- <div
- style={{
- width: 790,
- opacity: hueBar,
- translate: `0px ${(1 - hueBar) * 20}px`,
- }}
- >
- <div
- style={{
- height: 22,
- borderRadius: 11,
- background:
- 'linear-gradient(90deg, #ff8a00, #ffe600, #37ff5b, #00e5ff, #3a6bff, #c63bff, #ff3b8d, #ff8a00)',
- position: 'relative',
- }}
- >
- <div
- style={{
- position: 'absolute',
- left: (hueShift / 360) * 790 - 20,
- top: -9,
- width: 40,
- height: 40,
- borderRadius: 20,
- backgroundColor: colors.paper,
- boxShadow: '0 6px 16px rgba(0,0,0,0.3)',
- }}
- />
- </div>
- <div
- style={{
- marginTop: 20,
- fontFamily: mono,
- fontWeight: 600,
- fontSize: 30,
- color: colors.ink,
- textAlign: 'center',
- }}
- >
- hueShift: {Math.round(hueShift)}
- </div>
- </div>
- </Panel>
- );
-};
-
-const DirectOrSkill: React.FC = () => (
- <Panel style={{gap: 34, alignItems: 'stretch', padding: '0 20px'}}>
- <Pop from="left" delay={6}>
- <div
- style={{
- backgroundColor: colors.paper,
- borderRadius: 30,
- padding: '30px 36px',
- boxShadow: '0 24px 60px rgba(10,16,32,0.18)',
- }}
- >
- <Label>Use it directly</Label>
- <div
- style={{
- marginTop: 14,
- fontFamily: mono,
- fontWeight: 600,
- fontSize: 44,
- color: colors.ink,
- }}
- >
- <span style={{color: accents.lightLeaks}}>lightLeak</span>()
- </div>
- <div
- style={{
- marginTop: 8,
- fontFamily: mono,
- fontSize: 26,
- color: colors.muted,
- }}
- >
- @remotion/effects/light-leak
- </div>
- </div>
- </Pop>
- <Pop
- delay={72}
- style={{
- fontFamily: display,
- fontWeight: 700,
- fontSize: 40,
- color: colors.muted,
- textAlign: 'center',
- }}
- >
- β€” or β€”
- </Pop>
- <Pop from="left" delay={80}>
- <div
- style={{
- backgroundColor: colors.ink,
- borderRadius: 30,
- padding: '30px 36px',
- boxShadow: '0 24px 60px rgba(10,16,32,0.3)',
- display: 'flex',
- alignItems: 'center',
- gap: 28,
- }}
- >
- <div
- style={{
- width: 96,
- height: 96,
- borderRadius: 24,
- backgroundColor: accents.lightLeaks,
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
- }}
- >
- <FileIcon size={54} color={colors.paper} />
- </div>
- <div>
- <Label color="#9AA4B8">New agent skill</Label>
- <div
- style={{
- marginTop: 8,
- fontFamily: mono,
- fontWeight: 600,
- fontSize: 40,
- color: colors.paper,
- }}
- >
- light-leaks.md
- </div>
- </div>
- </div>
- </Pop>
- </Panel>
-);
-
-// Scene A -> light leak -> Scene B, played inside the panel.
-const TransitionDemo: React.FC = () => {
- const frame = useCurrentFrame();
- const showB = frame >= 34;
- return (
- <Panel>
- <Pop from="up">
- <div
- style={{
- width: 800,
- height: 450,
- borderRadius: 30,
- overflow: 'hidden',
- position: 'relative',
- boxShadow: '0 30px 70px rgba(10,16,32,0.3)',
- }}
- >
- <div
- style={{
- position: 'absolute',
- top: 0,
- left: 0,
- right: 0,
- bottom: 0,
- width: '100%',
- height: '100%',
- display: 'flex',
- flexDirection: 'column',
- background: showB
- ? 'linear-gradient(135deg, #FF5F6D, #FFC371)'
- : 'linear-gradient(135deg, #0B84F3, #5B3CFF)',
- justifyContent: 'center',
- alignItems: 'center',
- fontFamily: display,
- fontWeight: 700,
- fontSize: 110,
- color: colors.paper,
- letterSpacing: '-0.03em',
- }}
- >
- {showB ? 'Scene B' : 'Scene A'}
- </div>
- <Sequence from={10} durationInFrames={48} layout="none">
- <TileLeak />
- </Sequence>
- </div>
- </Pop>
- <Pop delay={4}>
- <Chip
- fontSize={32}
- background={colors.ink}
- color={colors.paper}
- icon={<SparkIcon size={32} color={accents.lightLeaks} />}
- >
- Stylish scene transitions
- </Chip>
- </Pop>
- </Panel>
- );
-};
-
-const TileLeak: React.FC = () => {
- const frame = useCurrentFrame();
- return (
- <Solid
- width={800}
- height={450}
- style={{position: 'absolute', left: 0, top: 0, mixBlendMode: 'screen'}}
- effects={[
- lightLeak({
- seed: 5,
- hueShift: 65,
- progress: interpolate(frame, [0, 47], [0, 1], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- }),
- }),
- ]}
- />
- );
-};
-
const LightLeaksSceneInner: React.FC = () => {
const frame = useCurrentFrame();
const captions = getCaptionPlacement(frame, layout);