Files
Wabenhain/src/components/scroll-reveal.tsx
T
Nick Szaunig c7927f2883 feat: Wabenhain Honig-Shop Anwendung
Vollstaendige Next.js/Prisma-E-Commerce-Anwendung fuer eine Imkerei:
Shop, Warenkorb, Stripe-Checkout, Kundenkonto mit 2FA, Admin-Bereich
(Produkte, Ernten, Chargen, Bestellungen, Gutscheine, admin-editierbare
Website-Inhalte), i18n (DE/EN), Rate-Limiting/CSP/Audit-Log-Haertung,
PostgreSQL- und MySQL-Unterstuetzung ueber austauschbare Prisma-
Treiber-Adapter, Unit-/Komponenten-/E2E-Tests.
2026-08-17 14:30:28 +02:00

36 lines
865 B
TypeScript

"use client";
import type { ReactNode } from "react";
import { motion, useReducedMotion } from "motion/react";
/**
* Dezente Scroll-Reveal-Animation (Fade-In + leichtes Anheben) fuer
* Startseiten-Sektionen. Nutzt motion/react's whileInView, respektiert
* reduced-motion-Praeferenzen und animiert nur einmal pro Element.
*/
export function ScrollReveal({
children,
className = "",
y = 24,
delay = 0,
}: {
children: ReactNode;
className?: string;
y?: number;
delay?: number;
}) {
const shouldReduceMotion = useReducedMotion();
return (
<motion.div
className={className}
initial={shouldReduceMotion ? false : { opacity: 0, y }}
whileInView={{ opacity: 1, y: 0 }}
viewport={{ once: true, amount: 0.15 }}
transition={{ duration: 0.7, delay, ease: "easeOut" }}
>
{children}
</motion.div>
);
}