diff --git a/cursor.jsx b/cursor.jsx new file mode 100644 index 0000000..409f6bf --- /dev/null +++ b/cursor.jsx @@ -0,0 +1,37 @@ +"use client"; +import { useEffect, useRef } from 'react'; +import { gsap } from 'gsap'; + +const CustomCursor = ({ isHoveringButton }) => { + const cursorRef = useRef(null); + + useEffect(() => { + const moveCursor = (e) => { + const { clientX: x, clientY: y } = e; + + gsap.to(cursorRef.current, { + x: x - 16, + y: y - 16, + duration: 0.1, + ease: "power3.out", + }); + }; + + window.addEventListener('mousemove', moveCursor); + + return () => { + window.removeEventListener('mousemove', moveCursor); + }; + }, []); + + return ( + <> +
+ > + ); +}; + +export default CustomCursor;