This was a very fun project to do as I leaned a lot of new things in JavaScript that I did not even know those exists. In this project I have created a face with two eyes that always keeps looking at the position of mouse curser or in simple work this face will keep stating on your mouse cursor wherever you position your mouse curser.
- getBoundingClientRect() --> This method returns a "DOMRect" object providing information about the size of an element and its position relative to the viewport. This is the one function that inspired me to create this project.
- atan2() function -> With help of this function we find angle between two DOM element in JavaScript with help of basic trignometric concept.
- requestAnimationFrame() function for smooth animation. I have to learn more about this function so that I can put this in more usecases.
- Setting CSS property dynamically using JavaScript variables.
https://ramshankarkumar.github.io/eyeball_tracking_mouse_cursor/