🎥 Make videos programmatically with React
cool
Jonny Burgerd6c8f9cbb43b
diff --git a/packages/docs/src/remotion/HomepageVideo/Card.tsx b/packages/docs/src/remotion/HomepageVideo/Card.tsxindex 52c8c836f0..7839a3739b 100644--- a/packages/docs/src/remotion/HomepageVideo/Card.tsx+++ b/packages/docs/src/remotion/HomepageVideo/Card.tsx@@ -1,5 +1,6 @@import React, { createRef, useCallback, useRef, useState } from "react";import { AbsoluteFill, spring } from "remotion";+import { CurrentCountry } from "./CurrentCountry";import styles from "./player-styles.module.css";export const paddingAndMargin = 20;@@ -282,6 +283,7 @@ const Card: React.FC<{}}className={styles.content}>+ <CurrentCountry />{content}</AbsoluteFill></div>diff --git a/packages/docs/src/remotion/HomepageVideo/CurrentCountry.tsx b/packages/docs/src/remotion/HomepageVideo/CurrentCountry.tsxnew file mode 100644index 0000000000..f084751eae--- /dev/null+++ b/packages/docs/src/remotion/HomepageVideo/CurrentCountry.tsx@@ -0,0 +1,26 @@+import { getBoundingBox, resetPath } from "@remotion/paths";+import React from "react";+import { AbsoluteFill } from "remotion";+import { countriesPaths } from "./paths";++export const CurrentCountry: React.FC = () => {+ const paths = countriesPaths.filter((c) => c.class === "US");+ const joined = paths.map((p) => p.d).join(" ");+ const reset = resetPath(joined);+ const boundingBox = getBoundingBox(reset);++ return (+ <AbsoluteFill>+ <svg+ viewBox={boundingBox.viewBox}+ style={{+ height: "100%",+ width: "100%",+ scale: "0.6",+ }}+ >+ <path fill="#222" d={reset} />+ </svg>+ </AbsoluteFill>+ );+};