Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
VVeerle
Last edited Jan 16, 2021
Created on Nov 25, 2020
Forked from Mouse Follower

A circle that tracks the mouse is not present; instead, this interactive SVG renders a 200-by-100 rectangle that follows the pointer across a 960-by-500 drawing area. The example demonstrates Reactive state updates in React, using the `useState` and `useCallback` hooks to capture `clientX` and `clientY` coordinates from the SVG’s `onMouseMove` event. Each pointer movement updates the rectangle’s position, with the captured coordinates logged to the console. Built with React 16.9 and rendered via ReactDOM, the visualization relies on declarative JSX to bind mouse data directly to SVG attributes.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes