Skip to main content
100%

Fork of Mouse Follower 2 - JAT

✓ Published1🌍 Public
JJason Tiller
Last edited Mar 2, 2021
Created on Mar 1, 2021

This example shows a circle in an SVG that tracks the user’s mouse movements across a 960×500 canvas, starting from the center. Built with React hooks, it uses `useState` to store the cursor’s `clientX` and `clientY` coordinates and `useCallback` to update that state on every `onMouseMove` event. ReactDOM renders the SVG element and its circle, whose `cx` and `cy` attributes are bound to the tracked position. The circle’s constant radius is 30 pixels.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes