🎥 Make videos programmatically with React
clone template strip
Jonny Burger9fcd23917b10
diff --git a/packages/docs/components/LandingPage/if-you-know-react.tsx b/packages/docs/components/LandingPage/if-you-know-react.tsxindex 760b05c3be..c4e487955f 100644--- a/packages/docs/components/LandingPage/if-you-know-react.tsx+++ b/packages/docs/components/LandingPage/if-you-know-react.tsx@@ -7,8 +7,8 @@ import styles from "./ifyouknowreact.module.css";export const IfYouKnowReact: React.FC = () => {return (<div className={styles.ifyouknowrow}>- <CodeExample></CodeExample>- <div style={{ width: 40 }}></div>+ <CodeExample />+ <div style={{ width: 40 }} /><div><h2 className={styles.ifyouknowtitle}>If you know <span className={styles.rea}>React</span> <br />@@ -19,8 +19,8 @@ export const IfYouKnowReact: React.FC = () => {of React stay the same. <br /></p>Learn the fundamentals in just a few minutes.- <Spacer></Spacer>- <Spacer></Spacer>+ <Spacer />+ <Spacer /><a className={styles.aknow} href="/docs/the-fundamentals"><BlueButton size="sm" fullWidth={false} loading={false}>Learn Remotiondiff --git a/packages/docs/src/css/custom.css b/packages/docs/src/css/custom.cssindex 12f8c3dee0..fb280351c2 100644--- a/packages/docs/src/css/custom.css+++ b/packages/docs/src/css/custom.css@@ -25,6 +25,7 @@--light-text-color: #777;--clear-hover: rgba(0, 0, 0, 0.04);--box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);+ --shaded-panel: rgba(0, 0, 0, 0.02);}[data-theme="dark"] {--text-color: #fff;@@ -34,6 +35,7 @@--blue-button-color: white;--light-text-color: #aaa;--box-shadow: 0 1px 8px rgba(255, 255, 255, 0.2);+ --shaded-panel: rgba(255, 255, 255, 0.02);}[data-theme="light"] .docusaurus-highlight-code-line {diff --git a/packages/docs/src/pages/ChooseTemplate.tsx b/packages/docs/src/pages/ChooseTemplate.tsxnew file mode 100644index 0000000000..eb0c5acc39--- /dev/null+++ b/packages/docs/src/pages/ChooseTemplate.tsx@@ -0,0 +1,58 @@+import React from "react";+import { Blank } from "./icons/blank";+import { Cubes } from "./icons/cubes";+import { JSIcon } from "./icons/js";+import { Next } from "./icons/next";+import { TypeScriptIcon } from "./icons/ts";+import { TTSIcon } from "./icons/tts";+import { Waveform } from "./icons/waveform";+import { TemplateIcon } from "./template-icon";++const clone: React.CSSProperties = {+ fontSize: 13,+ textAlign: "center",+ borderBottom: "1px solid white",+ marginBottom: 10,+};++export const ChooseTemplate: React.FC = () => {+ return (+ <div+ style={{+ display: "flex",+ flexDirection: "column",+ }}+ >+ <div style={{ flex: 1 }} />+ <div+ style={{+ display: "flex",+ flexDirection: "row",+ justifyContent: "center",+ }}+ >+ <TemplateIcon label={"Blank Project"}>+ <Blank style={{ height: 40 }} />+ </TemplateIcon>+ <TemplateIcon label={"Hello World"}>+ <TypeScriptIcon style={{ height: 40 }} />+ </TemplateIcon>+ <TemplateIcon label={"Plain Javascript"}>+ <JSIcon style={{ width: 40 }} />+ </TemplateIcon>+ <TemplateIcon label={"Audio Visualizer"}>+ <Waveform style={{ width: 40 }} />+ </TemplateIcon>+ <TemplateIcon label={"3D Video"}>+ <Cubes style={{ width: 40 }} />+ </TemplateIcon>+ <TemplateIcon label={"Text to Speech"}>+ <TTSIcon style={{ height: 40 }} />+ </TemplateIcon>+ <TemplateIcon label={"Next.JS project"}>+ <Next style={{ width: 60 }} />+ </TemplateIcon>+ </div>+ </div>+ );+};diff --git a/packages/docs/src/pages/icons/blank.tsx b/packages/docs/src/pages/icons/blank.tsxnew file mode 100644index 0000000000..bd1c7709c7--- /dev/null+++ b/packages/docs/src/pages/icons/blank.tsx@@ -0,0 +1,22 @@+import React, { SVGProps } from "react";++export const Blank: React.FC<SVGProps<SVGSVGElement>> = (props) => {+ return (+ <svg+ aria-hidden="true"+ focusable="false"+ data-prefix="far"+ data-icon="file"+ className="svg-inline--fa fa-file fa-w-12"+ role="img"+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 384 512"+ {...props}+ >+ <path+ fill="currentColor"+ d="M369.9 97.9L286 14C277 5 264.8-.1 252.1-.1H48C21.5 0 0 21.5 0 48v416c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48V131.9c0-12.7-5.1-25-14.1-34zM332.1 128H256V51.9l76.1 76.1zM48 464V48h160v104c0 13.3 10.7 24 24 24h104v288H48z"+ />+ </svg>+ );+};diff --git a/packages/docs/src/pages/icons/cubes.tsx b/packages/docs/src/pages/icons/cubes.tsxnew file mode 100644index 0000000000..5a59667ddb--- /dev/null+++ b/packages/docs/src/pages/icons/cubes.tsx@@ -0,0 +1,22 @@+import React, { SVGProps } from "react";++export const Cubes: React.FC<SVGProps<SVGSVGElement>> = (props) => {+ return (+ <svg+ aria-hidden="true"+ focusable="false"+ data-prefix="fas"+ data-icon="cubes"+ className="svg-inline--fa fa-cubes fa-w-16"+ role="img"+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 512 512"+ {...props}+ >+ <path+ fill="currentColor"+ d="M488.6 250.2L392 214V105.5c0-15-9.3-28.4-23.4-33.7l-100-37.5c-8.1-3.1-17.1-3.1-25.3 0l-100 37.5c-14.1 5.3-23.4 18.7-23.4 33.7V214l-96.6 36.2C9.3 255.5 0 268.9 0 283.9V394c0 13.6 7.7 26.1 19.9 32.2l100 50c10.1 5.1 22.1 5.1 32.2 0l103.9-52 103.9 52c10.1 5.1 22.1 5.1 32.2 0l100-50c12.2-6.1 19.9-18.6 19.9-32.2V283.9c0-15-9.3-28.4-23.4-33.7zM358 214.8l-85 31.9v-68.2l85-37v73.3zM154 104.1l102-38.2 102 38.2v.6l-102 41.4-102-41.4v-.6zm84 291.1l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6zm240 112l-85 42.5v-79.1l85-38.8v75.4zm0-112l-102 41.4-102-41.4v-.6l102-38.2 102 38.2v.6z"+ />+ </svg>+ );+};diff --git a/packages/docs/src/pages/icons/js.tsx b/packages/docs/src/pages/icons/js.tsxnew file mode 100644index 0000000000..97a5862d5c--- /dev/null+++ b/packages/docs/src/pages/icons/js.tsx@@ -0,0 +1,16 @@+import React, { SVGProps } from "react";++export const JSIcon: React.FC<SVGProps<SVGSVGElement>> = (props) => {+ return (+ <svg+ className="svg-inline--fa fa-js-square fa-w-14"+ viewBox="0 0 448 512"+ {...props}+ >+ <path+ fill="currentColor"+ d="M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zM243.8 381.4c0 43.6-25.6 63.5-62.9 63.5-33.7 0-53.2-17.4-63.2-38.5l34.3-20.7c6.6 11.7 12.6 21.6 27.1 21.6 13.8 0 22.6-5.4 22.6-26.5V237.7h42.1v143.7zm99.6 63.5c-39.1 0-64.4-18.6-76.7-43l34.3-19.8c9 14.7 20.8 25.6 41.5 25.6 17.4 0 28.6-8.7 28.6-20.8 0-14.4-11.4-19.5-30.7-28l-10.5-4.5c-30.4-12.9-50.5-29.2-50.5-63.5 0-31.6 24.1-55.6 61.6-55.6 26.8 0 46 9.3 59.8 33.7L368 290c-7.2-12.9-15-18-27.1-18-12.3 0-20.1 7.8-20.1 18 0 12.6 7.8 17.7 25.9 25.6l10.5 4.5c35.8 15.3 55.9 31 55.9 66.2 0 37.8-29.8 58.6-69.7 58.6z"+ />+ </svg>+ );+};diff --git a/packages/docs/src/pages/icons/next.tsx b/packages/docs/src/pages/icons/next.tsxnew file mode 100644index 0000000000..8de5c1cd65--- /dev/null+++ b/packages/docs/src/pages/icons/next.tsx@@ -0,0 +1,45 @@+import React, { SVGProps } from "react";++export const Next: React.FC<SVGProps<SVGSVGElement>> = () => {+ return (+ <svg+ width="207px"+ height="124px"+ viewBox="0 0 207 124"+ version="1.1"+ xmlns="http://www.w3.org/2000/svg"+ >+ <g+ id="Page-1"+ stroke="none"+ strokeWidth="1"+ fill="none"+ fillRule="evenodd"+ >+ <g+ id="Black-Next.js"+ transform="translate(-247.000000, -138.000000)"+ fill="currentColor"+ fillRule="nonzero"+ >+ <g id="next-black" transform="translate(247.000000, 138.000000)">+ <g id="EXT-+-Type-something">+ <path+ d="M48.9421964,32.6320058 L87.9011585,32.6320058 L87.9011585,35.7136421 L52.5134345,35.7136421 L52.5134345,58.9070103 L85.7908813,58.9070103 L85.7908813,61.9886466 L52.5134345,61.9886466 L52.5134345,87.4526941 L88.306981,87.4526941 L88.306981,90.5343303 L48.9421964,90.5343303 L48.9421964,32.6320058 Z M91.3912326,32.6320058 L95.5306221,32.6320058 L113.8738,58.0960534 L132.622801,32.6320058 L158.124498,0.286809811 L116.22757,60.7722112 L137.817329,90.5343303 L133.51561,90.5343303 L113.8738,63.4483691 L94.1508254,90.5343303 L89.9302715,90.5343303 L111.682358,60.7722112 L91.3912326,32.6320058 Z M139.359455,35.713642 L139.359455,32.6320058 L183.756439,32.6320058 L183.756439,35.7136421 L163.302983,35.7136421 L163.302983,90.5343303 L159.731745,90.5343303 L159.731745,35.7136421 L139.359455,35.713642 Z"+ id="EXT"+ />+ <polygon+ id="Type-something"+ points="0.202923647 32.6320058 4.66697141 32.6320058 66.2235778 124.303087 40.785176 90.5343303 3.93649086 37.0111732 3.77416185 90.5343303 0.202923647 90.5343303"+ />+ </g>+ <path+ d="M183.396622,86.5227221 C184.134938,86.5227221 184.673474,85.9601075 184.673474,85.233037 C184.673474,84.5059658 184.134938,83.9433513 183.396622,83.9433513 C182.666993,83.9433513 182.11977,84.5059658 182.11977,85.233037 C182.11977,85.9601075 182.666993,86.5227221 183.396622,86.5227221 Z M186.905793,83.1297235 C186.905793,85.2763149 188.460599,86.678523 190.727662,86.678523 C193.142388,86.678523 194.601647,85.233037 194.601647,82.7229099 L194.601647,73.8855335 L192.655968,73.8855335 L192.655968,82.7142542 C192.655968,84.1078073 191.952397,84.8521899 190.710289,84.8521899 C189.598473,84.8521899 188.842785,84.1597409 188.816727,83.1297235 L186.905793,83.1297235 Z M197.146664,83.0172011 C197.285642,85.2503478 199.153145,86.678523 201.932686,86.678523 C204.903321,86.678523 206.762139,85.1811034 206.762139,82.792155 C206.762139,80.9138876 205.702439,79.8752151 203.131364,79.2779777 L201.750279,78.9404092 C200.117298,78.5595622 199.457158,78.0488813 199.457158,77.1573541 C199.457158,76.0321243 200.482113,75.296398 202.019547,75.296398 C203.478806,75.296398 204.48639,76.0148135 204.668797,77.1660091 L206.562359,77.1660091 C206.44944,75.0626962 204.590622,73.5825873 202.045605,73.5825873 C199.309495,73.5825873 197.48542,75.0626962 197.48542,77.2871878 C197.48542,79.1221767 198.519063,80.2127835 200.786126,80.7407758 L202.401734,81.1302779 C204.060773,81.5197807 204.790402,82.091051 204.790402,83.0431676 C204.790402,84.1510859 203.643842,84.9560573 202.08035,84.9560573 C200.403939,84.9560573 199.240006,84.2030196 199.074971,83.0172011 L197.146664,83.0172011 Z"+ id=".JS"+ />+ </g>+ </g>+ </g>+ </svg>+ );+};diff --git a/packages/docs/src/pages/icons/ts.tsx b/packages/docs/src/pages/icons/ts.tsxnew file mode 100644index 0000000000..9b08410719--- /dev/null+++ b/packages/docs/src/pages/icons/ts.tsx@@ -0,0 +1,22 @@+import React, { SVGProps } from "react";++export const TypeScriptIcon: React.FC<SVGProps<SVGSVGElement>> = (props) => {+ return (+ <svg+ aria-hidden="true"+ focusable="false"+ data-prefix="fas"+ data-icon="globe-europe"+ className="svg-inline--fa fa-globe-europe fa-w-16"+ role="img"+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 496 512"+ {...props}+ >+ <path+ fill="currentColor"+ d="M248 8C111 8 0 119 0 256s111 248 248 248 248-111 248-248S385 8 248 8zm200 248c0 22.5-3.9 44.2-10.8 64.4h-20.3c-4.3 0-8.4-1.7-11.4-4.8l-32-32.6c-4.5-4.6-4.5-12.1.1-16.7l12.5-12.5v-8.7c0-3-1.2-5.9-3.3-8l-9.4-9.4c-2.1-2.1-5-3.3-8-3.3h-16c-6.2 0-11.3-5.1-11.3-11.3 0-3 1.2-5.9 3.3-8l9.4-9.4c2.1-2.1 5-3.3 8-3.3h32c6.2 0 11.3-5.1 11.3-11.3v-9.4c0-6.2-5.1-11.3-11.3-11.3h-36.7c-8.8 0-16 7.2-16 16v4.5c0 6.9-4.4 13-10.9 15.2l-31.6 10.5c-3.3 1.1-5.5 4.1-5.5 7.6v2.2c0 4.4-3.6 8-8 8h-16c-4.4 0-8-3.6-8-8s-3.6-8-8-8H247c-3 0-5.8 1.7-7.2 4.4l-9.4 18.7c-2.7 5.4-8.2 8.8-14.3 8.8H194c-8.8 0-16-7.2-16-16V199c0-4.2 1.7-8.3 4.7-11.3l20.1-20.1c4.6-4.6 7.2-10.9 7.2-17.5 0-3.4 2.2-6.5 5.5-7.6l40-13.3c1.7-.6 3.2-1.5 4.4-2.7l26.8-26.8c2.1-2.1 3.3-5 3.3-8 0-6.2-5.1-11.3-11.3-11.3H258l-16 16v8c0 4.4-3.6 8-8 8h-16c-4.4 0-8-3.6-8-8v-20c0-2.5 1.2-4.9 3.2-6.4l28.9-21.7c1.9-.1 3.8-.3 5.7-.3C358.3 56 448 145.7 448 256zM130.1 149.1c0-3 1.2-5.9 3.3-8l25.4-25.4c2.1-2.1 5-3.3 8-3.3 6.2 0 11.3 5.1 11.3 11.3v16c0 3-1.2 5.9-3.3 8l-9.4 9.4c-2.1 2.1-5 3.3-8 3.3h-16c-6.2 0-11.3-5.1-11.3-11.3zm128 306.4v-7.1c0-8.8-7.2-16-16-16h-20.2c-10.8 0-26.7-5.3-35.4-11.8l-22.2-16.7c-11.5-8.6-18.2-22.1-18.2-36.4v-23.9c0-16 8.4-30.8 22.1-39l42.9-25.7c7.1-4.2 15.2-6.5 23.4-6.5h31.2c10.9 0 21.4 3.9 29.6 10.9l43.2 37.1h18.3c8.5 0 16.6 3.4 22.6 9.4l17.3 17.3c3.4 3.4 8.1 5.3 12.9 5.3H423c-32.4 58.9-93.8 99.5-164.9 103.1z"+ />+ </svg>+ );+};diff --git a/packages/docs/src/pages/icons/tts.tsx b/packages/docs/src/pages/icons/tts.tsxnew file mode 100644index 0000000000..bdfa19e790--- /dev/null+++ b/packages/docs/src/pages/icons/tts.tsx@@ -0,0 +1,22 @@+import React, { SVGProps } from "react";++export const TTSIcon: React.FC<SVGProps<SVGSVGElement>> = (props) => {+ return (+ <svg+ aria-hidden="true"+ focusable="false"+ data-prefix="fas"+ data-icon="volume"+ className="svg-inline--fa fa-volume fa-w-15"+ role="img"+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 480 512"+ {...props}+ >+ <path+ fill="currentColor"+ d="M215.03 71.05L126.06 160H24c-13.26 0-24 10.74-24 24v144c0 13.25 10.74 24 24 24h102.06l88.97 88.95c15.03 15.03 40.97 4.47 40.97-16.97V88.02c0-21.46-25.96-31.98-40.97-16.97zM480 256c0-63.53-32.06-121.94-85.77-156.24-11.19-7.14-26.03-3.82-33.12 7.46s-3.78 26.21 7.41 33.36C408.27 165.97 432 209.11 432 256s-23.73 90.03-63.48 115.42c-11.19 7.14-14.5 22.07-7.41 33.36 6.51 10.36 21.12 15.14 33.12 7.46C447.94 377.94 480 319.53 480 256zm-141.77-76.87c-11.58-6.33-26.19-2.16-32.61 9.45-6.39 11.61-2.16 26.2 9.45 32.61C327.98 228.28 336 241.63 336 256c0 14.38-8.02 27.72-20.92 34.81-11.61 6.41-15.84 21-9.45 32.61 6.43 11.66 21.05 15.8 32.61 9.45 28.23-15.55 45.77-45 45.77-76.88s-17.54-61.32-45.78-76.86z"+ />+ </svg>+ );+};diff --git a/packages/docs/src/pages/icons/waveform.tsx b/packages/docs/src/pages/icons/waveform.tsxnew file mode 100644index 0000000000..1a2cfd10f1--- /dev/null+++ b/packages/docs/src/pages/icons/waveform.tsx@@ -0,0 +1,22 @@+import React, { SVGProps } from "react";++export const Waveform: React.FC<SVGProps<SVGSVGElement>> = (props) => {+ return (+ <svg+ aria-hidden="true"+ focusable="false"+ data-prefix="fas"+ data-icon="waveform"+ className="svg-inline--fa fa-waveform fa-w-20"+ role="img"+ xmlns="http://www.w3.org/2000/svg"+ viewBox="0 0 640 512"+ {...props}+ >+ <path+ fill="currentColor"+ d="M140 192h-24a16 16 0 0 0-16 16v96a16 16 0 0 0 16 16h24a16 16 0 0 0 16-16v-96a16 16 0 0 0-16-16zm-96 32H20a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h24a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM236 96h-24a16 16 0 0 0-16 16v288a16 16 0 0 0 16 16h24a16 16 0 0 0 16-16V112a16 16 0 0 0-16-16zm384 128h-24a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h24a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zM524 64h-24a16 16 0 0 0-16 16v352a16 16 0 0 0 16 16h24a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm-96 64h-24a16 16 0 0 0-16 16v224a16 16 0 0 0 16 16h24a16 16 0 0 0 16-16V144a16 16 0 0 0-16-16zM332 0h-24a16 16 0 0 0-16 16v480a16 16 0 0 0 16 16h24a16 16 0 0 0 16-16V16a16 16 0 0 0-16-16z"+ />+ </svg>+ );+};diff --git a/packages/docs/src/pages/index.tsx b/packages/docs/src/pages/index.tsxindex e2579ce7ac..3cef5817c0 100644--- a/packages/docs/src/pages/index.tsx+++ b/packages/docs/src/pages/index.tsx@@ -7,47 +7,69 @@ import { IfYouKnowReact } from "../../components/LandingPage/if-you-know-react";import { Parametrize } from "../../components/LandingPage/parametrize";import { RealMP4Videos } from "../../components/LandingPage/real-mp4-videos";import { WriteInReact } from "../../components/LandingPage/WriteInReact";+import { ChooseTemplate } from "./ChooseTemplate";import styles from "./landing.module.css";setTimeout(() => {splitbee.init();}, 100);+const clone: React.CSSProperties = {+ fontSize: 13,+ textAlign: "center",+ paddingBottom: 10,+ paddingTop: 10,+};const NewLanding: React.FC = () => {return (<Layouttitle="Write videos in React"description="Create MP4 motion graphics in React. Leverage CSS, SVG, WebGL and more technologies to render videos programmatically!">+ <div style={{ height: "10vh" }} /><div className={styles.content}>- <WriteInReact></WriteInReact>+ <WriteInReact /><br /><br />+ </div>+ <div+ style={{+ backgroundColor: "var(--shaded-panel)",+ paddingBottom: 20,+ }}+ >+ <div style={clone}>Clone a template to get started</div>++ <div className={styles.content}>+ <ChooseTemplate />+ </div>+ </div>+ <div className={styles.content}><br /><br /><br />- <IfYouKnowReact></IfYouKnowReact>+ <IfYouKnowReact /><br /><br /><br /><br /><br />- <RealMP4Videos></RealMP4Videos>+ <RealMP4Videos /><br /><br /><br /><br />- <LightningFastEditor></LightningFastEditor>+ <LightningFastEditor /><br /><br /><br /><br />- <Parametrize></Parametrize>+ <Parametrize /><br /><br /><br /><br />- <FreePricing></FreePricing>+ <FreePricing /></div></Layout>);diff --git a/packages/docs/src/pages/landing.module.css b/packages/docs/src/pages/landing.module.cssindex 25fbd63d56..577d968a77 100644--- a/packages/docs/src/pages/landing.module.css+++ b/packages/docs/src/pages/landing.module.css@@ -1,7 +1,6 @@.content {max-width: 1000px;margin: auto;- padding-top: 10vh;padding-left: 20px;padding-right: 20px;}diff --git a/packages/docs/src/pages/template-icon.tsx b/packages/docs/src/pages/template-icon.tsxnew file mode 100644index 0000000000..3d4ba8622a--- /dev/null+++ b/packages/docs/src/pages/template-icon.tsx@@ -0,0 +1,35 @@+import React from "react";++const outer: React.CSSProperties = {+ width: 110,+ textAlign: "center",+ display: "flex",+ alignItems: "center",+ flexDirection: "column",+};++const icon: React.CSSProperties = {+ display: "flex",+ width: 50,+ height: 50,+ justifyContent: "center",+ alignItems: "center",+ margin: 10,+};++const labelStyle: React.CSSProperties = {+ fontSize: 12,+ cursor: "pointer",+};++export const TemplateIcon: React.FC<{ label: string }> = ({+ children,+ label,+}) => {+ return (+ <div style={outer}>+ <div style={icon}>{children}</div>+ <div style={labelStyle}>{label}</div>+ </div>+ );+};