Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
RRonanFonseca
Last edited Aug 17, 2022
Created on Aug 17, 2022

A yellow circle follows the mouse cursor as it moves across a blank SVG canvas. The circle’s position is updated on every mouse-move event, using React’s `useState` and a custom `handleMouseMove` callback. The example uses React and ReactDOM to render an SVG `<circle>` element, with the cursor’s `clientX` and `clientY` coordinates directly mapping to the circle’s `cx` and `cy` attributes. The initial circle is centered at 480, 250 with a radius of 30.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes