Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

mouse follower

Public visualization

Viewing a saved revision (read-only)

ec8129fde689427093b6fefd1091bf9c

mouse follower

0 stars1🌍 Public
Ssabrinamochi
Last edited Mar 11, 2021
Created on Mar 11, 2021

A smiley face drawn with SVG circles follows the mouse cursor across the full browser window. The example uses React’s `useState` and `useCallback` hooks to track mouse position on the `<svg>` element, updating the circle’s `cx` and `cy` attributes in response to `onMouseMove` events. Rendering is handled by ReactDOM, with the viewport dimensions determined by `window.innerWidth` and `window.innerHeight`. The code includes a static yellow smiley face in a commented block, but the active visualization shows only a single black circle.

AI-generated description

Smiley face implementation with React.