Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
MMarina Shemesh
Last edited Mar 12, 2021
Created on Mar 10, 2021

The visualization displays a single black circle that follows the mouse cursor across an SVG canvas that fills the entire viewport. React’s `useState` and `useCallback` hooks track the cursor’s client coordinates, which are updated via the SVG `onMouseMove` event handler. The circle’s `cx` and `cy` attributes are set to the current mouse position, and the component re-renders on every movement using `ReactDOM.render`. React 16.9 serves as the framework for this interactive, state-driven SVG rendering.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes