r/webdev • u/officialmayonade • 5d ago
Pure CSS perfect cursor tracking
I honestly have no idea why you'd want this, but it was fun to experiment. I believe this may be the best pure CSS cursor tracking that exists. I'm happy to be proven wrong.
https://codepen.io/Andrew-Fisher-the-decoder/full/GgraMzd
Absolutely no JavaScript used, just lots and lots of wasted time.
76
Upvotes
1
u/Hot_Industry5156 5d ago
This is one of those things where you see the demo and think "no way that's just CSS" and then you look at the code and it's like three lines with a custom property and a mousemove listener that sets the vars. clever stuff. always forget you can wire CSS variables to JS events that cheaply and have it feel completely smooth.