Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

mouse follower

Public visualization

mouse follower

0 stars1🌍 Public
Rrishyossarian
Last edited Dec 27, 2021
Created on Dec 27, 2021

A smiley face rendered as an SVG circle tracks the cursor's movement across a full-window canvas. The code uses React hooks, specifically `useState` for mouse coordinates and `useCallback` for the event handler, to update the circle's `cx` and `cy` attributes on every `mousemove`. The visualization displays a single yellow circle with black outlines, omitting facial features, and directly lands on the `clientX` and `clientY` properties of the mouse event.

AI-generated description

Smiley face implementation with React.

Comments

Sign in to join the discussion.

MIT Licensed