Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Viewing a saved revision (read-only)

85ba980ceba74ae0a710a90b15d51807

Mouse Follower

0 stars1🌍 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!