Local Build and Deploy / deploy (push) Successful in 53s
- Add framer-motion and tailwindcss-animate for transitions - Add page transitions via AnimatePresence in the site layout - Convert nav dropdown and mobile menu to animated motion components - Add entry animation to the radio player widget - Add reveal/stagger animations to the home page views - Add shared motion utilities and reusable animated components
56 lines
1.2 KiB
TypeScript
56 lines
1.2 KiB
TypeScript
"use client";
|
|
|
|
import { motion } from "framer-motion";
|
|
import type { ReactNode } from "react";
|
|
|
|
interface RevealProps {
|
|
children: ReactNode;
|
|
className?: string;
|
|
delay?: number;
|
|
}
|
|
|
|
export function Reveal({ children, className, delay = 0 }: RevealProps) {
|
|
return (
|
|
<motion.div
|
|
className={className}
|
|
initial={{ opacity: 0, y: 24 }}
|
|
whileInView={{ opacity: 1, y: 0 }}
|
|
viewport={{ once: true, margin: "-50px" }}
|
|
transition={{ duration: 0.45, delay, ease: [0.25, 0.1, 0.25, 1] }}
|
|
>
|
|
{children}
|
|
</motion.div>
|
|
);
|
|
}
|
|
|
|
export function RevealStagger({ children, className }: RevealProps) {
|
|
return (
|
|
<motion.div
|
|
className={className}
|
|
initial="hidden"
|
|
whileInView="visible"
|
|
viewport={{ once: true, margin: "-50px" }}
|
|
variants={{
|
|
hidden: {},
|
|
visible: { transition: { staggerChildren: 0.08, delayChildren: 0.05 } },
|
|
}}
|
|
>
|
|
{children}
|
|
</motion.div>
|
|
);
|
|
}
|
|
|
|
export function RevealItem({ children, className }: RevealProps) {
|
|
return (
|
|
<motion.div
|
|
className={className}
|
|
variants={{
|
|
hidden: { opacity: 0, y: 20 },
|
|
visible: { opacity: 1, y: 0, transition: { duration: 0.35 } },
|
|
}}
|
|
>
|
|
{children}
|
|
</motion.div>
|
|
);
|
|
}
|