Skip to content

🎥 Make videos programmatically with React

remotion: Clip managed absolute-fill layouts by default

Jonny Burger23e6c18d4c20
diff --git a/packages/core/src/Interactive.tsx b/packages/core/src/Interactive.tsx
index 1a5184adbe..f81394955e 100644
--- a/packages/core/src/Interactive.tsx
+++ b/packages/core/src/Interactive.tsx
@@ -462,7 +462,7 @@ const withSchema: WithSchema = (untypedOptions: unknown) => {
? {
width,
height,
- style: croppedStyle ?? undefined,
+ style: {overflow: 'hidden', ...croppedStyle},
ref: ref as React.ForwardedRef<HTMLDivElement>,
}
: {})}
diff --git a/packages/docs/docs/interactive-with-schema.mdx b/packages/docs/docs/interactive-with-schema.mdx
index 4e46f10917..900047ddf1 100644
--- a/packages/docs/docs/interactive-with-schema.mdx
+++ b/packages/docs/docs/interactive-with-schema.mdx
@@ -94,7 +94,7 @@ If set to false, you need to manually forward all props.
Requires `wrapInSequence: true`. Defaults to `'none'`, which forwards styles to `Component` without adding a container.
-Set to `'absolute-fill'` to give the component a full-size, absolutely positioned container. Styles, transforms, cropping, and premount styles apply to this container. It shares the component's timeline item, so no extra layout layer appears in Studio. The returned component also accepts `width` and `height` to size the container and set the dimensions reported by `useVideoConfig()`.
+Set to `'absolute-fill'` to give the component a full-size, absolutely positioned container with `overflow: 'hidden'` by default. Set `style={{overflow: 'visible'}}` on the returned component to let content extend beyond its bounds. Styles, transforms, cropping, and premount styles apply to this container. It shares the component's timeline item, so no extra layout layer appears in Studio. The returned component also accepts `width` and `height` to size the container and set the dimensions reported by `useVideoConfig()`.
The inner component can return a fragment and does not need to forward styles:
diff --git a/packages/jonnys-videos/src/how-can-remotion-be-free/FirstCustomerChart.tsx b/packages/jonnys-videos/src/how-can-remotion-be-free/FirstCustomerChart.tsx
index 63bd1919c5..892eae78bf 100644
--- a/packages/jonnys-videos/src/how-can-remotion-be-free/FirstCustomerChart.tsx
+++ b/packages/jonnys-videos/src/how-can-remotion-be-free/FirstCustomerChart.tsx
@@ -1,11 +1,5 @@
import React from 'react';
-import {
- AbsoluteFill,
- Easing,
- Interactive,
- interpolate,
- useCurrentFrame,
-} from 'remotion';
+import {Easing, Interactive, interpolate, useCurrentFrame} from 'remotion';
export const FIRST_CUSTOMER_CHART_DURATION_IN_FRAMES = 221;
@@ -58,299 +52,297 @@ const FirstCustomerChartInner: React.FC = () => {
const frame = useCurrentFrame();
return (
- <AbsoluteFill showInTimeline={false} style={{overflow: 'hidden'}}>
+ <Interactive.Div
+ name="First customer chart"
+ style={{
+ height: 790,
+ left: 52,
+ opacity: interpolate(frame, [0, 7, 211, 220], [0, 1, 1, 0], {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ }),
+ position: 'absolute',
+ right: 52,
+ top: 166,
+ translate: interpolate(frame, [0, 12], ['0px 34px', '0px 0px'], {
+ easing: Easing.bezier(0.16, 1, 0.3, 1),
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ }),
+ }}
+ >
<Interactive.Div
- name="First customer chart"
+ name="Four months heading"
style={{
- height: 790,
- left: 52,
- opacity: interpolate(frame, [0, 7, 211, 220], [0, 1, 1, 0], {
+ color: '#91b7ff',
+ fontFamily: FONT_FAMILY,
+ fontSize: 42,
+ fontWeight: 700,
+ letterSpacing: 2.2,
+ opacity: interpolate(frame, [2, 10], [0, 1], {
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
}),
position: 'absolute',
- right: 52,
- top: 166,
- translate: interpolate(frame, [0, 12], ['0px 34px', '0px 0px'], {
- easing: Easing.bezier(0.16, 1, 0.3, 1),
+ rotate: '-1.2deg',
+ textTransform: 'uppercase',
+ top: 0,
+ }}
+ >
+ Four months to find...
+ </Interactive.Div>
+
+ <Interactive.Div
+ name="First customer heading"
+ style={{
+ color: '#f5f0dc',
+ fontFamily: FONT_FAMILY,
+ fontSize: 82,
+ fontWeight: 700,
+ letterSpacing: -1.8,
+ lineHeight: 1,
+ opacity: interpolate(frame, [42, 51], [0, 1], {
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
}),
+ position: 'absolute',
+ rotate: '0.6deg',
+ top: 51,
}}
>
- <Interactive.Div
- name="Four months heading"
- style={{
- color: '#91b7ff',
- fontFamily: FONT_FAMILY,
- fontSize: 42,
- fontWeight: 700,
- letterSpacing: 2.2,
- opacity: interpolate(frame, [2, 10], [0, 1], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- }),
- position: 'absolute',
- rotate: '-1.2deg',
- textTransform: 'uppercase',
- top: 0,
- }}
- >
- Four months to find...
- </Interactive.Div>
-
- <Interactive.Div
- name="First customer heading"
- style={{
- color: '#f5f0dc',
- fontFamily: FONT_FAMILY,
- fontSize: 82,
- fontWeight: 700,
- letterSpacing: -1.8,
- lineHeight: 1,
- opacity: interpolate(frame, [42, 51], [0, 1], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- }),
- position: 'absolute',
- rotate: '0.6deg',
- top: 51,
- }}
- >
- the first customer
- </Interactive.Div>
-
- <svg
- aria-hidden="true"
- viewBox="0 0 976 520"
- style={{
- height: 520,
- left: 0,
- overflow: 'visible',
- position: 'absolute',
- top: 164,
- width: 976,
- }}
- >
- <defs>
- <clipPath id="june-bar-reveal">
- <rect
- x={760}
- y={interpolate(frame, [107, 129], [410, 40], {
- easing: Easing.bezier(0.16, 1, 0.3, 1),
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- })}
- width={210}
- height={interpolate(frame, [107, 129], [0, 370], {
- easing: Easing.bezier(0.16, 1, 0.3, 1),
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- })}
- />
- </clipPath>
- </defs>
- <path
- d="M13 407 C190 398 364 412 535 404 C694 397 833 410 964 401"
- fill="none"
- pathLength={1}
- stroke="#6f98df"
- strokeDasharray={1}
- strokeDashoffset={interpolate(frame, [4, 18], [1, 0], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- })}
- strokeLinecap="round"
- strokeWidth={5}
- />
- <path
- d="M19 413 C206 407 371 419 546 411 C719 404 849 417 958 409"
- fill="none"
- pathLength={1}
- stroke="rgba(111, 152, 223, 0.28)"
- strokeDasharray={1}
- strokeDashoffset={interpolate(frame, [7, 21], [1, 0], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- })}
- strokeLinecap="round"
- strokeWidth={3}
- />
-
- {MONTHS.map((month) => (
- <ZeroMonth key={month.label} {...month} />
- ))}
+ the first customer
+ </Interactive.Div>
- <g clipPath="url(#june-bar-reveal)">
- <path
- d="M805 399 C808 325 801 223 811 126 C845 119 896 126 925 120 C929 226 922 321 934 399 C895 394 849 404 805 399Z"
- fill="rgba(255, 86, 61, 0.22)"
- stroke="#ff674f"
- strokeLinejoin="round"
- strokeWidth={8}
- />
- <path
- d="M816 390 C820 303 811 218 821 137 C850 132 891 138 915 130 C917 229 913 316 924 389"
- fill="none"
- stroke="rgba(255, 199, 188, 0.62)"
- strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={3}
- />
- <path
- d="M827 381 L909 145 M841 390 L922 177 M812 352 L904 126"
- fill="none"
- stroke="rgba(255, 103, 79, 0.35)"
- strokeLinecap="round"
- strokeWidth={5}
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 976 520"
+ style={{
+ height: 520,
+ left: 0,
+ overflow: 'visible',
+ position: 'absolute',
+ top: 164,
+ width: 976,
+ }}
+ >
+ <defs>
+ <clipPath id="june-bar-reveal">
+ <rect
+ x={760}
+ y={interpolate(frame, [107, 129], [410, 40], {
+ easing: Easing.bezier(0.16, 1, 0.3, 1),
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ })}
+ width={210}
+ height={interpolate(frame, [107, 129], [0, 370], {
+ easing: Easing.bezier(0.16, 1, 0.3, 1),
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ })}
/>
- </g>
+ </clipPath>
+ </defs>
+ <path
+ d="M13 407 C190 398 364 412 535 404 C694 397 833 410 964 401"
+ fill="none"
+ pathLength={1}
+ stroke="#6f98df"
+ strokeDasharray={1}
+ strokeDashoffset={interpolate(frame, [4, 18], [1, 0], {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ })}
+ strokeLinecap="round"
+ strokeWidth={5}
+ />
+ <path
+ d="M19 413 C206 407 371 419 546 411 C719 404 849 417 958 409"
+ fill="none"
+ pathLength={1}
+ stroke="rgba(111, 152, 223, 0.28)"
+ strokeDasharray={1}
+ strokeDashoffset={interpolate(frame, [7, 21], [1, 0], {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ })}
+ strokeLinecap="round"
+ strokeWidth={3}
+ />
+ {MONTHS.map((month) => (
+ <ZeroMonth key={month.label} {...month} />
+ ))}
+
+ <g clipPath="url(#june-bar-reveal)">
<path
- d="M781 83 C816 53 924 50 956 88 C981 119 947 151 879 154 C812 157 764 131 781 83Z"
- fill="none"
- pathLength={1}
+ d="M805 399 C808 325 801 223 811 126 C845 119 896 126 925 120 C929 226 922 321 934 399 C895 394 849 404 805 399Z"
+ fill="rgba(255, 86, 61, 0.22)"
stroke="#ff674f"
- strokeDasharray={1}
- strokeDashoffset={interpolate(frame, [129, 143], [1, 0], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- })}
- strokeLinecap="round"
strokeLinejoin="round"
- strokeWidth={6}
+ strokeWidth={8}
/>
<path
- d="M770 74 C817 41 935 48 962 94"
+ d="M816 390 C820 303 811 218 821 137 C850 132 891 138 915 130 C917 229 913 316 924 389"
fill="none"
- pathLength={1}
- stroke="rgba(255, 103, 79, 0.46)"
- strokeDasharray={1}
- strokeDashoffset={interpolate(frame, [134, 146], [1, 0], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- })}
+ stroke="rgba(255, 199, 188, 0.62)"
strokeLinecap="round"
+ strokeLinejoin="round"
strokeWidth={3}
/>
<path
- d="M748 194 C774 179 790 161 811 139 M795 139 L813 137 L809 156"
+ d="M827 381 L909 145 M841 390 L922 177 M812 352 L904 126"
fill="none"
- pathLength={1}
- stroke="#ff674f"
- strokeDasharray={1}
- strokeDashoffset={interpolate(frame, [137, 150], [1, 0], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- })}
+ stroke="rgba(255, 103, 79, 0.35)"
strokeLinecap="round"
- strokeLinejoin="round"
- strokeWidth={6}
+ strokeWidth={5}
/>
- </svg>
+ </g>
- {MONTHS.map((month) => (
- <React.Fragment key={month.label}>
- <Interactive.Div
- name={`${month.label} value`}
- style={{
- color: '#f5f0dc',
- fontFamily: FONT_FAMILY,
- fontSize: 48,
- fontWeight: 700,
- left: month.x - 58,
- opacity: interpolate(
- frame,
- [month.delay + 2, month.delay + 8],
- [0, 1],
- {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- },
- ),
- position: 'absolute',
- rotate: `${month.rotate}deg`,
- textAlign: 'center',
- top: 451,
- width: 120,
- }}
- >
- {month.value}
- </Interactive.Div>
- <Interactive.Div
- name={`${month.label} label`}
- style={{
- color: '#c9c2ad',
- fontFamily: FONT_FAMILY,
- fontSize: 35,
- fontWeight: 700,
- left: month.x - 78,
- lineHeight: 1,
- opacity: interpolate(
- frame,
- [month.delay + 5, month.delay + 11],
- [0, 1],
- {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- },
- ),
- position: 'absolute',
- rotate: `${month.rotate * -0.6}deg`,
- textAlign: 'center',
- top: 589,
- width: 160,
- }}
- >
- {month.label}
- </Interactive.Div>
- </React.Fragment>
- ))}
+ <path
+ d="M781 83 C816 53 924 50 956 88 C981 119 947 151 879 154 C812 157 764 131 781 83Z"
+ fill="none"
+ pathLength={1}
+ stroke="#ff674f"
+ strokeDasharray={1}
+ strokeDashoffset={interpolate(frame, [129, 143], [1, 0], {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ })}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth={6}
+ />
+ <path
+ d="M770 74 C817 41 935 48 962 94"
+ fill="none"
+ pathLength={1}
+ stroke="rgba(255, 103, 79, 0.46)"
+ strokeDasharray={1}
+ strokeDashoffset={interpolate(frame, [134, 146], [1, 0], {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ })}
+ strokeLinecap="round"
+ strokeWidth={3}
+ />
+ <path
+ d="M748 194 C774 179 790 161 811 139 M795 139 L813 137 L809 156"
+ fill="none"
+ pathLength={1}
+ stroke="#ff674f"
+ strokeDasharray={1}
+ strokeDashoffset={interpolate(frame, [137, 150], [1, 0], {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ })}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ strokeWidth={6}
+ />
+ </svg>
- <Interactive.Div
- name="June revenue"
- style={{
- color: '#fff4e7',
- fontFamily: FONT_FAMILY,
- fontSize: 49,
- fontWeight: 700,
- left: 770,
- opacity: interpolate(frame, [123, 132], [0, 1], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- }),
- position: 'absolute',
- rotate: '-2deg',
- textAlign: 'center',
- top: 224,
- width: 200,
- }}
- >
- $15 MRR
- </Interactive.Div>
- <Interactive.Div
- name="June 2021 label"
- style={{
- color: '#ff8b78',
- fontFamily: FONT_FAMILY,
- fontSize: 38,
- fontWeight: 700,
- left: 788,
- opacity: interpolate(frame, [111, 120], [0, 1], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- }),
- position: 'absolute',
- rotate: '-1.5deg',
- textAlign: 'center',
- top: 589,
- width: 176,
- }}
- >
- June '21
- </Interactive.Div>
+ {MONTHS.map((month) => (
+ <React.Fragment key={month.label}>
+ <Interactive.Div
+ name={`${month.label} value`}
+ style={{
+ color: '#f5f0dc',
+ fontFamily: FONT_FAMILY,
+ fontSize: 48,
+ fontWeight: 700,
+ left: month.x - 58,
+ opacity: interpolate(
+ frame,
+ [month.delay + 2, month.delay + 8],
+ [0, 1],
+ {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ },
+ ),
+ position: 'absolute',
+ rotate: `${month.rotate}deg`,
+ textAlign: 'center',
+ top: 451,
+ width: 120,
+ }}
+ >
+ {month.value}
+ </Interactive.Div>
+ <Interactive.Div
+ name={`${month.label} label`}
+ style={{
+ color: '#c9c2ad',
+ fontFamily: FONT_FAMILY,
+ fontSize: 35,
+ fontWeight: 700,
+ left: month.x - 78,
+ lineHeight: 1,
+ opacity: interpolate(
+ frame,
+ [month.delay + 5, month.delay + 11],
+ [0, 1],
+ {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ },
+ ),
+ position: 'absolute',
+ rotate: `${month.rotate * -0.6}deg`,
+ textAlign: 'center',
+ top: 589,
+ width: 160,
+ }}
+ >
+ {month.label}
+ </Interactive.Div>
+ </React.Fragment>
+ ))}
+
+ <Interactive.Div
+ name="June revenue"
+ style={{
+ color: '#fff4e7',
+ fontFamily: FONT_FAMILY,
+ fontSize: 49,
+ fontWeight: 700,
+ left: 770,
+ opacity: interpolate(frame, [123, 132], [0, 1], {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ }),
+ position: 'absolute',
+ rotate: '-2deg',
+ textAlign: 'center',
+ top: 224,
+ width: 200,
+ }}
+ >
+ $15 MRR
+ </Interactive.Div>
+ <Interactive.Div
+ name="June 2021 label"
+ style={{
+ color: '#ff8b78',
+ fontFamily: FONT_FAMILY,
+ fontSize: 38,
+ fontWeight: 700,
+ left: 788,
+ opacity: interpolate(frame, [111, 120], [0, 1], {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ }),
+ position: 'absolute',
+ rotate: '-1.5deg',
+ textAlign: 'center',
+ top: 589,
+ width: 176,
+ }}
+ >
+ June '21
</Interactive.Div>
- </AbsoluteFill>
+ </Interactive.Div>
);
};
diff --git a/packages/jonnys-videos/src/how-can-remotion-be-free/PremiumVersion.tsx b/packages/jonnys-videos/src/how-can-remotion-be-free/PremiumVersion.tsx
index 162ef529ad..2218a3d2d5 100644
--- a/packages/jonnys-videos/src/how-can-remotion-be-free/PremiumVersion.tsx
+++ b/packages/jonnys-videos/src/how-can-remotion-be-free/PremiumVersion.tsx
@@ -1,11 +1,5 @@
import React from 'react';
-import {
- AbsoluteFill,
- Easing,
- Interactive,
- interpolate,
- useCurrentFrame,
-} from 'remotion';
+import {Easing, Interactive, interpolate, useCurrentFrame} from 'remotion';
export const PREMIUM_VERSION_DURATION_IN_FRAMES = 36;
@@ -139,27 +133,25 @@ const TierRow: React.FC<{index: number; label: string; rings: number}> = ({
const PremiumVersionInner: React.FC = () => {
return (
- <AbsoluteFill showInTimeline={false} style={{overflow: 'hidden'}}>
- <div
- style={{
- display: 'flex',
- flexDirection: 'column',
- gap: 8,
- left: 92,
- position: 'absolute',
- top: 42,
- }}
- >
- {TIERS.map((tier, index) => (
- <TierRow
- key={tier.label}
- index={index}
- label={tier.label}
- rings={tier.rings}
- />
- ))}
- </div>
- </AbsoluteFill>
+ <div
+ style={{
+ display: 'flex',
+ flexDirection: 'column',
+ gap: 8,
+ left: 92,
+ position: 'absolute',
+ top: 42,
+ }}
+ >
+ {TIERS.map((tier, index) => (
+ <TierRow
+ key={tier.label}
+ index={index}
+ label={tier.label}
+ rings={tier.rings}
+ />
+ ))}
+ </div>
);
};
diff --git a/packages/jonnys-videos/src/how-can-remotion-be-free/UnrulyOutcome.tsx b/packages/jonnys-videos/src/how-can-remotion-be-free/UnrulyOutcome.tsx
index 37ff9df537..643c3cb27e 100644
--- a/packages/jonnys-videos/src/how-can-remotion-be-free/UnrulyOutcome.tsx
+++ b/packages/jonnys-videos/src/how-can-remotion-be-free/UnrulyOutcome.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import {AbsoluteFill, Interactive} from 'remotion';
+import {Interactive} from 'remotion';
export const UNRULY_OUTCOME_DURATION_IN_FRAMES = 70;
@@ -92,23 +92,21 @@ const OutcomeRow: React.FC<{item: string; index: number}> = ({item, index}) => {
const UnrulyOutcomeInner: React.FC = () => {
return (
- <AbsoluteFill showInTimeline={false} style={{overflow: 'hidden'}}>
- <div
- style={{
- display: 'flex',
- flexDirection: 'column',
- gap: 12,
- left: 58,
- position: 'absolute',
- right: 58,
- top: 135,
- }}
- >
- {OUTCOMES.map((item, index) => (
- <OutcomeRow key={item} item={item} index={index} />
- ))}
- </div>
- </AbsoluteFill>
+ <div
+ style={{
+ display: 'flex',
+ flexDirection: 'column',
+ gap: 12,
+ left: 58,
+ position: 'absolute',
+ right: 58,
+ top: 135,
+ }}
+ >
+ {OUTCOMES.map((item, index) => (
+ <OutcomeRow key={item} item={item} index={index} />
+ ))}
+ </div>
);
};
diff --git a/packages/jonnys-videos/src/how-can-remotion-be-free/ZurichPhoto.tsx b/packages/jonnys-videos/src/how-can-remotion-be-free/ZurichPhoto.tsx
index 3bda5d7759..3fbb592cbc 100644
--- a/packages/jonnys-videos/src/how-can-remotion-be-free/ZurichPhoto.tsx
+++ b/packages/jonnys-videos/src/how-can-remotion-be-free/ZurichPhoto.tsx
@@ -1,6 +1,5 @@
import React from 'react';
import {
- AbsoluteFill,
CanvasImage,
Easing,
Interactive,
@@ -15,86 +14,79 @@ const ZurichPhotoInner: React.FC = () => {
const frame = useCurrentFrame();
return (
- <AbsoluteFill showInTimeline={false} style={{overflow: 'hidden'}}>
- <Interactive.Div
- name="Zurich full-screen photograph"
+ <Interactive.Div
+ name="Zurich full-screen photograph"
+ style={{
+ inset: 0,
+ opacity: interpolate(frame, [0, 5, 40, 47], [0, 1, 1, 0], {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ }),
+ overflow: 'hidden',
+ position: 'absolute',
+ }}
+ >
+ <CanvasImage
+ name="Zurich Bahnhofstrasse photograph"
+ src={asset('zurich-bahnhofstrasse.jpg')}
style={{
- inset: 0,
- opacity: interpolate(frame, [0, 5, 40, 47], [0, 1, 1, 0], {
+ filter: 'saturate(1.04) contrast(1.02)',
+ height: 1920,
+ left: -300,
+ position: 'absolute',
+ scale: interpolate(frame, [0, 47], [1.035, 1], {
+ easing: Easing.bezier(0.16, 1, 0.3, 1),
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
+ output: 'perceptual-scale',
}),
- overflow: 'hidden',
+ top: 0,
+ width: 2560,
+ }}
+ />
+ <Interactive.Div
+ name="Caption contrast gradient"
+ style={{
+ background:
+ 'linear-gradient(180deg, rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, 0.08) 51%, rgba(0, 0, 0, 0.52) 82%, rgba(0, 0, 0, 0.68) 100%)',
+ inset: 0,
position: 'absolute',
}}
- >
- <CanvasImage
- name="Zurich Bahnhofstrasse photograph"
- src={asset('zurich-bahnhofstrasse.jpg')}
- style={{
- filter: 'saturate(1.04) contrast(1.02)',
- height: 1920,
- left: -300,
- position: 'absolute',
- scale: interpolate(frame, [0, 47], [1.035, 1], {
- easing: Easing.bezier(0.16, 1, 0.3, 1),
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- output: 'perceptual-scale',
- }),
- top: 0,
- width: 2560,
- }}
- />
- <Interactive.Div
- name="Caption contrast gradient"
- style={{
- background:
- 'linear-gradient(180deg, rgba(0, 0, 0, 0) 38%, rgba(0, 0, 0, 0.08) 51%, rgba(0, 0, 0, 0.52) 82%, rgba(0, 0, 0, 0.68) 100%)',
- inset: 0,
- position: 'absolute',
- }}
- />
- <CanvasImage
- name="Flying Zurich watch"
- src={asset('zurich-watch-cutout.png')}
- style={{
- filter: 'drop-shadow(0 28px 24px rgba(0, 0, 0, 0.46))',
- height: 480,
- left: 0,
- position: 'absolute',
- rotate: interpolate(
- frame,
- [0, 24, 47],
- ['-18deg', '8deg', '30deg'],
- {
- easing: Easing.bezier(0.22, 0.72, 0.24, 1),
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- },
- ),
- scale: interpolate(frame, [0, 24, 47], [0.68, 1.06, 0.72], {
+ />
+ <CanvasImage
+ name="Flying Zurich watch"
+ src={asset('zurich-watch-cutout.png')}
+ style={{
+ filter: 'drop-shadow(0 28px 24px rgba(0, 0, 0, 0.46))',
+ height: 480,
+ left: 0,
+ position: 'absolute',
+ rotate: interpolate(frame, [0, 24, 47], ['-18deg', '8deg', '30deg'], {
+ easing: Easing.bezier(0.22, 0.72, 0.24, 1),
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ }),
+ scale: interpolate(frame, [0, 24, 47], [0.68, 1.06, 0.72], {
+ easing: Easing.bezier(0.22, 0.72, 0.24, 1),
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ output: 'perceptual-scale',
+ }),
+ top: 0,
+ translate: interpolate(
+ frame,
+ [0, 24, 47],
+ ['-850px 980px', '180px 560px', '1250px 120px'],
+ {
easing: Easing.bezier(0.22, 0.72, 0.24, 1),
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
- output: 'perceptual-scale',
- }),
- top: 0,
- translate: interpolate(
- frame,
- [0, 24, 47],
- ['-850px 980px', '180px 560px', '1250px 120px'],
- {
- easing: Easing.bezier(0.22, 0.72, 0.24, 1),
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- },
- ),
- width: 720,
- }}
- />
- </Interactive.Div>
- </AbsoluteFill>
+ },
+ ),
+ width: 720,
+ }}
+ />
+ </Interactive.Div>
);
};
diff --git a/packages/jonnys-videos/src/roller-skis/Composition.tsx b/packages/jonnys-videos/src/roller-skis/Composition.tsx
index 97d35d6064..3b1544a19b 100644
--- a/packages/jonnys-videos/src/roller-skis/Composition.tsx
+++ b/packages/jonnys-videos/src/roller-skis/Composition.tsx
@@ -129,59 +129,54 @@ const PresenterZoomInner: React.FC = () => {
});
return (
- <AbsoluteFill showInTimeline={false} style={{overflow: 'hidden'}}>
- <AbsoluteFill
- showInTimeline={false}
- style={{transform: `scale(${zoom})`}}
- >
- <Video
- src={rollerSkiAsset('footage/webcam1790843295628.mp4')}
- durationInFrames={436}
- trimBefore={120}
- style={videoStyle}
- objectFit="cover"
- premountFor={fps}
- effects={[
- lut({content: studioLut}),
- vignette({
- amount: interpolate(frame, [423, 466], [0, 0.55], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- }),
-
- radius: 0.62,
- feather: 0.35,
- roundness: 1,
- center: [0.5, 0.5],
- color: '#000000',
+ <AbsoluteFill showInTimeline={false} style={{transform: `scale(${zoom})`}}>
+ <Video
+ src={rollerSkiAsset('footage/webcam1790843295628.mp4')}
+ durationInFrames={436}
+ trimBefore={120}
+ style={videoStyle}
+ objectFit="cover"
+ premountFor={fps}
+ effects={[
+ lut({content: studioLut}),
+ vignette({
+ amount: interpolate(frame, [423, 466], [0, 0.55], {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
}),
- ]}
- />
- <Video
- src={rollerSkiAsset('footage/webcam1790843295628.mp4')}
- from={436}
- trimBefore={556}
- style={videoStyle}
- objectFit="cover"
- premountFor={fps}
- effects={[
- lut({content: studioLut}),
- vignette({
- amount: interpolate(frame, [409, 485], [0, 0.55], {
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- }),
- radius: 0.63,
- feather: 0.67,
- roundness: 1,
- center: [0.5, 0.5],
- color: '#000000',
+ radius: 0.62,
+ feather: 0.35,
+ roundness: 1,
+ center: [0.5, 0.5],
+ color: '#000000',
+ }),
+ ]}
+ />
+ <Video
+ src={rollerSkiAsset('footage/webcam1790843295628.mp4')}
+ from={436}
+ trimBefore={556}
+ style={videoStyle}
+ objectFit="cover"
+ premountFor={fps}
+ effects={[
+ lut({content: studioLut}),
+ vignette({
+ amount: interpolate(frame, [409, 485], [0, 0.55], {
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
}),
- ]}
- toneFrequency={0.95}
- />
- </AbsoluteFill>
+
+ radius: 0.63,
+ feather: 0.67,
+ roundness: 1,
+ center: [0.5, 0.5],
+ color: '#000000',
+ }),
+ ]}
+ toneFrequency={0.95}
+ />
</AbsoluteFill>
);
};
diff --git a/packages/skills/skills/remotion-interactivity/SKILL.md b/packages/skills/skills/remotion-interactivity/SKILL.md
index 2a3f1986c8..708fb56f5b 100644
--- a/packages/skills/skills/remotion-interactivity/SKILL.md
+++ b/packages/skills/skills/remotion-interactivity/SKILL.md
@@ -15,9 +15,9 @@ If the markup is too complex for the Studio to make it interactive, then the val
## Prefer interactive components with their own timelines
-Use `Interactive.withSchema({wrapInSequence: true, layout: 'absolute-fill'})` for scenes whose layers share the canvas. The wrapper provides their visual root and timeline item, so the inner component can return a fragment. Put timing, premounting, dimensions, and per-instance styles on the exported component.
+Use `Interactive.withSchema({wrapInSequence: true, layout: 'absolute-fill'})` for components that fill their parent. The wrapper provides their visual root and timeline item, and clips overflow by default, so the inner component can return a fragment. Put timing, premounting, dimensions, and per-instance styles on the exported component.
-Keep visuals that belong together in the same component, so they move and trim together. An inner layout container can still provide alignment, clipping, or an animated group; a container that only fills the scene is usually unnecessary. Cards, text boxes, and SVGs with their own bounds can keep the default `layout: 'none'` and forward `style` to their visual root.
+Keep visuals that belong together in the same component, so they move and trim together. An inner layout container can still provide alignment, clipping within a smaller area, or an animated group; a container that only fills the scene is usually unnecessary. Cards, text boxes, and SVGs with their own bounds can keep the default `layout: 'none'` and forward `style` to their visual root.
```tsx title="Scene.tsx"
import {Video} from '@remotion/media';