Skip to content

Production-ready animations, transitions, backgrounds, and scenes for Remotion

feat: added hero components bg

dev_wandry1cc04905149e
diff --git a/app/(home)/components/sections/bento-registry.tsx b/app/(home)/components/sections/bento-registry.tsx
index 2ce56c57..258d60c3 100644
--- a/app/(home)/components/sections/bento-registry.tsx
+++ b/app/(home)/components/sections/bento-registry.tsx
@@ -4,12 +4,13 @@ import { Player, type PlayerRef } from "@remotion/player";
import { ArrowRight, Check, Copy } from "lucide-react";
import { motion } from "motion/react";
import Link from "next/link";
-import { useRef, useState } from "react";
+import { useMemo, useRef, useState } from "react";
import { Button } from "@/components/ui/button";
import { SPRING_SOFT } from "@/config/site";
import { useTrackEvent } from "@/lib/analytics";
import { cn } from "@/lib/utils";
import registry from "@/registry/__index__";
+import { Backdrop, type BackdropFill } from "@/registry/remocn/backdrop";
import { SpotlightSurface } from "@/components/spotlight-surface";
import { FadeUp } from "../fade-up";
import { SectionHeading } from "../section-heading";
@@ -68,6 +69,7 @@ function BentoCard({
featured = false,
compositionWidth,
compositionHeight,
+ backdrop,
}: {
name: string;
title: string;
@@ -78,12 +80,25 @@ function BentoCard({
featured?: boolean;
compositionWidth?: number;
compositionHeight?: number;
+ backdrop?: BackdropFill;
}) {
const entry = registry[name];
const playerRef = useRef<PlayerRef>(null);
useAutoplay(playerRef, Boolean(entry));
+ const Composition = useMemo(() => {
+ const Inner = entry?.Component;
+ if (!Inner || !backdrop) return Inner;
+ return function BackdroppedComposition(props: Record<string, unknown>) {
+ return (
+ <Backdrop fill={backdrop} padding={0} radius={0} shadow="">
+ <Inner {...props} />
+ </Backdrop>
+ );
+ };
+ }, [entry, backdrop]);
+
return (
<motion.div
whileHover={{ y: -4 }}
@@ -115,7 +130,7 @@ function BentoCard({
{entry ? (
<Player
ref={playerRef}
- component={entry.Component}
+ component={Composition ?? entry.Component}
inputProps={inputProps ?? {}}
durationInFrames={entry.config.durationInFrames}
fps={entry.config.fps}
@@ -223,6 +238,7 @@ export function BentoRegistry() {
name="x-followers-overview"
title="X Followers"
description="Names cycle, then the total lands with confetti"
+ backdrop={{ type: "color", value: "#ffffff" }}
/>
<BentoCard
name="grid-pixelate-wipe"
diff --git a/app/(home)/components/sections/hero.tsx b/app/(home)/components/sections/hero.tsx
index 42410883..ee13a21d 100644
--- a/app/(home)/components/sections/hero.tsx
+++ b/app/(home)/components/sections/hero.tsx
@@ -11,10 +11,26 @@ import { INSTALL_COMMAND, SPRING_BOUNCE } from "@/config/site";
import { useTrackEvent } from "@/lib/analytics";
import { HERO_CODE } from "@/lib/config/snippets";
import registry from "@/registry/__index__";
+import { Backdrop } from "@/registry/remocn/backdrop";
import { FadeUp } from "../fade-up";
import { InstallCommand } from "../install-command";
import { useAutoplay } from "../use-autoplay";
+const GlassCodeBlock = registry["glass-code-block"]?.Component;
+
+function HeroComposition(props: Record<string, unknown>) {
+ return (
+ <Backdrop
+ fill={{ type: "image", src: "/hero.png" }}
+ padding={0}
+ radius={0}
+ shadow=""
+ >
+ {GlassCodeBlock ? <GlassCodeBlock {...props} /> : null}
+ </Backdrop>
+ );
+}
+
export function Hero() {
const heroEntry = registry["glass-code-block"];
const playerRef = useRef<PlayerRef>(null);
@@ -138,16 +154,12 @@ export function Hero() {
{heroEntry ? (
<Player
ref={playerRef}
- component={heroEntry.Component}
+ component={HeroComposition}
inputProps={{
code: HERO_CODE,
title: "LaunchScene.tsx",
width: 860,
height: 480,
- // Scene backdrop behind the glass card — the abstract texture
- // with a dark wash so the code stays legible through the glass.
- background:
- "linear-gradient(rgba(5,5,8,0.5), rgba(5,5,8,0.62)), url(/bg.jpg) center / cover no-repeat",
}}
durationInFrames={heroEntry.config.durationInFrames}
fps={heroEntry.config.fps}