Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
CChristian Rohrer
Last edited Jan 27, 2023
Created on Jan 27, 2023

A single red circle follows the cursor across the entire browser viewport. The circle is rendered as an SVG `<circle>` element, with its center coordinates updated on every mouse move event. Built with React (using `useState` and `useCallback`) and rendered with `ReactDOM.render`, the application listens for `onMouseMove` on a full-window SVG and sets the circle’s `cx` and `cy` properties to the event’s client coordinates. The viewport dimensions are taken from `window.innerWidth` and `window.innerHeight`.

AI-generated description

Smiley face implementation with React.

MIT Licensed

Similar vizzes