Skip to content

🎥 Make videos programmatically with React

660 B
Raw Blame
import {paper} from '@remotion/effects/paper';
import React from 'react';
import {Interactive, interpolate, Solid, useCurrentFrame} from 'remotion';

const PaperTextureInner: React.FC = () => {
	const frame = useCurrentFrame();

	return (
		<Solid
			color="white"
			width={1920}
			height={1080}
			effects={[
				paper({
					colorFront: 'white',
					colorBack: 'white',
					seed: interpolate(frame, [0, 120], [0, 1000], {
						extrapolateLeft: 'clamp',
						extrapolateRight: 'clamp',
						posterize: 30,
					}),
				}),
			]}
		/>
	);
};

export const PaperTexture = Interactive.create({
	Component: PaperTextureInner,
	layout: 'absolute-fill',
});