Skip to main content
100%

Mouse Follower

✓ Published1🌍 Public
AAnthonyAl-Rifai
Last edited Feb 12, 2023
Created on Feb 12, 2023

A single dark circle tracks the cursor’s movement across a 960×500 SVG canvas. The circle’s center is repositioned directly to the mouse’s client coordinates on every move event, using React state updates triggered by the SVG’s `onMouseMove` handler. Built with React and ReactDOM, the example renders purely through SVG elements, with the circle maintaining a constant radius of 30 pixels while following the pointer smoothly across the viewport. The code initializes the circle at the canvas center before any mouse activity occurs.

AI-generated description

A program that follows your mouse with a circle!

MIT Licensed

Similar vizzes