Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Fork for Cursor Following

Public visualization

Fork for Cursor Following

0 stars1🌍 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.

Comments

Sign in to join the discussion.

MIT Licensed