Skip to content

🎥 Make videos programmatically with React

`@remotion/brand`: Add effects showcase composition (#8503)

Jonny Burger899d597a176c
diff --git a/bun.lock b/bun.lock
index 60c6105070..c3215ee2a7 100644
--- a/bun.lock
+++ b/bun.lock
@@ -107,6 +107,7 @@
"@remotion/noise": "workspace:*",
"@remotion/paths": "workspace:*",
"@remotion/shapes": "workspace:*",
+ "@remotion/starburst": "workspace:*",
"@remotion/svg-3d-engine": "workspace:*",
"@remotion/tailwind-v4": "workspace:*",
"@remotion/transitions": "workspace:*",
diff --git a/packages/brand/package.json b/packages/brand/package.json
index b51f7a4e81..ac829f1070 100644
--- a/packages/brand/package.json
+++ b/packages/brand/package.json
@@ -24,6 +24,7 @@
"@remotion/noise": "workspace:*",
"@remotion/paths": "workspace:*",
"@remotion/shapes": "workspace:*",
+ "@remotion/starburst": "workspace:*",
"@remotion/svg-3d-engine": "workspace:*",
"@remotion/captions": "workspace:*",
"@remotion/tailwind-v4": "workspace:*",
diff --git a/packages/brand/remotion.config.ts b/packages/brand/remotion.config.ts
index cb16d652ab..2c962acaf6 100644
--- a/packages/brand/remotion.config.ts
+++ b/packages/brand/remotion.config.ts
@@ -10,4 +10,5 @@ import {enableTailwind} from '@remotion/tailwind-v4';
Config.setVideoImageFormat('jpeg');
Config.setOverwriteOutput(true);
+Config.setChromiumOpenGlRenderer('angle');
Config.overrideWebpackConfig(enableTailwind);
diff --git a/packages/brand/src/Brand/Logo.tsx b/packages/brand/src/Brand/Logo.tsx
index e33df46c05..31effbd765 100644
--- a/packages/brand/src/Brand/Logo.tsx
+++ b/packages/brand/src/Brand/Logo.tsx
@@ -1,13 +1,13 @@
+import React from 'react';
import {useCurrentFrame} from 'remotion';
import {useVideoConfig} from 'remotion';
import {Easing} from 'remotion';
import {interpolate} from 'remotion';
import {spring} from 'remotion';
import {Sequence} from 'remotion';
-import React from 'react';
-import {TriangleToSquare} from './TriangleToSquare';
-import type { Theme} from './colors';
+import type {Theme} from './colors';
import {getOpacity} from './colors';
+import {TriangleToSquare} from './TriangleToSquare';
export const Logo: React.FC<{
readonly theme: Theme;
@@ -69,7 +69,7 @@ export const Logo: React.FC<{
[0, -Math.PI * 2.5],
{
easing: Easing.out(Easing.ease),
- }
+ },
);
const translation = interpolate(progressWithEaseOut, [0, 1], [0, 540], {
diff --git a/packages/brand/src/Brand/TriangleToSquare.tsx b/packages/brand/src/Brand/TriangleToSquare.tsx
index 92faa3358e..9b8b8c00e9 100644
--- a/packages/brand/src/Brand/TriangleToSquare.tsx
+++ b/packages/brand/src/Brand/TriangleToSquare.tsx
@@ -1,8 +1,8 @@
-import {AbsoluteFill, interpolateColors, useCurrentFrame} from 'remotion';
-import {interpolate} from 'remotion';
import {Rect, Triangle} from '@remotion/shapes';
import React from 'react';
-import type { Theme} from './colors';
+import {AbsoluteFill, interpolateColors, useCurrentFrame} from 'remotion';
+import {interpolate} from 'remotion';
+import type {Theme} from './colors';
import {getBackground, getBrand} from './colors';
export const TriangleToSquare: React.FC<{
@@ -15,12 +15,12 @@ export const TriangleToSquare: React.FC<{
const triangleEdgeRoundness = interpolate(
progress,
[0, 0.5],
- [0.707, Math.sqrt(2) - 1]
+ [0.707, Math.sqrt(2) - 1],
);
const rectEdgeRoundness = interpolate(
progress,
[0.5, 1],
- [(4 * (Math.sqrt(2) - 1)) / 3, 0.69]
+ [(4 * (Math.sqrt(2) - 1)) / 3, 0.69],
);
const color = interpolateColors(
@@ -30,10 +30,10 @@ export const TriangleToSquare: React.FC<{
interpolateColors(
opacity,
[0, 1],
- [getBackground(theme), getBrand(theme)]
+ [getBackground(theme), getBrand(theme)],
),
interpolateColors(opacity, [0, 1], [getBackground(theme), '#F43B00']),
- ]
+ ],
);
const correctCenter = interpolate(progress, [0.5, 1], [-80, 0]);
diff --git a/packages/brand/src/Compose/WhatIsRemotion.tsx b/packages/brand/src/Compose/WhatIsRemotion.tsx
index 0d808e0871..6fcaad58d0 100644
--- a/packages/brand/src/Compose/WhatIsRemotion.tsx
+++ b/packages/brand/src/Compose/WhatIsRemotion.tsx
@@ -1,6 +1,5 @@
import React from 'react';
-import type {
- CalculateMetadataFunction} from 'remotion';
+import type {CalculateMetadataFunction} from 'remotion';
import {
AbsoluteFill,
Easing,
@@ -124,7 +123,7 @@ const VideoLayers: React.FC<{
muted
style={{width: '100%', height: '100%', objectFit: 'cover'}}
src={staticFile('video.mp4')}
- />
+ />
</Sequence>
) : null}
{bRoll ? (
@@ -133,14 +132,14 @@ const VideoLayers: React.FC<{
muted
style={{width: '100%', height: '100%', objectFit: 'cover'}}
src={staticFile('spiral_.mp4')}
- />
+ />
</Sequence>
) : null}
{endCard ? (
<AbsoluteFill
className="bg-white"
style={{borderRadius: cornerRadius, border: '3px solid black'}}
- />
+ />
) : null}
</div>
</div>
@@ -164,7 +163,7 @@ const CaptionLayers: React.FC<{
<AbsoluteFill
className="bg-black"
style={{borderRadius: cornerRadius, overflow: 'hidden'}}
- />
+ />
}
>
<div
@@ -351,7 +350,7 @@ export const WhatIsRemotion = ({
delay={animationStart}
label="<EndCard />"
endCard
- />
+ />
</LabelOpacityContext.Provider>
</RotateY>
</TranslateX>
@@ -378,9 +377,7 @@ export const WhatIsRemotion = ({
position: 'relative',
}}
>
- {endCard ? (
- <EndCard cornerRadius={cornerRadius} />
- ) : null}
+ {endCard ? <EndCard cornerRadius={cornerRadius} /> : null}
</div>
</Sequence>
</AbsoluteFill>
diff --git a/packages/brand/src/Root.tsx b/packages/brand/src/Root.tsx
index 8514ad93b3..2cb28cc894 100644
--- a/packages/brand/src/Root.tsx
+++ b/packages/brand/src/Root.tsx
@@ -13,6 +13,14 @@ import {
whatIsRemotionCalculateMetadata,
whatIsRemotionSchema,
} from './Compose/WhatIsRemotion';
+import {
+ StarburstEffectShowcase,
+ starburstEffectShowcaseDurationInFrames,
+} from './effects/StarburstEffectShowcase';
+import {
+ ZigzagLinearBlurShowcase,
+ zigzagLinearBlurShowcaseDurationInFrames,
+} from './effects/ZigzagLinearBlurShowcase';
import {EmailSignature} from './EmailSignature';
import {Logo} from './Logo';
import {LogoCollab, logoCollabSchema} from './LogoCollab/LogoCollab';
@@ -115,6 +123,24 @@ export const RemotionRoot: React.FC = () => {
calculateMetadata={calculateHtmlInCanvasAllEffectsMetadata}
/>
</Folder>
+ <Folder name="effects">
+ <Composition
+ id="starburst-effect-showcase"
+ component={StarburstEffectShowcase}
+ durationInFrames={starburstEffectShowcaseDurationInFrames}
+ fps={30}
+ width={1080}
+ height={1350}
+ />
+ <Composition
+ id="zigzag-linear-blur-effect-showcase"
+ component={ZigzagLinearBlurShowcase}
+ durationInFrames={zigzagLinearBlurShowcaseDurationInFrames}
+ fps={30}
+ width={1080}
+ height={1350}
+ />
+ </Folder>
<Folder name="animated-logo">
<Composition
component={AnimatedLogo}
diff --git a/packages/brand/src/RulesEnumeration/RulesEnumeration.tsx b/packages/brand/src/RulesEnumeration/RulesEnumeration.tsx
index b3e5ff9474..a044b955cb 100644
--- a/packages/brand/src/RulesEnumeration/RulesEnumeration.tsx
+++ b/packages/brand/src/RulesEnumeration/RulesEnumeration.tsx
@@ -1,3 +1,4 @@
+import {loadFont} from '@remotion/fonts';
import {
AbsoluteFill,
spring,
@@ -6,7 +7,6 @@ import {
useVideoConfig,
} from 'remotion';
import {z} from 'zod';
-import {loadFont} from '@remotion/fonts';
const fontFamily = 'GTPlanar';
diff --git a/packages/brand/src/Showcase/index.tsx b/packages/brand/src/Showcase/index.tsx
index 49eff42ac8..5ec5cbc9ee 100644
--- a/packages/brand/src/Showcase/index.tsx
+++ b/packages/brand/src/Showcase/index.tsx
@@ -14,7 +14,7 @@ export const Showcase: React.FC = (props) => {
damping: 500,
},
}),
- [fps, frame]
+ [fps, frame],
);
const glorySpr = React.useCallback(
(delay: number) =>
@@ -26,7 +26,7 @@ export const Showcase: React.FC = (props) => {
damping: 500,
},
}),
- [fps, frame]
+ [fps, frame],
);
const animateIn = React.useCallback(
(delay: number): React.CSSProperties => {
@@ -38,7 +38,7 @@ export const Showcase: React.FC = (props) => {
opacity: interpolate(spr(delay), [0, 1], [0, 1]),
};
},
- [spr]
+ [spr],
);
const glory = React.useCallback(
@@ -51,7 +51,7 @@ export const Showcase: React.FC = (props) => {
opacity: interpolate(glorySpr(delay), [0, 1], [0, 1]),
};
},
- [glorySpr]
+ [glorySpr],
);
return (
diff --git a/packages/brand/src/animated-logo/ExplodingLogo.tsx b/packages/brand/src/animated-logo/ExplodingLogo.tsx
index 3980060c89..c21b27b621 100644
--- a/packages/brand/src/animated-logo/ExplodingLogo.tsx
+++ b/packages/brand/src/animated-logo/ExplodingLogo.tsx
@@ -138,7 +138,7 @@ export const ExplodingLogo: React.FC<{
transform: `translateX(${interpolate(
align,
[0, 1],
- [-600, 0]
+ [-600, 0],
)}px)`,
}}
>
diff --git a/packages/brand/src/animated-logo/i.tsx b/packages/brand/src/animated-logo/i.tsx
index fc218617e1..89c98154a4 100644
--- a/packages/brand/src/animated-logo/i.tsx
+++ b/packages/brand/src/animated-logo/i.tsx
@@ -8,7 +8,7 @@ import svg = require('svg-path-properties');
import _reverse = require('svg-path-reverse');
const p1 = reversePath(
- translatePath('M1511 335 L1511 508', motionFixedPath, 0)
+ translatePath('M1511 335 L1511 508', motionFixedPath, 0),
);
export const I: React.FC<{
@@ -48,7 +48,7 @@ export const I: React.FC<{
transform: `translateY(${interpolate(
iPointProgress,
[0, 1],
- [100, 0]
+ [100, 0],
)}px)`,
}}
/>
diff --git a/packages/brand/src/animated-logo/m.tsx b/packages/brand/src/animated-logo/m.tsx
index 44c6b723a9..42549ec630 100644
--- a/packages/brand/src/animated-logo/m.tsx
+++ b/packages/brand/src/animated-logo/m.tsx
@@ -18,14 +18,14 @@ export const M: React.FC<{
translatePath(
`M949 ${b}V406.455C949 379.142 971.142 357 998.455 357V357C1025.77 357 1047.91 379.142 1047.91 406.455V${m}`,
motionFixedPath,
- 0
- )
+ 0,
+ ),
);
const path2 = (b: number, m: number) =>
translatePath(
`M1048.55 ${m}V406.455C1048.55 379.142 1070.69 357 1098 357V357C1125.31 357 1147.45 379.142 1147.45 406.455V${b}`,
motionFixedPath,
- 0
+ 0,
);
const prog1 = spring({
diff --git a/packages/brand/src/animated-logo/n.tsx b/packages/brand/src/animated-logo/n.tsx
index 1905f0373f..c9038e795a 100644
--- a/packages/brand/src/animated-logo/n.tsx
+++ b/packages/brand/src/animated-logo/n.tsx
@@ -7,7 +7,7 @@ import {springD} from './springs';
const d = translatePath(
'M1771 508 V 415 C1771 383.52 1796.52 358 1828 358 V358 C1859.48 358 1885 383.52 1885 415 V508',
motionFixedPath,
- 0
+ 0,
);
export const N: React.FC<{
diff --git a/packages/brand/src/effects/EffectShowcaseScaffold.tsx b/packages/brand/src/effects/EffectShowcaseScaffold.tsx
new file mode 100644
index 0000000000..9f4301a672
--- /dev/null
+++ b/packages/brand/src/effects/EffectShowcaseScaffold.tsx
@@ -0,0 +1,576 @@
+import React from 'react';
+import {AbsoluteFill, Easing, Solid, interpolate} from 'remotion';
+
+export const WIDTH = 1080;
+export const HEIGHT = 1350;
+export const TOP_HEIGHT = 675;
+export const BOTTOM_HEIGHT = HEIGHT - TOP_HEIGHT;
+export const STUDIO_BLUE = '#0b84f3';
+export const LIGHT_TEXT = '#dfe2e6';
+export const PANEL_BG = '#1f2428';
+export const SOLID_CREAM = '#fff4d8';
+
+const BOTTOM_PANEL_LEFT_PADDING = 220;
+const EFFECT_HEADER_LEFT_PADDING = 183;
+const PARAM_ROW_HEIGHT = 48;
+const EFFECT_HEADER_HEIGHT = 56;
+const PARAM_FONT_SIZE = 24;
+const KEYFRAME_INACTIVE = '#A6A7A9';
+const BORDER = '#13161b';
+const INPUT_BACKGROUND = '#2f363d';
+const INPUT_BORDER_COLOR_UNHOVERED = 'rgba(0, 0, 0, 0.6)';
+const ROW_HIGHLIGHT_OPACITY = 0.15;
+const KEYFRAME_DIAMOND_SIZE = 22;
+const EFFECT_TOGGLE_ANIMATION_DURATION = 12;
+const EFFECT_EXPAND_DURATION = 14;
+const PREVIEW_FADE_DURATION = 14;
+const UV_KNOB_RADIUS = 16;
+const UV_KNOB_STROKE_WIDTH = 4;
+
+export const clamp = {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+} as const;
+
+const mainFont: React.CSSProperties = {
+ fontFamily:
+ 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif',
+};
+
+const topHalf: React.CSSProperties = {
+ left: 0,
+ backgroundColor: '#080b10',
+ height: TOP_HEIGHT,
+ overflow: 'visible',
+ position: 'relative',
+ top: 0,
+ width: WIDTH,
+ zIndex: 1,
+};
+
+export const previewLayerStyle: React.CSSProperties = {
+ backgroundColor: SOLID_CREAM,
+ display: 'block',
+ height: '100%',
+ left: 0,
+ position: 'absolute',
+ top: 0,
+ width: '100%',
+};
+
+const studioPanel: React.CSSProperties = {
+ ...mainFont,
+ backgroundColor: PANEL_BG,
+ borderTop: '1px solid #0d1014',
+ boxSizing: 'border-box',
+ color: LIGHT_TEXT,
+ height: BOTTOM_HEIGHT,
+ left: 0,
+ position: 'absolute',
+ top: TOP_HEIGHT,
+ width: WIDTH,
+};
+
+const paramsPanel: React.CSSProperties = {
+ borderBottom: `1px solid ${BORDER}`,
+ flex: 1,
+};
+
+const effectLabel: React.CSSProperties = {
+ alignItems: 'center',
+ borderBottom: `1px solid ${BORDER}`,
+ color: LIGHT_TEXT,
+ display: 'flex',
+ fontSize: PARAM_FONT_SIZE,
+ fontWeight: 400,
+ height: EFFECT_HEADER_HEIGHT,
+};
+
+const rowContent: React.CSSProperties = {
+ alignItems: 'center',
+ boxSizing: 'border-box',
+ display: 'flex',
+ height: '100%',
+ paddingLeft: BOTTOM_PANEL_LEFT_PADDING,
+ width: '100%',
+};
+
+const effectHeaderContent: React.CSSProperties = {
+ ...rowContent,
+ paddingLeft: EFFECT_HEADER_LEFT_PADDING,
+};
+
+const effectArrow: React.CSSProperties = {
+ alignItems: 'center',
+ display: 'flex',
+ height: 31,
+ justifyContent: 'center',
+ marginRight: 10,
+ width: 31,
+};
+
+const effectToggle: React.CSSProperties = {
+ alignItems: 'center',
+ backgroundColor: 'rgba(0, 0, 0, 0.4)',
+ borderRadius: 4,
+ display: 'inline-flex',
+ height: 36,
+ justifyContent: 'center',
+ marginRight: 12,
+ position: 'relative',
+ width: 36,
+};
+
+const effectToggleIcon: React.CSSProperties = {
+ color: 'currentColor',
+ height: 31,
+ pointerEvents: 'none',
+ width: 31,
+};
+
+const effectToggleIconWrapper: React.CSSProperties = {
+ alignItems: 'center',
+ display: 'flex',
+ height: 31,
+ justifyContent: 'center',
+ transformOrigin: '50% 50%',
+ width: 31,
+};
+
+const effectToggleCenterLayer: React.CSSProperties = {
+ alignItems: 'center',
+ display: 'flex',
+ height: '100%',
+ justifyContent: 'center',
+ left: 0,
+ position: 'absolute',
+ top: 0,
+ width: '100%',
+};
+
+const rowStyle: React.CSSProperties = {
+ alignItems: 'center',
+ borderBottom: `1px solid ${BORDER}`,
+ display: 'flex',
+ height: PARAM_ROW_HEIGHT,
+};
+
+const rowLabel: React.CSSProperties = {
+ color: LIGHT_TEXT,
+ fontSize: PARAM_FONT_SIZE,
+ fontWeight: 400,
+ width: 190,
+};
+
+export const fieldBox: React.CSSProperties = {
+ alignItems: 'center',
+ color: STUDIO_BLUE,
+ display: 'flex',
+ fontSize: PARAM_FONT_SIZE,
+ height: 38,
+ paddingLeft: 10,
+ paddingRight: 10,
+};
+
+export const tinyFieldBox: React.CSSProperties = {
+ ...fieldBox,
+ width: 88,
+};
+
+const colorsField: React.CSSProperties = {
+ ...fieldBox,
+ gap: 10,
+ minWidth: 280,
+};
+
+const enumFieldBox: React.CSSProperties = {
+ ...fieldBox,
+ backgroundColor: INPUT_BACKGROUND,
+ border: `1px solid ${INPUT_BORDER_COLOR_UNHOVERED}`,
+ boxSizing: 'border-box',
+ color: 'white',
+ height: 40,
+ justifyContent: 'space-between',
+ paddingLeft: 16,
+ paddingRight: 14,
+ width: 172,
+};
+
+const swatch: React.CSSProperties = {
+ border: '1px solid rgba(255, 255, 255, 0.9)',
+ borderRadius: 999,
+ boxSizing: 'border-box',
+ height: 26,
+ width: 26,
+};
+
+const transparentSwatch: React.CSSProperties = {
+ ...swatch,
+ backgroundColor: '#f7f7f7',
+ backgroundImage:
+ 'linear-gradient(45deg, #9b9b9b 25%, transparent 25%), linear-gradient(-45deg, #9b9b9b 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #9b9b9b 75%), linear-gradient(-45deg, transparent 75%, #9b9b9b 75%)',
+ backgroundPosition: '0 0, 0 13px, 13px -13px, -13px 0',
+ backgroundSize: '26px 26px',
+};
+
+export const formatNumber = (value: number) => {
+ return value.toFixed(2);
+};
+
+export const formatDegrees = (value: number) => {
+ return `${Math.round(value)}°`;
+};
+
+export const getTransitionProgress = (frame: number, start: number) => {
+ return interpolate(
+ frame,
+ [start, start + PREVIEW_FADE_DURATION],
+ [0, 1],
+ clamp,
+ );
+};
+
+export const getExpandProgress = (frame: number, start: number) => {
+ return interpolate(frame, [start, start + EFFECT_EXPAND_DURATION], [0, 1], {
+ ...clamp,
+ easing: Easing.bezier(0.16, 1, 0.3, 1),
+ });
+};
+
+export const getToggleIconScale = (frame: number, start: number) => {
+ return interpolate(
+ frame,
+ [start, start + 5, start + EFFECT_TOGGLE_ANIMATION_DURATION],
+ [0, 1.35, 1],
+ clamp,
+ );
+};
+
+export const getHighlightOpacity = ({
+ frame,
+ start,
+ end,
+ fadeDuration = 10,
+}: {
+ readonly frame: number;
+ readonly start: number;
+ readonly end: number;
+ readonly fadeDuration?: number;
+}) => {
+ const fadeIn = interpolate(
+ frame,
+ [start - fadeDuration, start],
+ [0, 1],
+ clamp,
+ );
+ const fadeOut = interpolate(frame, [end, end + fadeDuration], [1, 0], clamp);
+
+ return Math.min(fadeIn, fadeOut);
+};
+
+const getHighlightBackground = (opacity: number) => {
+ return opacity > 0
+ ? `hsla(0, 0%, 100%, ${ROW_HIGHLIGHT_OPACITY * opacity})`
+ : 'transparent';
+};
+
+const KeyframeDiamond: React.FC<{
+ readonly active: boolean;
+}> = ({active}) => {
+ return (
+ <svg
+ width={KEYFRAME_DIAMOND_SIZE}
+ height={KEYFRAME_DIAMOND_SIZE}
+ viewBox="0 0 12 12"
+ style={{display: 'block', overflow: 'visible'}}
+ >
+ <polygon
+ points="6 1.5 10.5 6 6 10.5 1.5 6"
+ fill={active ? STUDIO_BLUE : KEYFRAME_INACTIVE}
+ stroke="rgba(0, 0, 0, 0.45)"
+ strokeWidth="1"
+ strokeLinejoin="round"
+ />
+ </svg>
+ );
+};
+
+export const ParamRow: React.FC<{
+ readonly label: string;
+ readonly activeDiamond?: boolean;
+ readonly highlightOpacity?: number;
+ readonly children: React.ReactNode;
+}> = ({label, activeDiamond = false, highlightOpacity = 0, children}) => {
+ return (
+ <div
+ style={{
+ ...rowStyle,
+ backgroundColor: getHighlightBackground(highlightOpacity),
+ }}
+ >
+ <div style={rowContent}>
+ <div
+ style={{
+ alignItems: 'center',
+ display: 'flex',
+ justifyContent: 'center',
+ width: 52,
+ }}
+ >
+ <KeyframeDiamond active={activeDiamond} />
+ </div>
+ <div style={rowLabel}>{label}</div>
+ <div
+ style={{
+ alignItems: 'center',
+ display: 'flex',
+ flex: 1,
+ minWidth: 0,
+ }}
+ >
+ {children}
+ </div>
+ </div>
+ </div>
+ );
+};
+
+export const ColorSwatches: React.FC<{
+ readonly colors: readonly string[];
+}> = ({colors}) => {
+ return (
+ <div style={colorsField}>
+ {colors.map((color) => {
+ const isTransparent = color === 'transparent' || color.includes(', 0)');
+
+ return (
+ <div
+ key={color}
+ style={
+ isTransparent
+ ? transparentSwatch
+ : {
+ ...swatch,
+ backgroundColor: color,
+ }
+ }
+ />
+ );
+ })}
+ </div>
+ );
+};
+
+export const EnumValue: React.FC<{
+ readonly value: string;
+}> = ({value}) => {
+ return (
+ <div style={enumFieldBox}>
+ <span>{value}</span>
+ <svg width="13" viewBox="0 0 320 512">
+ <path
+ fill="currentColor"
+ d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"
+ />
+ </svg>
+ </div>
+ );
+};
+
+const EffectArrow: React.FC<{
+ readonly expandProgress: number;
+}> = ({expandProgress}) => {
+ return (
+ <div
+ style={{...effectArrow, transform: `rotate(${expandProgress * 90}deg)`}}
+ >
+ <svg width="23" height="23" viewBox="0 0 8 8" style={{display: 'block'}}>
+ <path d="M2 1L6 4L2 7Z" fill="#ccc" />
+ </svg>
+ </div>
+ );
+};
+
+const EffectToggle: React.FC<{
+ readonly enabled: boolean;
+ readonly iconScale?: number;
+}> = ({enabled, iconScale = 1}) => {
+ return (
+ <div style={effectToggle}>
+ {enabled ? (
+ <div
+ style={{
+ ...effectToggleCenterLayer,
+ opacity: iconScale <= 0 ? 0 : 1,
+ }}
+ >
+ <div
+ style={{
+ ...effectToggleIconWrapper,
+ transform: `scale(${iconScale})`,
+ }}
+ >
+ <svg viewBox="0 0 16 16" fill="none" style={effectToggleIcon}>
+ <path
+ d="M4.405 4.48C4.575 3.82 4.865 3.325 5.275 2.995C5.695 2.665 6.25 2.5 6.94 2.5H9.235V4.06H7.045C6.555 4.06 6.235 4.3 6.085 4.78L5.83 5.68H7.975V7.255H5.395L3.805 13H2.02L3.625 7.255H1.96V5.68H4.075L4.405 4.48ZM8.57102 9.085L6.87602 5.68H8.79602L9.86102 7.99L11.991 5.68H14.331L10.686 9.415L12.426 13H10.491L9.35102 10.585L7.02602 13H4.68602L8.57102 9.085Z"
+ fill="white"
+ />
+ </svg>
+ </div>
+ </div>
+ ) : null}
+ </div>
+ );
+};
+
+export const EffectHeader: React.FC<{
+ readonly label: string;
+ readonly enabled: boolean;
+ readonly expandProgress?: number;
+ readonly highlightOpacity?: number;
+ readonly iconScale?: number;
+}> = ({
+ label,
+ enabled,
+ expandProgress = 1,
+ highlightOpacity = 0,
+ iconScale,
+}) => {
+ return (
+ <div
+ style={{
+ ...effectLabel,
+ backgroundColor: getHighlightBackground(highlightOpacity),
+ }}
+ >
+ <div style={effectHeaderContent}>
+ <EffectToggle enabled={enabled} iconScale={iconScale} />
+ <EffectArrow expandProgress={expandProgress} />
+ {label}
+ </div>
+ </div>
+ );
+};
+
+export const EffectProperties: React.FC<{
+ readonly children: React.ReactNode;
+ readonly expandProgress?: number;
+ readonly rowCount: number;
+}> = ({children, expandProgress = 1, rowCount}) => {
+ return (
+ <div
+ style={{
+ height: rowCount * PARAM_ROW_HEIGHT * expandProgress,
+ overflow: 'hidden',
+ }}
+ >
+ <div
+ style={{
+ opacity: expandProgress,
+ transform: `translateY(${(1 - expandProgress) * -18}px)`,
+ }}
+ >
+ {children}
+ </div>
+ </div>
+ );
+};
+
+export const UvKnob: React.FC<{
+ readonly frame: number;
+ readonly uv: readonly [number, number];
+ readonly start: number;
+ readonly end: number;
+ readonly lineTo?: readonly [number, number];
+}> = ({frame, uv, start, end, lineTo}) => {
+ const progress = getHighlightOpacity({
+ frame,
+ start,
+ end: end + 22,
+ fadeDuration: 12,
+ });
+ const scale = interpolate(progress, [0, 1], [0.42, 1], clamp);
+ const centerX = WIDTH * uv[0];
+ const centerY = TOP_HEIGHT * uv[1];
+
+ if (progress <= 0) {
+ return null;
+ }
+
+ return (
+ <svg
+ width={WIDTH}
+ height={TOP_HEIGHT}
+ viewBox={`0 0 ${WIDTH} ${TOP_HEIGHT}`}
+ style={{
+ left: 0,
+ opacity: progress,
+ overflow: 'visible',
+ pointerEvents: 'none',
+ position: 'absolute',
+ top: 0,
+ }}
+ >
+ {lineTo ? (
+ <line
+ x1={centerX}
+ y1={centerY}
+ x2={WIDTH * lineTo[0]}
+ y2={TOP_HEIGHT * lineTo[1]}
+ stroke={STUDIO_BLUE}
+ strokeWidth={2}
+ vectorEffect="non-scaling-stroke"
+ />
+ ) : null}
+ <circle
+ cx={centerX}
+ cy={centerY}
+ r={UV_KNOB_RADIUS * scale}
+ fill="white"
+ stroke={STUDIO_BLUE}
+ strokeWidth={UV_KNOB_STROKE_WIDTH}
+ vectorEffect="non-scaling-stroke"
+ />
+ </svg>
+ );
+};
+
+export const EffectShowcaseShell: React.FC<{
+ readonly preview: React.ReactNode;
+ readonly studio: React.ReactNode;
+}> = ({preview, studio}) => {
+ return (
+ <AbsoluteFill style={{backgroundColor: PANEL_BG}}>
+ <div style={topHalf}>{preview}</div>
+ <div style={studioPanel}>
+ <div style={{display: 'flex', height: BOTTOM_HEIGHT}}>
+ <div
+ style={{
+ display: 'flex',
+ flex: 1,
+ flexDirection: 'column',
+ minWidth: 0,
+ }}
+ >
+ <div style={paramsPanel}>{studio}</div>
+ </div>
+ </div>
+ </div>
+ </AbsoluteFill>
+ );
+};
+
+export const PreviewSolidLayer: React.FC<{
+ readonly opacity?: number;
+ readonly effects?: React.ComponentProps<typeof Solid>['effects'];
+}> = ({opacity = 1, effects}) => {
+ return (
+ <Solid
+ width={WIDTH}
+ height={TOP_HEIGHT}
+ color={SOLID_CREAM}
+ style={{...previewLayerStyle, opacity}}
+ effects={effects}
+ />
+ );
+};
diff --git a/packages/brand/src/effects/StarburstEffectShowcase.tsx b/packages/brand/src/effects/StarburstEffectShowcase.tsx
new file mode 100644
index 0000000000..43738515b4
--- /dev/null
+++ b/packages/brand/src/effects/StarburstEffectShowcase.tsx
@@ -0,0 +1,870 @@
+import {halftone} from '@remotion/effects/halftone';
+import {starburst} from '@remotion/starburst';
+import React from 'react';
+import {
+ AbsoluteFill,
+ Easing,
+ Solid,
+ interpolate,
+ useCurrentFrame,
+} from 'remotion';
+
+const WIDTH = 1080;
+const HEIGHT = 1350;
+const TOP_HEIGHT = 675;
+const BOTTOM_HEIGHT = HEIGHT - TOP_HEIGHT;
+const BOTTOM_PANEL_LEFT_PADDING = 220;
+const EFFECT_HEADER_LEFT_PADDING = 183;
+const PARAM_ROW_HEIGHT = 48;
+const EFFECT_HEADER_HEIGHT = 56;
+const PARAM_FONT_SIZE = 24;
+
+const ORIGIN_MOVE_START = 78;
+const ORIGIN_MOVE_END = 126;
+const KEYFRAME_SET_FRAME = 174;
+const ROTATION_START = 198;
+const ROTATION_DURATION = 72;
+const STARBURST_ENABLE_FRAME = 30;
+const HALFTONE_ENABLE_DELAY = 72;
+const HALFTONE_ENABLE_FRAME =
+ ROTATION_START + ROTATION_DURATION / 2 + HALFTONE_ENABLE_DELAY;
+const FX_ICON_JUMP_DURATION = 12;
+const EFFECT_EXPAND_DURATION = 14;
+const PREVIEW_CROSSFADE_DURATION = 14;
+const HALFTONE_PARAM_ROWS = 4;
+const HALFTONE_DOT_SIZE_TWEAK_START =
+ HALFTONE_ENABLE_FRAME + EFFECT_EXPAND_DURATION + 24;
+const HALFTONE_DOT_SIZE_TWEAK_END = HALFTONE_DOT_SIZE_TWEAK_START + 96;
+const HALFTONE_SHAPE_TWEAK_FRAME = HALFTONE_DOT_SIZE_TWEAK_END + 48;
+const HALFTONE_SHAPE_TWEAK_HIGHLIGHT_END = HALFTONE_SHAPE_TWEAK_FRAME + 48;
+
+const STUDIO_BLUE = '#0b84f3';
+const LIGHT_TEXT = '#dfe2e6';
+const KEYFRAME_INACTIVE = '#A6A7A9';
+const PANEL_BG = '#1f2428';
+const BORDER = '#13161b';
+const INPUT_BACKGROUND = '#2f363d';
+const INPUT_BORDER_COLOR_UNHOVERED = 'rgba(0, 0, 0, 0.6)';
+const ROW_HIGHLIGHT_OPACITY = 0.15;
+const STARBURST_ORANGE = '#ff8a00';
+const SOLID_CREAM = '#fff4d8';
+const STARBURST_COLORS = [STARBURST_ORANGE, 'rgba(255, 244, 216, 0)'] as const;
+const RAYS = 18;
+const KEYFRAME_DIAMOND_SIZE = 22;
+const HALFTONE_DOT_SIZE_START = 12;
+const HALFTONE_DOT_SIZE_END = 20;
+const HALFTONE_DOT_SPACING = 14;
+const HALFTONE_DOT_COLOR = '#ff8a00';
+const ORIGIN_KNOB_RADIUS = 16;
+const ORIGIN_KNOB_STROKE_WIDTH = 4;
+
+export const starburstEffectShowcaseDurationInFrames = 582;
+
+const clamp = {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+} as const;
+
+const mainFont: React.CSSProperties = {
+ fontFamily:
+ 'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif',
+};
+
+const topHalf: React.CSSProperties = {
+ left: 0,
+ backgroundColor: '#080b10',
+ height: TOP_HEIGHT,
+ overflow: 'visible',
+ position: 'relative',
+ top: 0,
+ width: WIDTH,
+ zIndex: 1,
+};
+
+const solidStyle: React.CSSProperties = {
+ backgroundColor: SOLID_CREAM,
+ display: 'block',
+ height: '100%',
+ width: '100%',
+};
+
+const previewLayerStyle: React.CSSProperties = {
+ ...solidStyle,
+ left: 0,
+ position: 'absolute',
+ top: 0,
+};
+
+const studioPanel: React.CSSProperties = {
+ ...mainFont,
+ backgroundColor: PANEL_BG,
+ borderTop: '1px solid #0d1014',
+ boxSizing: 'border-box',
+ color: LIGHT_TEXT,
+ height: BOTTOM_HEIGHT,
+ left: 0,
+ position: 'absolute',
+ top: TOP_HEIGHT,
+ width: WIDTH,
+};
+
+const studioBody: React.CSSProperties = {
+ display: 'flex',
+ height: BOTTOM_HEIGHT,
+};
+
+const inspector: React.CSSProperties = {
+ display: 'flex',
+ flex: 1,
+ flexDirection: 'column',
+ minWidth: 0,
+};
+
+const paramsPanel: React.CSSProperties = {
+ borderBottom: `1px solid ${BORDER}`,
+ flex: 1,
+};
+
+const effectLabel: React.CSSProperties = {
+ alignItems: 'center',
+ borderBottom: `1px solid ${BORDER}`,
+ color: LIGHT_TEXT,
+ display: 'flex',
+ fontSize: PARAM_FONT_SIZE,
+ fontWeight: 400,
+ height: EFFECT_HEADER_HEIGHT,
+};
+
+const rowContent: React.CSSProperties = {
+ alignItems: 'center',
+ boxSizing: 'border-box',
+ display: 'flex',
+ height: '100%',
+ paddingLeft: BOTTOM_PANEL_LEFT_PADDING,
+ width: '100%',
+};
+
+const effectHeaderContent: React.CSSProperties = {
+ ...rowContent,
+ paddingLeft: EFFECT_HEADER_LEFT_PADDING,
+};
+
+const effectArrow: React.CSSProperties = {
+ alignItems: 'center',
+ display: 'flex',
+ height: 31,
+ justifyContent: 'center',
+ marginRight: 10,
+ width: 31,
+};
+
+const effectArrowSvg: React.CSSProperties = {
+ display: 'block',
+};
+
+const effectToggle: React.CSSProperties = {
+ alignItems: 'center',
+ backgroundColor: 'rgba(0, 0, 0, 0.4)',
+ borderRadius: 4,
+ display: 'inline-flex',
+ height: 36,
+ justifyContent: 'center',
+ marginRight: 12,
+ position: 'relative',
+ width: 36,
+};
+
+const effectToggleIcon: React.CSSProperties = {
+ color: 'currentColor',
+ height: 31,
+ pointerEvents: 'none',
+ width: 31,
+};
+
+const effectToggleIconWrapper: React.CSSProperties = {
+ alignItems: 'center',
+ display: 'flex',
+ height: 31,
+ justifyContent: 'center',
+ transformOrigin: '50% 50%',
+ width: 31,
+};
+
+const effectToggleJumpLayer: React.CSSProperties = {
+ alignItems: 'center',
+ display: 'flex',
+ height: '100%',
+ justifyContent: 'center',
+ left: 0,
+ position: 'absolute',
+ top: 0,
+ width: '100%',
+};
+
+const rowStyle: React.CSSProperties = {
+ alignItems: 'center',
+ borderBottom: `1px solid ${BORDER}`,
+ display: 'flex',
+ height: PARAM_ROW_HEIGHT,
+};
+
+const rowLabel: React.CSSProperties = {
+ color: LIGHT_TEXT,
+ fontSize: PARAM_FONT_SIZE,
+ fontWeight: 400,
+ width: 190,
+};
+
+const fieldBox: React.CSSProperties = {
+ alignItems: 'center',
+ color: STUDIO_BLUE,
+ display: 'flex',
+ fontSize: PARAM_FONT_SIZE,
+ height: 38,
+ paddingLeft: 10,
+ paddingRight: 10,
+};
+
+const tinyFieldBox: React.CSSProperties = {
+ ...fieldBox,
+ width: 88,
+};
+
+const colorsField: React.CSSProperties = {
+ ...fieldBox,
+ gap: 10,
+ minWidth: 280,
+};
+
+const enumFieldBox: React.CSSProperties = {
+ ...fieldBox,
+ backgroundColor: INPUT_BACKGROUND,
+ border: `1px solid ${INPUT_BORDER_COLOR_UNHOVERED}`,
+ color: 'white',
+ boxSizing: 'border-box',
+ height: 40,
+ justifyContent: 'space-between',
+ paddingLeft: 16,
+ paddingRight: 14,
+ width: 172,
+};
+
+const swatch: React.CSSProperties = {
+ border: '1px solid rgba(255, 255, 255, 0.9)',
+ borderRadius: 999,
+ boxSizing: 'border-box',
+ height: 26,
+ width: 26,
+};
+
+const transparentSwatch: React.CSSProperties = {
+ ...swatch,
+ backgroundColor: '#f7f7f7',
+ backgroundImage:
+ 'linear-gradient(45deg, #9b9b9b 25%, transparent 25%), linear-gradient(-45deg, #9b9b9b 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #9b9b9b 75%), linear-gradient(-45deg, transparent 75%, #9b9b9b 75%)',
+ backgroundPosition: '0 0, 0 13px, 13px -13px, -13px 0',
+ backgroundSize: '26px 26px',
+};
+
+const formatNumber = (value: number) => {
+ return value.toFixed(2);
+};
+
+const formatDegrees = (value: number) => {
+ return `${Math.round(value)}°`;
+};
+
+const getRotation = (frame: number) => {
+ if (frame < ROTATION_START) {
+ return 0;
+ }
+
+ return ((frame - ROTATION_START) / ROTATION_DURATION) * 360;
+};
+
+const getHalftoneDotSize = (frame: number) => {
+ return interpolate(
+ frame,
+ [HALFTONE_DOT_SIZE_TWEAK_START, HALFTONE_DOT_SIZE_TWEAK_END],
+ [HALFTONE_DOT_SIZE_START, HALFTONE_DOT_SIZE_END],
+ clamp,
+ );
+};
+
+const getHalftoneShape = (frame: number): 'circle' | 'line' => {
+ return frame >= HALFTONE_SHAPE_TWEAK_FRAME ? 'line' : 'circle';
+};
+
+const getTransitionProgress = (frame: number, start: number) => {
+ return interpolate(
+ frame,
+ [start, start + PREVIEW_CROSSFADE_DURATION],
+ [0, 1],
+ clamp,
+ );
+};
+
+const getHighlightOpacity = ({
+ frame,
+ start,
+ end,
+ fadeDuration = 10,
+}: {
+ readonly frame: number;
+ readonly start: number;
+ readonly end: number;
+ readonly fadeDuration?: number;
+}) => {
+ const fadeIn = interpolate(
+ frame,
+ [start - fadeDuration, start],
+ [0, 1],
+ clamp,
+ );
+ const fadeOut = interpolate(frame, [end, end + fadeDuration], [1, 0], clamp);
+
+ return Math.min(fadeIn, fadeOut);
+};
+
+const getHighlightBackground = (opacity: number) => {
+ return opacity > 0
+ ? `hsla(0, 0%, 100%, ${ROW_HIGHLIGHT_OPACITY * opacity})`
+ : 'transparent';
+};
+
+const getOriginKnobProgress = (frame: number) => {
+ return getHighlightOpacity({
+ frame,
+ start: ORIGIN_MOVE_START,
+ end: ORIGIN_MOVE_END + 22,
+ fadeDuration: 12,
+ });
+};
+
+const KeyframeDiamond: React.FC<{
+ readonly active: boolean;
+}> = ({active}) => {
+ return (
+ <svg
+ width={KEYFRAME_DIAMOND_SIZE}
+ height={KEYFRAME_DIAMOND_SIZE}
+ viewBox="0 0 12 12"
+ style={{
+ display: 'block',
+ overflow: 'visible',
+ }}
+ >
+ <polygon
+ points="6 1.5 10.5 6 6 10.5 1.5 6"
+ fill={active ? STUDIO_BLUE : KEYFRAME_INACTIVE}
+ stroke="rgba(0, 0, 0, 0.45)"
+ strokeWidth="1"
+ strokeLinejoin="round"
+ />
+ </svg>
+ );
+};
+
+const ParamRow: React.FC<{
+ readonly label: string;
+ readonly activeDiamond?: boolean;
+ readonly highlightOpacity?: number;
+ readonly children: React.ReactNode;
+}> = ({label, activeDiamond = false, highlightOpacity = 0, children}) => {
+ return (
+ <div
+ style={{
+ ...rowStyle,
+ backgroundColor: getHighlightBackground(highlightOpacity),
+ }}
+ >
+ <div style={rowContent}>
+ <div
+ style={{
+ alignItems: 'center',
+ display: 'flex',
+ justifyContent: 'center',
+ width: 52,
+ }}
+ >
+ <KeyframeDiamond active={activeDiamond} />
+ </div>
+ <div style={rowLabel}>{label}</div>
+ <div
+ style={{
+ alignItems: 'center',
+ display: 'flex',
+ flex: 1,
+ minWidth: 0,
+ }}
+ >
+ {children}
+ </div>
+ </div>
+ </div>
+ );
+};
+
+const ColorsValue: React.FC = () => {
+ return (
+ <div style={colorsField}>
+ {STARBURST_COLORS.map((color) => {
+ const isTransparent = color.includes(', 0)');
+
+ return (
+ <div
+ key={color}
+ style={
+ isTransparent
+ ? transparentSwatch
+ : {
+ ...swatch,
+ backgroundColor: color,
+ }
+ }
+ />
+ );
+ })}
+ </div>
+ );
+};
+
+const EnumValue: React.FC<{
+ readonly value: string;
+}> = ({value}) => {
+ return (
+ <div style={enumFieldBox}>
+ <span>{value}</span>
+ <svg width="13" viewBox="0 0 320 512">
+ <path
+ fill="currentColor"
+ d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"
+ />
+ </svg>
+ </div>
+ );
+};
+
+const EffectArrow: React.FC<{
+ readonly expandProgress: number;
+}> = ({expandProgress}) => {
+ return (
+ <div
+ style={{
+ ...effectArrow,
+ transform: `rotate(${expandProgress * 90}deg)`,
+ }}
+ >
+ <svg width="23" height="23" viewBox="0 0 8 8" style={effectArrowSvg}>
+ <path d="M2 1L6 4L2 7Z" fill="#ccc" />
+ </svg>
+ </div>
+ );
+};
+
+const EffectToggle: React.FC<{
+ readonly enabled: boolean;
+ readonly iconScale?: number;
+}> = ({enabled, iconScale = 1}) => {
+ return (
+ <div style={effectToggle}>
+ {enabled ? (
+ <div
+ style={{
+ ...effectToggleJumpLayer,
+ opacity: iconScale <= 0 ? 0 : 1,
+ }}
+ >
+ <div
+ style={{
+ ...effectToggleIconWrapper,
+ transform: `scale(${iconScale})`,
+ }}
+ >
+ <svg viewBox="0 0 16 16" fill="none" style={effectToggleIcon}>
+ <path
+ d="M4.405 4.48C4.575 3.82 4.865 3.325 5.275 2.995C5.695 2.665 6.25 2.5 6.94 2.5H9.235V4.06H7.045C6.555 4.06 6.235 4.3 6.085 4.78L5.83 5.68H7.975V7.255H5.395L3.805 13H2.02L3.625 7.255H1.96V5.68H4.075L4.405 4.48ZM8.57102 9.085L6.87602 5.68H8.79602L9.86102 7.99L11.991 5.68H14.331L10.686 9.415L12.426 13H10.491L9.35102 10.585L7.02602 13H4.68602L8.57102 9.085Z"
+ fill="white"
+ />
+ </svg>
+ </div>
+ </div>
+ ) : null}
+ </div>
+ );
+};
+
+const EffectHeader: React.FC<{
+ readonly label: string;
+ readonly enabled: boolean;
+ readonly expandProgress?: number;
+ readonly highlightOpacity?: number;
+ readonly iconScale?: number;
+}> = ({
+ label,
+ enabled,
+ expandProgress = 1,
+ highlightOpacity = 0,
+ iconScale,
+}) => {
+ return (
+ <div
+ style={{
+ ...effectLabel,
+ backgroundColor: getHighlightBackground(highlightOpacity),
+ }}
+ >
+ <div style={effectHeaderContent}>
+ <EffectToggle enabled={enabled} iconScale={iconScale} />
+ <EffectArrow expandProgress={expandProgress} />
+ {label}
+ </div>
+ </div>
+ );
+};
+
+const EffectProperties: React.FC<{
+ readonly children: React.ReactNode;
+ readonly expandProgress?: number;
+ readonly rowCount: number;
+}> = ({children, expandProgress = 1, rowCount}) => {
+ return (
+ <div
+ style={{
+ height: rowCount * PARAM_ROW_HEIGHT * expandProgress,
+ overflow: 'hidden',
+ }}
+ >
+ <div
+ style={{
+ opacity: expandProgress,
+ transform: `translateY(${(1 - expandProgress) * -18}px)`,
+ }}
+ >
+ {children}
+ </div>
+ </div>
+ );
+};
+
+const OriginKnob: React.FC<{
+ readonly frame: number;
+ readonly originY: number;
+}> = ({frame, originY}) => {
+ const progress = getOriginKnobProgress(frame);
+ const scale = interpolate(progress, [0, 1], [0.42, 1], clamp);
+ const centerX = WIDTH * 0.5;
+ const centerY = TOP_HEIGHT * originY;
+
+ if (progress <= 0) {
+ return null;
+ }
+
+ return (
+ <svg
+ width={WIDTH}
+ height={TOP_HEIGHT}
+ viewBox={`0 0 ${WIDTH} ${TOP_HEIGHT}`}
+ style={{
+ left: 0,
+ opacity: progress,
+ overflow: 'visible',
+ pointerEvents: 'none',
+ position: 'absolute',
+ top: 0,
+ }}
+ >
+ <circle
+ cx={centerX}
+ cy={centerY}
+ r={ORIGIN_KNOB_RADIUS * scale}
+ fill="white"
+ stroke={STUDIO_BLUE}
+ strokeWidth={ORIGIN_KNOB_STROKE_WIDTH}
+ vectorEffect="non-scaling-stroke"
+ />
+ </svg>
+ );
+};
+
+const StudioUi: React.FC<{
+ readonly frame: number;
+ readonly originY: number;
+ readonly rotation: number;
+ readonly halftoneDotSize: number;
+ readonly halftoneShape: 'circle' | 'line';
+}> = ({frame, originY, rotation, halftoneDotSize, halftoneShape}) => {
+ const rotationKeyframed = frame >= KEYFRAME_SET_FRAME;
+ const starburstEnabled = frame >= STARBURST_ENABLE_FRAME;
+ const halftoneEnabled = frame >= HALFTONE_ENABLE_FRAME;
+ const starburstHighlightOpacity = getHighlightOpacity({
+ frame,
+ start: STARBURST_ENABLE_FRAME,
+ end: STARBURST_ENABLE_FRAME + EFFECT_EXPAND_DURATION + 10,
+ });
+ const originHighlightOpacity = getHighlightOpacity({
+ frame,
+ start: ORIGIN_MOVE_START,
+ end: ORIGIN_MOVE_END,
+ });
+ const rotationHighlightOpacity = getHighlightOpacity({
+ frame,
+ start: KEYFRAME_SET_FRAME,
+ end: ROTATION_START + ROTATION_DURATION + 20,
+ });
+ const halftoneHighlightOpacity = getHighlightOpacity({
+ frame,
+ start: HALFTONE_ENABLE_FRAME,
+ end: HALFTONE_ENABLE_FRAME + EFFECT_EXPAND_DURATION + 10,
+ });
+ const dotSizeHighlightOpacity = getHighlightOpacity({
+ frame,
+ start: HALFTONE_DOT_SIZE_TWEAK_START,
+ end: HALFTONE_DOT_SIZE_TWEAK_END,
+ });
+ const shapeHighlightOpacity = getHighlightOpacity({
+ frame,
+ start: HALFTONE_SHAPE_TWEAK_FRAME,
+ end: HALFTONE_SHAPE_TWEAK_HIGHLIGHT_END,
+ });
+ const starburstExpandProgress = interpolate(
+ frame,
+ [STARBURST_ENABLE_FRAME, STARBURST_ENABLE_FRAME + EFFECT_EXPAND_DURATION],
+ [0, 1],
+ {
+ ...clamp,
+ easing: Easing.bezier(0.16, 1, 0.3, 1),
+ },
+ );
+ const starburstIconScale = interpolate(
+ frame,
+ [
+ STARBURST_ENABLE_FRAME,
+ STARBURST_ENABLE_FRAME + 5,
+ STARBURST_ENABLE_FRAME + FX_ICON_JUMP_DURATION,
+ ],
+ [0, 1.35, 1],
+ clamp,
+ );
+ const halftoneExpandProgress = interpolate(
+ frame,
+ [HALFTONE_ENABLE_FRAME, HALFTONE_ENABLE_FRAME + EFFECT_EXPAND_DURATION],
+ [0, 1],
+ {
+ ...clamp,
+ easing: Easing.bezier(0.16, 1, 0.3, 1),
+ },
+ );
+ const halftoneIconScale = interpolate(
+ frame,
+ [
+ HALFTONE_ENABLE_FRAME,
+ HALFTONE_ENABLE_FRAME + 5,
+ HALFTONE_ENABLE_FRAME + FX_ICON_JUMP_DURATION,
+ ],
+ [0, 1.35, 1],
+ clamp,
+ );
+
+ return (
+ <div style={studioPanel}>
+ <div style={studioBody}>
+ <div style={inspector}>
+ <div style={paramsPanel}>
+ <EffectHeader
+ label="starburst()"
+ enabled={starburstEnabled}
+ expandProgress={starburstExpandProgress}
+ highlightOpacity={starburstHighlightOpacity}
+ iconScale={starburstIconScale}
+ />
+ <EffectProperties
+ rowCount={5}
+ expandProgress={starburstExpandProgress}
+ >
+ <ParamRow label="Rays">
+ <div style={{...fieldBox, width: 120}}>{RAYS}</div>
+ </ParamRow>
+ <ParamRow label="Colors">
+ <ColorsValue />
+ </ParamRow>
+ <ParamRow
+ label="Rotation"
+ activeDiamond={rotationKeyframed}
+ highlightOpacity={rotationHighlightOpacity}
+ >
+ <div
+ style={{
+ ...fieldBox,
+ width: 130,
+ }}
+ >
+ {formatDegrees(rotation)}
+ </div>
+ </ParamRow>
+ <ParamRow label="Smoothness">
+ <div style={{...fieldBox, width: 120}}>0</div>
+ </ParamRow>
+ <ParamRow
+ label="Origin"
+ highlightOpacity={originHighlightOpacity}
+ >
+ <div style={tinyFieldBox}>0.50</div>
+ <div style={{...tinyFieldBox, marginLeft: 10}}>
+ {formatNumber(originY)}
+ </div>
+ </ParamRow>
+ </EffectProperties>
+ <EffectHeader
+ label="halftone()"
+ enabled={halftoneEnabled}
+ expandProgress={halftoneExpandProgress}
+ highlightOpacity={halftoneHighlightOpacity}
+ iconScale={halftoneIconScale}
+ />
+ <EffectProperties
+ rowCount={HALFTONE_PARAM_ROWS}
+ expandProgress={halftoneExpandProgress}
+ >
+ <ParamRow label="Shape" highlightOpacity={shapeHighlightOpacity}>
+ <EnumValue value={halftoneShape} />
+ </ParamRow>
+ <ParamRow
+ label="Dot Size"
+ highlightOpacity={dotSizeHighlightOpacity}
+ >
+ <div style={{...fieldBox, width: 120}}>
+ {Math.round(halftoneDotSize)}
+ </div>
+ </ParamRow>
+ <ParamRow label="Dot Spacing">
+ <div style={{...fieldBox, width: 120}}>
+ {HALFTONE_DOT_SPACING}
+ </div>
+ </ParamRow>
+ <ParamRow label="Dot Color">
+ <div style={colorsField}>
+ <div
+ style={{
+ ...swatch,
+ backgroundColor: HALFTONE_DOT_COLOR,
+ }}
+ />
+ </div>
+ </ParamRow>
+ </EffectProperties>
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+};
+
+export const StarburstEffectShowcase: React.FC = () => {
+ const frame = useCurrentFrame();
+ const originY = interpolate(
+ frame,
+ [ORIGIN_MOVE_START, ORIGIN_MOVE_END],
+ [0.5, 1],
+ {
+ ...clamp,
+ easing: Easing.bezier(0.16, 1, 0.3, 1),
+ },
+ );
+ const rotation = getRotation(frame);
+ const halftoneDotSize = getHalftoneDotSize(frame);
+ const halftoneShape = getHalftoneShape(frame);
+ const origin: readonly [number, number] = [0.5, originY];
+ const starburstProgress = getTransitionProgress(
+ frame,
+ STARBURST_ENABLE_FRAME,
+ );
+ const halftoneProgress = getTransitionProgress(frame, HALFTONE_ENABLE_FRAME);
+ const lineShapeProgress = getTransitionProgress(
+ frame,
+ HALFTONE_SHAPE_TWEAK_FRAME,
+ );
+ const baseOpacity = 1;
+ const starburstOpacity = starburstProgress;
+ const halftoneCircleOpacity = starburstProgress * halftoneProgress;
+ const halftoneLineOpacity =
+ starburstProgress * halftoneProgress * lineShapeProgress;
+
+ return (
+ <AbsoluteFill style={{backgroundColor: PANEL_BG}}>
+ <div style={topHalf}>
+ <Solid
+ width={WIDTH}
+ height={TOP_HEIGHT}
+ color={SOLID_CREAM}
+ style={{...previewLayerStyle, opacity: baseOpacity}}
+ />
+ <Solid
+ width={WIDTH}
+ height={TOP_HEIGHT}
+ color={SOLID_CREAM}
+ style={{...previewLayerStyle, opacity: starburstOpacity}}
+ effects={[
+ starburst({
+ rays: RAYS,
+ colors: STARBURST_COLORS,
+ rotation,
+ origin,
+ }),
+ ]}
+ />
+ <Solid
+ width={WIDTH}
+ height={TOP_HEIGHT}
+ color={SOLID_CREAM}
+ style={{
+ ...previewLayerStyle,
+ opacity: halftoneCircleOpacity,
+ }}
+ effects={[
+ starburst({
+ rays: RAYS,
+ colors: STARBURST_COLORS,
+ rotation,
+ origin,
+ }),
+ halftone({
+ shape: 'circle',
+ dotSize: halftoneDotSize,
+ dotSpacing: HALFTONE_DOT_SPACING,
+ dotColor: HALFTONE_DOT_COLOR,
+ }),
+ ]}
+ />
+ <Solid
+ width={WIDTH}
+ height={TOP_HEIGHT}
+ color={SOLID_CREAM}
+ style={{...previewLayerStyle, opacity: halftoneLineOpacity}}
+ effects={[
+ starburst({
+ rays: RAYS,
+ colors: STARBURST_COLORS,
+ rotation,
+ origin,
+ }),
+ halftone({
+ shape: 'line',
+ dotSize: halftoneDotSize,
+ dotSpacing: HALFTONE_DOT_SPACING,
+ dotColor: HALFTONE_DOT_COLOR,
+ }),
+ ]}
+ />
+ <OriginKnob frame={frame} originY={originY} />
+ </div>
+ <StudioUi
+ frame={frame}
+ originY={originY}
+ rotation={rotation}
+ halftoneDotSize={halftoneDotSize}
+ halftoneShape={halftoneShape}
+ />
+ </AbsoluteFill>
+ );
+};
diff --git a/packages/brand/src/effects/ZigzagLinearBlurShowcase.tsx b/packages/brand/src/effects/ZigzagLinearBlurShowcase.tsx
new file mode 100644
index 0000000000..c56f8a1193
--- /dev/null
+++ b/packages/brand/src/effects/ZigzagLinearBlurShowcase.tsx
@@ -0,0 +1,280 @@
+import {linearProgressiveBlur} from '@remotion/effects/linear-progressive-blur';
+import {zigzag} from '@remotion/effects/zigzag';
+import React from 'react';
+import {Easing, interpolate, useCurrentFrame} from 'remotion';
+import {
+ ColorSwatches,
+ EffectHeader,
+ EffectProperties,
+ EffectShowcaseShell,
+ EnumValue,
+ ParamRow,
+ PreviewSolidLayer,
+ UvKnob,
+ clamp,
+ fieldBox,
+ formatDegrees,
+ formatNumber,
+ getExpandProgress,
+ getHighlightOpacity,
+ getToggleIconScale,
+ getTransitionProgress,
+ tinyFieldBox,
+} from './EffectShowcaseScaffold';
+
+const ZIGZAG_ENABLE_FRAME = 30;
+const ANGLE_TWEAK_START = 78;
+const ANGLE_TWEAK_END = 126;
+const OFFSET_KEYFRAME_SET_FRAME = 156;
+const OFFSET_START = 174;
+const OFFSET_DURATION = 72;
+const BLUR_ENABLE_FRAME = 270;
+const END_BLUR_TWEAK_START = BLUR_ENABLE_FRAME + 38;
+const END_BLUR_TWEAK_END = END_BLUR_TWEAK_START + 96;
+const BLUR_END_MOVE_START = END_BLUR_TWEAK_END + 36;
+const BLUR_END_MOVE_END = BLUR_END_MOVE_START + 60;
+
+const ZIGZAG_COLORS = ['#0b84f3', '#fff4d8'] as const;
+const ZIGZAG_THICKNESS = 34;
+const ZIGZAG_GAP = 10;
+const ZIGZAG_AMPLITUDE = 58;
+const ZIGZAG_WAVELENGTH = 170;
+const BLUR_START: readonly [number, number] = [0, 0.5];
+const START_BLUR = 0;
+const END_BLUR_START = 0;
+const END_BLUR_END = 72;
+
+export const zigzagLinearBlurShowcaseDurationInFrames = 540;
+
+const getAngle = (frame: number) => {
+ return interpolate(frame, [ANGLE_TWEAK_START, ANGLE_TWEAK_END], [0, 18], {
+ ...clamp,
+ easing: Easing.bezier(0.16, 1, 0.3, 1),
+ });
+};
+
+const getOffset = (frame: number) => {
+ if (frame < OFFSET_START) {
+ return 0;
+ }
+
+ return ((frame - OFFSET_START) / OFFSET_DURATION) * 180;
+};
+
+const getEndBlur = (frame: number) => {
+ return interpolate(
+ frame,
+ [END_BLUR_TWEAK_START, END_BLUR_TWEAK_END],
+ [END_BLUR_START, END_BLUR_END],
+ clamp,
+ );
+};
+
+const getBlurEnd = (frame: number): readonly [number, number] => {
+ const x = interpolate(
+ frame,
+ [BLUR_END_MOVE_START, BLUR_END_MOVE_END],
+ [1, 0.7],
+ clamp,
+ );
+ const y = interpolate(
+ frame,
+ [BLUR_END_MOVE_START, BLUR_END_MOVE_END],
+ [0.5, 1],
+ clamp,
+ );
+
+ return [x, y];
+};
+
+const StudioUi: React.FC<{
+ readonly frame: number;
+ readonly angle: number;
+ readonly offset: number;
+ readonly endBlur: number;
+ readonly blurEnd: readonly [number, number];
+}> = ({frame, angle, offset, endBlur, blurEnd}) => {
+ const zigzagEnabled = frame >= ZIGZAG_ENABLE_FRAME;
+ const blurEnabled = frame >= BLUR_ENABLE_FRAME;
+ const offsetKeyframed = frame >= OFFSET_KEYFRAME_SET_FRAME;
+ const zigzagExpandProgress = getExpandProgress(frame, ZIGZAG_ENABLE_FRAME);
+ const blurExpandProgress = getExpandProgress(frame, BLUR_ENABLE_FRAME);
+
+ return (
+ <>
+ <EffectHeader
+ label="zigzag()"
+ enabled={zigzagEnabled}
+ expandProgress={zigzagExpandProgress}
+ highlightOpacity={getHighlightOpacity({
+ frame,
+ start: ZIGZAG_ENABLE_FRAME,
+ end: ZIGZAG_ENABLE_FRAME + 24,
+ })}
+ iconScale={getToggleIconScale(frame, ZIGZAG_ENABLE_FRAME)}
+ />
+ <EffectProperties rowCount={7} expandProgress={zigzagExpandProgress}>
+ <ParamRow label="Colors">
+ <ColorSwatches colors={ZIGZAG_COLORS} />
+ </ParamRow>
+ <ParamRow label="Direction">
+ <EnumValue value="horizontal" />
+ </ParamRow>
+ <ParamRow
+ label="Angle"
+ highlightOpacity={getHighlightOpacity({
+ frame,
+ start: ANGLE_TWEAK_START,
+ end: ANGLE_TWEAK_END,
+ })}
+ >
+ <div style={{...fieldBox, width: 130}}>{formatDegrees(angle)}</div>
+ </ParamRow>
+ <ParamRow
+ label="Offset"
+ activeDiamond={offsetKeyframed}
+ highlightOpacity={getHighlightOpacity({
+ frame,
+ start: OFFSET_KEYFRAME_SET_FRAME,
+ end: OFFSET_START + OFFSET_DURATION + 18,
+ })}
+ >
+ <div style={{...fieldBox, width: 130}}>{Math.round(offset)}</div>
+ </ParamRow>
+ <ParamRow label="Amplitude">
+ <div style={{...fieldBox, width: 120}}>{ZIGZAG_AMPLITUDE}</div>
+ </ParamRow>
+ <ParamRow label="Wavelength">
+ <div style={{...fieldBox, width: 120}}>{ZIGZAG_WAVELENGTH}</div>
+ </ParamRow>
+ <ParamRow label="Gap">
+ <div style={{...fieldBox, width: 120}}>{ZIGZAG_GAP}</div>
+ </ParamRow>
+ </EffectProperties>
+ <EffectHeader
+ label="linearProgressiveBlur()"
+ enabled={blurEnabled}
+ expandProgress={blurExpandProgress}
+ highlightOpacity={getHighlightOpacity({
+ frame,
+ start: BLUR_ENABLE_FRAME,
+ end: BLUR_ENABLE_FRAME + 24,
+ })}
+ iconScale={getToggleIconScale(frame, BLUR_ENABLE_FRAME)}
+ />
+ <EffectProperties rowCount={4} expandProgress={blurExpandProgress}>
+ <ParamRow label="Start">
+ <div style={tinyFieldBox}>{formatNumber(BLUR_START[0])}</div>
+ <div style={{...tinyFieldBox, marginLeft: 10}}>
+ {formatNumber(BLUR_START[1])}
+ </div>
+ </ParamRow>
+ <ParamRow
+ label="End"
+ highlightOpacity={getHighlightOpacity({
+ frame,
+ start: BLUR_END_MOVE_START,
+ end: BLUR_END_MOVE_END,
+ })}
+ >
+ <div style={tinyFieldBox}>{formatNumber(blurEnd[0])}</div>
+ <div style={{...tinyFieldBox, marginLeft: 10}}>
+ {formatNumber(blurEnd[1])}
+ </div>
+ </ParamRow>
+ <ParamRow label="Start Blur">
+ <div style={{...fieldBox, width: 120}}>{START_BLUR}</div>
+ </ParamRow>
+ <ParamRow
+ label="End Blur"
+ highlightOpacity={getHighlightOpacity({
+ frame,
+ start: END_BLUR_TWEAK_START,
+ end: END_BLUR_TWEAK_END,
+ })}
+ >
+ <div style={{...fieldBox, width: 120}}>{Math.round(endBlur)}</div>
+ </ParamRow>
+ </EffectProperties>
+ </>
+ );
+};
+
+export const ZigzagLinearBlurShowcase: React.FC = () => {
+ const frame = useCurrentFrame();
+ const angle = getAngle(frame);
+ const offset = getOffset(frame);
+ const endBlur = getEndBlur(frame);
+ const blurEnd = getBlurEnd(frame);
+ const zigzagProgress = getTransitionProgress(frame, ZIGZAG_ENABLE_FRAME);
+ const blurProgress = getTransitionProgress(frame, BLUR_ENABLE_FRAME);
+
+ return (
+ <EffectShowcaseShell
+ preview={
+ <>
+ <PreviewSolidLayer />
+ <PreviewSolidLayer
+ opacity={zigzagProgress}
+ effects={[
+ zigzag({
+ colors: ZIGZAG_COLORS,
+ direction: 'horizontal',
+ thickness: ZIGZAG_THICKNESS,
+ gap: ZIGZAG_GAP,
+ angle,
+ offset,
+ amplitude: ZIGZAG_AMPLITUDE,
+ wavelength: ZIGZAG_WAVELENGTH,
+ }),
+ ]}
+ />
+ <PreviewSolidLayer
+ opacity={zigzagProgress * blurProgress}
+ effects={[
+ zigzag({
+ colors: ZIGZAG_COLORS,
+ direction: 'horizontal',
+ thickness: ZIGZAG_THICKNESS,
+ gap: ZIGZAG_GAP,
+ angle,
+ offset,
+ amplitude: ZIGZAG_AMPLITUDE,
+ wavelength: ZIGZAG_WAVELENGTH,
+ }),
+ linearProgressiveBlur({
+ start: BLUR_START,
+ end: blurEnd,
+ startBlur: START_BLUR,
+ endBlur,
+ }),
+ ]}
+ />
+ <UvKnob
+ frame={frame}
+ uv={BLUR_START}
+ start={BLUR_END_MOVE_START}
+ end={BLUR_END_MOVE_END}
+ lineTo={blurEnd}
+ />
+ <UvKnob
+ frame={frame}
+ uv={blurEnd}
+ start={BLUR_END_MOVE_START}
+ end={BLUR_END_MOVE_END}
+ lineTo={BLUR_START}
+ />
+ </>
+ }
+ studio={
+ <StudioUi
+ frame={frame}
+ angle={angle}
+ offset={offset}
+ endBlur={endBlur}
+ blurEnd={blurEnd}
+ />
+ }
+ />
+ );
+};
diff --git a/packages/brand/src/index.css b/packages/brand/src/index.css
index f1d8c73cdc..d4b5078586 100644
--- a/packages/brand/src/index.css
+++ b/packages/brand/src/index.css
@@ -1 +1 @@
-@import "tailwindcss";
+@import 'tailwindcss';
diff --git a/packages/brand/src/video-elements/Prompt.tsx b/packages/brand/src/video-elements/Prompt.tsx
index 1a8805259b..618e03d65a 100644
--- a/packages/brand/src/video-elements/Prompt.tsx
+++ b/packages/brand/src/video-elements/Prompt.tsx
@@ -24,7 +24,9 @@ const LINE_HEIGHT = 54;
const POSTERIZE_FRAMES = 3;
export const PromptSchema = z.object({
- prompt: z.string().describe('The prompt text to display with typing animation'),
+ prompt: z
+ .string()
+ .describe('The prompt text to display with typing animation'),
thinkingIndex: z
.number()
.describe('Index for the thinking animation variant'),
diff --git a/packages/brand/src/video-elements/lower-reference/index.tsx b/packages/brand/src/video-elements/lower-reference/index.tsx
index 132a82ba06..8c69cb81e3 100644
--- a/packages/brand/src/video-elements/lower-reference/index.tsx
+++ b/packages/brand/src/video-elements/lower-reference/index.tsx
@@ -41,7 +41,7 @@ export const LowerReference: React.FC = () => {
transform: `translateY(${interpolate(
entry,
[0, 1],
- [400, 0]
+ [400, 0],
)}px) rotateZ(${interpolate(entry, [0, 1], [Math.PI * 0.05, 0])}rad)`,
}}
>
diff --git a/packages/brand/src/video-elements/step-guide.tsx b/packages/brand/src/video-elements/step-guide.tsx
index 8de129ab93..9518ab6db3 100644
--- a/packages/brand/src/video-elements/step-guide.tsx
+++ b/packages/brand/src/video-elements/step-guide.tsx
@@ -1,3 +1,5 @@
+import {loadFont} from '@remotion/fonts';
+import {Video} from '@remotion/media';
import {
AbsoluteFill,
Img,
@@ -6,9 +8,7 @@ import {
useCurrentFrame,
useVideoConfig,
} from 'remotion';
-import {Video} from '@remotion/media';
import {z} from 'zod';
-import {loadFont} from '@remotion/fonts';
const fontFamily = 'GTPlanar';
diff --git a/packages/brand/src/video-elements/upper-reference/index.tsx b/packages/brand/src/video-elements/upper-reference/index.tsx
index 4df0736441..d5a9f20708 100644
--- a/packages/brand/src/video-elements/upper-reference/index.tsx
+++ b/packages/brand/src/video-elements/upper-reference/index.tsx
@@ -48,7 +48,7 @@ export const GithubRepo: React.FC<GithubRepoProps> = ({repoName}) => {
transform: `translateY(${-interpolate(
entry,
[0, 1],
- [400, 0]
+ [400, 0],
)}px) rotateZ(${interpolate(entry, [0, 1], [Math.PI * 0.05, 0])}rad)`,
}}
>
diff --git a/packages/effects/src/halftone.ts b/packages/effects/src/halftone.ts
index 5a5761e75b..10af7b26ce 100644
--- a/packages/effects/src/halftone.ts
+++ b/packages/effects/src/halftone.ts
@@ -292,7 +292,26 @@ void main() {
coverage = (1.0 - smoothstep(s - 0.5, s + 0.5, abs(diff.x)))
* (1.0 - smoothstep(s - 0.5, s + 0.5, abs(diff.y)));
} else {
+ vec4 localTexColor = texture(uSource, vUv);
+ float localAlpha = localTexColor.a;
+ vec3 localRgb = localAlpha > 0.001 ? localTexColor.rgb / localAlpha : vec3(0.0);
+ float localLum = dot(localRgb, vec3(0.299, 0.587, 0.114));
+ float localLumDefault = localLum * localAlpha + (1.0 - localAlpha);
+ float localDotScale = uShadeOutside
+ ? localLumDefault
+ : 1.0 - localLumDefault;
+
+ if (localDotScale <= 0.12) {
+ fragColor = vec4(0.0);
+ return;
+ }
+
float lineHalf = uDotSize * dotScale * 0.5;
+ if (lineHalf <= 1.0) {
+ fragColor = vec4(0.0);
+ return;
+ }
+
coverage = (1.0 - smoothstep(halfSize - 0.5, halfSize + 0.5, abs(diff.x)))
* (1.0 - smoothstep(lineHalf - 0.5, lineHalf + 0.5, abs(diff.y)));
}