Skip to main content
100%

mouse follower

✓ Published1🌍 Public
Nn.koldovsky@gmail.com
Last edited Jul 26, 2021
Created on Jul 18, 2021

A circle in an SVG chart follows the mouse cursor, growing larger as the cursor moves right and down across the 960 by 500 pixel viewport. The React component uses the `useState` and `useCallback` hooks to track the cursor's `clientX` and `clientY` coordinates, which are then bound to the circle's `cx`, `cy`, and `r` attributes. Mouse movement is handled by an `onMouseMove` event on the SVG element, and the circle's radius is calculated as the sum of the coordinates divided by 30.

AI-generated description

Mouse followers

MIT Licensed

Similar vizzes