Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Follower - Code Optimization

Public visualization

Mouse Follower - Code Optimization

0 stars0🌍 Public
Bbakstorage00001
Last edited Feb 2, 2022
Created on Feb 2, 2022
Forked from Mouse Follower

Two navy and red circles follow the mouse cursor across an SVG canvas, offset horizontally to create a trailing effect. Built with React and rendered as SVG elements, the visualization uses the `useState` hook to track mouse coordinates and the `useCallback` hook to optimize the mousemove event handler, which updates the circle positions via `setMousePosition`. The initial mouse position is centered on the 960×500 viewport.

AI-generated description

A program that follows your mouse with a circle.

Comments

Sign in to join the discussion.

MIT Licensed