Capítulo 664 de 988

Chapter 664: linearTiming()

Core Idea

A timing function for <TransitionSeries> based on interpolate().

Key Concepts

  • API
  • durationInFrames
  • easing?
  • See also

Code Examples

const Letter: React.FC<{
  children: React.ReactNode;
  color: string;
}> = ({children, color}) => {
  return (
    <AbsoluteFill
      style={{
        backgroundColor: color,
        opacity: 0.9,
        justifyContent: 'center',
        alignItems: 'center',
        fontSize: 200,
        color: 'white',
      }}
    >
      {children}
    </AbsoluteFill>
  );
};

const BasicTransition = () => {
  return (
    <TransitionSeries>
      <TransitionSeries.Sequence durationInFrames={40}>
        <Letter color="#0b84f3">A</Letter>
      </TransitionSeries.Sequence>
      <TransitionSeries.Transition
        presentation={slide()}
        timing={linearTiming({
          durationInFrames: 30,
          easing: Easing.in(Easing.ease),
        })}
      />
      <TransitionSeries.Sequence durationInFrames={60}>
        <Letter color="pink">B</Letter>
      </TransitionSeries.Sequence>
    </TransitionSeries>
  );
};
  • What it demonstrates: Usage pattern for linearTiming() from the official docs.

Key Takeaways

  1. Understand api when working with linearTiming().
  2. Understand durationinframes when working with linearTiming().
  3. Understand easing? when working with linearTiming().
  4. Understand see also when working with linearTiming().

Connects To

  • Audio Transitions: related page in the Transitions (@remotion/transitions) section.
  • Make Html in Canvas Presentation: related page in the Transitions (@remotion/transitions) section.
  • Presentations: related page in the Transitions (@remotion/transitions) section.