Skip to content

🎥 Make videos programmatically with React

move to page header

Jonny Burgered6133ba12b9
diff --git a/packages/docs/docs/getting-started.md b/packages/docs/docs/getting-started.md
index 89ab481da3..32e6b167f2 100644
--- a/packages/docs/docs/getting-started.md
+++ b/packages/docs/docs/getting-started.md
@@ -22,13 +22,13 @@ Please read these guides to install them in case you haven't yet.
You can initialize a new Remotion video using
<Tabs
- defaultValue="npm"
- values={[
- { label: 'npm', value: 'npm', },
- { label: 'Yarn', value: 'yarn', },
- ]
+defaultValue="npm"
+values={[
+{ label: 'npm', value: 'npm', },
+{ label: 'yarn', value: 'yarn', },
+]
}>
- <TabItem value="npm">
+<TabItem value="npm">
```bash
npm init video
@@ -57,4 +57,4 @@ Linux users need to install some additional packages to get Chrome/Puppeteer wor
apt install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget libgbm-dev
```
-Got instructions for more Linux distributions? [Add them to this page](https://github.com/JonnyBurger/remotion/edit/main/packages/docs/docs/getting-started.md)!
\ No newline at end of file
+Got instructions for more Linux distributions? [Add them to this page](https://github.com/JonnyBurger/remotion/edit/main/packages/docs/docs/getting-started.md)!
diff --git a/packages/docs/src/pages/index.tsx b/packages/docs/src/pages/index.tsx
index 58767d6c3e..984f96bc8f 100644
--- a/packages/docs/src/pages/index.tsx
+++ b/packages/docs/src/pages/index.tsx
@@ -2,11 +2,12 @@ import Link from "@docusaurus/Link";
import useBaseUrl from "@docusaurus/useBaseUrl";
import splitbee from "@splitbee/web";
import Layout from "@theme/Layout";
+import TabItem from "@theme/TabItem";
+import Tabs from "@theme/Tabs";
import clsx from "clsx";
-import React from "react";
+import React, { useState } from "react";
import headerStyles from "./header.module.css";
import styles from "./styles.module.css";
-
setTimeout(() => {
splitbee.init();
}, 100);
@@ -65,13 +66,20 @@ const Feature: React.FC<{
};
const Snippet: React.FC<{
- snippetValue: string
-}> = ({snippetValue}) => {
+ snippetValue: string;
+}> = ({ snippetValue }) => {
+ const [copied, setCopied] = useState(false);
return (
<div className={styles.snippet}>
<div className={styles.snippetValue}>$ {snippetValue}</div>
- <div className={styles.copySnippet} onClick={() => {navigator.clipboard.writeText(snippetValue)}}>
- copy
+ <div
+ className={styles.copySnippet}
+ onClick={() => {
+ navigator.clipboard.writeText(snippetValue);
+ setCopied(true);
+ }}
+ >
+ {copied ? "Copied!" : "Copy"}
</div>
</div>
);
@@ -84,11 +92,27 @@ const PageHeader: React.FC = () => {
<h1 className={headerStyles.title}>
Write videos programmatically in React
</h1>
- <p>
+ <p style={{ marginBottom: 0 }}>
Use your React knowledge to create real MP4 videos. Render videos
dynamically using server-side rendering and parametrization.
</p>
+ <Tabs
+ defaultValue="npm"
+ values={[
+ { label: "NPM", value: "npm" },
+ { label: "Yarn", value: "yarn" },
+ ]}
+ >
+ <TabItem value="npm">
+ <Snippet snippetValue={"npm init video"} />
+ </TabItem>
+
+ <TabItem value="yarn">
+ <Snippet snippetValue={"yarn create video"} />
+ </TabItem>
+ </Tabs>
</div>
+ <div style={{ width: 20 }}></div>
<iframe
style={{
width: 560,
@@ -115,13 +139,7 @@ function Home() {
<header className={clsx("hero ", styles.heroBanner)}>
<div className="container">
<PageHeader />
- <br />
- <div className={styles.snippets}>
- <div className={styles.snippetsTitle}>Get Started in seconds with :</div>
- <Snippet snippetValue={"npm init video"} />
- or
- <Snippet snippetValue={"yarn create video"} />
- </div>
+
<br />
<div>
<StartPageExplainer
diff --git a/packages/docs/src/pages/styles.module.css b/packages/docs/src/pages/styles.module.css
index 5c4a047256..992ba1b7b9 100644
--- a/packages/docs/src/pages/styles.module.css
+++ b/packages/docs/src/pages/styles.module.css
@@ -5,7 +5,7 @@
* and scoped locally.
*/
- .heroBanner {
+.heroBanner {
padding: 4rem 0;
text-align: center;
position: relative;
@@ -60,38 +60,32 @@
}
.snippet {
- padding: 10px 10px 10px 20px;
- background-color: #44494f;
- height: fit-content;
- margin-top: 10px;
+ padding: 12px 12px 10px 20px;
+ background-color: #111111;
margin-bottom: 10px;
display: flex;
flex-direction: row;
+ align-items: center;
position: relative;
border-radius: 0.4rem;
}
.snippetValue {
color: white;
- font-size: 1em;
- font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
- Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
+ font-size: 1.5em;
+ font-family: monospace;
}
.copySnippet {
- background-color: #303845;
color: white;
right: 15px;
- padding: 0px 10px;
+ padding: 2px 10px;
border-radius: 0.4rem;
position: absolute;
- border: 1px white solid;
width: fit-content;
}
.copySnippet:hover {
cursor: pointer;
- background-color: white;
- color: #44494f;
- border: 1px #44494f solid;
-}
\ No newline at end of file
+ background-color: rgba(255, 255, 255, 0.15);
+}