Day 18 - Mastering Framer Motion
What I learnt:
- I didn't know that we can use function for
useTransform()
.- Working with
useTransform()
's values are sometimes confusing, but now I am a bit better when it comes to using to it.- We can use
Infinity
for one of the value of useMotionValue. the icons get big based on a value. So when it is 0, the icon's size must get bigger, that is why using Infinity solve the issue.- I learned how to get the center position of each element in the DOM. First we need to determine where our mouse is on the page then subtract the x-axis from the position of the element from the left and subtract again by half of the width of the element to find the center of the element.
Credit
- All thanks to this video