🌍 Public
Viewing a saved revision (read-only)
6e5cd8bade834366991a32d55ce9e58b
Fork of Mouse Follower 2 - JAT
This example shows a circle in an SVG that tracks the user’s mouse movements across a 960×500 canvas, starting from the center. Built with React hooks, it uses `useState` to store the cursor’s `clientX` and `clientY` coordinates and `useCallback` to update that state on every `onMouseMove` event. ReactDOM renders the SVG element and its circle, whose `cx` and `cy` attributes are bound to the tracked position. The circle’s constant radius is 30 pixels.
AI-generated descriptionA program that follows your mouse with a circle.