feat: The Other Dude v9.0.1 — full-featured email system
ci: add GitHub Pages deployment workflow for docs site Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
35
frontend/src/components/layout/PageTransition.tsx
Normal file
35
frontend/src/components/layout/PageTransition.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
import { motion, useReducedMotion } from 'framer-motion'
|
||||
import { type ReactNode } from 'react'
|
||||
|
||||
const variants = {
|
||||
initial: { opacity: 0, y: 8 },
|
||||
animate: { opacity: 1, y: 0 },
|
||||
exit: { opacity: 0, y: -8 },
|
||||
}
|
||||
|
||||
interface PageTransitionProps {
|
||||
children: ReactNode
|
||||
/** Unique key for AnimatePresence to detect page changes */
|
||||
pageKey: string
|
||||
}
|
||||
|
||||
export function PageTransition({ children, pageKey }: PageTransitionProps) {
|
||||
const prefersReducedMotion = useReducedMotion()
|
||||
|
||||
if (prefersReducedMotion) {
|
||||
return <div key={pageKey}>{children}</div>
|
||||
}
|
||||
|
||||
return (
|
||||
<motion.div
|
||||
key={pageKey}
|
||||
variants={variants}
|
||||
initial="initial"
|
||||
animate="animate"
|
||||
exit="exit"
|
||||
transition={{ duration: 0.2, ease: 'easeOut' }}
|
||||
>
|
||||
{children}
|
||||
</motion.div>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user