$npx -y skills add calesthio/OpenMontage --skill framer-motionUse when implementing Disney's 12 animation principles with Framer Motion in React applications
| 1 | # Framer Motion Animation Principles |
| 2 | |
| 3 | Implement all 12 Disney animation principles using Framer Motion's declarative React API. |
| 4 | |
| 5 | ## 1. Squash and Stretch |
| 6 | |
| 7 | ```jsx |
| 8 | <motion.div |
| 9 | animate={{ scaleX: [1, 1.2, 1], scaleY: [1, 0.8, 1] }} |
| 10 | transition={{ duration: 0.3, times: [0, 0.5, 1] }} |
| 11 | /> |
| 12 | ``` |
| 13 | |
| 14 | ## 2. Anticipation |
| 15 | |
| 16 | ```jsx |
| 17 | <motion.div |
| 18 | variants={{ |
| 19 | idle: { y: 0, scaleY: 1 }, |
| 20 | anticipate: { y: 10, scaleY: 0.9 }, |
| 21 | jump: { y: -200 } |
| 22 | }} |
| 23 | initial="idle" |
| 24 | animate={["anticipate", "jump"]} |
| 25 | transition={{ duration: 0.5, times: [0, 0.2, 1] }} |
| 26 | /> |
| 27 | ``` |
| 28 | |
| 29 | ## 3. Staging |
| 30 | |
| 31 | ```jsx |
| 32 | <motion.div animate={{ filter: "blur(3px)", opacity: 0.6 }} /> {/* bg */} |
| 33 | <motion.div animate={{ scale: 1.1, zIndex: 10 }} /> {/* hero */} |
| 34 | ``` |
| 35 | |
| 36 | ## 4. Straight Ahead / Pose to Pose |
| 37 | |
| 38 | ```jsx |
| 39 | <motion.div |
| 40 | animate={{ |
| 41 | x: [0, 100, 200, 300], |
| 42 | y: [0, -50, 0, -30] |
| 43 | }} |
| 44 | transition={{ duration: 1, ease: "easeInOut" }} |
| 45 | /> |
| 46 | ``` |
| 47 | |
| 48 | ## 5. Follow Through and Overlapping Action |
| 49 | |
| 50 | ```jsx |
| 51 | <motion.div animate={{ x: 200 }} transition={{ duration: 0.5 }}> |
| 52 | <motion.span |
| 53 | animate={{ x: 200 }} |
| 54 | transition={{ duration: 0.5, delay: 0.05 }} // hair |
| 55 | /> |
| 56 | <motion.span |
| 57 | animate={{ x: 200 }} |
| 58 | transition={{ duration: 0.6, delay: 0.1 }} // cape |
| 59 | /> |
| 60 | </motion.div> |
| 61 | ``` |
| 62 | |
| 63 | ## 6. Slow In and Slow Out |
| 64 | |
| 65 | ```jsx |
| 66 | <motion.div |
| 67 | animate={{ x: 300 }} |
| 68 | transition={{ |
| 69 | duration: 0.6, |
| 70 | ease: [0.42, 0, 0.58, 1] // easeInOut cubic-bezier |
| 71 | }} |
| 72 | /> |
| 73 | // Or use: "easeIn", "easeOut", "easeInOut" |
| 74 | ``` |
| 75 | |
| 76 | ## 7. Arc |
| 77 | |
| 78 | ```jsx |
| 79 | <motion.div |
| 80 | animate={{ |
| 81 | x: [0, 100, 200], |
| 82 | y: [0, -100, 0] |
| 83 | }} |
| 84 | transition={{ duration: 1, ease: "easeInOut" }} |
| 85 | /> |
| 86 | ``` |
| 87 | |
| 88 | ## 8. Secondary Action |
| 89 | |
| 90 | ```jsx |
| 91 | <motion.button |
| 92 | whileHover={{ scale: 1.05 }} |
| 93 | whileTap={{ scale: 0.95 }} |
| 94 | > |
| 95 | <motion.span |
| 96 | animate={{ rotate: [0, 10, -10, 0] }} |
| 97 | transition={{ duration: 0.3 }} |
| 98 | > |
| 99 | Icon |
| 100 | </motion.span> |
| 101 | </motion.button> |
| 102 | ``` |
| 103 | |
| 104 | ## 9. Timing |
| 105 | |
| 106 | ```jsx |
| 107 | const timings = { |
| 108 | fast: { duration: 0.15 }, |
| 109 | normal: { duration: 0.3 }, |
| 110 | slow: { duration: 0.6 }, |
| 111 | spring: { type: "spring", stiffness: 300, damping: 20 } |
| 112 | }; |
| 113 | ``` |
| 114 | |
| 115 | ## 10. Exaggeration |
| 116 | |
| 117 | ```jsx |
| 118 | <motion.div |
| 119 | animate={{ scale: 1.5, rotate: 720 }} |
| 120 | transition={{ |
| 121 | type: "spring", |
| 122 | stiffness: 200, |
| 123 | damping: 10 // low damping = overshoot |
| 124 | }} |
| 125 | /> |
| 126 | ``` |
| 127 | |
| 128 | ## 11. Solid Drawing |
| 129 | |
| 130 | ```jsx |
| 131 | <motion.div |
| 132 | style={{ perspective: 1000 }} |
| 133 | animate={{ rotateX: 45, rotateY: 30 }} |
| 134 | transition={{ duration: 0.5 }} |
| 135 | /> |
| 136 | ``` |
| 137 | |
| 138 | ## 12. Appeal |
| 139 | |
| 140 | ```jsx |
| 141 | <motion.div |
| 142 | whileHover={{ |
| 143 | scale: 1.02, |
| 144 | boxShadow: "0 20px 40px rgba(0,0,0,0.2)" |
| 145 | }} |
| 146 | transition={{ duration: 0.3 }} |
| 147 | /> |
| 148 | ``` |
| 149 | |
| 150 | ## Stagger Children |
| 151 | |
| 152 | ```jsx |
| 153 | const container = { |
| 154 | hidden: { opacity: 0 }, |
| 155 | show: { |
| 156 | opacity: 1, |
| 157 | transition: { staggerChildren: 0.1 } |
| 158 | } |
| 159 | }; |
| 160 | |
| 161 | <motion.ul variants={container} initial="hidden" animate="show"> |
| 162 | {items.map(item => <motion.li variants={itemVariant} />)} |
| 163 | </motion.ul> |
| 164 | ``` |
| 165 | |
| 166 | ## Key Framer Motion Features |
| 167 | |
| 168 | - `animate` - Target state |
| 169 | - `variants` - Named animation states |
| 170 | - `whileHover` / `whileTap` - Gesture animations |
| 171 | - `transition` - Timing and easing |
| 172 | - `AnimatePresence` - Exit animations |
| 173 | - `useAnimation` - Programmatic control |
| 174 | - `layout` - Auto-animate layout changes |