淡入上滑
元素从下方淡入并向上滑动,最常见的入场动画之一。
交互预览
动效定义与代码
{
"slug": "fade-in-up",
"name": "淡入上滑",
"nameEn": "Fade In Up",
"description": "元素从下方淡入并向上滑动,最常见的入场动画之一。",
"descriptionEn": "Element fades in while sliding upward. One of the most common entrance animations.",
"category": "entrance",
"tags": [
"fade",
"slide",
"entrance",
"mount"
],
"trigger": "on-mount",
"difficulty": "beginner",
"duration": "600ms",
"easing": "cubic-bezier(0.16, 1, 0.3, 1)",
"cssProperties": [
"opacity",
"transform"
],
"isGPUAccelerated": true,
"previewBg": "light",
"keywords": [
"fade in",
"slide up",
"entrance",
"appear",
"mount animation"
],
"useCases": [
"Page section entrance",
"Card list staggered reveal",
"Modal content appearance",
"Hero text entrance"
],
"relatedAnimations": [
"fade-in-down",
"scale-in",
"blur-in"
],
"recommendedStyles": [
"glassmorphism",
"minimalist-flat",
"soft-ui"
],
"codeSnippets": [
{
"label": "CSS Keyframes",
"language": "css",
"code": "@keyframes fade-in-up {\n from {\n opacity: 0;\n transform: translateY(20px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n.fade-in-up {\n --sk-duration: 600ms;\n --sk-delay: 0ms;\n --sk-ease: cubic-bezier(0.16, 1, 0.3, 1);\n will-change: transform, opacity;\n animation: fade-in-up var(--sk-duration) var(--sk-ease) var(--sk-delay) both;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fade-in-up {\n animation: none;\n opacity: 1;\n transform: none;\n }\n}"
},
{
"label": "Tailwind CSS",
"language": "css",
"code": "/* Add to your global CSS or Tailwind v4 theme */\n@keyframes fade-in-up {\n from {\n opacity: 0;\n transform: translateY(20px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n\n@utility animate-fade-in-up {\n --sk-duration: 600ms;\n --sk-delay: 0ms;\n --sk-ease: cubic-bezier(0.16, 1, 0.3, 1);\n will-change: transform, opacity;\n animation: fade-in-up var(--sk-duration) var(--sk-ease) var(--sk-delay) both;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fade-in-up {\n animation: none;\n opacity: 1;\n transform: none;\n }\n}"
},
{
"label": "Framer Motion",
"language": "tsx",
"code": "import { motion } from \"framer-motion\";\n\n// Tip: respect user's motion preferences\n// import { useReducedMotion } from \"framer-motion\";\n// const reduced = useReducedMotion();\n// Use reduced ? { opacity: 0 } : { opacity: 0, y: 20 } for initial\n\n<motion.div\n initial={{ opacity: 0, y: 20 }}\n animate={{ opacity: 1, y: 0 }}\n transition={{ duration: 0.6, ease: [0.16, 1, 0.3, 1] }}\n>\n Content\n</motion.div>"
}
]
}