Capítulo 918 de 988

Chapter 918: interpolateStyles()

Core Idea

_Part of the @remotion/animation-utils package.

Key Concepts

  • Example
  • API
  • Return value
  • Usage Notes
  • See also

Code Examples

import {
  interpolateStyles,
  makeTransform,
  translateY,
} from "@remotion/animation-utils";

const MyComponent: React.FC = () => {
  const animatedStyles = interpolateStyles(
    15,
    [0, 30, 60],
    [
      { opacity: 0, transform: makeTransform([translateY(-50)]) },
      { opacity: 1, transform: makeTransform([translateY(0)]) },
      { opacity: 0, transform: makeTransform([translateY(50)]) },
    ],
  );

  return <div style={animatedStyles} />;
};
  • What it demonstrates: Usage pattern for interpolateStyles() from the official docs.

Key Takeaways

  1. Understand example when working with interpolateStyles().
  2. Understand api when working with interpolateStyles().
  3. Understand return value when working with interpolateStyles().
  4. Understand usage notes when working with interpolateStyles().
  5. Understand see also when working with interpolateStyles().

Connects To

  • Make Transform: related page in the Animation Utils (@remotion/animation-utils) section.