Mouse Follower
✓ Published0🌍 Public
A React and SVG visualization renders a black circle that follows the mouse cursor across a 960 by 500 canvas. As the pointer moves, the circle’s fill color changes randomly to one of six predefined hex values (e.g., red, green, blue). The application tracks cursor coordinates via the `onMouseMove` event on the `<svg>` element, updating the circle’s `cx` and `cy` attributes through React state. The code uses React’s `useState` and `useCallback` hooks to manage position and color updates efficiently.
AI-generated descriptionA program that follows your mouse with a circle.
MIT Licensed