Skip to main content
100%

Mouse Follower

✓ Published0🌍 Public
MMorris Muriithi
Last edited Jun 17, 2024
Created on Jun 16, 2024

This interactive SVG visualization displays a circle that continuously follows the mouse cursor across the viewport. The circle remains centered on the pointer’s position, updating in real time as the user moves the mouse. Built with React and rendered as SVG, it uses the `useState` hook to track mouse coordinates and a `handleMouseMove` callback triggered by the SVG element’s `onMouseMove` event. The circle’s `cx` and `cy` attributes are bound to these state values, with a fixed radius of 30 pixels. The visualization starts with the circle centered on the screen.

AI-generated description

A program to interactively change the position of a circle depending on the position of the mouse.

MIT Licensed

Similar vizzes