Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars1🌍 Public
Wwzhang88
Last edited Nov 20, 2021
Created on Nov 17, 2021

A smiley face follows the mouse cursor on an SVG canvas, with a yellow circle acting as the face and a smaller circle representing its mouth. Built with React and ReactDOM, the component tracks the cursor’s position via the `onMouseMove` event and updates state with the `useState` and `useCallback` hooks, re-rendering the SVG circle’s `cx` and `cy` coordinates accordingly.

AI-generated description

Smiley face implementation with React.

Comments

Sign in to join the discussion.

MIT Licensed