Skip to main content
100%

Mouse follower

✓ Published1🌍 Public
BbeauMarko
Last edited Feb 26, 2021
Created on Feb 26, 2021

A circle follows the mouse cursor across a full-screen SVG canvas, updating its center position in real time as the pointer moves. Built with React and ReactDOM, the application tracks mouse coordinates through an `onMouseMove` event handler and stores them in component state via the `useState` hook. The SVG circle’s `cx` and `cy` attributes are bound to this state, causing React to re-render the shape at each new location. The canvas dimensions adapt to the browser window using `window.innerWidth` and `window.innerHeight`, with a fixed circle radius of 30 pixels.

AI-generated description

Aprogram that follows your mouse with a circle.

MIT Licensed

Similar vizzes