Skip to main content
100%

mouse follower

✓ Published1🌍 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.

MIT Licensed

Similar vizzes