Skip to content

🎥 Make videos programmatically with React

`@remotion/studio`: Fix `Track` clip rows and keyframe expansion

Jonny Burger40904f4dbbfa
diff --git a/packages/studio/src/components/AudioWaveform.tsx b/packages/studio/src/components/AudioWaveform.tsx
index 24ed34d472..8337454e4d 100644
--- a/packages/studio/src/components/AudioWaveform.tsx
+++ b/packages/studio/src/components/AudioWaveform.tsx
@@ -280,10 +280,11 @@ const AudioWaveformInner: React.FC<{
return (
<div style={getContainerStyle(height)}>
+ <canvas ref={waveformCanvas} style={waveformCanvasStyle} />
+ {/* Paint the volume shade over the waveform as well as its background. */}
{shouldRenderVolumeOverlay ? (
<canvas ref={volumeCanvas} style={volumeCanvasStyle} />
) : null}
- <canvas ref={waveformCanvas} style={waveformCanvasStyle} />
</div>
);
};
diff --git a/packages/studio/src/components/Timeline/Timeline.tsx b/packages/studio/src/components/Timeline/Timeline.tsx
index 2728f8821d..c3e2a648e8 100644
--- a/packages/studio/src/components/Timeline/Timeline.tsx
+++ b/packages/studio/src/components/Timeline/Timeline.tsx
@@ -572,19 +572,38 @@ const TimelineInner: React.FC = () => {
]);
const maxTimelineTracks = getStudioMaxTimelineTracks();
- const displayRows = useMemo(
- () => getTimelineDisplayRows(visibleTracks),
- [visibleTracks],
- );
+ const displayRows = useMemo(() => {
+ const collapsedTrackIds = new Set<string>();
+ for (const {sequence} of visibleTracks) {
+ const key = layerChildrenValue.keys.get(sequence.id);
+ if (
+ sequence.timelineTrack?.role === 'track' &&
+ key !== undefined &&
+ layerChildrenValue.collapsed[key]
+ ) {
+ collapsedTrackIds.add(sequence.timelineTrack.id);
+ }
+ }
+
+ return getTimelineDisplayRows(visibleTracks, collapsedTrackIds);
+ }, [layerChildrenValue, visibleTracks]);
const shownRows = useMemo(() => {
return maxTimelineTracks !== null && displayRows.length > maxTimelineTracks
? displayRows.slice(0, maxTimelineTracks)
: displayRows;
}, [displayRows, maxTimelineTracks]);
- const shown = useMemo(
- () => shownRows.flatMap((row) => [row.track, ...(row.items ?? [])]),
- [shownRows],
- );
+ const shown = useMemo(() => {
+ // A Track clip appears in its container's scene items and its own row,
+ // but selection and keyboard actions must only include it once.
+ const byId = new Map<string, TimelineTrackWithDisplayGroup>();
+ for (const row of shownRows) {
+ for (const track of [row.track, ...(row.items ?? [])]) {
+ byId.set(track.sequence.id, track);
+ }
+ }
+
+ return [...byId.values()];
+ }, [shownRows]);
const hasBeenCut = displayRows.length > shownRows.length;
diff --git a/packages/studio/src/components/Timeline/TimelineLayerChildren.tsx b/packages/studio/src/components/Timeline/TimelineLayerChildren.tsx
index c4a60c6d81..4182109aa8 100644
--- a/packages/studio/src/components/Timeline/TimelineLayerChildren.tsx
+++ b/packages/studio/src/components/Timeline/TimelineLayerChildren.tsx
@@ -107,11 +107,13 @@ export const useTimelineLayerChildren = (
.map((id) => siblingIndices.get(id)),
];
const key = JSON.stringify([compositionId, identity]);
- // Packed clips have no child-collapse control. Do not let a saved
- // layer collapse make an explicit nested Track inaccessible.
+ // Series clips have no child-collapse control. Regular Track clips
+ // have their own child rows and can collapse their nested contents.
if (
!track.sequence.timelineTrack ||
- track.sequence.timelineTrack.role === 'track'
+ track.sequence.timelineTrack.role === 'track' ||
+ (track.sequence.timelineTrack.role === 'clip' &&
+ track.sequence.timelineTrack.seriesOffset === null)
) {
keys.set(track.sequence.id, key);
}
@@ -123,7 +125,7 @@ export const useTimelineLayerChildren = (
(key: string) => {
const affectedKeys = new Set([key]);
if (compactSeries) {
- const rows = getTimelineDisplayRows(tracks);
+ const rows = getTimelineDisplayRows(tracks, null);
const index = rows.findIndex(
(row) => hierarchy.keys.get(row.track.sequence.id) === key,
);
diff --git a/packages/studio/src/components/Timeline/TimelineList.tsx b/packages/studio/src/components/Timeline/TimelineList.tsx
index 356f6c87f5..79d4a2a357 100644
--- a/packages/studio/src/components/Timeline/TimelineList.tsx
+++ b/packages/studio/src/components/Timeline/TimelineList.tsx
@@ -86,6 +86,10 @@ const TimelineSceneList: React.FC<{
const frame = Internals.Timeline.useTimelinePosition();
const lastFrame = useRef(frame);
const panels = useRef(new Map<string, HTMLDivElement>());
+ const transition = useRef<{
+ readonly pending: {updatePending: boolean};
+ readonly cancel: () => void;
+ } | null>(null);
const view = groups.map((group) => ({
id: group.id,
rows: group.items
@@ -103,9 +107,32 @@ const TimelineSceneList: React.FC<{
const latest = useRef({view, frame, previousFrame: frame});
latest.current = {view, frame, previousFrame: lastFrame.current};
+ useLayoutEffect(() => {
+ return () => transition.current?.cancel();
+ }, []);
+
useLayoutEffect(() => {
const next = latest.current;
const previous = displayedViewRef.current;
+ const update = () => {
+ const currentView = latest.current.view;
+ displayedViewRef.current = currentView;
+ setDisplayedView(currentView);
+ };
+
+ // Activity discovery and virtualization can change another group's rows
+ // after the playhead has moved. Keep the pending snapshot intact and let
+ // its callback apply the latest rows instead of cancelling the slide.
+ if (transition.current !== null && next.frame === next.previousFrame) {
+ if (!transition.current.pending.updatePending) {
+ update();
+ }
+
+ return;
+ }
+
+ transition.current?.cancel();
+ transition.current = null;
const scrollBounds =
timelineVerticalScroll.current?.getBoundingClientRect();
const changingPanels = next.view.flatMap((group, index) => {
@@ -142,11 +169,6 @@ const TimelineSceneList: React.FC<{
},
];
});
- const update = () => {
- displayedViewRef.current = next.view;
- setDisplayedView(next.view);
- };
-
// Mounting, Activity discovery and layout edits are immediate. Animate
// only a playhead crossing between two discovered scene views.
if (changingPanels.length === 0 || next.frame === next.previousFrame) {
@@ -154,17 +176,23 @@ const TimelineSceneList: React.FC<{
return;
}
+ const pending = {
+ updatePending: true,
+ };
const cancel = startSlideViewTransition({
panels: changingPanels,
direction: next.frame > next.previousFrame ? 'forward' : 'backward',
- update,
+ update: () => {
+ pending.updatePending = false;
+ update();
+ },
});
if (cancel === null) {
update();
return;
}
- return cancel;
+ transition.current = {pending, cancel};
}, [key]);
useLayoutEffect(() => {
lastFrame.current = frame;
diff --git a/packages/studio/src/components/Timeline/TimelineSequence.tsx b/packages/studio/src/components/Timeline/TimelineSequence.tsx
index 1c07432ac6..dfd0e36f37 100644
--- a/packages/studio/src/components/Timeline/TimelineSequence.tsx
+++ b/packages/studio/src/components/Timeline/TimelineSequence.tsx
@@ -45,7 +45,6 @@ import {
} from '../../helpers/studio-runtime-config';
import {
getTimelineLayerHeight,
- TIMELINE_ITEM_BORDER_BOTTOM,
TIMELINE_LAYER_HEIGHT_AUDIO,
TIMELINE_PADDING,
} from '../../helpers/timeline-layout';
@@ -86,8 +85,8 @@ import {
TimelineSequenceLabel,
} from './timeline-sequence-label';
import {
- TIMELINE_PACKED_AUXILIARY_ROW_HEIGHT,
- TIMELINE_PACKED_TRACK_HEIGHT,
+ getTimelineSequenceHeight,
+ hasTimelineTrackMediaLabel,
} from './timeline-track-groups';
import {timelineTrimEdgeCursor} from './timeline-trim-edge-cursor';
import {TimelineImageInfo} from './TimelineImageInfo';
@@ -564,6 +563,9 @@ const TimelineSequenceBar: React.FC<{
Math.max(labelOffset, negativeStartEnd + (premount?.width ?? 0)),
right: 0,
bottom: PACKED_LABEL_BOTTOM,
+ ...(hasTimelineTrackMediaLabel(s)
+ ? {top: getTimelineLayerHeight(s.type)}
+ : {}),
display: 'flex',
flexDirection: 'column',
alignItems: 'flex-start',
@@ -1642,9 +1644,11 @@ const TimelineSequenceLayoutInner: React.FC<{
return {
width: visibleLayout?.media?.width ?? 0,
marginLeft: visibleLayout?.media?.left ?? 0,
- height: '100%',
+ height: hasTimelineTrackMediaLabel(s)
+ ? getTimelineLayerHeight(s.type)
+ : '100%',
};
- }, [visibleLayout]);
+ }, [s, visibleLayout]);
useLayoutEffect(() => {
if (
(maxMediaDuration === null && !s.loopDisplay) ||
@@ -1697,12 +1701,7 @@ const TimelineSequenceLayoutInner: React.FC<{
const parentEnd = parentVisibleEnd ?? video.durationInFrames;
const frameIncrement =
(windowWidth - TIMELINE_PADDING * 2) / video.durationInFrames;
- const layerHeight =
- s.timelineTrack?.role === 'overlay'
- ? TIMELINE_PACKED_AUXILIARY_ROW_HEIGHT - TIMELINE_ITEM_BORDER_BOTTOM
- : s.timelineTrack
- ? TIMELINE_PACKED_TRACK_HEIGHT
- : getTimelineLayerHeight(s.type);
+ const layerHeight = getTimelineSequenceHeight(s);
const trimOutline = (() => {
if (
activeEdgeHighlight === null ||
@@ -1988,23 +1987,31 @@ const TimelineSequenceLayoutInner: React.FC<{
</div>
) : null}
{s.type === 'video' && visibleLayout.media ? (
- <TimelineVideoInfo
- src={s.src}
- visualizationWidth={visibleLayout.media.width}
- displayOffsetInFrames={mediaDisplayOffsetInFrames}
- displayDurationInFrames={mediaDisplayDurationInFrames}
- startMediaFrom={s.startMediaFrom}
- mediaFrameAtSequenceZero={mediaLoopStartFrame}
- sequenceFrameOffset={0}
- playbackRate={s.playbackRate * s.sequencePlaybackRate}
- volume={timelineVolume}
- muted={s.muted}
- marginLeft={visibleLayout.media.left}
- loopDisplay={s.loopDisplay}
- loopDisplayOffsetInFrames={s.loopDisplay?.phaseOffsetInFrames ?? 0}
- frozenMediaFrame={s.frozenMediaFrame}
- extendLastFrame={extendVideoLastFrame}
- />
+ <div
+ style={{
+ height: hasTimelineTrackMediaLabel(s)
+ ? getTimelineLayerHeight(s.type)
+ : '100%',
+ }}
+ >
+ <TimelineVideoInfo
+ src={s.src}
+ visualizationWidth={visibleLayout.media.width}
+ displayOffsetInFrames={mediaDisplayOffsetInFrames}
+ displayDurationInFrames={mediaDisplayDurationInFrames}
+ startMediaFrom={s.startMediaFrom}
+ mediaFrameAtSequenceZero={mediaLoopStartFrame}
+ sequenceFrameOffset={0}
+ playbackRate={s.playbackRate * s.sequencePlaybackRate}
+ volume={timelineVolume}
+ muted={s.muted}
+ marginLeft={visibleLayout.media.left}
+ loopDisplay={s.loopDisplay}
+ loopDisplayOffsetInFrames={s.loopDisplay?.phaseOffsetInFrames ?? 0}
+ frozenMediaFrame={s.frozenMediaFrame}
+ extendLastFrame={extendVideoLastFrame}
+ />
+ </div>
) : null}
{s.type === 'image' && visibleLayout.media ? (
<div style={mediaVisualizationStyle}>
diff --git a/packages/studio/src/components/Timeline/TimelineSequenceItem.tsx b/packages/studio/src/components/Timeline/TimelineSequenceItem.tsx
index 856441b7ce..41a3dad7b5 100644
--- a/packages/studio/src/components/Timeline/TimelineSequenceItem.tsx
+++ b/packages/studio/src/components/Timeline/TimelineSequenceItem.tsx
@@ -42,7 +42,6 @@ import {
} from '../../helpers/pointer-session';
import {getStudioKeyboardShortcutsEnabled} from '../../helpers/studio-runtime-config';
import {
- getTimelineLayerHeight,
TIMELINE_ITEM_BORDER_BOTTOM,
TIMELINE_LIST_ITEM_ROW_HEIGHT,
} from '../../helpers/timeline-layout';
@@ -95,7 +94,7 @@ import {
EDGE_SCROLL_VERTICAL_INCREMENT,
startTimelineEdgeAutoScroll,
} from './timeline-scroll-logic';
-import {TIMELINE_PACKED_TRACK_HEIGHT} from './timeline-track-groups';
+import {getTimelineSequenceHeight} from './timeline-track-groups';
import {TimelineDuplicateCount} from './TimelineDuplicateCount';
import {
TimelineExpandArrowButton,
@@ -1027,7 +1026,8 @@ const TimelineSequenceItemInner: React.FC<{
? sequence.src
: null;
const isExpanded =
- !isPackedTrack &&
+ (!isPackedTrack ||
+ sequence.controls?.componentIdentity === 'dev.remotion.remotion.Track') &&
previewConnected &&
nodePathInfo !== null &&
getIsExpanded(nodePathInfo);
@@ -1098,11 +1098,8 @@ const TimelineSequenceItemInner: React.FC<{
);
const outerHeight = useMemo(
- () =>
- (isPackedTrack
- ? TIMELINE_PACKED_TRACK_HEIGHT
- : getTimelineLayerHeight(sequence.type)) + TIMELINE_ITEM_BORDER_BOTTOM,
- [isPackedTrack, sequence.type],
+ () => getTimelineSequenceHeight(sequence) + TIMELINE_ITEM_BORDER_BOTTOM,
+ [sequence],
);
const connectedCompositionIconStyle = useMemo(
@@ -1137,7 +1134,8 @@ const TimelineSequenceItemInner: React.FC<{
}, [effectDropHovered, inner]);
const hasExpandableContent =
- !isPackedTrack &&
+ (!isPackedTrack ||
+ sequence.controls?.componentIdentity === 'dev.remotion.remotion.Track') &&
isStudioInteractivityEnabled() &&
(Boolean(sequence.controls) || sequence.effects.length > 0);
diff --git a/packages/studio/src/components/Timeline/TimelineTrack.tsx b/packages/studio/src/components/Timeline/TimelineTrack.tsx
index 5f276db384..fbfd1199b9 100644
--- a/packages/studio/src/components/Timeline/TimelineTrack.tsx
+++ b/packages/studio/src/components/Timeline/TimelineTrack.tsx
@@ -1,12 +1,10 @@
import React, {useContext, useMemo} from 'react';
import {StudioServerConnectionCtx} from '../../helpers/client-id';
import type {TimelineTrackData} from '../../helpers/get-timeline-sequence-sort-key';
-import {
- getTimelineLayerHeight,
- TIMELINE_ITEM_BORDER_BOTTOM,
-} from '../../helpers/timeline-layout';
+import {TIMELINE_ITEM_BORDER_BOTTOM} from '../../helpers/timeline-layout';
import {useTimelineSequenceHover} from '../../state/timeline-sequence-hover';
import {ExpandedTracksGetterContext} from '../ExpandedTracksProvider';
+import {getTimelineSequenceHeight} from './timeline-track-groups';
import {TimelineExpandedTrackKeyframes} from './TimelineExpandedTrackKeyframes';
import {
getTimelineSelectedTrackHighlightStyle,
@@ -38,11 +36,11 @@ const TimelineTrackUnmemoized: React.FC<{
const layerStyle = useMemo(
(): React.CSSProperties => ({
- height: getTimelineLayerHeight(track.sequence.type),
+ height: getTimelineSequenceHeight(track.sequence),
marginBottom: TIMELINE_ITEM_BORDER_BOTTOM,
position: 'relative',
}),
- [track.sequence.type],
+ [track.sequence],
);
const showExpandedKeyframes =
diff --git a/packages/studio/src/components/Timeline/TimelineTracks.tsx b/packages/studio/src/components/Timeline/TimelineTracks.tsx
index 2e0b0a6f2e..93f93ffae0 100644
--- a/packages/studio/src/components/Timeline/TimelineTracks.tsx
+++ b/packages/studio/src/components/Timeline/TimelineTracks.tsx
@@ -99,7 +99,9 @@ const TimelineTracksInner: React.FC<{
const {sceneRange, track, items, auxiliaryRows, auxiliaryRowOffsets} =
rows[virtualItem.index];
const trackContent =
- items === null ? (
+ items === null ||
+ track.sequence.controls?.componentIdentity ===
+ 'dev.remotion.remotion.Track' ? (
<TimelineTrack track={track} />
) : (
<TimelinePackedTrack
diff --git a/packages/studio/src/components/Timeline/TimelineVirtualization.tsx b/packages/studio/src/components/Timeline/TimelineVirtualization.tsx
index 16b1773f24..d38164f46a 100644
--- a/packages/studio/src/components/Timeline/TimelineVirtualization.tsx
+++ b/packages/studio/src/components/Timeline/TimelineVirtualization.tsx
@@ -83,12 +83,14 @@ export const TimelineVirtualizationProvider: React.FC<{
});
const trackHeights = useMemo(
() =>
- timeline.map((row, index) =>
- row.items === null
- ? individualHeights[index]
- : TIMELINE_PACKED_TRACK_HEIGHT +
- TIMELINE_ITEM_BORDER_BOTTOM +
- row.auxiliaryRows.length * TIMELINE_PACKED_AUXILIARY_ROW_HEIGHT,
+ timeline.map(
+ (row, index) =>
+ (row.items === null ||
+ row.track.sequence.controls?.componentIdentity ===
+ 'dev.remotion.remotion.Track'
+ ? individualHeights[index]
+ : TIMELINE_PACKED_TRACK_HEIGHT + TIMELINE_ITEM_BORDER_BOTTOM) +
+ row.auxiliaryRows.length * TIMELINE_PACKED_AUXILIARY_ROW_HEIGHT,
),
[individualHeights, timeline],
);
diff --git a/packages/studio/src/components/Timeline/timeline-series-layout.ts b/packages/studio/src/components/Timeline/timeline-series-layout.ts
index a711fd2894..6b66994ac8 100644
--- a/packages/studio/src/components/Timeline/timeline-series-layout.ts
+++ b/packages/studio/src/components/Timeline/timeline-series-layout.ts
@@ -53,12 +53,14 @@ export const getTimelineSeriesLayout = ({
row.items === null ||
row.items.length === 0 ||
!registered ||
- registered.some(
- (item) =>
- (item.timelineTrack?.role === 'clip' &&
- item.timelineTrack.seriesOffset !== 0) ||
- !item.showInTimeline,
- )
+ (row.track.sequence.controls?.componentIdentity !==
+ 'dev.remotion.remotion.Track' &&
+ registered.some(
+ (item) =>
+ (item.timelineTrack?.role === 'clip' &&
+ item.timelineTrack.seriesOffset !== 0) ||
+ !item.showInTimeline,
+ ))
) {
continue;
}
@@ -81,7 +83,10 @@ export const getTimelineSeriesLayout = ({
const childrenByScene = new Map<string, number[]>();
const roots: number[] = [];
for (let index = 0; index < rows.length; index++) {
- let {parent} = rows[index].track.sequence;
+ const {sequence} = rows[index].track;
+ // A regular Track's clip label shares the same scene space as its
+ // descendants. Series only display the descendants of their scenes.
+ let parent = seriesByScene.has(sequence.id) ? sequence.id : sequence.parent;
while (parent !== null && !seriesByScene.has(parent)) {
parent = byId.get(parent)?.parent ?? null;
}
diff --git a/packages/studio/src/components/Timeline/timeline-track-groups.ts b/packages/studio/src/components/Timeline/timeline-track-groups.ts
index 0af035ec3f..dd896e2ff6 100644
--- a/packages/studio/src/components/Timeline/timeline-track-groups.ts
+++ b/packages/studio/src/components/Timeline/timeline-track-groups.ts
@@ -1,9 +1,42 @@
import type {TSequence} from 'remotion';
+import {
+ getTimelineLayerHeight,
+ TIMELINE_ITEM_BORDER_BOTTOM,
+} from '../../helpers/timeline-layout';
import {timelineNodePathInfoToKey} from '../../helpers/timeline-node-path-key';
import type {TimelineTrackWithDisplayGroup} from './timeline-display-groups';
export const TIMELINE_PACKED_TRACK_HEIGHT = 28;
export const TIMELINE_PACKED_AUXILIARY_ROW_HEIGHT = 24;
+export const TIMELINE_TRACK_MEDIA_LABEL_HEIGHT = 16;
+
+export const hasTimelineTrackMediaLabel = (sequence: TSequence): boolean =>
+ sequence.timelineTrack?.role === 'clip' &&
+ sequence.timelineTrack.seriesOffset === null &&
+ (sequence.type === 'audio' ||
+ sequence.type === 'video' ||
+ sequence.type === 'image');
+
+export const getTimelineSequenceHeight = (sequence: TSequence): number => {
+ if (sequence.timelineTrack?.role === 'overlay') {
+ return TIMELINE_PACKED_AUXILIARY_ROW_HEIGHT - TIMELINE_ITEM_BORDER_BOTTOM;
+ }
+
+ if (
+ sequence.timelineTrack &&
+ (sequence.timelineTrack.role !== 'clip' ||
+ sequence.timelineTrack.seriesOffset !== null)
+ ) {
+ return TIMELINE_PACKED_TRACK_HEIGHT;
+ }
+
+ return (
+ getTimelineLayerHeight(sequence.type) +
+ (hasTimelineTrackMediaLabel(sequence)
+ ? TIMELINE_TRACK_MEDIA_LABEL_HEIGHT
+ : 0)
+ );
+};
export type TimelineDisplayRow = {
readonly track: TimelineTrackWithDisplayGroup;
@@ -140,6 +173,7 @@ export const filterTimelineTrackContents = (
export const getTimelineDisplayRows = (
tracks: readonly TimelineTrackWithDisplayGroup[],
+ collapsedTrackIds: ReadonlySet<string> | null,
): TimelineDisplayRow[] => {
const rows: TimelineDisplayRow[] = [];
const groupedItems = new Map<string, TimelineTrackWithDisplayGroup[]>();
@@ -158,6 +192,14 @@ export const getTimelineDisplayRows = (
const group = track.sequence.timelineTrack;
if (!group) {
rows.push({track, items: null, auxiliaryRows: []});
+ } else if (
+ group.role === 'clip' &&
+ group.seriesOffset === null &&
+ !collapsedTrackIds?.has(group.id)
+ ) {
+ // Regular Track clips have their own bars and expandable properties
+ // below the container's row.
+ rows.push({track, items: null, auxiliaryRows: []});
} else if (group.role === 'track') {
if (
track.sequence.loopDisplay !== undefined ||
diff --git a/packages/studio/src/components/Timeline/use-timeline-height.ts b/packages/studio/src/components/Timeline/use-timeline-height.ts
index 9320f45fcd..14dc97849e 100644
--- a/packages/studio/src/components/Timeline/use-timeline-height.ts
+++ b/packages/studio/src/components/Timeline/use-timeline-height.ts
@@ -5,7 +5,6 @@ import type {TimelineTrackData} from '../../helpers/get-timeline-sequence-sort-k
import {
buildTimelineTree,
flattenVisibleTreeNodes,
- getTimelineLayerHeight,
getTreeRowHeight,
TIMELINE_ITEM_BORDER_BOTTOM,
} from '../../helpers/timeline-layout';
@@ -17,6 +16,7 @@ import {
getSelectedTimelineExpandedRowKeys,
isTimelineExpandedNodeSelected,
} from './timeline-expanded-filter';
+import {getTimelineSequenceHeight} from './timeline-track-groups';
import {useTimelineSelection} from './TimelineSelection';
const emptyDragOverrideSnapshot = {};
@@ -165,8 +165,7 @@ export const useTimelineTrackHeights = ({
}
const layerHeight =
- getTimelineLayerHeight(track.sequence.type) +
- TIMELINE_ITEM_BORDER_BOTTOM;
+ getTimelineSequenceHeight(track.sequence) + TIMELINE_ITEM_BORDER_BOTTOM;
const expandedHeight = (() => {
if (!isExpanded || track.nodePathInfo === null) {
return 0;
diff --git a/packages/studio/src/helpers/inject-css.ts b/packages/studio/src/helpers/inject-css.ts
index cec5ea5ab1..7e1792fe87 100644
--- a/packages/studio/src/helpers/inject-css.ts
+++ b/packages/studio/src/helpers/inject-css.ts
@@ -30,11 +30,11 @@ const makeDefaultGlobalCSS = () => {
html.__remotion-slide-forward,
html.__remotion-slide-backward {
view-transition-name: none;
- --remotion-slide-distance: 100%;
+ --remotion-slide-distance: 15%;
}
html.__remotion-slide-backward {
- --remotion-slide-distance: -100%;
+ --remotion-slide-distance: -15%;
}
html.__remotion-slide-forward::view-transition,
@@ -43,11 +43,13 @@ const makeDefaultGlobalCSS = () => {
}
@keyframes remotion-slide-out {
- to { transform: translateX(calc(-1 * var(--remotion-slide-distance))); }
+ from { opacity: 1; transform: translateX(0); }
+ to { opacity: 0; transform: translateX(calc(-1 * var(--remotion-slide-distance))); }
}
@keyframes remotion-slide-in {
- from { transform: translateX(var(--remotion-slide-distance)); }
+ from { opacity: 0; transform: translateX(var(--remotion-slide-distance)); }
+ to { opacity: 1; transform: translateX(0); }
}
.remotion-splitter {
diff --git a/packages/studio/src/helpers/slide-view-transition.ts b/packages/studio/src/helpers/slide-view-transition.ts
index 87fcb41943..81319cb684 100644
--- a/packages/studio/src/helpers/slide-view-transition.ts
+++ b/packages/studio/src/helpers/slide-view-transition.ts
@@ -44,12 +44,15 @@ export const startSlideViewTransition = ({
}
::view-transition-old(${name}), ::view-transition-new(${name}) {
animation-duration: 75ms;
- animation-timing-function: ease-out;
+ animation-timing-function: ease-in-out;
animation-fill-mode: both;
mix-blend-mode: normal;
}
::view-transition-old(${name}) { animation-name: remotion-slide-out; }
- ::view-transition-new(${name}) { animation-name: remotion-slide-in; }
+ ::view-transition-new(${name}) {
+ animation-name: remotion-slide-in;
+ animation-delay: 75ms;
+ }
@media (prefers-reduced-motion: reduce) {
::view-transition-old(${name}), ::view-transition-new(${name}) { animation: none; }
}