Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
JJoe Hutchins
Last edited Feb 16, 2022
Created on Feb 16, 2022

A single circle follows the mouse cursor across an SVG canvas, responding directly to pointer movement. Built with React, the component tracks the mouse position via the `onMouseMove` event and updates state with `useState` and `useCallback`. The circle’s `cx` and `cy` attributes are bound to the current coordinates, using the `clientX` and `clientY` properties from the event object. The visualization demonstrates real-time interaction, with the circle centered at the initial screen midpoint before any movement occurs.

AI-generated description

A program that follows your mouse with a circle

MIT Licensed

Similar vizzes