Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower

Public visualization

Mouse Follower

0 stars1🌍 Public
MMinh Luong
Last edited Jan 8, 2022
Created on Jan 7, 2022

This example displays a single circle that follows the mouse cursor across the full browser window. The circle is rendered as an SVG element with its position updated on every mouse movement event. Built with React, the code uses the `useState` and `useCallback` hooks to manage and optimize the cursor position state, while `ReactDOM.render` mounts the component. The SVG viewport is set to the window’s dimensions, and the circle’s center coordinates are directly bound to the tracked mouse position.

AI-generated description

A Program that follows your mouse with a circle

Comments

Sign in to join the discussion.

MIT Licensed