Skip to content

🎥 Make videos programmatically with React

Elements: Restore fixed slide-to-split-screen timing

Jonny Burgercb0974fa4f9b
diff --git a/packages/docs/elements/layouts/slide-to-split-screen/slide-to-split-screen.tsx b/packages/docs/elements/layouts/slide-to-split-screen/slide-to-split-screen.tsx
index 41e96c8a0b..67f3145ba0 100644
--- a/packages/docs/elements/layouts/slide-to-split-screen/slide-to-split-screen.tsx
+++ b/packages/docs/elements/layouts/slide-to-split-screen/slide-to-split-screen.tsx
@@ -16,24 +16,19 @@ const SlideToSplitScreenInner: React.FC<InteractiveTransformProps> = ({
style,
}) => {
const frame = useCurrentFrame();
- const {durationInFrames, height, width} = useVideoConfig();
+ const {height, width} = useVideoConfig();
const bPanelWidth = width * 0.4;
const aPanelWidth = width - bPanelWidth - DIVIDER_WIDTH;
const aShift = (width - aPanelWidth) / 2;
- const splitProgress = interpolate(
- frame,
- [20, 52, durationInFrames - 52, durationInFrames - 20],
- [0, 1, 1, 0],
- {
- easing: [
- Easing.bezier(0.65, 0, 0.35, 1),
- Easing.linear,
- Easing.bezier(0.65, 0, 0.35, 1),
- ],
- extrapolateLeft: 'clamp',
- extrapolateRight: 'clamp',
- },
- );
+ const splitProgress = interpolate(frame, [20, 52, 98, 130], [0, 1, 1, 0], {
+ easing: [
+ Easing.bezier(0.65, 0, 0.35, 1),
+ Easing.linear,
+ Easing.bezier(0.65, 0, 0.35, 1),
+ ],
+ extrapolateLeft: 'clamp',
+ extrapolateRight: 'clamp',
+ });
return (
<AbsoluteFill