Skip to content

🎥 Make videos programmatically with React

13.0 KB
Raw Blame
import {Interactive} from 'remotion';
import {Banner} from './Banner';

type CompactLogoProps = {
	readonly color: string;
	readonly onWhite: boolean;
};

const CompactLogo = ({color, onWhite}: CompactLogoProps) => {
	return (
		<Interactive.Svg
			name="Compact Remotion logo"
			width={410}
			height={425}
			viewBox="0 0 410 425"
			fill="none"
			xmlns="http://www.w3.org/2000/svg"
			style={{display: 'block'}}
		>
			<path
				d="M92.3905 0.603638C83.5124 1.08554 76.358 2.49417 69.1481 5.2373C65.5523 6.59033 59.6583 9.53735 56.4148 11.5762C42.8474 20.0836 32.5051 32.8724 27.1115 47.7558C26.0365 50.7028 23.1266 60.0998 21.2546 66.5684C8.78078 109.81 1.70055 157.092 0.180713 207.135C-0.0602375 215.105 -0.0602375 234.084 0.180713 241.925C1.20012 275.102 4.36954 305.053 10.1153 335.599C12.4506 347.961 16.1946 364.568 18.3632 372.112C22.793 387.44 31.8379 400.488 44.7009 410.052C53.3195 416.465 63.1058 420.765 73.9485 422.878C79.1753 423.897 86.0702 424.361 91.1487 424.027C98.1733 423.564 112.111 421.692 123.436 419.672C174.48 410.571 221.632 394.279 264.392 370.963C291.471 356.19 314.621 340.195 336.955 320.789C359.215 301.476 378.194 280.699 394.894 257.382C398.768 251.989 400.714 248.838 402.66 244.872C407.665 234.64 410.018 224.465 410 213.085C410 202.483 407.998 193.067 403.68 183.429C401.604 178.777 399.62 175.441 395.172 169.102C378.788 145.767 360.605 125.434 338.438 105.676C304.074 75.0573 263.261 49.9428 217.685 31.3526C207.806 27.3306 198.075 23.7905 186.361 19.9538C161.562 11.8542 130.868 4.82956 104.901 1.32651C100.824 0.770477 95.2819 0.455353 92.3905 0.603638Z"
				fill={onWhite ? '#E7F3FE' : color}
				fillOpacity={onWhite ? undefined : 0.1}
			/>
			<path
				d="M116.44 45.697C109.454 46.0762 103.824 47.1846 98.1503 49.3432C95.3208 50.4079 90.6828 52.7269 88.1304 54.3313C77.4543 61.0258 69.3159 71.0894 65.0717 82.8011C64.2257 85.1201 61.9359 92.5146 60.4628 97.6048C50.6472 131.631 45.0757 168.838 43.8798 208.217C43.6901 214.488 43.6901 229.423 43.8798 235.593C44.6819 261.7 47.1759 285.269 51.6973 309.305C53.535 319.033 56.4811 332.101 58.1876 338.037C61.6734 350.099 68.7908 360.367 78.9128 367.893C85.6948 372.939 93.3956 376.323 101.928 377.986C106.041 378.788 111.466 379.152 115.463 378.89C120.99 378.525 131.958 377.052 140.87 375.462C181.036 368.301 218.141 355.481 251.788 337.133C273.097 325.509 291.313 312.922 308.888 297.652C326.405 282.454 341.34 266.105 354.481 247.757C357.529 243.512 359.06 241.033 360.592 237.912C364.53 229.861 366.382 221.854 366.367 212.899C366.367 204.556 364.792 197.147 361.394 189.563C359.76 185.902 358.2 183.277 354.699 178.289C341.806 159.926 327.498 143.927 310.055 128.379C283.014 104.285 250.898 84.5221 215.034 69.8934C207.26 66.7285 199.603 63.9427 190.385 60.9237C170.871 54.55 146.718 49.0224 126.285 46.2658C123.076 45.8282 118.715 45.5803 116.44 45.697Z"
				fill={onWhite ? '#BBDDFC' : color}
				fillOpacity={onWhite ? undefined : 0.2}
			/>
			<path
				d="M141.332 92.4681C136.307 92.7408 132.259 93.5379 128.179 95.0902C126.144 95.8559 122.809 97.5236 120.973 98.6774C113.295 103.492 107.443 110.729 104.391 119.151C103.782 120.819 102.136 126.137 101.076 129.797C94.0174 154.267 90.0107 181.023 89.1506 209.343C89.0143 213.853 89.0143 224.593 89.1506 229.03C89.7275 247.804 91.5211 264.754 94.7725 282.039C96.0941 289.035 98.2128 298.433 99.44 302.702C101.947 311.376 107.065 318.76 114.344 324.172C119.221 327.801 124.759 330.235 130.895 331.43C133.853 332.007 137.755 332.269 140.629 332.081C144.604 331.818 152.491 330.759 158.9 329.616C187.786 324.466 214.469 315.246 238.666 302.052C253.99 293.692 267.09 284.641 279.729 273.659C292.326 262.73 303.066 250.972 312.516 237.777C314.708 234.725 315.81 232.942 316.911 230.698C319.743 224.908 321.075 219.15 321.064 212.71C321.064 206.71 319.932 201.382 317.488 195.928C316.313 193.295 315.191 191.407 312.674 187.82C303.402 174.615 293.112 163.109 280.568 151.928C261.122 134.601 238.026 120.389 212.235 109.869C206.644 107.593 201.138 105.589 194.509 103.418C180.475 98.8347 163.106 94.8595 148.411 92.8771C146.104 92.5625 142.968 92.3842 141.332 92.4681Z"
				fill={color}
			/>
		</Interactive.Svg>
	);
};

type SquareBlueLogoProps = {
	readonly onWhite: boolean;
};

const SquareBlueLogo = ({onWhite}: SquareBlueLogoProps) => {
	return (
		<Interactive.Svg
			name="Square blue Remotion logo"
			width={1024}
			height={1024}
			viewBox="0 0 1024 1024"
			fill="none"
			xmlns="http://www.w3.org/2000/svg"
			style={{display: 'block'}}
		>
			{onWhite ? (
				<rect width={1024} height={1024} rx={10} fill="white" />
			) : null}
			<path
				d="M363.108 232.62C351.402 233.255 341.969 235.113 332.462 238.73C327.721 240.514 319.95 244.4 315.673 247.088C297.784 258.305 284.147 275.168 277.035 294.792C275.618 298.678 271.781 311.068 269.313 319.597C252.865 376.613 243.53 438.956 241.526 504.94C241.208 515.449 241.208 540.474 241.526 550.811C242.87 594.557 247.049 634.05 254.625 674.324C257.704 690.625 262.641 712.522 265.5 722.469C271.341 742.679 283.267 759.884 300.228 772.495C311.591 780.95 324.495 786.62 338.792 789.406C345.683 790.75 354.775 791.361 361.471 790.921C370.733 790.31 389.111 787.842 404.043 785.178C471.347 773.179 533.519 751.697 589.899 720.953C625.604 701.476 656.128 680.385 685.576 654.798C714.927 629.333 739.952 601.937 761.971 571.193C767.079 564.082 769.645 559.927 772.211 554.697C778.81 541.207 781.913 527.79 781.889 512.785C781.889 498.806 779.25 486.391 773.555 473.683C770.818 467.549 768.203 463.15 762.338 454.792C740.734 424.024 716.76 397.214 687.531 371.163C642.222 330.79 588.408 297.676 528.313 273.164C515.288 267.861 502.457 263.193 487.012 258.134C454.313 247.454 413.843 238.192 379.604 233.573C374.228 232.84 366.921 232.425 363.108 232.62Z"
				fill="#0B84F3"
				fillOpacity={0.3}
			/>
			<path
				d="M322.81 157.061C307.934 157.869 295.946 160.229 283.865 164.825C277.84 167.092 267.964 172.031 262.529 175.447C239.796 189.702 222.466 211.131 213.428 236.07C211.627 241.008 206.751 256.753 203.614 267.592C182.713 340.048 170.849 419.274 168.303 503.127C167.899 516.482 167.899 548.284 168.303 561.421C170.011 617.012 175.322 667.2 184.949 718.382C188.862 739.097 195.136 766.924 198.77 779.564C206.192 805.248 221.348 827.112 242.901 843.137C257.343 853.883 273.741 861.088 291.909 864.628C300.667 866.336 312.22 867.113 320.73 866.554C332.5 865.777 355.855 862.641 374.831 859.255C460.361 844.007 539.369 816.708 611.018 777.638C656.392 752.886 695.181 726.084 732.605 693.567C769.904 661.206 801.706 626.392 829.688 587.322C836.179 578.285 839.44 573.005 842.701 566.359C851.087 549.215 855.031 532.165 855 513.096C855 495.332 851.646 479.555 844.409 463.405C840.931 455.61 837.608 450.02 830.154 439.399C802.7 400.298 772.233 366.229 735.089 333.122C677.51 281.816 609.123 239.734 532.754 208.584C516.201 201.845 499.896 195.913 480.268 189.484C438.714 175.913 387.284 164.142 343.774 158.272C336.941 157.341 327.655 156.813 322.81 157.061Z"
				fill="#0B84F3"
				fillOpacity={0.1}
			/>
			<path
				d="M404.816 310.99C396.398 311.447 389.614 312.783 382.777 315.384C379.368 316.667 373.779 319.461 370.703 321.395C357.839 329.461 348.032 341.588 342.918 355.701C341.898 358.495 339.139 367.405 337.364 373.539C325.536 414.541 318.823 459.375 317.381 506.827C317.153 514.384 317.153 532.38 317.381 539.815C318.348 571.273 321.353 599.674 326.802 628.638C329.016 640.36 332.566 656.107 334.622 663.26C338.823 677.795 347.399 690.167 359.596 699.236C367.768 705.317 377.048 709.394 387.329 711.398C392.285 712.364 398.823 712.804 403.639 712.487C410.3 712.048 423.516 710.273 434.254 708.357C482.655 699.728 527.365 684.28 567.911 662.17C593.587 648.163 615.538 632.996 636.716 614.595C657.823 596.282 675.82 576.581 691.655 554.472C695.328 549.358 697.173 546.37 699.019 542.609C703.764 532.908 705.996 523.259 705.978 512.468C705.978 502.415 704.08 493.487 699.985 484.348C698.017 479.937 696.137 476.774 691.919 470.763C676.382 448.636 659.142 429.357 638.122 410.622C605.538 381.588 566.839 357.774 523.622 340.147C514.255 336.333 505.028 332.976 493.921 329.338C470.405 321.658 441.302 314.997 416.679 311.676C412.813 311.148 407.558 310.85 404.816 310.99Z"
				fill="#0B84F3"
			/>
		</Interactive.Svg>
	);
};

const SquareWhiteLogo = () => {
	return (
		<Interactive.Svg
			name="Square white Remotion logo"
			width={1024}
			height={1024}
			viewBox="0 0 1024 1024"
			fill="none"
			xmlns="http://www.w3.org/2000/svg"
			style={{display: 'block'}}
		>
			<path
				d="M354.753 216.133C342.348 216.806 332.352 218.775 322.278 222.607C317.254 224.498 309.019 228.616 304.487 231.464C285.53 243.351 271.079 261.22 263.543 282.015C262.041 286.133 257.975 299.263 255.36 308.301C237.931 368.719 228.038 434.783 225.915 504.705C225.578 515.841 225.578 542.36 225.915 553.314C227.339 599.67 231.767 641.52 239.795 684.198C243.059 701.472 248.29 724.676 251.32 735.216C257.509 756.633 270.147 774.864 288.12 788.227C300.162 797.188 313.835 803.196 328.985 806.148C336.288 807.572 345.922 808.22 353.018 807.754C362.833 807.106 382.308 804.491 398.131 801.668C469.451 788.952 535.334 766.189 595.078 733.61C632.914 712.97 665.26 690.621 696.466 663.507C727.568 636.522 754.087 607.491 777.42 574.912C782.833 567.376 785.552 562.974 788.271 557.432C795.263 543.137 798.552 528.919 798.526 513.018C798.526 498.205 795.73 485.049 789.696 471.583C786.795 465.083 784.024 460.421 777.809 451.564C754.916 418.96 729.511 390.55 698.538 362.944C650.524 320.162 593.499 285.071 529.818 259.096C516.014 253.477 502.418 248.53 486.052 243.17C451.401 231.853 408.515 222.038 372.234 217.143C366.536 216.366 358.793 215.926 354.753 216.133Z"
				fill="white"
				fillOpacity={0.3}
			/>
			<path
				d="M312.049 136.065C296.285 136.921 283.582 139.422 270.78 144.292C264.395 146.695 253.93 151.928 248.171 155.548C224.08 170.654 205.716 193.362 196.139 219.789C194.231 225.021 189.064 241.707 185.74 253.193C163.591 329.972 151.02 413.926 148.321 502.784C147.893 516.935 147.893 550.636 148.321 564.557C150.131 623.466 155.759 676.649 165.961 730.885C170.107 752.836 176.755 782.324 180.606 795.718C188.471 822.935 204.532 846.104 227.371 863.086C242.675 874.473 260.051 882.108 279.304 885.86C288.584 887.67 300.827 888.492 309.844 887.9C322.317 887.077 347.066 883.753 367.174 880.166C457.809 864.007 541.533 835.079 617.457 793.678C665.539 767.448 706.644 739.047 746.3 704.59C785.826 670.297 819.526 633.405 849.178 592.004C856.056 582.427 859.512 576.832 862.967 569.789C871.853 551.623 876.033 533.555 876 513.348C876 494.524 872.445 477.805 864.777 460.692C861.091 452.431 857.57 446.508 849.672 435.252C820.579 393.818 788.294 357.716 748.933 322.633C687.918 268.266 615.449 223.672 534.523 190.663C516.982 183.522 499.704 177.236 478.905 170.423C434.871 156.042 380.371 143.569 334.264 137.349C327.024 136.361 317.183 135.802 312.049 136.065Z"
				fill="white"
				fillOpacity={0.1}
			/>
			<path
				d="M398.951 299.18C390.03 299.665 382.841 301.08 375.597 303.836C371.984 305.196 366.061 308.157 362.802 310.206C349.17 318.754 338.778 331.604 333.358 346.559C332.278 349.52 329.354 358.962 327.473 365.462C314.939 408.911 307.825 456.42 306.298 506.704C306.056 514.712 306.056 533.783 306.298 541.661C307.322 574.997 310.507 605.093 316.28 635.785C318.627 648.207 322.389 664.894 324.568 672.474C329.019 687.875 338.107 700.987 351.032 710.596C359.692 717.04 369.525 721.361 380.42 723.484C385.672 724.508 392.6 724.974 397.703 724.639C404.761 724.173 418.766 722.292 430.145 720.262C481.435 711.118 528.814 694.748 571.779 671.319C598.988 656.476 622.249 640.404 644.69 620.905C667.057 601.499 686.128 580.622 702.908 557.193C706.8 551.774 708.756 548.608 710.711 544.622C715.74 534.342 718.105 524.117 718.086 512.682C718.086 502.03 716.075 492.569 711.736 482.885C709.65 478.21 707.657 474.858 703.187 468.488C686.724 445.041 668.454 424.611 646.18 404.758C611.652 373.992 570.642 348.757 524.847 330.077C514.92 326.036 505.143 322.479 493.373 318.624C468.454 310.485 437.613 303.427 411.522 299.907C407.424 299.348 401.856 299.031 398.951 299.18Z"
				fill="white"
			/>
		</Interactive.Svg>
	);
};

export type SvgLogoVariant =
	| 'compact-blue'
	| 'compact-blue-on-white'
	| 'compact-white'
	| 'square-blue'
	| 'square-blue-on-white'
	| 'square-white'
	| 'banner-light'
	| 'banner-light-on-white'
	| 'banner-dark'
	| 'banner-dark-on-black';

export const SvgLogo = ({variant}: {readonly variant: SvgLogoVariant}) => {
	switch (variant) {
		case 'compact-blue':
			return <CompactLogo color="#0B84F3" onWhite={false} />;
		case 'compact-blue-on-white':
			return <CompactLogo color="#0B84F3" onWhite />;
		case 'compact-white':
			return <CompactLogo color="white" onWhite={false} />;
		case 'square-blue':
			return <SquareBlueLogo onWhite={false} />;
		case 'square-blue-on-white':
			return <SquareBlueLogo onWhite />;
		case 'square-white':
			return <SquareWhiteLogo />;
		case 'banner-light':
			return <Banner theme="light" withBackground={false} />;
		case 'banner-light-on-white':
			return <Banner theme="light" withBackground />;
		case 'banner-dark':
			return <Banner theme="dark" withBackground={false} />;
		case 'banner-dark-on-black':
			return <Banner theme="dark" withBackground />;
		default:
			throw new Error(`Unknown SVG logo variant: ${variant satisfies never}`);
	}
};