tholman / cursor-effects

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

Option to have mobile turned off #47

Open tholman opened 1 year ago

tholman commented 1 year ago

Setting for all cursors to not init on mobile/touch devices. Defaulted to off.

meewgumi commented 1 year ago

Hacky workaround I'm using for now:

/* smartphones, touchscreens */
@media (hover: none) and (pointer: coarse) {
    canvas {
        display: none;
    }
}

/* Nintendo Wii controller, Microsoft Kinect */
@media (hover: hover) and (pointer: coarse) {
    canvas {
        display: none;
    }
}

source for media queries

luckily my project only has one canvas but it would be cool if this script gave it a unique class or ID so we can target it with CSS in the future

arlenpeiffer commented 1 year ago

+1 on the idea of having a unique id/class that could be used to apply any additional styles to the canvas element ! thanks for the super fun project 🙃