Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars1🌍 Public
Mmikekslv
Last edited Feb 21, 2022
Created on Feb 21, 2022

A circle follows the mouse cursor across a yellow-bordered SVG canvas. The React application tracks the pointer's client coordinates and repositions a fixed-radius circle at that location. Using React's `useState` and `useCallback`, it updates the circle's `cx` and `cy` attributes on every mouse move. The `onMouseMove` handler on the SVG element captures the position, and ReactDOM renders the updated circle at the new coordinates.

AI-generated description

A program that follows your mouce with a circle

Comments

Sign in to join the discussion.

MIT Licensed