Skip to content

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

feat: composition header

dev_wandryf7e3cd28be09
diff --git a/app/(home)/components/nav-links.tsx b/app/(home)/components/header-nav.tsx
similarity index 52%
rename from app/(home)/components/nav-links.tsx
rename to app/(home)/components/header-nav.tsx
index 473f10fc..69bfecc5 100644
--- a/app/(home)/components/nav-links.tsx
+++ b/app/(home)/components/header-nav.tsx
@@ -1,9 +1,9 @@
"use client";
-import { motion } from "motion/react";
import Link from "next/link";
import { useRef, useState } from "react";
-import { type NavLink } from "@/config/landing";
+import { SlidingHighlight } from "@/components/sliding-highlight";
+import type { NavLink } from "@/config/landing";
import { cn } from "@/lib/utils";
/**
@@ -13,7 +13,7 @@ import { cn } from "@/lib/utils";
* moving between items reads as the same pill sliding across the row. Hidden
* below `sm`, where the header falls back to the mobile sheet.
*/
-export function NavLinks({
+export function NavDesktop({
links,
className,
}: {
@@ -49,17 +49,7 @@ export function NavLinks({
}}
className={cn("relative hidden items-center gap-1 sm:flex", className)}
>
- <motion.span
- aria-hidden
- className="pointer-events-none absolute left-0 top-0 -z-10 h-full rounded-full bg-muted"
- initial={false}
- animate={{
- x: highlight?.left ?? 0,
- width: highlight?.width ?? 0,
- opacity: highlight ? 1 : 0,
- }}
- transition={{ type: "spring", stiffness: 420, damping: 34, mass: 0.6 }}
- />
+ <SlidingHighlight rect={highlight} />
{links.map((link) => (
<Link
key={link.href}
@@ -74,3 +64,68 @@ export function NavLinks({
</nav>
);
}
+
+/**
+ * Mobile nav: just the stacked list of links rendered inside the header's
+ * Sheet. The Sheet shell, GitHub stars, and the Get-started CTA stay with the
+ * header; `onNavigate` lets a tap close the sheet before routing.
+ */
+export function NavMobile({
+ links,
+ onNavigate,
+}: {
+ links: NavLink[];
+ onNavigate?: () => void;
+}) {
+ return (
+ <nav className="flex flex-col px-6 text-base">
+ {links.map((link) => (
+ <Link
+ key={link.href}
+ href={link.href}
+ onClick={() => onNavigate?.()}
+ className="py-3 text-foreground/90 transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none"
+ >
+ {link.label}
+ </Link>
+ ))}
+ </nav>
+ );
+}
+
+/**
+ * Footer nav: a flat row of links. External (`http`) targets open in a new tab
+ * via a plain anchor; internal targets use the client router.
+ */
+export function NavFooter({
+ links,
+ className,
+}: {
+ links: NavLink[];
+ className?: string;
+}) {
+ return (
+ <nav className={cn("flex gap-6", className)}>
+ {links.map((link) => {
+ const external = link.href.startsWith("http");
+ const linkClassName =
+ "transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none";
+ return external ? (
+ <a
+ key={link.href}
+ href={link.href}
+ target="_blank"
+ rel="noreferrer"
+ className={linkClassName}
+ >
+ {link.label}
+ </a>
+ ) : (
+ <Link key={link.href} href={link.href} className={linkClassName}>
+ {link.label}
+ </Link>
+ );
+ })}
+ </nav>
+ );
+}
diff --git a/app/(home)/components/header-parts.tsx b/app/(home)/components/header-parts.tsx
new file mode 100644
index 00000000..7fe79975
--- /dev/null
+++ b/app/(home)/components/header-parts.tsx
@@ -0,0 +1,155 @@
+"use client";
+
+import { Menu, Star } from "lucide-react";
+import Image from "next/image";
+import Link from "next/link";
+import { useState } from "react";
+import { Button } from "@/components/ui/button";
+import {
+ Sheet,
+ SheetContent,
+ SheetHeader,
+ SheetTitle,
+ SheetTrigger,
+} from "@/components/ui/sheet";
+import type { NavLink } from "@/config/landing";
+import { useTrackEvent } from "@/lib/analytics";
+import { formatStars } from "@/lib/github";
+import { NavMobile } from "./header-nav";
+import { ThemeToggle } from "./theme-toggle";
+
+const GITHUB_URL = "https://github.com/kapishdima/remocn";
+
+const GitHubIcon = ({ className }: { className?: string }) => (
+ <svg
+ viewBox="0 0 24 24"
+ className={className}
+ fill="currentColor"
+ role="img"
+ aria-label="GitHub"
+ >
+ <title>GitHub</title>
+ <path d="M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56 0-.27-.01-1-.02-1.96-3.2.69-3.87-1.54-3.87-1.54-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.7 1.26 3.36.96.1-.75.4-1.26.73-1.55-2.55-.29-5.24-1.28-5.24-5.71 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.47.11-3.06 0 0 .97-.31 3.18 1.18a11 11 0 0 1 5.79 0c2.21-1.49 3.18-1.18 3.18-1.18.63 1.59.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.44-2.7 5.41-5.27 5.7.41.36.78 1.06.78 2.14 0 1.55-.01 2.8-.01 3.18 0 .31.21.68.8.56C20.21 21.39 23.5 17.08 23.5 12 23.5 5.65 18.35.5 12 .5Z" />
+ </svg>
+);
+
+function GitHubStars({
+ stars,
+ onClick,
+}: {
+ stars: number | null;
+ onClick?: () => void;
+}) {
+ return (
+ <Link
+ href={GITHUB_URL}
+ target="_blank"
+ rel="noreferrer"
+ onClick={onClick}
+ className="inline-flex h-9 items-center gap-2 rounded-full border border-border px-3 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40"
+ >
+ <GitHubIcon className="size-4" />
+ <span className="hidden sm:inline">Star</span>
+ {stars !== null && (
+ <span className="inline-flex items-center gap-1 tabular-nums text-foreground">
+ <Star className="size-3.5 fill-current" />
+ {formatStars(stars)}
+ </span>
+ )}
+ </Link>
+ );
+}
+
+/** Wordmark + logo, links home. Shared across the landing and docs headers. */
+export function HeaderLogo() {
+ return (
+ <Link
+ href="/"
+ className="flex items-center gap-2 text-lg font-semibold tracking-tight text-foreground focus-visible:outline-none"
+ >
+ <Image
+ src="/logo.svg"
+ alt="remocn logo"
+ width={24}
+ height={24}
+ priority
+ className="rounded-md"
+ />
+ remocn
+ </Link>
+ );
+}
+
+/**
+ * Right-hand header cluster shared by both headers: GitHub stars (desktop),
+ * theme toggle, and the mobile menu Sheet. Owns its own open state and the
+ * GitHub click tracking. The Sheet contains the mobile link list plus the
+ * stars and Get-started CTA.
+ */
+export function HeaderActions({
+ navLinks,
+ githubStars,
+}: {
+ navLinks: NavLink[];
+ githubStars: number | null;
+}) {
+ const [open, setOpen] = useState(false);
+ const trackEvent = useTrackEvent();
+ const trackGitHubClick = () =>
+ trackEvent("cta_clicked", {
+ cta: "github_header",
+ destination: GITHUB_URL,
+ });
+
+ return (
+ <div className="flex items-center gap-2">
+ <div className="hidden sm:block">
+ <GitHubStars stars={githubStars} onClick={trackGitHubClick} />
+ </div>
+ <ThemeToggle />
+
+ {/* Mobile nav trigger */}
+ <Sheet open={open} onOpenChange={setOpen}>
+ <SheetTrigger
+ render={
+ <Button
+ variant="outline"
+ size="icon"
+ className="rounded-full sm:hidden"
+ aria-label="Open menu"
+ />
+ }
+ >
+ <Menu className="size-4" aria-hidden="true" />
+ </SheetTrigger>
+ <SheetContent side="right" className="bg-background">
+ <SheetHeader>
+ <SheetTitle>Menu</SheetTitle>
+ </SheetHeader>
+ <NavMobile links={navLinks} onNavigate={() => setOpen(false)} />
+ <div className="mt-4 flex flex-col gap-4 px-6 pb-6">
+ <GitHubStars
+ stars={githubStars}
+ onClick={() => {
+ setOpen(false);
+ trackGitHubClick();
+ }}
+ />
+ <Button
+ size="lg"
+ className="h-11 w-full rounded-full"
+ render={
+ <Link
+ href="/docs/getting-started/introduction"
+ onClick={() => setOpen(false)}
+ />
+ }
+ >
+ Get started
+ </Button>
+ </div>
+ </SheetContent>
+ </Sheet>
+ </div>
+ );
+}
diff --git a/app/(home)/components/install-command.tsx b/app/(home)/components/install-command.tsx
index 0f88110d..0f9b9daa 100644
--- a/app/(home)/components/install-command.tsx
+++ b/app/(home)/components/install-command.tsx
@@ -2,6 +2,7 @@
import { Check, Copy } from "lucide-react";
import { useState } from "react";
+import { Button } from "@/components/ui/button";
import { useTrackEvent } from "@/lib/analytics";
import { cn } from "@/lib/utils";
@@ -28,12 +29,12 @@ export function InstallCommand({
};
return (
- <button
- type="button"
+ <Button
+ variant="outline"
onClick={copy}
aria-label="Copy install command"
className={cn(
- "group inline-flex h-11 items-center gap-3 rounded-full border border-border bg-card/60 px-4 font-mono text-sm text-muted-foreground backdrop-blur-sm transition-colors hover:border-foreground/20 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
+ "group h-11 gap-3 rounded-full border-border bg-card/60 px-4 font-mono font-normal text-sm text-muted-foreground backdrop-blur-sm hover:border-foreground/20 hover:text-foreground",
className,
)}
>
@@ -48,6 +49,6 @@ export function InstallCommand({
<Copy className="size-4" />
)}
</span>
- </button>
+ </Button>
);
}
diff --git a/app/(home)/components/sections/bento-registry.tsx b/app/(home)/components/sections/bento-registry.tsx
index dd57a505..943bd4cf 100644
--- a/app/(home)/components/sections/bento-registry.tsx
+++ b/app/(home)/components/sections/bento-registry.tsx
@@ -4,12 +4,13 @@ import { Player } from "@remotion/player";
import { ArrowRight, Check, Copy } from "lucide-react";
import { motion } from "motion/react";
import Link from "next/link";
-import { type CSSProperties, useRef, useState } from "react";
+import { useState } from "react";
import { Button } from "@/components/ui/button";
import { SECTION, SPRING_SOFT } from "@/config/landing";
import { useTrackEvent } from "@/lib/analytics";
import { cn } from "@/lib/utils";
import registry from "@/registry/__index__";
+import { SpotlightSurface } from "@/components/spotlight-surface";
import { FadeUp } from "../fade-up";
import { SectionHeading } from "../section-heading";
@@ -31,11 +32,12 @@ function InstallPill({ name }: { name: string }) {
};
return (
- <button
+ <Button
+ variant="outline"
type="button"
onClick={copy}
aria-label={`Copy install command for ${name}`}
- className="mt-4 flex w-full items-center gap-2.5 rounded-xl border border-border bg-muted/40 px-3 py-2 font-mono text-xs text-muted-foreground transition-colors hover:border-foreground/20 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40"
+ className="mt-4 flex w-full items-center gap-2.5 rounded-xl border-border bg-muted/40 px-3 py-2 font-mono text-xs text-muted-foreground transition-colors hover:border-foreground/20 hover:text-foreground focus-visible:ring-ring/40"
>
<span aria-hidden className="select-none text-muted-foreground/50">
$
@@ -51,7 +53,7 @@ function InstallPill({ name }: { name: string }) {
<Copy className="size-3.5" />
)}
</span>
- </button>
+ </Button>
);
}
@@ -143,20 +145,8 @@ function BentoCard({
}
export function BentoRegistry() {
- const gridRef = useRef<HTMLDivElement>(null);
- const grid2Ref = useRef<HTMLDivElement>(null);
const trackEvent = useTrackEvent();
- const handleMove = (
- e: React.MouseEvent<HTMLDivElement>,
- target: HTMLDivElement | null,
- ) => {
- if (!target) return;
- const rect = target.getBoundingClientRect();
- target.style.setProperty("--mx", `${e.clientX - rect.left}px`);
- target.style.setProperty("--my", `${e.clientY - rect.top}px`);
- };
-
return (
<section id="components" className="relative py-20 sm:py-20">
<div className={SECTION}>
@@ -188,13 +178,7 @@ export function BentoRegistry() {
/>
<FadeUp delay={0.1} className="mt-12 sm:mt-16">
- {/* biome-ignore lint/a11y/noStaticElementInteractions: spotlight cursor tracking is purely visual */}
- <div
- ref={gridRef}
- onMouseMove={(e) => handleMove(e, gridRef.current)}
- className="grid gap-4 sm:gap-6 md:grid-cols-3 md:grid-rows-2"
- style={{ "--mx": "50%", "--my": "50%" } as CSSProperties}
- >
+ <SpotlightSurface className="grid gap-4 sm:gap-6 md:grid-cols-3 md:grid-rows-2">
<BentoCard
name="ai-generation-canvas"
title="AI Generation Canvas"
@@ -213,17 +197,11 @@ export function BentoRegistry() {
title="Ecosystem Constellation"
description="Orbits of integration logos around your brand"
/>
- </div>
+ </SpotlightSurface>
</FadeUp>
<FadeUp delay={0.18}>
- {/* biome-ignore lint/a11y/noStaticElementInteractions: spotlight cursor tracking is purely visual */}
- <div
- ref={grid2Ref}
- onMouseMove={(e) => handleMove(e, grid2Ref.current)}
- className="mt-4 grid gap-4 sm:mt-6 sm:gap-6 md:grid-cols-2"
- style={{ "--mx": "50%", "--my": "50%" } as CSSProperties}
- >
+ <SpotlightSurface className="mt-4 grid gap-4 sm:mt-6 sm:gap-6 md:grid-cols-2">
<BentoCard
name="grid-pixelate-wipe"
title="Grid Pixelate Wipe"
@@ -234,7 +212,7 @@ export function BentoRegistry() {
title="Frosted Glass Wipe"
description="An elegant transition through a sheet of glass"
/>
- </div>
+ </SpotlightSurface>
</FadeUp>
</div>
</section>
diff --git a/app/(home)/components/sections/get-started.tsx b/app/(home)/components/sections/get-started.tsx
index adddad1c..2145a865 100644
--- a/app/(home)/components/sections/get-started.tsx
+++ b/app/(home)/components/sections/get-started.tsx
@@ -1,67 +1,20 @@
import { ArrowRight } from "lucide-react";
import Link from "next/link";
import { CodeBlockCommand } from "@/components/docs/code-block-command";
-import { LAVENDER, MINT, PEACH, SECTION } from "@/config/landing";
+import { SECTION } from "@/config/landing";
import { convertNpmCommand } from "@/lib/convert-npm-command";
+import {
+ ADD,
+ INIT,
+ RENDER,
+ SAMPLE_COMPONENTS,
+ START,
+ type Step,
+} from "@/lib/config/snippets";
import { FadeUp } from "../fade-up";
import { SectionHeading } from "../section-heading";
import { Tok, TypewriterCodeBlock } from "../typewriter-code-block";
-type Step = {
- n: number;
- title: string;
- description: string;
- command: string;
- component?: string;
- /** Pastel accent that differentiates this step from its neighbours. */
- accent: string;
-};
-
-const START: Step = {
- n: 1,
- title: "Start with Remotion",
- description:
- "Already have a Remotion project? Skip ahead. Otherwise scaffold one in seconds.",
- command: "npx create-video@latest",
- accent: PEACH,
-};
-
-const INIT: Step = {
- n: 2,
- title: "Set up shadcn",
- description:
- "Run the shadcn init once so the CLI knows where to drop component files in your project.",
- command: "npx shadcn@latest init",
- accent: MINT,
-};
-
-const ADD: Step = {
- n: 3,
- title: "Add a component",
- description:
- "Pull any primitive or composition straight into your project with the shadcn CLI — the code lands in your repo, yours to tweak.",
- command: "npx shadcn@latest add remocn/blur-reveal",
- component: "blur-reveal",
- accent: LAVENDER,
-};
-
-const RENDER: Step = {
- n: 4,
- title: "Render your video",
- description:
- "Drop the component into a composition and export an mp4 — no editor required.",
- command: "npx remotion render",
- accent: PEACH,
-};
-
-/** A taste of what `remocn/<name>` pulls in — fills the featured card. */
-const SAMPLE_COMPONENTS = [
- "blur-reveal",
- "shimmer-sweep",
- "frosted-glass-wipe",
- "grid-pixelate-wipe",
-];
-
function StepBadge({ n, accent }: { n: number; accent: string }) {
return (
<span
diff --git a/app/(home)/components/sections/hero.tsx b/app/(home)/components/sections/hero.tsx
index 72f7142e..83926a48 100644
--- a/app/(home)/components/sections/hero.tsx
+++ b/app/(home)/components/sections/hero.tsx
@@ -8,26 +8,11 @@ import { useCallback, useRef, useState } from "react";
import { Button } from "@/components/ui/button";
import { INSTALL_COMMAND, SECTION, SPRING_BOUNCE } from "@/config/landing";
import { useTrackEvent } from "@/lib/analytics";
+import { HERO_CODE } from "@/lib/config/snippets";
import registry from "@/registry/__index__";
import { FadeUp } from "../fade-up";
import { InstallCommand } from "../install-command";
-// Shown inside the hero's glass-code-block player — the real remocn flow:
-// install components from the registry, then compose them in a Remotion scene.
-const HERO_CODE = `// npx shadcn@latest add remocn/blur-reveal remocn/mesh-gradient-bg
-import { AbsoluteFill } from "remotion";
-import { BlurReveal } from "@/components/remocn/blur-reveal";
-import { MeshGradientBg } from "@/components/remocn/mesh-gradient-bg";
-
-export function LaunchScene() {
- return (
- <AbsoluteFill>
- <MeshGradientBg />
- <BlurReveal text="Ship your launch video" />
- </AbsoluteFill>
- );
-}`;
-
export function Hero() {
const heroEntry = registry["glass-code-block"];
const playerRef = useRef<PlayerRef>(null);
diff --git a/app/(home)/components/sections/interactive-code.tsx b/app/(home)/components/sections/interactive-code.tsx
index d2b42b25..7e0ba945 100644
--- a/app/(home)/components/sections/interactive-code.tsx
+++ b/app/(home)/components/sections/interactive-code.tsx
@@ -12,6 +12,7 @@ import {
} from "react";
import { SECTION, SPRING_SOFT } from "@/config/landing";
import { useTrackEvent } from "@/lib/analytics";
+import { TYPEWRITER_DEFAULTS } from "@/lib/config/snippets";
import registry from "@/registry/__index__";
import { FadeUp } from "../fade-up";
import { SectionHeading } from "../section-heading";
@@ -19,14 +20,6 @@ import { SYNTAX_DARK, TypewriterCodeBlock } from "../typewriter-code-block";
const COMPONENT = "typewriter";
-const DEFAULTS = {
- text: "Ship it in React",
- fontSize: 104,
- color: "#171717",
- fontWeight: 700,
- cursor: true,
-};
-
const CHIP =
"rounded-[5px] bg-white/[0.07] px-1 align-baseline outline-none ring-1 ring-transparent transition-colors hover:bg-white/[0.12] focus-visible:bg-white/[0.12] focus-visible:ring-white/30";
@@ -261,11 +254,11 @@ function ToggleBool({
export function InteractiveCode() {
const entry = registry[COMPONENT];
- const [text, setText] = useState(DEFAULTS.text);
- const [fontSize, setFontSize] = useState(DEFAULTS.fontSize);
- const [color, setColor] = useState(DEFAULTS.color);
- const [fontWeight, setFontWeight] = useState(DEFAULTS.fontWeight);
- const [cursor, setCursor] = useState(DEFAULTS.cursor);
+ const [text, setText] = useState(TYPEWRITER_DEFAULTS.text);
+ const [fontSize, setFontSize] = useState(TYPEWRITER_DEFAULTS.fontSize);
+ const [color, setColor] = useState(TYPEWRITER_DEFAULTS.color);
+ const [fontWeight, setFontWeight] = useState(TYPEWRITER_DEFAULTS.fontWeight);
+ const [cursor, setCursor] = useState(TYPEWRITER_DEFAULTS.cursor);
const trackEvent = useTrackEvent();
const timers = useRef<Map<string, ReturnType<typeof setTimeout>>>(new Map());
diff --git a/app/(home)/components/sections/works-with.tsx b/app/(home)/components/sections/works-with.tsx
deleted file mode 100644
index edf097f6..00000000
--- a/app/(home)/components/sections/works-with.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import type { ComponentType, SVGProps } from "react";
-import { SECTION } from "@/config/landing";
-import { Remotion } from "@/components/ui/svgs/remotion";
-import { ReactDark } from "@/components/ui/svgs/reactDark";
-import { NextjsIconDark } from "@/components/ui/svgs/nextjsIconDark";
-import { Tailwindcss } from "@/components/ui/svgs/tailwindcss";
-import { ShadcnUi } from "@/components/ui/svgs/shadcnUi";
-import { FadeUp } from "../fade-up";
-
-type Logo = {
- label: string;
- Icon: ComponentType<SVGProps<SVGSVGElement>>;
-};
-
-const LOGOS: Logo[] = [
- { label: "Remotion", Icon: Remotion },
- { label: "React", Icon: ReactDark },
- { label: "Next.js", Icon: NextjsIconDark },
- { label: "Tailwind CSS", Icon: Tailwindcss },
- { label: "shadcn/ui", Icon: ShadcnUi },
-];
-
-export function WorksWith() {
- return (
- <section className="relative border-y border-border py-12 sm:py-16">
- <div className={SECTION}>
- <FadeUp>
- <div className="flex flex-col items-center gap-8">
- <p className=" text-xl font-medium text-muted-foreground">
- Built on tools you already use
- </p>
- <ul className="flex flex-wrap items-center justify-center gap-x-8 gap-y-6 sm:gap-x-12">
- {LOGOS.map(({ label, Icon }) => (
- <li
- key={label}
- className="flex items-center gap-x-2 text-sm font-medium text-muted-foreground"
- >
- <Icon
- role="img"
- aria-label={label}
- className="h-6 w-auto text-muted-foreground transition-colors hover:text-foreground sm:h-7"
- />
- {label}
- </li>
- ))}
- </ul>
- </div>
- </FadeUp>
- </div>
- </section>
- );
-}
diff --git a/app/(home)/components/site-footer.tsx b/app/(home)/components/site-footer.tsx
index 8bf7bc34..f14a349d 100644
--- a/app/(home)/components/site-footer.tsx
+++ b/app/(home)/components/site-footer.tsx
@@ -1,5 +1,5 @@
-import Link from "next/link";
import { type NavLink, SECTION } from "@/config/landing";
+import { NavFooter } from "./header-nav";
export function SiteFooter({
navLinks,
@@ -14,28 +14,7 @@ export function SiteFooter({
<span suppressHydrationWarning>
© {new Date().getFullYear()} remocn — MIT licensed
</span>
- <nav className="flex gap-6">
- {navLinks.map((link) => {
- const external = link.href.startsWith("http");
- const className =
- "transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none";
- return external ? (
- <a
- key={link.href}
- href={link.href}
- target="_blank"
- rel="noreferrer"
- className={className}
- >
- {link.label}
- </a>
- ) : (
- <Link key={link.href} href={link.href} className={className}>
- {link.label}
- </Link>
- );
- })}
- </nav>
+ <NavFooter links={navLinks} />
</footer>
</div>
);
diff --git a/app/(home)/components/site-header.tsx b/app/(home)/components/site-header.tsx
index e4ed89ed..fd0bd886 100644
--- a/app/(home)/components/site-header.tsx
+++ b/app/(home)/components/site-header.tsx
@@ -1,256 +1,57 @@
"use client";
-import { Menu, Star } from "lucide-react";
-import Image from "next/image";
-import Link from "next/link";
import { useEffect, useState } from "react";
-import { Button } from "@/components/ui/button";
-import {
- Sheet,
- SheetContent,
- SheetHeader,
- SheetTitle,
- SheetTrigger,
-} from "@/components/ui/sheet";
import { type NavLink } from "@/config/landing";
-import { useTrackEvent } from "@/lib/analytics";
-import { formatStars } from "@/lib/github";
import { cn } from "@/lib/utils";
-import { NavLinks } from "./nav-links";
-import { ThemeToggle } from "./theme-toggle";
-
-const GITHUB_URL = "https://github.com/kapishdima/remocn";
-
-const GitHubIcon = ({ className }: { className?: string }) => (
- <svg
- viewBox="0 0 24 24"
- className={className}
- fill="currentColor"
- role="img"
- aria-label="GitHub"
- >
- <title>GitHub</title>
- <path d="M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56 0-.27-.01-1-.02-1.96-3.2.69-3.87-1.54-3.87-1.54-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.7 1.26 3.36.96.1-.75.4-1.26.73-1.55-2.55-.29-5.24-1.28-5.24-5.71 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.47.11-3.06 0 0 .97-.31 3.18 1.18a11 11 0 0 1 5.79 0c2.21-1.49 3.18-1.18 3.18-1.18.63 1.59.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.44-2.7 5.41-5.27 5.7.41.36.78 1.06.78 2.14 0 1.55-.01 2.8-.01 3.18 0 .31.21.68.8.56C20.21 21.39 23.5 17.08 23.5 12 23.5 5.65 18.35.5 12 .5Z" />
- </svg>
-);
-
-function GitHubStars({
- stars,
- onClick,
-}: {
- stars: number | null;
- onClick?: () => void;
-}) {
- return (
- <Link
- href={GITHUB_URL}
- target="_blank"
- rel="noreferrer"
- onClick={onClick}
- className="inline-flex h-9 items-center gap-2 rounded-full border border-border px-3 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40"
- >
- <GitHubIcon className="size-4" />
- <span className="hidden sm:inline">Star</span>
- {stars !== null && (
- <span className="inline-flex items-center gap-1 tabular-nums text-foreground">
- <Star className="size-3.5 fill-current" />
- {formatStars(stars)}
- </span>
- )}
- </Link>
- );
-}
-
+import { NavDesktop } from "./header-nav";
+import { HeaderActions, HeaderLogo } from "./header-parts";
+
+/**
+ * Sticky header for the external pages (landing, sponsors). It always sticks to
+ * the top and collapses the full-width bar into a floating, container-width
+ * pill once the page scrolls. The static docs header lives in `DocsHeader`.
+ */
export function SiteHeader({
navLinks,
githubStars = null,
- sticky = true,
- docsAlign = false,
}: {
navLinks: NavLink[];
githubStars?: number | null;
- /**
- * Landing variant (default) is sticky and collapses into a floating pill on
- * scroll. Docs passes `sticky={false}` for a static, full-width bar with no
- * scroll listener and no pill morph.
- */
- sticky?: boolean;
- /**
- * Docs variant. Replaces the contained justify-between bar with a
- * content-aligned layout: the logo sits over the sidebar and the nav begins
- * at the article column's left edge, by mirroring Fumadocs' centered layout
- * width (`--fd-layout-width`) and sidebar column width (`--fd-sidebar-width`)
- * — redeclared here because this header renders outside DocsLayout's subtree.
- * Intended for the static (`sticky={false}`) docs header.
- */
- docsAlign?: boolean;
}) {
- const [open, setOpen] = useState(false);
const [scrolled, setScrolled] = useState(false);
- const trackEvent = useTrackEvent();
- const trackGitHubClick = () =>
- trackEvent("cta_clicked", {
- cta: "github_header",
- destination: GITHUB_URL,
- });
// Collapse the full-width bar into a floating, container-width pill on scroll.
- // Only the sticky (landing) variant listens to scroll; the static docs
- // variant never morphs, so the listener is not attached there.
useEffect(() => {
- if (!sticky) return;
const onScroll = () => setScrolled(window.scrollY > 8);
onScroll();
window.addEventListener("scroll", onScroll, { passive: true });
return () => window.removeEventListener("scroll", onScroll);
- }, [sticky]);
-
- // `scrolled` can only be true in the sticky variant; guard so the static
- // path never picks up the pill classes even if state lingers.
- const isPill = sticky && scrolled;
-
- const logo = (
- <Link
- href="/"
- className="flex items-center gap-2 text-lg font-semibold tracking-tight text-foreground focus-visible:outline-none"
- >
- <Image
- src="/logo.svg"
- alt="remocn logo"
- width={24}
- height={24}
- priority
- className="rounded-md"
- />
- remocn
- </Link>
- );
-
- const actions = (
- <div className="flex items-center gap-2">
- <div className="hidden sm:block">
- <GitHubStars stars={githubStars} onClick={trackGitHubClick} />
- </div>
- <ThemeToggle />
-
- {/* Mobile nav trigger */}
- <Sheet open={open} onOpenChange={setOpen}>
- <SheetTrigger
- render={
- <button
- type="button"
- aria-label="Open menu"
- className="inline-flex size-9 items-center justify-center rounded-full border border-border text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 sm:hidden"
- />
- }
- >
- <Menu className="size-4" aria-hidden="true" />
- </SheetTrigger>
- <SheetContent side="right" className="bg-background">
- <SheetHeader>
- <SheetTitle>Menu</SheetTitle>
- </SheetHeader>
- <nav className="flex flex-col px-6 pb-6 text-base">
- {navLinks.map((link) => (
- <Link
- key={link.href}
- href={link.href}
- onClick={() => setOpen(false)}
- className="py-3 text-foreground/90 transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none"
- >
- {link.label}
- </Link>
- ))}
- <div className="mt-4">
- <GitHubStars
- stars={githubStars}
- onClick={() => {
- setOpen(false);
- trackGitHubClick();
- }}
- />
- </div>
- <Button
- size="lg"
- className="mt-4 h-11 w-full rounded-full"
- render={
- <Link
- href="/docs/getting-started/introduction"
- onClick={() => setOpen(false)}
- />
- }
- >
- Get started
- </Button>
- </nav>
- </SheetContent>
- </Sheet>
- </div>
- );
+ }, []);
- // Docs variant: a content-aligned bar instead of justify-between. The inner
- // container mirrors Fumadocs' centered docs layout (`--fd-layout-width`) and
- // the logo cell is the width of the sidebar column (`--fd-sidebar-width`), so
- // the logo lands over the sidebar, the nav begins exactly at the article
- // column's left edge, and the actions sit at the content block's right edge.
- // The CSS vars are redeclared here because this header renders above (outside)
- // DocsLayout, so its variables aren't in scope. `-ml-3` pulls the first nav
- // item's label flush with the article text while its ghost-button background
- // bleeds back into the gutter.
- //
- // The 1400px / 268px literals mirror fumadocs-ui 16.7 defaults — the docs grid
- // sets `[--fd-layout-width:1400px]` and `md:layout:[--fd-sidebar-width:268px]`
- // (the non-collapsible sidebar column equals the sidebar width). They must stay
- // inline (Tailwind JIT can't read JS constants); if a fumadocs upgrade changes
- // those defaults, re-sync the two values below.
- if (docsAlign) {
- return (
- <header className="relative z-40 h-16 w-full border-b border-border bg-background/70 backdrop-blur-xl">
- <div className="mx-auto flex h-16 w-full max-w-(--fd-layout-width) items-center [--fd-layout-width:1400px] md:[--fd-sidebar-width:268px]">
- <div className="flex shrink-0 items-center px-4 md:w-(--fd-sidebar-width) md:px-0">
- {logo}
- </div>
- <div className="flex flex-1 items-center justify-between px-4 md:px-6 xl:px-5">
- <NavLinks links={navLinks} className="-ml-4" />
- {actions}
- </div>
- </div>
- </header>
- );
- }
+ const isPill = scrolled;
return (
<header
className={cn(
- "z-40",
- sticky
- ? cn(
- "sticky inset-x-0 top-0 transition-[background-color,border-color,padding] duration-300",
- isPill
- ? "border-transparent bg-transparent py-3"
- : "border-border bg-background/70 backdrop-blur-xl",
- )
- : "relative h-16 w-full border-b border-border bg-background/70 backdrop-blur-xl",
+ "sticky inset-x-0 top-0 z-40 transition-[background-color,border-color,padding] duration-300",
+ isPill
+ ? "border-transparent bg-transparent py-3"
+ : "border-border bg-background/70 backdrop-blur-xl",
)}
>
{/* Inner bar matches the page content width (same utilities as SECTION),
so when scrolled it becomes a floating pill exactly that width. */}
<div
className={cn(
- "mx-auto flex w-full max-w-6xl items-center justify-between px-4 sm:px-6",
- sticky
- ? cn(
- "border transition-all duration-300",
- isPill
- ? "h-14 rounded-2xl border-border bg-background/80 shadow-lg shadow-black/5 backdrop-blur-xl dark:shadow-black/30"
- : "h-16 border-transparent",
- )
- : "h-16",
+ "mx-auto flex w-full max-w-6xl items-center justify-between border px-4 transition-all duration-300 sm:px-6",
+ isPill
+ ? "h-14 rounded-2xl border-border bg-background/80 shadow-lg shadow-black/5 backdrop-blur-xl dark:shadow-black/30"
+ : "h-16 border-transparent",
)}
>
- {logo}
- <NavLinks links={navLinks} />
- {actions}
+ <HeaderLogo />
+ <NavDesktop links={navLinks} />
+ <HeaderActions navLinks={navLinks} githubStars={githubStars} />
</div>
</header>
);
diff --git a/app/(home)/components/theme-toggle.tsx b/app/(home)/components/theme-toggle.tsx
index 1307f900..d572ad37 100644
--- a/app/(home)/components/theme-toggle.tsx
+++ b/app/(home)/components/theme-toggle.tsx
@@ -3,6 +3,7 @@
import { Moon, Sun } from "lucide-react";
import { useTheme } from "next-themes";
import { useEffect, useState } from "react";
+import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";
export function ThemeToggle({ className }: { className?: string }) {
@@ -15,8 +16,9 @@ export function ThemeToggle({ className }: { className?: string }) {
const isDark = resolvedTheme === "dark";
return (
- <button
- type="button"
+ <Button
+ variant="ghost"
+ size="icon"
aria-label={
!mounted
? "Toggle theme"
@@ -25,10 +27,7 @@ export function ThemeToggle({ className }: { className?: string }) {
: "Switch to dark theme"
}
onClick={() => setTheme(isDark ? "light" : "dark")}
- className={cn(
- "inline-flex size-9 items-center justify-center rounded-full border border-border text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
- className,
- )}
+ className={cn("rounded-full", className)}
>
{mounted ? (
isDark ? (
@@ -39,6 +38,6 @@ export function ThemeToggle({ className }: { className?: string }) {
) : (
<span className="size-4" />
)}
- </button>
+ </Button>
);
}
diff --git a/app/(home)/page.tsx b/app/(home)/page.tsx
index 97d51b74..4e42926a 100644
--- a/app/(home)/page.tsx
+++ b/app/(home)/page.tsx
@@ -7,7 +7,6 @@ import { GetStarted } from "./components/sections/get-started";
import { Hero } from "./components/sections/hero";
import { InteractiveCode } from "./components/sections/interactive-code";
import { LandingPartners } from "./components/sections/landing-partners";
-import { WorksWith } from "./components/sections/works-with";
import { SiteFooter } from "./components/site-footer";
import { SiteHeader } from "./components/site-header";
@@ -19,7 +18,6 @@ export default async function Page() {
<SiteHeader navLinks={HOME_NAV} githubStars={githubStars} />
<main className="relative flex-1">
<Hero />
- {/* <WorksWith /> */}
<InteractiveCode />
<BentoRegistry />
<GetStarted />
diff --git a/app/(home)/sponsors/components/sections/tiers.tsx b/app/(home)/sponsors/components/sections/tiers.tsx
index 80f18269..03f3e0f1 100644
--- a/app/(home)/sponsors/components/sections/tiers.tsx
+++ b/app/(home)/sponsors/components/sections/tiers.tsx
@@ -3,13 +3,14 @@
import { ArrowRight, Check } from "lucide-react";
import { motion } from "motion/react";
import Link from "next/link";
-import { type CSSProperties, useRef, useState } from "react";
+import { useState } from "react";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
import { Separator } from "@/components/ui/separator";
import { SECTION, SPRING_BOUNCE, SPRING_SOFT } from "@/config/landing";
import { type BillingMode, type Tier, tiers } from "@/config/sponsors";
import { cn } from "@/lib/utils";
+import { SpotlightSurface } from "@/components/spotlight-surface";
import { FadeUp } from "../../../components/fade-up";
function BillingToggle({
@@ -29,8 +30,9 @@ function BillingToggle({
{options.map((opt) => {
const active = opt.id === value;
return (
- <button
+ <Button
key={opt.id}
+ variant="ghost"
type="button"
onClick={() => onChange(opt.id)}
className={cn(
@@ -48,7 +50,7 @@ function BillingToggle({
/>
)}
<span className="relative">{opt.label}</span>
- </button>
+ </Button>
);
})}
</div>
@@ -146,15 +148,6 @@ function TierCard({
export function Tiers() {
const [billingMode, setBillingMode] = useState<BillingMode>("monthly");
- const gridRef = useRef<HTMLDivElement>(null);
-
- const handleMove = (e: React.MouseEvent<HTMLDivElement>) => {
- const target = gridRef.current;
- if (!target) return;
- const rect = target.getBoundingClientRect();
- target.style.setProperty("--mx", `${e.clientX - rect.left}px`);
- target.style.setProperty("--my", `${e.clientY - rect.top}px`);
- };
return (
<section id="tiers" className="relative py-20 sm:py-24">
@@ -166,19 +159,13 @@ export function Tiers() {
</FadeUp>
<FadeUp delay={0.1}>
- {/* biome-ignore lint/a11y/noStaticElementInteractions: spotlight cursor tracking is purely visual */}
- <div
- ref={gridRef}
- onMouseMove={handleMove}
- className="grid gap-6 md:grid-cols-3"
- style={{ "--mx": "50%", "--my": "50%" } as CSSProperties}
- >
+ <SpotlightSurface className="grid gap-6 md:grid-cols-3">
{tiers.map((tier, i) => (
<FadeUp key={tier.id} delay={i * 0.08}>
<TierCard tier={tier} billingMode={billingMode} />
</FadeUp>
))}
- </div>
+ </SpotlightSurface>
</FadeUp>
</div>
</section>
diff --git a/app/docs/layout.tsx b/app/docs/layout.tsx
index 9f93aa78..d89d50a9 100644
--- a/app/docs/layout.tsx
+++ b/app/docs/layout.tsx
@@ -1,7 +1,7 @@
import { DocsLayout } from "fumadocs-ui/layouts/docs";
import type { ReactNode } from "react";
import { DOCS_NAV } from "@/config/landing";
-import { SiteHeader } from "@/app/(home)/components/site-header";
+import { DocsHeader } from "@/components/docs/docs-header";
import { getGitHubStars } from "@/lib/github";
import { baseOptions } from "@/lib/layout.shared";
import { source } from "@/source";
@@ -12,14 +12,9 @@ export default async function Layout({ children }: { children: ReactNode }) {
return (
<>
{/* Custom remocn chrome owns the only top nav. Static (non-sticky) and
- `docsAlign` so the bar tracks the docs grid: logo over the sidebar,
- nav starting at the article column's left edge. */}
- <SiteHeader
- sticky={false}
- docsAlign
- navLinks={DOCS_NAV}
- githubStars={githubStars}
- />
+ content-aligned so the bar tracks the docs grid: logo over the
+ sidebar, nav starting at the article column's left edge. */}
+ <DocsHeader navLinks={DOCS_NAV} githubStars={githubStars} />
<DocsLayout
tree={source.pageTree}
{...baseOptions()}
diff --git a/components/docs/component-preview.tsx b/components/docs/component-preview.tsx
index be78bfbe..6c8e997b 100644
--- a/components/docs/component-preview.tsx
+++ b/components/docs/component-preview.tsx
@@ -3,6 +3,7 @@
import { Player } from "@remotion/player";
import { DynamicCodeBlock } from "fumadocs-ui/components/dynamic-codeblock";
import { CheckIcon, LinkIcon, PlayIcon, RotateCcwIcon } from "lucide-react";
+import { Button } from "@/components/ui/button";
import {
parseAsBoolean,
parseAsFloat,
@@ -170,36 +171,31 @@ function Preview({
<div className="flex items-center justify-between pt-4 pb-2">
<span className="text-sm font-medium text-foreground">Customize</span>
<div className="flex items-center gap-1">
- <button
- type="button"
+ <Button
+ variant="outline"
+ size="icon-sm"
onClick={handleCopyLink}
aria-label="Copy share link"
title="Copy share link"
- className={cn(
- "inline-flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors",
- "hover:bg-background hover:text-foreground",
- )}
+ className="text-muted-foreground hover:text-foreground"
>
{copied ? (
<CheckIcon className="size-3.5" />
) : (
<LinkIcon className="size-3.5" />
)}
- </button>
- <button
- type="button"
+ </Button>
+ <Button
+ variant="outline"
+ size="icon-sm"
onClick={handleReset}
disabled={isDefault}
aria-label="Reset to defaults"
title="Reset to defaults"
- className={cn(
- "inline-flex size-7 items-center justify-center rounded-md text-muted-foreground transition-colors",
- "hover:bg-background hover:text-foreground",
- "disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-muted-foreground",
- )}
+ className="text-muted-foreground hover:text-foreground disabled:opacity-40"
>
<RotateCcwIcon className="size-3.5" />
- </button>
+ </Button>
</div>
</div>
<ComponentCustomizer
diff --git a/components/docs/copy-button.tsx b/components/docs/copy-button.tsx
index e2c3aeb7..f32e635c 100644
--- a/components/docs/copy-button.tsx
+++ b/components/docs/copy-button.tsx
@@ -2,6 +2,7 @@
import { Check, Copy } from "lucide-react";
import { useState } from "react";
+import { Button } from "@/components/ui/button";
import { cn } from "@/lib/utils";
export function CopyButton({
@@ -16,8 +17,9 @@ export function CopyButton({
const [copied, setCopied] = useState(false);
return (
- <button
- type="button"
+ <Button
+ variant="outline"
+ size="icon-xs"
aria-label="Copy to clipboard"
onClick={() => {
navigator.clipboard.writeText(value);
@@ -26,11 +28,11 @@ export function CopyButton({
setTimeout(() => setCopied(false), 1500);
}}
className={cn(
- "inline-flex size-7 items-center justify-center rounded-md border border-fd-border bg-fd-background text-fd-muted-foreground transition-colors hover:bg-fd-accent hover:text-fd-accent-foreground",
+ "border-fd-border bg-fd-background text-fd-muted-foreground hover:bg-fd-accent hover:text-fd-accent-foreground",
className,
)}
>
{copied ? <Check className="size-3.5" /> : <Copy className="size-3.5" />}
- </button>
+ </Button>
);
}
diff --git a/components/docs/docs-header.tsx b/components/docs/docs-header.tsx
new file mode 100644
index 00000000..058d271b
--- /dev/null
+++ b/components/docs/docs-header.tsx
@@ -0,0 +1,47 @@
+import {
+ HeaderActions,
+ HeaderLogo,
+} from "@/app/(home)/components/header-parts";
+import { NavDesktop } from "@/app/(home)/components/header-nav";
+import { type NavLink } from "@/config/landing";
+
+/**
+ * Static, content-aligned header for the docs. Unlike `SiteHeader` it never
+ * sticks, never listens to scroll, and never morphs into a pill.
+ *
+ * The inner container mirrors Fumadocs' centered docs layout
+ * (`--fd-layout-width`) and the logo cell is the width of the sidebar column
+ * (`--fd-sidebar-width`), so the logo lands over the sidebar, the nav begins
+ * exactly at the article column's left edge, and the actions sit at the content
+ * block's right edge. The CSS vars are redeclared here because this header
+ * renders above (outside) DocsLayout, so its variables aren't in scope. `-ml-4`
+ * pulls the first nav item's label flush with the article text while its
+ * ghost-button background bleeds back into the gutter.
+ *
+ * The 1400px / 268px literals mirror fumadocs-ui 16.7 defaults — the docs grid
+ * sets `[--fd-layout-width:1400px]` and `md:layout:[--fd-sidebar-width:268px]`
+ * (the non-collapsible sidebar column equals the sidebar width). They must stay
+ * inline (Tailwind JIT can't read JS constants); if a fumadocs upgrade changes
+ * those defaults, re-sync the two values below.
+ */
+export function DocsHeader({
+ navLinks,
+ githubStars = null,
+}: {
+ navLinks: NavLink[];
+ githubStars?: number | null;
+}) {
+ return (
+ <header className="relative z-40 h-16 w-full border-b border-border bg-background/70 backdrop-blur-xl">
+ <div className="mx-auto flex h-16 w-full max-w-(--fd-layout-width) items-center [--fd-layout-width:1400px] md:[--fd-sidebar-width:268px]">
+ <div className="flex shrink-0 items-center px-4 md:w-(--fd-sidebar-width) md:px-0">
+ <HeaderLogo />
+ </div>
+ <div className="flex flex-1 items-center justify-between px-4 md:px-6 xl:px-5">
+ <NavDesktop links={navLinks} className="-ml-4" />
+ <HeaderActions navLinks={navLinks} githubStars={githubStars} />
+ </div>
+ </div>
+ </header>
+ );
+}
diff --git a/components/sliding-highlight.tsx b/components/sliding-highlight.tsx
new file mode 100644
index 00000000..c0a4896d
--- /dev/null
+++ b/components/sliding-highlight.tsx
@@ -0,0 +1,44 @@
+"use client";
+
+import { motion, type Transition } from "motion/react";
+import { cn } from "@/lib/utils";
+
+const DEFAULT_TRANSITION: Transition = {
+ type: "spring",
+ stiffness: 420,
+ damping: 34,
+ mass: 0.6,
+};
+
+/**
+ * Absolutely-positioned pill that springs to a target rect. Driven by transform
+ * (left:0 + translateX) rather than animating layout, so it slides between
+ * targets instead of popping. `rect={null}` retracts it (opacity 0). The parent
+ * owns positioning context and measurement; this only renders the moving span.
+ */
+export function SlidingHighlight({
+ rect,
+ className,
+ transition = DEFAULT_TRANSITION,
+}: {
+ rect: { left: number; width: number } | null;
+ className?: string;
+ transition?: Transition;
+}) {
+ return (
+ <motion.span
+ aria-hidden
+ initial={false}
+ className={cn(
+ "pointer-events-none absolute left-0 top-0 -z-10 h-full rounded-full bg-muted",
+ className,
+ )}
+ animate={{
+ x: rect?.left ?? 0,
+ width: rect?.width ?? 0,
+ opacity: rect ? 1 : 0,
+ }}
+ transition={transition}
+ />
+ );
+}
diff --git a/components/spotlight-surface.tsx b/components/spotlight-surface.tsx
new file mode 100644
index 00000000..1d0f29e7
--- /dev/null
+++ b/components/spotlight-surface.tsx
@@ -0,0 +1,35 @@
+"use client";
+import { type CSSProperties, type HTMLAttributes, type ReactNode, useRef } from "react";
+import { cn } from "@/lib/utils";
+
+export function SpotlightSurface({
+ className,
+ style,
+ children,
+ ...rest
+}: {
+ className?: string;
+ style?: CSSProperties;
+ children: ReactNode;
+} & HTMLAttributes<HTMLDivElement>) {
+ const ref = useRef<HTMLDivElement>(null);
+ const handleMove = (e: React.MouseEvent<HTMLDivElement>) => {
+ const el = ref.current;
+ if (!el) return;
+ const r = el.getBoundingClientRect();
+ el.style.setProperty("--mx", `${e.clientX - r.left}px`);
+ el.style.setProperty("--my", `${e.clientY - r.top}px`);
+ };
+ return (
+ // biome-ignore lint/a11y/noStaticElementInteractions: spotlight cursor tracking is purely visual
+ <div
+ ref={ref}
+ onMouseMove={handleMove}
+ className={cn(className)}
+ style={{ "--mx": "50%", "--my": "50%", ...style } as CSSProperties}
+ {...rest}
+ >
+ {children}
+ </div>
+ );
+}
diff --git a/lib/config/snippets.ts b/lib/config/snippets.ts
new file mode 100644
index 00000000..168da7b5
--- /dev/null
+++ b/lib/config/snippets.ts
@@ -0,0 +1,92 @@
+import { LAVENDER, MINT, PEACH } from "@/config/landing";
+
+// ---------------------------------------------------------------------------
+// Hero code block
+// ---------------------------------------------------------------------------
+
+/** Shown inside the hero's glass-code-block player — the real remocn flow. */
+export const HERO_CODE = `// npx shadcn@latest add remocn/blur-reveal remocn/mesh-gradient-bg
+import { AbsoluteFill } from "remotion";
+import { BlurReveal } from "@/components/remocn/blur-reveal";
+import { MeshGradientBg } from "@/components/remocn/mesh-gradient-bg";
+
+export function LaunchScene() {
+ return (
+ <AbsoluteFill>
+ <MeshGradientBg />
+ <BlurReveal text="Ship your launch video" />
+ </AbsoluteFill>
+ );
+}`;
+
+// ---------------------------------------------------------------------------
+// Get-started steps
+// ---------------------------------------------------------------------------
+
+export type Step = {
+ n: number;
+ title: string;
+ description: string;
+ command: string;
+ component?: string;
+ /** Pastel accent that differentiates this step from its neighbours. */
+ accent: string;
+};
+
+export const START: Step = {
+ n: 1,
+ title: "Start with Remotion",
+ description:
+ "Already have a Remotion project? Skip ahead. Otherwise scaffold one in seconds.",
+ command: "npx create-video@latest",
+ accent: PEACH,
+};
+
+export const INIT: Step = {
+ n: 2,
+ title: "Set up shadcn",
+ description:
+ "Run the shadcn init once so the CLI knows where to drop component files in your project.",
+ command: "npx shadcn@latest init",
+ accent: MINT,
+};
+
+export const ADD: Step = {
+ n: 3,
+ title: "Add a component",
+ description:
+ "Pull any primitive or composition straight into your project with the shadcn CLI — the code lands in your repo, yours to tweak.",
+ command: "npx shadcn@latest add remocn/blur-reveal",
+ component: "blur-reveal",
+ accent: LAVENDER,
+};
+
+export const RENDER: Step = {
+ n: 4,
+ title: "Render your video",
+ description:
+ "Drop the component into a composition and export an mp4 — no editor required.",
+ command: "npx remotion render",
+ accent: PEACH,
+};
+
+/** A taste of what `remocn/<name>` pulls in — fills the featured card. */
+export const SAMPLE_COMPONENTS = [
+ "blur-reveal",
+ "shimmer-sweep",
+ "frosted-glass-wipe",
+ "grid-pixelate-wipe",
+];
+
+// ---------------------------------------------------------------------------
+// Interactive-code section defaults
+// ---------------------------------------------------------------------------
+
+/** Default prop values for the typewriter component live preview. */
+export const TYPEWRITER_DEFAULTS = {
+ text: "Ship it in React",
+ fontSize: 104,
+ color: "#171717",
+ fontWeight: 700,
+ cursor: true,
+};