Capítulo 971 de 988
Posterization makes an animation update in steps instead of changing on every frame. Use it for stop-motion, low-frame-rate motion, or a choppy graphic style.
export const MyComposition: React.FC = () => {
const frame = useCurrentFrame();
return (
<AbsoluteFill style={{justifyContent: 'center', alignItems: 'center'}}>
<div
style={{
width: 120,
height: 120,
borderRadius: 24,
backgroundColor: '#0b84f3',
translate: interpolate(frame, [0, 60], ['-200px', '200px'], {
posterize: 3,
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
}),
}}
/>
</AbsoluteFill>
);
};