I went on to create this mockup animation, and I was able to complete half of it. But I got stuck when I tried to achieve smooth rotation on mouse movement from the X and Y direction. I thought using .maprange would be a good idea to map the input range of -100 to 100 (which corresponds to the full range of the X and Y values) to the output range of -30 to 30. However, the result didn't turn out as I hoped
. Can you help me like where I went wrong? Also, could you enlighten me on how I can make the div rotate on click and infinitely, like it is being rotated using CSS custom properties? I'm really feeling very embarrassed about not being that good in math.
Website Link: https://linktr.ee/ http://https://imgur.com/30OnrJN