Skip to main content

fade()

一个简单的淡入淡出动画。新幻灯片在旧幻灯片上淡入,而旧幻灯片保持不变。仅当新幻灯片完全不透明时才有效。

🌐 A simple fade animation. The incoming slide fades in over the outgoing slide, while the outgoing slide does not change. Works only if the incoming slide is fully opaque.

示例

🌐 Example

FadeTransition.tsx
import { linearTiming, TransitionSeries } from "@remotion/transitions"; import { fade } from "@remotion/transitions/fade"; const BasicTransition = () => { return ( <TransitionSeries> <TransitionSeries.Sequence durationInFrames={40}> <Letter color="#0b84f3">A</Letter> </TransitionSeries.Sequence> <TransitionSeries.Transition presentation={fade()} timing={linearTiming({ durationInFrames: 30 })} /> <TransitionSeries.Sequence durationInFrames={60}> <Letter color="pink">B</Letter> </TransitionSeries.Sequence> </TransitionSeries> ); };

应用编程接口

🌐 API

一个接收以下内容的对象:

🌐 An object which takes:

enterStyle?v4.0.84

场景进入时容器元素的样式。

🌐 The style of the container element when the scene is is entering.

exitStyle?v4.0.84

场景退出时容器元素的样式。

🌐 The style of the container element when the scene is exiting.

shouldFadeOutExitingScene?v4.0.166

是否应该让退出场景淡出。默认 false

🌐 Whether the exiting scene should fade out or not. Default false.

note

默认值是 false,因为如果进入的场景和现有场景都是半透明的,整个场景将会半透明,这会导致下面的内容透出来。
我们建议在完全不透明场景之间进行过渡时将此设置为 false
如果场景没有完全覆盖(例如在覆盖层之间淡入淡出),我们建议将此设置为 false

另请参阅

🌐 See also