🎥 Make videos programmatically with React
cool
Jonny Burger52bc7d98ed4a
diff --git a/packages/docs/components/TextInput.tsx b/packages/docs/components/TextInput.tsxindex 2ecbdb112e..ee3ea4583d 100644--- a/packages/docs/components/TextInput.tsx+++ b/packages/docs/components/TextInput.tsx@@ -1,9 +1,6 @@import type { DetailedHTMLProps } from "react";import React, { useCallback, useState } from "react";-const LIGHT_BLUE = "#42e9f5";-const DARK_BLUE = "#4290f5";-const inputStyle: React.CSSProperties = {padding: 16,border: "none",@@ -19,11 +16,9 @@ const backgroundStyle = (): React.CSSProperties => {return {padding: 3,- background: focused- ? `linear-gradient(to right, ${LIGHT_BLUE}, ${DARK_BLUE})`- : "rgba(0, 0, 0, 0.1)",+ background: focused ? "var(--ifm-color-primary)" : "rgba(0, 0, 0, 0.1)",display: fullWidth ? "block" : "inline-block",- transition: "1s background-color",+ transition: "0.2s background-color",borderRadius: 7,overflow: "hidden",};diff --git a/packages/docs/src/components/V4Countdown.tsx b/packages/docs/src/components/V4Countdown.tsxindex 7a7d26e001..6de9780112 100644--- a/packages/docs/src/components/V4Countdown.tsx+++ b/packages/docs/src/components/V4Countdown.tsx@@ -1,24 +1,36 @@-import { useEffect } from "react";-import React from "react";-import { useState } from "react";+import React, { useEffect, useState } from "react";const style: React.CSSProperties = {- display: "flex",+ display: "inline-flex",flex: 1,justifyContent: "center",alignItems: "center",+ border: "2px solid #000",+ backgroundColor: "#F9F9F9",+ borderRadius: 10,+ padding: 10,};const timeWrapper: React.CSSProperties = {- padding: "10px",- borderRadius: " 15px",- paddingBottom: "10px",+ borderRadius: "15px",display: "flex",flexDirection: "column",- fontSize: "3em",justifyContent: "center",alignItems: "center",fontVariantNumeric: "tabular-nums",+ fontFamily: "GTPlanar",+ width: 80,+};++const timeAmount: React.CSSProperties = {+ fontWeight: 900,+ fontSize: "3em",+ marginBottom: 0,+ lineHeight: 1,+};++const timeLabel: React.CSSProperties = {+ marginBottom: 0,};export const V4Countdown: React.FC = () => {@@ -65,21 +77,22 @@ export const V4Countdown: React.FC = () => {return (<div style={style}>- <h1 style={timeWrapper}>- {countdown[0]}- <p style={{ fontSize: "16px" }}> Days</p>- </h1>- <h1 style={timeWrapper}>- {countdown[1]}- <p style={{ fontSize: "16px" }}> Hours</p>- </h1>- <h1 style={timeWrapper}>- {countdown[2]}- <p style={{ fontSize: "16px" }}> Minutes</p>- </h1>- <h1 style={timeWrapper}>- {countdown[3]} <p style={{ fontSize: "16px" }}> Seconds</p>- </h1>+ <div style={timeWrapper}>+ <h1 style={timeAmount}>{countdown[0]}</h1>+ <p style={timeLabel}>days</p>+ </div>+ <div style={timeWrapper}>+ <h1 style={timeAmount}>{countdown[1]}</h1>+ <p style={timeLabel}>hours</p>+ </div>+ <div style={timeWrapper}>+ <h1 style={timeAmount}>{countdown[2]}</h1>+ <p style={timeLabel}>min</p>+ </div>+ <div style={timeWrapper}>+ <h1 style={timeAmount}> {countdown[3]}</h1>+ <p style={timeLabel}>sec</p>+ </div></div>);};diff --git a/packages/docs/src/pages/4/index.tsx b/packages/docs/src/pages/4/index.tsxindex 60d793e310..effa907a33 100644--- a/packages/docs/src/pages/4/index.tsx+++ b/packages/docs/src/pages/4/index.tsx@@ -1,15 +1,12 @@/* eslint-disable no-alert */-import { useMemo } from "react";-import { useCallback, useState } from "react";-import React from "react";-import Layout from "@theme/Layout";import Head from "@docusaurus/Head";-import { Seo } from "../../components/Seo";-import styles from "./v4.module.css";-import { BlueButton } from "../../../components/layout/Button";-import { CoolInput } from "../../../components/TextInput";+import Layout from "@theme/Layout";+import React, { useCallback, useMemo, useState } from "react";import { Spacer } from "../../../components/layout/Spacer";+import { CoolInput } from "../../../components/TextInput";+import { Seo } from "../../components/Seo";import { V4Countdown } from "../../components/V4Countdown";+import styles from "./v4.module.css";const spacer: React.CSSProperties = {height: "10px",@@ -84,57 +81,80 @@ const V4: React.FC = () => {<Head>{Seo.renderTitle("Remotion V4")}</Head><div className={styles.container}><div className={styles.wrapper}>- <h1 className={styles.pagetitle}>Remotion V4 launches in</h1>-- <V4Countdown />+ <h1 className={styles.pagetitle}>Do more with React.</h1><div style={{ display: "flex", justifyContent: "center" }}>- <p className={styles.title}>On July 3, 7 p.m UTC+2</p>+ <p className={styles.title}>+ Learn about the new possibilities of Remotion 4.0 and celebrate+ the launch with us.{" "}+ </p></div>- <div style={{ display: "flex", justifyContent: "center" }}>- <a- href="/documents/RemotionV4Launch.ics"- download="RemotionV4Launch.ics"- >- Add to Calendar- </a>+ <br />+ <br />+ <div style={{ textAlign: "center" }}>+ <div>+ <V4Countdown />+ </div>+ <div>+ <div className={[styles.button, styles.calendarbutton].join(" ")}>+ <a+ href="/documents/RemotionV4Launch.ics"+ download="RemotionV4Launch.ics"+ >+ Add to Calendar+ </a>+ </div>+ </div></div><div style={{ height: "60px" }} />-- <p className={styles.title}> July 3: V4 keynotes</p>- <p> Whats new with Remotion V4? </p>- <p className={styles.title}> July 4: .....</p>- <p> insert text</p>-- <p className={styles.title}> July 5: .....</p>- <p> Insert text</p>- <div className={styles.panel}>- <p>- Get a newsletter with all the imporant information when Remotion- V4 launches!- </p>- <CoolInput- type="email"- autoComplete="none"- onChange={onChange}- placeholder="Your email adress"- style={{ width: "100%" }}+ <div className={styles.grid}>+ <EventComp+ description="Celebrate the launch of Remotion 4.0 and experience the new possibilities of video creation with React."+ date="July 3rd"+ title="Keynote"+ />+ <EventComp+ date="July 4th"+ title="Visual editing"+ description="Expose parameters to the user interface, edit them, see the result in real-time and save them back to code."+ />+ <EventComp+ date="July 5th"+ title="Render button"+ description="Parametrize React content and export React components as videos and other media with the click of a button."+ />+ <EventComp+ description="Leverage the new system for data fetching and dynamically calculating the duration and dimensions of your video."+ date="July 6th"+ title="Data-driven videos"/>- <Spacer />- <Spacer />+ <EventComp+ description="A rundown of the remaining improvements coming with Remotion 4.0."+ date="July 7th"+ title="Last but not least"+ />+ <div className={styles.panel}>+ <p>Get a reminder on July 3rd:</p>+ <CoolInput+ type="email"+ autoComplete="none"+ onChange={onChange}+ placeholder="Your email adress"+ style={{ width: "100%", fontFamily: "GTPlanar" }}+ />+ <Spacer />+ <Spacer />- <BlueButton- type="submit"- fullWidth- onClick={onSubmit}- loading={loading}- disabled={loading || subscribed}- size="bg"- >- {buttonLabel}- </BlueButton>- <Spacer />- <div style={errorStyle}>{error}</div>+ <button+ type="submit"+ onClick={onSubmit}+ disabled={loading || subscribed}+ >+ {buttonLabel}+ </button>+ <Spacer />+ <div style={errorStyle}>{error}</div>+ </div></div><div style={spacer} /><div style={spacer} />@@ -144,4 +164,24 @@ const V4: React.FC = () => {);};+export const EventComp: React.FC<{+ date: string;+ title: string;+ description: string;+}> = ({ date, title, description }) => {+ return (+ <div+ style={{+ border: "2px solid var(--ifm-font-color-base)",+ borderRadius: 8,+ padding: 10,+ }}+ >+ <p className={styles.date}>{date}</p>+ <p className={styles.eventtitle}>{title}</p>+ <p>{description}</p>+ </div>+ );+};+export default V4;diff --git a/packages/docs/src/pages/4/v4.module.css b/packages/docs/src/pages/4/v4.module.cssindex 8367a1172b..dbd8046e23 100644--- a/packages/docs/src/pages/4/v4.module.css+++ b/packages/docs/src/pages/4/v4.module.css@@ -5,7 +5,7 @@.wrapper {max-width: 1000px;margin: auto;- padding-top: 60px;+ padding-top: 100px;padding-left: 20px;padding-right: 20px;display: flex;@@ -13,9 +13,8 @@}.panel {- background-color: var(--ifm-background-color);- box-shadow: var(--box-shadow);- padding: 10px;+ border: 2px solid var(--ifm-font-color-base);+ padding: 14px;border-radius: 15px;flex: 1;padding-bottom: 10px;@@ -27,10 +26,73 @@.title {font-size: 1.2rem;margin-bottom: 0;- font-weight: bold;+ font-weight: 500;+ margin-top: -5px;+ font-weight: 600;+ margin-bottom: 10px;+}++.eventtitle {+ font-size: 1.2rem;+ margin-bottom: 0;+ font-weight: 500;+ margin-top: -5px;+ font-weight: 600;+ margin-bottom: 10px;+ margin-left: 70px;}.pagetitle {- font-size: 3em;+ font-size: 5em;text-align: center;+ font-weight: 900;+}++.button {+ background-color: var(--ifm-color-primary);+ border: none;+ border-radius: 8px;+ padding: 3px 12px;+ font-size: 1.1rem;+ font-weight: 500;+ cursor: pointer;+ margin-top: 10px;+ margin-bottom: 10px;+ display: inline-block;+ text-align: center;+ border: 2px solid black;+ border-bottom-width: 4px;+}++.calendarbutton {+ margin-top: -20px;+ position: relative;+}++.button a {+ color: white;+ font-family: "GTPlanar";+}++.date {+ background-color: var(--ifm-color-primary);+ border: 2px solid black;+ border-bottom: 3px solid black;+ color: white;+ border-radius: 8px;+ font-family: "GTPlanar";+ padding: 3px 8px;+ display: inline;+ font-weight: bold;+ position: absolute;+ margin-left: -20px;+ margin-top: -8px;+}++.grid {+ display: grid;+ grid-template-columns: repeat(2, 1fr);+ grid-gap: 20px;+ margin-top: 20px;+ grid-auto-rows: 1fr;}diff --git a/packages/docs/static/documents/RemotionV4Launch.ics b/packages/docs/static/documents/RemotionV4Launch.icsindex 96d1261086..bc96cb9801 100644--- a/packages/docs/static/documents/RemotionV4Launch.ics+++ b/packages/docs/static/documents/RemotionV4Launch.ics@@ -28,11 +28,11 @@ UID:[email protected]DTSTART;TZID=Europe/Zurich:20230703T190000DTEND;TZID=Europe/Zurich:20230703T200000SUMMARY:Remotion V4 Launch-DESCRIPTION:https://www.remotion.dev/4\n\nLink to the YoutTube livestream:+DESCRIPTION:Watch it on https://www.remotion.dev/4\nBEGIN:VALARMACTION:DISPLAYDESCRIPTION:Remotion V4 LaunchTRIGGER:-P1DEND:VALARMEND:VEVENT-END:VCALENDAR\ No newline at end of file+END:VCALENDAR