Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
GGonzalo Alarcón Usui
Last edited Dec 2, 2021
Created on Dec 2, 2021

A single yellow circle tracks the mouse position within an SVG viewport of 960 by 500 pixels. The React component uses the `useState` hook to store the mouse coordinates, which are updated on every `mousemove` event via the `handleMouseMove` callback. The circle’s `cx` and `cy` attributes are bound to the current state, causing it to follow the cursor directly without any animation or interpolation. The rendering is handled entirely by React’s declarative SVG elements, with no D3 API calls used.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes