Production-ready animations, transitions, backgrounds, and scenes for Remotion
TypeScript ai-agentsclaude-codedemo-videomcpmcp-servermodel-context-protocolmotion-designproduct-demoreactremotionshadcnvideo
feat: whyremocn highlight
kapishdima349b474b9bbb
diff --git a/app/(home)/components/section-heading.tsx b/app/(home)/components/section-heading.tsxindex 29dac1e6..56743b39 100644--- a/app/(home)/components/section-heading.tsx+++ b/app/(home)/components/section-heading.tsx@@ -40,11 +40,11 @@ export function SectionHeading({centered && "mx-auto text-center sm:items-center",)}>- {eyebrow && (+ {/*{eyebrow && (<p className="mb-3 font-mono text-xs font-medium text-muted-foreground">{eyebrow}</p>- )}+ )}*/}<h2 className="text-3xl font-semibold tracking-tight text-balance text-foreground sm:text-4xl">{title}</h2>diff --git a/app/(home)/components/sections/how-it-works.tsx b/app/(home)/components/sections/how-it-works.tsxindex a2c2a7e3..2a161164 100644--- a/app/(home)/components/sections/how-it-works.tsx+++ b/app/(home)/components/sections/how-it-works.tsx@@ -75,7 +75,7 @@ export function HowItWorks({ className }: { className?: string }) {animated={false}/>- <div className="mt-10 grid grid-cols-1 border-y border-border/60 sm:mt-14 lg:grid-cols-3">+ <div className="mt-10 grid grid-cols-1 border-y border-border/60 sm:mt-10 lg:grid-cols-3">{HOW_IT_WORKS_STEPS.map((step, i) => (<StepColumn key={step.title} step={step} index={i} />))}diff --git a/app/(home)/components/sections/why-remocn.tsx b/app/(home)/components/sections/why-remocn.tsxindex 0090f9fc..ce135d4e 100644--- a/app/(home)/components/sections/why-remocn.tsx+++ b/app/(home)/components/sections/why-remocn.tsx@@ -1,3 +1,5 @@+"use client";+import {Bot,Clapperboard,@@ -6,13 +8,24 @@ import {Wallet,Zap,} from "lucide-react";-import type { ComponentType } from "react";+import {+ AnimatePresence,+ motion,+ type Transition,+ useReducedMotion,+} from "motion/react";+import {+ type ComponentType,+ type PointerEvent,+ useRef,+ useState,+} from "react";import { REASONS } from "@/config/landing";import { cn } from "@/lib/utils";import { SectionHeading } from "../section-heading";const EYEBROW = "Why remocn";-const TITLE = "Every other way costs you something.";+const TITLE = "Every other way costs you something";const LEAD ="A designer’s invoice, a weekend in After Effects, or a screen recording you’re not proud of. remocn hands the animation to your agent already built.";@@ -25,7 +38,52 @@ const ICONS: ComponentType<{ className?: string }>[] = [Zap,];+const HIGHLIGHT_INSET = 16;++const MOVE: Transition = {+ type: "spring",+ stiffness: 420,+ damping: 34,+ mass: 0.6,+};+const FADE: Transition = { duration: 0.15, ease: [0.32, 0.72, 0, 1] };+const EXIT: Transition = { duration: 0.12, ease: [0.32, 0.72, 0, 1] };++type HighlightRect = { x: number; y: number; width: number; height: number };+export function WhyRemocn({ className }: { className?: string }) {+ const gridRef = useRef<HTMLDivElement>(null);+ const activeRef = useRef(false);+ const [rect, setRect] = useState<HighlightRect | null>(null);+ const [enterId, setEnterId] = useState(0);+ const reduceMotion = useReducedMotion();++ const handleEnter = (event: PointerEvent<HTMLDivElement>) => {+ if (event.pointerType !== "mouse") return;+ const grid = gridRef.current;+ if (!grid) return;++ const item = event.currentTarget.getBoundingClientRect();+ const bounds = grid.getBoundingClientRect();++ if (!activeRef.current) {+ activeRef.current = true;+ setEnterId((id) => id + 1);+ }++ setRect({+ x: item.left - bounds.left - HIGHLIGHT_INSET,+ y: item.top - bounds.top - HIGHLIGHT_INSET,+ width: item.width + HIGHLIGHT_INSET * 2,+ height: item.height + HIGHLIGHT_INSET * 2,+ });+ };++ const handleLeave = () => {+ activeRef.current = false;+ setRect(null);+ };+return (<sectionid="why-remocn"@@ -39,11 +97,41 @@ export function WhyRemocn({ className }: { className?: string }) {animated={false}/>- <div className="mt-12 grid grid-cols-1 gap-x-8 gap-y-10 sm:mt-16 sm:grid-cols-2 lg:grid-cols-3 lg:gap-x-12">+ <div+ ref={gridRef}+ onPointerLeave={handleLeave}+ className="relative isolate mt-12 grid grid-cols-1 gap-x-8 gap-y-10 sm:mt-16 sm:grid-cols-2 lg:grid-cols-3 lg:gap-x-12"+ >+ <AnimatePresence>+ {rect && (+ <motion.span+ key={enterId}+ aria-hidden+ className="pointer-events-none absolute top-0 left-0 -z-10 rounded-xl bg-muted"+ initial={{ ...rect, opacity: 0, scale: 0.96 }}+ animate={{ ...rect, opacity: 1, scale: 1 }}+ exit={{+ opacity: 0,+ scale: 0.96,+ transition: reduceMotion ? { duration: 0 } : EXIT,+ }}+ transition={+ reduceMotion+ ? { duration: 0 }+ : { default: MOVE, opacity: FADE, scale: FADE }+ }+ />+ )}+ </AnimatePresence>+{REASONS.map((reason, i) => {const Icon = ICONS[i];return (- <div key={reason.title} className="min-w-0">+ <div+ key={reason.title}+ onPointerEnter={handleEnter}+ className="min-w-0"+ ><div className="flex items-center gap-2"><Iconaria-hidden