Skip to main content
🌍 Public

Share visualization

Send this visualization to others.

Mouse Tracking

Public visualization

Mouse Tracking

0 stars1🌍 Public
GGabriel
Last edited Mar 30, 2022
Created on Mar 30, 2022
Forked from HTML Starter

A single circle tracks the mouse cursor in real time across a full-screen SVG canvas. Built with React 18, the app uses the `useState` hook to store cursor coordinates from the `onMouseMove` event on a div catcher, then passes those coordinates to an SVG circle’s `cx` and `cy` attributes for immediate repositioning. The `useCallback` hook memoizes the event handler for efficiency. ReactDOM renders the component into the page’s root element.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

Comments

Sign in to join the discussion.

MIT Licensed