Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

8.00 Mouse Follower

Public visualization

8.00 Mouse Follower

0 stars1🌍 Public
EEric Weiss
Last edited Apr 6, 2021
Created on Apr 6, 2021

A single dark circle moves within an SVG viewport in direct response to the mouse cursor. The example demonstrates a simple React state update mechanism: the `onMouseMove` event on the `<svg>` element captures cursor coordinates, which are stored in `mousePosition` via `React.useState` and applied to the circle’s `cx` and `cy` attributes. The initial position is centered at (480, 250), and the circle’s radius is set to 10% of the viewport height. Crafted with React 17 and ReactDOM, it renders a pure SVG without external data or animation libraries.

AI-generated description

Comments

Sign in to join the discussion.

MIT Licensed