Spinning Cursor Dots

A retro-futuristic cursor effect. A set of particles orbits the cursor position, creating a dynamic, rotating halo effect.

Move your mouse here.

Copy the Script

<script>
// Simple logic concept
var angle = 0;
var mouseX = 0, mouseY = 0;

document.onmousemove = function(e) {
    mouseX = e.pageX; mouseY = e.pageY;
}

setInterval(function() {
    angle += 0.1;
    var dot = document.getElementById("dot1");
    // Calculate orbit
    dot.style.left = (mouseX + Math.cos(angle) * 30) + "px";
    dot.style.top = (mouseY + Math.sin(angle) * 30) + "px";
}, 20);
</script>

Frequently Asked Questions

It relies on JavaScript `setInterval` or `requestAnimationFrame` to calculate positions. It is efficient for a few dots (e.g., 5-8) but can slow down old computers if you add too many.

Yes. The rotation logic relies on an angle variable that increments every frame. Increasing the increment step makes the dots spin faster.

This specific script just follows movement. You could modify it to expand the ring radius on click for a 'pulse' effect.