Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
SShankar Ghimire
Last edited Apr 13, 2022
Created on Apr 13, 2022

A large, unfilled circle traces the pointer's path across the full browser window, its position updating in real time as the mouse moves. The visualization uses React's `useState` and `useCallback` hooks to manage the circle's coordinates, which are rendered on an SVG canvas that spans the viewport's width and height. The circle's center is set from the `clientX` and `clientY` properties of the mouse-move event, while the window's initial dimensions determine the starting position. This example demonstrates a minimal, responsive interaction between user input and SVG graphics.

AI-generated description

A program that follows your mouse pointer with a circle.

MIT Licensed

Similar vizzes