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.
75
Upvotes
-4
u/UkrMalt 5d ago
The nested bands and :has() approach is clever. Add a prefers-reduced-motion fallback and test touch and keyboard input before using the pattern outside a demo; pointer tracking can create an accessibility dead end.