Skip to main content
100%

Fork for Cursor Following

✓ Published1🌍 Public
HHoosierExperienceDesigner
Last edited Jul 22, 2021
Created on Jul 22, 2021

A circle follows the cursor across a full-screen SVG canvas, continuously updating its position as the mouse moves. The React app uses the `useState` hook to store mouse coordinates and the `useCallback` hook to handle `onMouseMove` events, with `clientX` and `clientY` from the event object. The SVG circle’s `cx` and `cy` attributes are re-rendered with each move, and the viewport size is determined by `window.innerWidth` and `window.innerHeight`.

AI-generated description

A program for following the mouse around the screen.

MIT Licensed

Similar vizzes