Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars1🌍 Public
IIverefiner
Last edited Nov 1, 2021
Created on Nov 1, 2021

A single circle follows the mouse cursor across a full-screen SVG canvas. Built with React and SVG, the example uses the `useState` and `useCallback` hooks to track `clientX` and `clientY` coordinates from the SVG element's `onMouseMove` event, updating the circle's `cx` and `cy` attributes in real time. The circle starts at the center of the viewport and moves smoothly with pointer input.

AI-generated description

A Program that follows your mouse with a circle.

Comments

Sign in to join the discussion.

MIT Licensed