Capítulo 943 de 988
The lightLeak() effect from @remotion/effects renders an animated WebGL2-based light leak overlay. The light leak reveals during the first half of its progress and retracts during the second half.
import {
AbsoluteFill,
interpolate,
Solid,
useCurrentFrame,
useVideoConfig,
} from 'remotion';
export const MyComp: React.FC = () => {
const frame = useCurrentFrame();
const {durationInFrames, height, width} = useVideoConfig();
return (
<AbsoluteFill style={{backgroundColor: 'black'}}>
<Solid
width={width}
height={height}
effects={[
lightLeak({
seed: 3,
hueShift: 30,
progress: interpolate(
frame,
[0, durationInFrames - 1],
[0, 1],
{
extrapolateLeft: 'clamp',
extrapolateRight: 'clamp',
},
),
}),
]}
/>
</AbsoluteFill>
);
};