tholman / cursor-effects

Old-school cursor effects for your browser built with modern JavaScript
https://tholman.com/cursor-effects
3.44k stars 254 forks source link

Toggle Cursor effects #33

Closed ispringle closed 2 years ago

ispringle commented 2 years ago

I'm wondering if there is a way to toggle the cursor on and off. I like the clock cursor, brings some retro early 00s flair, but it also interfers with reading websites. I have a event listening for mousemove and if the main tag is in the :hover query selector results I would like to turn off the cursor.

ispringle commented 2 years ago

This might also be needed for things that don't reload the dom when a new page loads. With NextJS I am seeing a duplicate cursor being created with every click because NextJS only updates elements that change in the DOM and doesn't repaint the whole dome, thus it doesn't clear objects/values/state/etc, like the cursor.

tholman commented 2 years ago

Definitely seems like something that should be easy to add!

tholman commented 2 years ago

Can now call .destroy() on the effects