Files
ar.badieiandCursor c2376b3b9e
Build & Push Docker Image / build (push) Has been cancelled
feat: redesign landing page with brand system and section blocks
Refresh the homepage around new hero/services/roadmap sections, shared design tokens, and updated brand assets.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-23 17:00:55 +03:30

70 lines
1.5 KiB
TypeScript

"use client";
import type { ReactNode } from "react";
import { motion, useReducedMotion } from "motion/react";
import {
blockRevealContainer,
blockRevealItem,
blockViewport,
} from "@/lib/block-motion";
import { cn } from "@/lib/utils";
type MotionRevealProps = {
children: ReactNode;
className?: string;
/** Stagger direct `MotionRevealItem` children (max ~8 for feel). */
stagger?: boolean;
};
/**
* Scroll-driven entrance for page blocks.
* Respects `prefers-reduced-motion` and plays once per view.
*/
export function MotionReveal({
children,
className,
stagger = false,
}: MotionRevealProps) {
const reduceMotion = useReducedMotion();
if (reduceMotion) {
return <div className={className}>{children}</div>;
}
return (
<motion.div
className={cn(className)}
initial="hidden"
whileInView="visible"
viewport={blockViewport}
variants={stagger ? blockRevealContainer : blockRevealItem}
>
{children}
</motion.div>
);
}
type MotionRevealItemProps = {
children: ReactNode;
className?: string;
};
/** Child of a staggered `MotionReveal`. No-op when reduced motion is on. */
export function MotionRevealItem({
children,
className,
}: MotionRevealItemProps) {
const reduceMotion = useReducedMotion();
if (reduceMotion) {
return <div className={className}>{children}</div>;
}
return (
<motion.div className={cn(className)} variants={blockRevealItem}>
{children}
</motion.div>
);
}