Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars1🌍 Public
MMonish Vassantrai
Last edited Sep 23, 2021
Created on Mar 10, 2021

A circle follows the mouse cursor across a full-screen SVG canvas, tracking the pointer's current position in real time. The visualization uses React's `useState` and `useCallback` hooks to manage and update the circle's center coordinates on every `onMouseMove` event, rendering the result as an SVG `<circle>` element. The initial position is centered in the viewport, and the window dimensions determine the SVG's width and height.

AI-generated description

A program that follows your mouse with a circle.

Comments

Sign in to join the discussion.

MIT Licensed