Skip to content

🎥 Make videos programmatically with React

Fix Studio coding handoff window chrome

Jonny Burgere17db8fca978
diff --git a/packages/brand/src/WebMCPPromo/MacBookScene.tsx b/packages/brand/src/WebMCPPromo/MacBookScene.tsx
index 4254be5d42..92b2d0a3fd 100644
--- a/packages/brand/src/WebMCPPromo/MacBookScene.tsx
+++ b/packages/brand/src/WebMCPPromo/MacBookScene.tsx
@@ -19,20 +19,21 @@ loadFont('normal', {
});
export const MacBookScreen: React.FC<{
+ readonly borderRadius: number | null;
readonly children: React.ReactNode;
readonly height: number;
readonly left: number;
readonly showCameraNotch: boolean;
readonly top: number;
readonly width: number;
-}> = ({children, height, left, showCameraNotch, top, width}) => {
+}> = ({borderRadius, children, height, left, showCameraNotch, top, width}) => {
return (
<Interactive.Div
name="Desktop / screen"
style={{
backgroundColor: '#101114',
border: '1px solid #35373d',
- borderRadius: 36,
+ borderRadius: borderRadius ?? 36,
boxShadow: '0 42px 90px rgba(15, 22, 35, 0.24)',
height,
left,
@@ -101,6 +102,7 @@ export const MacBookAppScene = () => {
export const MacBookDesktopScene = () => {
return (
<MacBookScreen
+ borderRadius={null}
height={863}
left={282}
showCameraNotch
diff --git a/packages/brand/src/video-elements/Codex.tsx b/packages/brand/src/video-elements/Codex.tsx
index 31753355f1..042ec4c039 100644
--- a/packages/brand/src/video-elements/Codex.tsx
+++ b/packages/brand/src/video-elements/Codex.tsx
@@ -976,6 +976,7 @@ export const Codex: React.FC<CodexProps> = ({height, width}) => {
style={{
WebkitFontSmoothing: 'antialiased',
backgroundColor: '#ffffff',
+ borderRadius: 10 * scale,
fontFamily:
'-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif',
fontWeight: 400,
@@ -986,6 +987,7 @@ export const Codex: React.FC<CodexProps> = ({height, width}) => {
name="Codex window"
style={{
backgroundColor: '#ffffff',
+ borderRadius: 10,
height: referenceHeight,
left: 0,
overflow: 'hidden',
diff --git a/packages/brand/src/video-elements/Studio.tsx b/packages/brand/src/video-elements/Studio.tsx
index 2cb0363e8c..a08e60cc73 100644
--- a/packages/brand/src/video-elements/Studio.tsx
+++ b/packages/brand/src/video-elements/Studio.tsx
@@ -52,6 +52,7 @@ const BACKGROUND = '#1f2428';
const INPUT_BACKGROUND = '#2f363d';
const LIGHT_TEXT = '#A6A7A9';
const TOOLBAR_FOREGROUND = '#d2d3d4';
+const MENU_BAR_ICON_COLOR = '#d8d8d8';
const WHITE = '#ffffff';
const BLUE = '#0b84f3';
const TIMELINE_BACKGROUND = '#15181B';
@@ -179,7 +180,7 @@ const MenuToolbar: React.FC<{
<Interactive.Div name="Left sidebar toggle" style={{marginRight: 4}}>
<IconButton>
<SidebarIcon
- color={LIGHT_TEXT}
+ color={MENU_BAR_ICON_COLOR}
expanded={responsivenessProgress < 0.5}
side="left"
size={16}
@@ -188,102 +189,32 @@ const MenuToolbar: React.FC<{
</Interactive.Div>
<Interactive.Div name="Remotion menu">
<IconButton width={30}>
- <RemotionGlyph color={TOOLBAR_FOREGROUND} size={14} />
+ <RemotionGlyph color={MENU_BAR_ICON_COLOR} size={14} />
</IconButton>
</Interactive.Div>
<Interactive.Div
- name="File menu"
+ name="Composition breadcrumb"
style={{
alignItems: 'center',
+ color: 'rgba(255, 255, 255, 0.8)',
display: 'flex',
- height: 24,
- paddingLeft: 8,
- paddingRight: 8,
- }}
- >
- File
- </Interactive.Div>
- <Interactive.Div
- name="View menu"
- style={{
- alignItems: 'center',
- display: 'flex',
- height: 24,
- paddingLeft: 8,
- paddingRight: 8,
- }}
- >
- View
- </Interactive.Div>
- <Interactive.Div
- name="Composition menu"
- style={{
- alignItems: 'center',
- display: 'flex',
- height: 24,
- paddingLeft: 8,
- paddingRight: 8,
- }}
- >
- Composition
- </Interactive.Div>
- <Interactive.Div
- name="Tools menu"
- style={{
- alignItems: 'center',
- display: 'flex',
- height: 24,
- paddingLeft: 8,
- paddingRight: 8,
- }}
- >
- Tools
- </Interactive.Div>
- <Interactive.Div
- name="Help menu"
- style={{
- alignItems: 'center',
- display: 'flex',
- height: 24,
- paddingLeft: 8,
- paddingRight: 8,
+ gap: 5,
+ marginLeft: 8,
+ whiteSpace: 'nowrap',
}}
>
- Help
+ <span style={{letterSpacing: 0.08}}>brand / {compositionName}</span>
+ <span style={{color: '#1594f6', display: 'flex'}}>
+ <VscodeIcon size={16} />
+ </span>
+ <CaretIcon
+ color="#5a6065"
+ direction="down"
+ size={13}
+ style={{position: 'relative', left: 4, scale: '0.84 1'}}
+ />
</Interactive.Div>
</div>
- <Interactive.Div
- name="Composition breadcrumb"
- style={{
- alignItems: 'center',
- color: 'rgba(255, 255, 255, 0.8)',
- display: 'flex',
- gap: 5,
- left: '50%',
- position: 'absolute',
- translate: '-50% 0',
- whiteSpace: 'nowrap',
- }}
- >
- <span
- style={{
- letterSpacing: 0.08,
- position: 'relative',
- left: -8,
- }}
- >
- brand / {compositionName}
- </span>
- <span style={{color: '#1594f6', display: 'flex'}}>
- <VscodeIcon size={16} />
- </span>
- <CaretIcon
- color="#5a6065"
- direction="down"
- size={13}
- style={{position: 'relative', left: 4, scale: '0.84 1'}}
- />
- </Interactive.Div>
<div
style={{
alignItems: 'center',
@@ -296,13 +227,13 @@ const MenuToolbar: React.FC<{
>
<Interactive.Div name="Settings">
<IconButton>
- <SettingsIcon color={LIGHT_TEXT} size={16} />
+ <SettingsIcon color={MENU_BAR_ICON_COLOR} size={16} />
</IconButton>
</Interactive.Div>
<Interactive.Div name="Right sidebar toggle">
<IconButton>
<SidebarIcon
- color={LIGHT_TEXT}
+ color={MENU_BAR_ICON_COLOR}
expanded={responsivenessProgress < 0.5}
side="right"
size={16}
@@ -1820,6 +1751,7 @@ export const StudioDeviceFrame: React.FC<StudioReferenceProps> = ({
}}
>
<MacBookScreen
+ borderRadius={null}
height={macBookHeight}
left={0}
showCameraNotch={false}
diff --git a/packages/brand/src/video-elements/StudioCodeHandoff.tsx b/packages/brand/src/video-elements/StudioCodeHandoff.tsx
index 9ee711ea51..c53a13219c 100644
--- a/packages/brand/src/video-elements/StudioCodeHandoff.tsx
+++ b/packages/brand/src/video-elements/StudioCodeHandoff.tsx
@@ -13,6 +13,10 @@ import {Codex} from './Codex';
import {Studio} from './Studio';
import {TextEditor} from './TextEditor';
+const windowBorderRadius = 6;
+const screenInset = 6;
+const deviceBezel = 18;
+
export const StudioCodeHandoff: React.FC = () => {
const frame = useCurrentFrame();
@@ -31,6 +35,7 @@ export const StudioCodeHandoff: React.FC = () => {
}}
>
<MacBookScreen
+ borderRadius={windowBorderRadius + screenInset + deviceBezel}
height={796}
left={0}
showCameraNotch={false}
@@ -41,7 +46,7 @@ export const StudioCodeHandoff: React.FC = () => {
name="Screen viewport"
style={{
backgroundColor: '#101114',
- borderRadius: 19,
+ borderRadius: windowBorderRadius + screenInset,
height: 760,
left: 18,
overflow: 'hidden',
@@ -124,7 +129,6 @@ export const Scene11: React.FC = () => {
<Interactive.Div
name="Codex"
style={{
- backgroundColor: '#f4f4f2',
height: 748,
left: 0,
overflow: 'hidden',
@@ -153,7 +157,7 @@ export const Scene11: React.FC = () => {
<Interactive.Div
name="Remotion Studio"
style={{
- borderRadius: 12,
+ borderRadius: windowBorderRadius,
height: 748,
left: 0,
overflow: 'hidden',
@@ -193,27 +197,17 @@ export const Scene11: React.FC = () => {
}
durationInFrames={742}
frame={655}
- responsivenessProgress={interpolate(
- frame,
- [140, 180],
- [1, 0],
- {
- easing: Easing.bezier(0.16, 1, 0.3, 1),
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- },
- )}
+ responsivenessProgress={interpolate(frame, [140, 180], [1, 0], {
+ easing: Easing.bezier(0.16, 1, 0.3, 1),
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ })}
viewportHeight={748}
- viewportWidth={interpolate(
- frame,
- [140, 180],
- [667, 1340],
- {
- easing: Easing.bezier(0.16, 1, 0.3, 1),
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- },
- )}
+ viewportWidth={interpolate(frame, [140, 180], [667, 1340], {
+ easing: Easing.bezier(0.16, 1, 0.3, 1),
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ })}
/>
</Interactive.Div>
</Interactive.Div>
diff --git a/packages/brand/src/video-elements/TextEditor.tsx b/packages/brand/src/video-elements/TextEditor.tsx
index bb429b8c1f..8e23caaa91 100644
--- a/packages/brand/src/video-elements/TextEditor.tsx
+++ b/packages/brand/src/video-elements/TextEditor.tsx
@@ -95,7 +95,7 @@ export const TextEditor: React.FC<TextEditorProps> = ({
alignItems: 'center',
backgroundColor: 'transparent',
display: 'flex',
- height: 30 * scale,
+ height: 18 * scale,
minWidth: '100%',
}}
>
@@ -104,7 +104,7 @@ export const TextEditor: React.FC<TextEditorProps> = ({
boxSizing: 'border-box',
color: '#858585',
flex: `0 0 ${67 * scale}px`,
- fontSize: 24 * scale,
+ fontSize: 12 * scale,
paddingRight: 25 * scale,
textAlign: 'right',
userSelect: 'none',
@@ -146,13 +146,20 @@ export const TextEditor: React.FC<TextEditorProps> = ({
return (
<Interactive.Div
name="Backdrop"
- style={{backgroundColor: '#000000', inset: 0, position: 'absolute'}}
+ style={{
+ backgroundColor: '#000000',
+ borderRadius: 10 * scale,
+ inset: 0,
+ overflow: 'hidden',
+ position: 'absolute',
+ }}
>
<Interactive.Div
name="Editor window"
style={{
backgroundColor: '#131414',
border: `${scale}px solid #454545`,
+ borderRadius: 10 * scale,
boxSizing: 'border-box',
color: '#cccccc',
fontFamily:
@@ -178,13 +185,37 @@ export const TextEditor: React.FC<TextEditorProps> = ({
position: 'relative',
}}
>
- <div style={{display: 'flex', gap: 8 * scale, left: 8 * scale, position: 'absolute'}}>
+ <div
+ style={{
+ display: 'flex',
+ gap: 8 * scale,
+ left: 8 * scale,
+ position: 'absolute',
+ }}
+ >
{['#ff5f57', '#febc2e', '#28c840'].map((color) => (
- <div key={color} style={{backgroundColor: color, borderRadius: '50%', height: 12 * scale, width: 12 * scale}} />
+ <div
+ key={color}
+ style={{
+ backgroundColor: color,
+ borderRadius: '50%',
+ height: 12 * scale,
+ width: 12 * scale,
+ }}
+ />
))}
</div>
- <div style={{color: '#999999', fontSize: 20 * scale}}>{fileName} — brand</div>
- <div style={{color: '#888888', display: 'flex', position: 'absolute', right: 10 * scale}}>
+ <div style={{color: '#999999', fontSize: 12 * scale}}>
+ {fileName} — brand
+ </div>
+ <div
+ style={{
+ color: '#888888',
+ display: 'flex',
+ position: 'absolute',
+ right: 10 * scale,
+ }}
+ >
<VscodeIcon name="ellipsis" size={14 * scale} />
</div>
</Interactive.Div>
@@ -216,14 +247,31 @@ export const TextEditor: React.FC<TextEditorProps> = ({
<VscodeIcon name={name} size={25 * scale} />
</div>
))}
- <div style={{alignItems: 'center', bottom: 7 * scale, display: 'flex', height: 34 * scale, justifyContent: 'center', position: 'absolute', width: '100%'}}>
+ <div
+ style={{
+ alignItems: 'center',
+ bottom: 7 * scale,
+ display: 'flex',
+ height: 34 * scale,
+ justifyContent: 'center',
+ position: 'absolute',
+ width: '100%',
+ }}
+ >
<VscodeIcon name="settings-gear" size={24 * scale} />
</div>
</Interactive.Div>
<Interactive.Div
name="Editor tabs"
- style={{backgroundColor: '#131414', height: tabBarHeight, left: activityBarWidth, position: 'absolute', right: 0, top: titleBarHeight}}
+ style={{
+ backgroundColor: '#131414',
+ height: tabBarHeight,
+ left: activityBarWidth,
+ position: 'absolute',
+ right: 0,
+ top: titleBarHeight,
+ }}
>
<div style={{display: 'flex', height: '100%'}}>
{tabs.map((tab, index) => (
@@ -236,7 +284,7 @@ export const TextEditor: React.FC<TextEditorProps> = ({
boxSizing: 'border-box',
color: tab.active ? '#e7e7e7' : '#8e8e8e',
display: 'flex',
- fontSize: 20 * scale,
+ fontSize: 12 * scale,
fontStyle: index === 2 ? 'italic' : 'normal',
height: '100%',
paddingLeft: 10 * scale,
@@ -245,49 +293,163 @@ export const TextEditor: React.FC<TextEditorProps> = ({
}}
>
<ReactFileIcon size={14 * scale} />
- <span style={{marginLeft: 7 * scale, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap'}}>{tab.label}</span>
- <span style={{display: 'flex', marginLeft: 'auto'}}><VscodeIcon name="close" size={14 * scale} /></span>
+ <span
+ style={{
+ marginLeft: 7 * scale,
+ overflow: 'hidden',
+ textOverflow: 'ellipsis',
+ whiteSpace: 'nowrap',
+ }}
+ >
+ {tab.label}
+ </span>
+ <span style={{display: 'flex', marginLeft: 'auto'}}>
+ <VscodeIcon name="close" size={14 * scale} />
+ </span>
</div>
))}
</div>
- <div style={{color: '#777777', display: 'flex', position: 'absolute', right: 8 * scale, top: 8 * scale}}><VscodeIcon name="ellipsis" size={14 * scale} /></div>
+ <div
+ style={{
+ color: '#777777',
+ display: 'flex',
+ position: 'absolute',
+ right: 8 * scale,
+ top: 8 * scale,
+ }}
+ >
+ <VscodeIcon name="ellipsis" size={14 * scale} />
+ </div>
</Interactive.Div>
<Interactive.Div
name="Breadcrumbs"
- style={{alignItems: 'center', backgroundColor: '#131414', color: '#9c9c9c', display: 'flex', fontSize: 20 * scale, height: breadcrumbHeight, left: activityBarWidth, paddingLeft: 16 * scale, position: 'absolute', right: 0, top: titleBarHeight + tabBarHeight}}
+ style={{
+ alignItems: 'center',
+ backgroundColor: '#131414',
+ color: '#9c9c9c',
+ display: 'flex',
+ fontSize: 12 * scale,
+ height: breadcrumbHeight,
+ left: activityBarWidth,
+ paddingLeft: 16 * scale,
+ position: 'absolute',
+ right: 0,
+ top: titleBarHeight + tabBarHeight,
+ }}
>
- <span>src</span><span style={{margin: `0 ${6 * scale}px`, color: '#686868'}}>›</span>
- <span>announcements</span><span style={{margin: `0 ${6 * scale}px`, color: '#686868'}}>›</span>
- <span>whats-new-in-remotion</span><span style={{margin: `0 ${6 * scale}px`, color: '#686868'}}>›</span>
- <ReactFileIcon size={13 * scale} /><span style={{marginLeft: 5 * scale}}>{fileName}</span>
- <span style={{margin: `0 ${6 * scale}px`, color: '#686868'}}>›</span><span>…</span>
+ <span>src</span>
+ <span style={{margin: `0 ${6 * scale}px`, color: '#686868'}}>›</span>
+ <span>announcements</span>
+ <span style={{margin: `0 ${6 * scale}px`, color: '#686868'}}>›</span>
+ <span>whats-new-in-remotion</span>
+ <span style={{margin: `0 ${6 * scale}px`, color: '#686868'}}>›</span>
+ <ReactFileIcon size={13 * scale} />
+ <span style={{marginLeft: 5 * scale}}>{fileName}</span>
+ <span style={{margin: `0 ${6 * scale}px`, color: '#686868'}}>›</span>
+ <span>…</span>
</Interactive.Div>
<Interactive.Div
name="Code editor"
- style={{backgroundColor: '#131414', height: editorHeight + 2 * scale, left: activityBarWidth, overflow: 'hidden', position: 'absolute', right: 0, top: editorTop - 2 * scale}}
+ style={{
+ backgroundColor: '#131414',
+ height: editorHeight + 2 * scale,
+ left: activityBarWidth,
+ overflow: 'hidden',
+ position: 'absolute',
+ right: 0,
+ top: editorTop - 2 * scale,
+ }}
>
{highlighted ? (
<Pre
code={highlighted}
handlers={[lineHandler]}
- style={{backgroundColor: 'transparent', color: '#d4d4d4', fontFamily: 'Menlo, Monaco, "Courier New", monospace', fontSize: 24 * scale, fontVariantLigatures: 'none', left: scale, lineHeight: `${30 * scale}px`, margin: 0, minWidth: '100%', position: 'relative', tabSize: 4}}
+ style={{
+ backgroundColor: 'transparent',
+ color: '#d4d4d4',
+ fontFamily: 'Menlo, Monaco, "Courier New", monospace',
+ fontSize: 12 * scale,
+ fontVariantLigatures: 'none',
+ left: scale,
+ lineHeight: `${18 * scale}px`,
+ margin: 0,
+ minWidth: '100%',
+ position: 'relative',
+ tabSize: 4,
+ }}
/>
) : null}
- <div style={{backgroundColor: '#131414', bottom: 0, position: 'absolute', right: 4 * scale, top: 0, width: 14 * scale}}>
- <div style={{backgroundColor: '#5c5d5e', borderRadius: 5 * scale, height: Math.min(707 * scale, editorHeight - 4 * scale), left: scale, position: 'absolute', top: 0, width: 13 * scale}} />
+ <div
+ style={{
+ backgroundColor: '#131414',
+ bottom: 0,
+ position: 'absolute',
+ right: 4 * scale,
+ top: 0,
+ width: 14 * scale,
+ }}
+ >
+ <div
+ style={{
+ backgroundColor: '#5c5d5e',
+ borderRadius: 5 * scale,
+ height: Math.min(707 * scale, editorHeight - 4 * scale),
+ left: scale,
+ position: 'absolute',
+ top: 0,
+ width: 13 * scale,
+ }}
+ />
</div>
</Interactive.Div>
<Interactive.Div
name="Status bar"
- style={{alignItems: 'center', backgroundColor: '#181919', borderTop: `${scale}px solid #2b2b2b`, bottom: 0, boxSizing: 'border-box', color: '#9a9a9a', display: 'flex', fontSize: 20 * scale, height: statusBarHeight, left: 0, paddingLeft: 13 * scale, position: 'absolute', right: 0}}
+ style={{
+ alignItems: 'center',
+ backgroundColor: '#181919',
+ borderTop: `${scale}px solid #2b2b2b`,
+ bottom: 0,
+ boxSizing: 'border-box',
+ color: '#9a9a9a',
+ display: 'flex',
+ fontSize: 12 * scale,
+ height: statusBarHeight,
+ left: 0,
+ paddingLeft: 13 * scale,
+ position: 'absolute',
+ right: 0,
+ }}
>
- <VscodeIcon name="error" size={13 * scale} /><span style={{marginLeft: 4 * scale}}>0</span>
- <span style={{display: 'flex', marginLeft: 7 * scale}}><VscodeIcon name="warning" size={13 * scale} /></span><span style={{marginLeft: 3 * scale}}>0</span>
- <div style={{alignItems: 'center', display: 'flex', gap: 16 * scale, marginLeft: 'auto', paddingRight: 14 * scale}}>
- <span>Ln {code.split('\n').length}, Col 1</span><span>Tab Size: 4</span><span>UTF-8</span><span>LF</span><span>{'{ }'}&nbsp; TypeScript JSX</span><span style={{display: 'flex'}}><VscodeIcon name="copilot" size={14 * scale} /></span><span>✓ oxc</span><span style={{display: 'flex'}}><VscodeIcon name="bell" size={14 * scale} /></span>
+ <VscodeIcon name="error" size={13 * scale} />
+ <span style={{marginLeft: 4 * scale}}>0</span>
+ <span style={{display: 'flex', marginLeft: 7 * scale}}>
+ <VscodeIcon name="warning" size={13 * scale} />
+ </span>
+ <span style={{marginLeft: 3 * scale}}>0</span>
+ <div
+ style={{
+ alignItems: 'center',
+ display: 'flex',
+ gap: 16 * scale,
+ marginLeft: 'auto',
+ paddingRight: 14 * scale,
+ }}
+ >
+ <span>Ln {code.split('\n').length}, Col 1</span>
+ <span>Tab Size: 4</span>
+ <span>UTF-8</span>
+ <span>LF</span>
+ <span>{'{ }'}&nbsp; TypeScript JSX</span>
+ <span style={{display: 'flex'}}>
+ <VscodeIcon name="copilot" size={14 * scale} />
+ </span>
+ <span>✓ oxc</span>
+ <span style={{display: 'flex'}}>
+ <VscodeIcon name="bell" size={14 * scale} />
+ </span>
</div>
</Interactive.Div>
</Interactive.Div>
diff --git a/packages/brand/src/video-elements/studio-icons.tsx b/packages/brand/src/video-elements/studio-icons.tsx
index db31ea863d..05e15cdb02 100644
--- a/packages/brand/src/video-elements/studio-icons.tsx
+++ b/packages/brand/src/video-elements/studio-icons.tsx
@@ -53,12 +53,17 @@ export type SidebarIconProps = StudioIconProps & {
export const SidebarIcon: React.FC<SidebarIconProps> = ({
expanded = true,
side,
+ style,
...props
}) => {
const dividerX = side === 'left' ? 5.75 : 10.25;
return (
- <SvgIcon viewBox="0 0 16 16" {...props}>
+ <SvgIcon
+ viewBox="0 0 16 16"
+ style={{overflow: 'visible', ...style}}
+ {...props}
+ >
<rect
x="0.5"
y="0.5"