Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars1🌍 Public
OOlof Ollerstam
Last edited Mar 17, 2021
Created on Mar 15, 2021

A yellow circle tracks the cursor's position within an SVG canvas. The circle's center coordinates are updated with each mouse movement, creating a direct one-to-one mapping between the pointer and the graphic. Built with React, the application uses the `useState` hook to store the current mouse coordinates and the `useCallback` hook to manage the event handler. The SVG element listens for the `onMouseMove` event, and ReactDOM renders the circle with a 30-pixel radius onto the 960 by 500 pixel canvas.

AI-generated description

A program that witha a circle that follows your mouse.

Comments

Sign in to join the discussion.

MIT Licensed