Mouse Follower with Smiley Face
✓ Published0🌍 Public
A smiley face rendered as an SVG group follows the mouse cursor across a full-screen yellow canvas. Built with React and D3, the component tracks `clientX` and `clientY` coordinates from a `mousemove` event on the `<svg>` element, updating state via `useState` and `useCallback`. The face’s head, eyes, and mouth are drawn using D3’s `arc()` generator for the mouth path, with circles for the eyes and a stroked yellow circle for the face. The group translates to the live mouse position, creating a direct, interactive visual response.
AI-generated descriptionA program that follows your mouse with a Smiley Face.
MIT Licensed