Skip to content

Instantly share code, notes, and snippets.

View Vis-halG's full-sized avatar
🎯
Focusing

Vishal Gupta Vis-halG

🎯
Focusing
View GitHub Profile
@Vis-halG
Vis-halG / elastic-custom-cursor-following-mouse-squeeze-and-rotate-w-javascript.markdown
Created October 13, 2025 08:17
Elastic Custom Cursor Following Mouse (Squeeze and Rotate) w/ JavaScript

Elastic Custom Cursor Following Mouse (Squeeze and Rotate) w/ JavaScript

Here I've created an elastic circle that follows your mouse cursor. This is achieved by calculating the velocity and direction of the mouse movement, and then dynamically adjusting the 'transform' property to reflect these changes.

YouTube Tutorial: https://youtu.be/wG_5453Vq98

A Pen by Denis Gusev on CodePen.

License.