Skip to main content
100%

Smiley Face Part II

✓ Published0🌍 Public
LLicheng Zhang
Last edited May 23, 2021
Created on May 23, 2021

A single black circle follows the mouse cursor across a blank SVG canvas, responding to every movement with a one-to-one positional update. The React component tracks the pointer via the `onMouseMove` event and stores the coordinates in state using the `useState` hook, while `useCallback` optimizes the handler. ReactDOM renders the scene, and the circle's center is set directly to the cursor's clientX and clientY values, creating a simple, immediate interactive visualization.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes