Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
MMorgan Worrell
Last edited Aug 4, 2023
Created on Aug 3, 2023

A full-screen React application renders an SVG circle that tracks the mouse cursor across the viewport. The component listens to the SVG’s `onMouseMove` event, updating React state with the cursor’s `clientX` and `clientY` coordinates, which are then bound to the circle’s `cx` and `cy` attributes. The circle has a fixed radius of 30 pixels, and the SVG dimensions match the browser window. React uses the `useState` and `useCallback` hooks to manage and optimize the position updates.

AI-generated description

A program that follows your mouse with a circle.

MIT Licensed

Similar vizzes