Fork of Mouse Follower
✓ Published0🌍 Public
A circle follows the mouse cursor across an SVG canvas. The visualization is built with React and renders a single circle element whose center coordinates are updated on mouse movement. The code uses React’s `useState` and `useCallback` hooks to manage the cursor position, and the `ReactDOM` library for rendering. The SVG’s `onMouseMove` event handler captures the cursor’s `clientX` and `clientY` values, which are then set as the circle’s `cx` and `cy` attributes. The canvas is fixed at 960 by 500 pixels, and the circle has a radius of 30 pixels.
AI-generated descriptionA program that follows your mouse with a circle.
MIT Licensed