Created
January 2, 2025 03:10
-
-
Save hellokaton/8b13dce38712bee0af1a5ae3de5c5172 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
"use client"; | |
import { motion } from "framer-motion"; | |
export const AnimatedCard = () => { | |
return ( | |
<motion.div | |
initial={{ opacity: 0, y: 20 }} | |
animate={{ opacity: 1, y: 0 }} | |
exit={{ opacity: 0, y: -20 }} | |
transition={{ | |
duration: 0.3, | |
type: "spring", | |
stiffness: 260, | |
damping: 20, | |
}} | |
whileHover={{ scale: 1.05 }} | |
className="p-6 bg-white rounded-xl shadow-lg" | |
> | |
<h3 className="text-xl font-bold">动效卡片</h3> | |
<p>优雅的弹性动画效果</p> | |
</motion.div> | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment