Skip to main content
100%

Fork of Mouse Follower

✓ Published0🌍 Public
GGordon Yang
Last edited Apr 6, 2021
Created on Apr 6, 2021
Forked from Mouse Follower

A circle follows the mouse cursor across an SVG canvas. The visualization is built with React and renders a single circle element whose center coordinates are updated on mouse movement. The code uses React’s `useState` and `useCallback` hooks to manage the cursor position, and the `ReactDOM` library for rendering. The SVG’s `onMouseMove` event handler captures the cursor’s `clientX` and `clientY` values, which are then set as the circle’s `cx` and `cy` attributes. The canvas is fixed at 960 by 500 pixels, and the circle has a radius of 30 pixels.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes