Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
Ee-ines
Last edited Apr 1, 2021
Created on Apr 1, 2021

A React component renders a 960-by-500 SVG containing a single circle that follows the mouse cursor across the viewport. The circle’s center coordinates are tracked via React’s `useState` hook, updated on every `mousemove` event through a `useCallback` handler that reads `clientX` and `clientY`. The SVG element listens for the mouse movement, and the circle’s `cx` and `cy` attributes are bound to the current position state. The code uses React 16.9 and `ReactDOM.render` to display the interactive graphic.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes