Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
11godfrey
Last edited Mar 5, 2023
Created on Mar 5, 2023

A colored circle follows the cursor across an SVG canvas, updating its position in real time. The visualization demonstrates React's state management and event handling, using the `useState` and `useCallback` hooks to track mouse coordinates. The `App` component renders an SVG with a `<circle>` element, and the `handleMouseMove` callback updates the circle's `cx` and `cy` attributes via `clientX` and `clientY` events. ReactDOM renders the component into the DOM, with the circle initially centered at 960 by 500 pixels.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes