Skip to content

🎥 Make videos programmatically with React

Remove unused components

ASchwad3f8b27263a05
diff --git a/packages/template-code-generation/src/remotion/MyComp/Main.tsx b/packages/template-code-generation/src/remotion/MyComp/Main.tsx
deleted file mode 100644
index cf23037a59..0000000000
--- a/packages/template-code-generation/src/remotion/MyComp/Main.tsx
+++ /dev/null
@@ -1,58 +0,0 @@
-import { z } from "zod";
-import {
- AbsoluteFill,
- Sequence,
- spring,
- useCurrentFrame,
- useVideoConfig,
-} from "remotion";
-import { CompositionProps } from "../../../types/constants";
-import { NextLogo } from "./NextLogo";
-import { loadFont, fontFamily } from "@remotion/google-fonts/Inter";
-import { Rings } from "./Rings";
-import { TextFade } from "./TextFade";
-
-loadFont("normal", {
- subsets: ["latin"],
- weights: ["400", "700"],
-});
-export const Main = ({ title }: z.infer<typeof CompositionProps>) => {
- const frame = useCurrentFrame();
- const { fps } = useVideoConfig();
-
- const transitionStart = 2 * fps;
- const transitionDuration = 1 * fps;
-
- const logoOut = spring({
- fps,
- frame,
- config: {
- damping: 200,
- },
- durationInFrames: transitionDuration,
- delay: transitionStart,
- });
-
- return (
- <AbsoluteFill className="bg-white">
- <Sequence durationInFrames={transitionStart + transitionDuration}>
- <Rings outProgress={logoOut}></Rings>
- <AbsoluteFill className="justify-center items-center">
- <NextLogo outProgress={logoOut}></NextLogo>
- </AbsoluteFill>
- </Sequence>
- <Sequence from={transitionStart + transitionDuration / 2}>
- <TextFade>
- <h1
- className="text-[70px] font-bold"
- style={{
- fontFamily,
- }}
- >
- {title}
- </h1>
- </TextFade>
- </Sequence>
- </AbsoluteFill>
- );
-};
diff --git a/packages/template-code-generation/src/remotion/MyComp/NextLogo.tsx b/packages/template-code-generation/src/remotion/MyComp/NextLogo.tsx
deleted file mode 100644
index b7f87f6bf2..0000000000
--- a/packages/template-code-generation/src/remotion/MyComp/NextLogo.tsx
+++ /dev/null
@@ -1,122 +0,0 @@
-import { evolvePath } from "@remotion/paths";
-import React, { useMemo } from "react";
-import { interpolate, spring, useCurrentFrame, useVideoConfig } from "remotion";
-
-const nStroke =
- "M149.508 157.52L69.142 54H54V125.97H66.1136V69.3836L139.999 164.845C143.333 162.614 146.509 160.165 149.508 157.52Z";
-
-export const NextLogo: React.FC<{
- outProgress: number;
-}> = ({ outProgress }) => {
- const { fps } = useVideoConfig();
- const frame = useCurrentFrame();
-
- const evolve1 = spring({
- fps,
- frame,
- config: {
- damping: 200,
- },
- });
- const evolve2 = spring({
- fps,
- frame: frame - 15,
- config: {
- damping: 200,
- },
- });
- const evolve3 = spring({
- fps,
- frame: frame - 30,
- config: {
- damping: 200,
- mass: 3,
- },
- durationInFrames: 30,
- });
-
- const style: React.CSSProperties = useMemo(() => {
- return {
- height: 140,
- borderRadius: 70,
- scale: String(1 - outProgress),
- };
- }, [outProgress]);
-
- const firstPath = `M 60.0568 54 v 71.97`;
- const secondPath = `M 63.47956 56.17496 L 144.7535 161.1825`;
- const thirdPath = `M 121 54 L 121 126`;
-
- const evolution1 = evolvePath(evolve1, firstPath);
- const evolution2 = evolvePath(evolve2, secondPath);
- const evolution3 = evolvePath(
- interpolate(evolve3, [0, 1], [0, 0.7]),
- thirdPath,
- );
-
- return (
- <svg style={style} fill="none" viewBox="0 0 180 180">
- <mask
- height="180"
- id="mask"
- className="[mask-type:alpha]"
- width="180"
- x="0"
- y="0"
- >
- <circle cx="90" cy="90" fill="black" r="90"></circle>
- </mask>
- <mask id="n-mask" className="[mask-type:alpha]">
- <path d={nStroke} fill="black"></path>
- </mask>
- <g mask="url(#mask)">
- <circle cx="90" cy="90" fill="black" r="90"></circle>
- <g stroke="url(#gradient0)" mask="url(#n-mask)">
- <path
- strokeWidth="12.1136"
- d={firstPath}
- strokeDasharray={evolution1.strokeDasharray}
- strokeDashoffset={evolution1.strokeDashoffset}
- ></path>
- <path
- strokeWidth={12.1136}
- d={secondPath}
- strokeDasharray={evolution2.strokeDasharray}
- strokeDashoffset={evolution2.strokeDashoffset}
- ></path>
- </g>
- <path
- stroke="url(#gradient1)"
- d={thirdPath}
- strokeDasharray={evolution3.strokeDasharray}
- strokeDashoffset={evolution3.strokeDashoffset}
- strokeWidth="12"
- ></path>
- </g>
- <defs>
- <linearGradient
- gradientUnits="userSpaceOnUse"
- id="gradient0"
- x1="109"
- x2="144.5"
- y1="116.5"
- y2="160.5"
- >
- <stop stopColor="white"></stop>
- <stop offset="1" stopColor="white" stopOpacity="0"></stop>
- </linearGradient>
- <linearGradient
- gradientUnits="userSpaceOnUse"
- id="gradient1"
- x1="121"
- x2="120.799"
- y1="54"
- y2="106.875"
- >
- <stop stopColor="white"></stop>
- <stop offset="1" stopColor="white" stopOpacity="0"></stop>
- </linearGradient>
- </defs>
- </svg>
- );
-};
diff --git a/packages/template-code-generation/src/remotion/MyComp/Rings.tsx b/packages/template-code-generation/src/remotion/MyComp/Rings.tsx
deleted file mode 100644
index 8e27bae856..0000000000
--- a/packages/template-code-generation/src/remotion/MyComp/Rings.tsx
+++ /dev/null
@@ -1,56 +0,0 @@
-import React from "react";
-import { AbsoluteFill, interpolateColors, useVideoConfig } from "remotion";
-
-const RadialGradient: React.FC<{
- radius: number;
- color: string;
-}> = ({ radius, color }) => {
- const height = radius * 2;
- const width = radius * 2;
-
- return (
- <AbsoluteFill
- style={{
- justifyContent: "center",
- alignItems: "center",
- }}
- >
- <div
- style={{
- height,
- width,
- backgroundColor: color,
- }}
- className="rounded-[50%] absolute shadow-[0px_0px_100px_rgba(0,0,0,0.05)]"
- ></div>
- </AbsoluteFill>
- );
-};
-
-export const Rings: React.FC<{
- outProgress: number;
-}> = ({ outProgress }) => {
- const scale = 1 / (1 - outProgress);
- const { height } = useVideoConfig();
-
- return (
- <AbsoluteFill
- style={{
- transform: `scale(${scale})`,
- }}
- >
- {new Array(5)
- .fill(true)
- .map((_, i) => {
- return (
- <RadialGradient
- key={i}
- radius={height * 0.3 * i}
- color={interpolateColors(i, [0, 4], ["#fff", "#fff"])}
- />
- );
- })
- .reverse()}
- </AbsoluteFill>
- );
-};
diff --git a/packages/template-code-generation/src/remotion/MyComp/TextFade.tsx b/packages/template-code-generation/src/remotion/MyComp/TextFade.tsx
deleted file mode 100644
index 1b71930a0b..0000000000
--- a/packages/template-code-generation/src/remotion/MyComp/TextFade.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import React, { useMemo } from "react";
-import {
- AbsoluteFill,
- interpolate,
- spring,
- useCurrentFrame,
- useVideoConfig,
-} from "remotion";
-
-export const TextFade: React.FC<{
- children: React.ReactNode;
-}> = ({ children }) => {
- const { fps } = useVideoConfig();
- const frame = useCurrentFrame();
-
- const progress = spring({
- fps,
- frame,
- config: {
- damping: 200,
- },
- durationInFrames: 80,
- });
-
- const rightStop = interpolate(progress, [0, 1], [200, 0]);
-
- const leftStop = Math.max(0, rightStop - 60);
-
- const maskImage = `linear-gradient(-45deg, transparent ${leftStop}%, black ${rightStop}%)`;
-
- const content: React.CSSProperties = useMemo(() => {
- return {
- maskImage,
- WebkitMaskImage: maskImage,
- };
- }, [maskImage]);
-
- return (
- <AbsoluteFill>
- <AbsoluteFill className="justify-center items-center">
- <div style={content}>{children}</div>
- </AbsoluteFill>
- </AbsoluteFill>
- );
-};
diff --git a/packages/template-code-generation/src/remotion/Root.tsx b/packages/template-code-generation/src/remotion/Root.tsx
deleted file mode 100644
index 83276274db..0000000000
--- a/packages/template-code-generation/src/remotion/Root.tsx
+++ /dev/null
@@ -1,38 +0,0 @@
-import { Composition } from "remotion";
-import { Main } from "./MyComp/Main";
-import {
- COMP_NAME,
- defaultMyCompProps,
- DURATION_IN_FRAMES,
- VIDEO_FPS,
- VIDEO_HEIGHT,
- VIDEO_WIDTH,
-} from "../../types/constants";
-import { NextLogo } from "./MyComp/NextLogo";
-
-export const RemotionRoot: React.FC = () => {
- return (
- <>
- <Composition
- id={COMP_NAME}
- component={Main}
- durationInFrames={DURATION_IN_FRAMES}
- fps={VIDEO_FPS}
- width={VIDEO_WIDTH}
- height={VIDEO_HEIGHT}
- defaultProps={defaultMyCompProps}
- />
- <Composition
- id="NextLogo"
- component={NextLogo}
- durationInFrames={300}
- fps={30}
- width={140}
- height={140}
- defaultProps={{
- outProgress: 0,
- }}
- />
- </>
- );
-};
diff --git a/packages/template-code-generation/src/remotion/index.ts b/packages/template-code-generation/src/remotion/index.ts
deleted file mode 100644
index 23d7a0fb20..0000000000
--- a/packages/template-code-generation/src/remotion/index.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import { registerRoot } from "remotion";
-import { RemotionRoot } from "./Root";
-import "../../styles/global.css";
-
-registerRoot(RemotionRoot);
diff --git a/packages/template-code-generation/src/remotion/webpack-override.mjs b/packages/template-code-generation/src/remotion/webpack-override.mjs
deleted file mode 100644
index 2f326a1071..0000000000
--- a/packages/template-code-generation/src/remotion/webpack-override.mjs
+++ /dev/null
@@ -1,8 +0,0 @@
-import { enableTailwind } from "@remotion/tailwind-v4";
-
-/**
- * @param {import('webpack').Configuration} currentConfig
- */
-export const webpackOverride = (currentConfig) => {
- return enableTailwind(currentConfig);
-};