Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
Aalexanderjpark
Last edited Jan 4, 2022
Created on Jan 2, 2022

An interactive React and SVG visualization demonstrates mouse tracking by rendering a single black circle that follows the cursor across a 960x500 coordinate space. The app uses the `useState` hook to store the mouse position and a `useCallback`-wrapped event handler to update that state on every SVG `onMouseMove` event. The circle’s center coordinates are bound directly to the current mouse position, producing a seamless, real-time response. The initial position is set to the viewport’s center, and the circle radius is fixed at 30 pixels.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes