Skip to content

🎥 Make videos programmatically with React

2.0 KB
Raw Blame
import {adjustHue, lighten} from 'polished';
import {AbsoluteFill, interpolateColors} from 'remotion';

export const SpringSeasonLogo: React.FC<{index: number}> = ({index}) => {
	const size = 200;
	return (
		<AbsoluteFill
			style={{
				justifyContent: 'center',
				alignItems: 'center',
				rotate: index * 72 + 'deg',
			}}
		>
			<svg
				style={{
					width: size,
					height: size,
					marginRight: 320,
				}}
				viewBox="0 0 96 99"
				fill="none"
				xmlns="http://www.w3.org/2000/svg"
			>
				<path
					d="M21.6329 0.00854903C19.5541 0.121183 17.879 0.450419 16.1908 1.09157C15.3489 1.40781 13.9688 2.09662 13.2093 2.57315C10.0326 4.56157 7.61096 7.55071 6.34807 11.0294C6.09636 11.7182 5.41501 13.9145 4.97669 15.4264C2.05599 25.5332 0.398184 36.5843 0.0423176 48.281C-0.0141001 50.1438 -0.0141005 54.5798 0.0423169 56.4123C0.281006 64.1667 1.02311 71.1674 2.36846 78.3066C2.91527 81.1961 3.79192 85.0777 4.29967 86.8408C5.33689 90.4235 7.45472 93.4732 10.4666 95.7086C12.4846 97.2075 14.776 98.2125 17.3148 98.7064C18.5386 98.9447 20.153 99.053 21.3421 98.975C22.9869 98.8667 26.2505 98.4292 28.9021 97.957C40.8539 95.8299 51.8944 92.022 61.9064 86.5722C68.2469 83.1196 73.6673 79.381 78.8968 74.8453C84.1089 70.3313 88.5529 65.475 92.463 60.0252C93.37 58.7646 93.8257 58.0281 94.2814 57.1011C95.4532 54.7098 96.0043 52.3315 96 49.6716C96 47.1936 95.5313 44.9929 94.5201 42.7402C94.034 41.6529 93.5697 40.8731 92.5281 39.3915C88.6917 33.9374 84.4344 29.1851 79.244 24.5671C71.1979 17.4105 61.6417 11.5406 50.9701 7.19548C48.6569 6.25542 46.3785 5.42799 43.6358 4.53125C37.8291 2.63813 30.6424 0.996266 24.5623 0.177502C23.6075 0.047539 22.3099 -0.0261076 21.6329 0.00854903Z"
					fill={lighten(
						index === 0 ? 0 : 0.38,
						interpolateColors(
							index,
							[0, 4],
							['#0B84F3', adjustHue(0, '#0B84F3')],
						),
					)}
				/>
			</svg>
		</AbsoluteFill>
	);
};

export const SpringSeason = () => {
	return (
		<AbsoluteFill>
			{new Array(5).fill(true).map((_, index) => {
				return <SpringSeasonLogo index={index} />;
			})}
		</AbsoluteFill>
	);
};