diff --git a/Animated-cursor/animated-cursor.js b/Animated-cursor/animated-cursor.js new file mode 100644 index 00000000..40366e5a --- /dev/null +++ b/Animated-cursor/animated-cursor.js @@ -0,0 +1,16 @@ +const cursor = document.querySelector(".cursor") + +document.addEventListener("mousemove",(e)=>{ + + let x = e.pageX; + let y = e.pageY; + + cursor.style.top = y + "px"; + cursor.style.left = x + "px"; + cursor.style.display = "block"; +}) + +document.addEventListener("mouseout",(e)=>{ + cursor.style.display = "none" ; +}) +