Fork for Cursor Following
✓ Published1🌍 Public
A circle follows the cursor across a full-screen SVG canvas, continuously updating its position as the mouse moves. The React app uses the `useState` hook to store mouse coordinates and the `useCallback` hook to handle `onMouseMove` events, with `clientX` and `clientY` from the event object. The SVG circle’s `cx` and `cy` attributes are re-rendered with each move, and the viewport size is determined by `window.innerWidth` and `window.innerHeight`.
AI-generated descriptionA program for following the mouse around the screen.
MIT Licensed