Created
October 10, 2025 13:12
-
-
Save kitlangton/c710adda0314495162b3ac63d3c5c752 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { AnimatePresence, motion } from "motion/react" | |
| type BlurTransitionProps = { | |
| text: string | |
| className?: string | |
| } | |
| export function BlurTransition({ text, className = "" }: BlurTransitionProps) { | |
| return ( | |
| <AnimatePresence mode="popLayout"> | |
| <motion.div | |
| key={text} | |
| className={className} | |
| initial={{ | |
| opacity: 0, | |
| scale: 1.2, | |
| filter: "blur(8px)", | |
| }} | |
| animate={{ | |
| opacity: 1, | |
| scale: 1, | |
| filter: "blur(0px)", | |
| }} | |
| exit={{ | |
| opacity: 0, | |
| scale: 0.8, | |
| filter: "blur(8px)", | |
| }} | |
| transition={{ | |
| type: "spring", | |
| visualDuration: 0.4, | |
| bounce: 0.3, | |
| }} | |
| style={{ | |
| willChange: "opacity, filter, scale", | |
| }} | |
| > | |
| {text} | |
| </motion.div> | |
| </AnimatePresence> | |
| ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment