This hack works by disabling the real cursor (using a custom CSS cursor image set to a transparent png), then moving around a fake cursor image using JS.
See by comparison this hack I made a few months ago [1], which uses a dynamic CSS cursor image (drawn in JS). The interesting thing it shows is that CSS cursors can escape the viewport, leading to possible security issues.
Nice hack. It's not obvious whether it still works now that GitHub Pages uses HTTPS, though the fact that clicking on the page triggers the same action as clicking the page icon/padlock suggests it does.
Interesting trick. I was recently looking through Safari CSS Reference and thought using an image to replace the cursor wasn't allowed: "Although the CSS specification allows it, Safari does not support custom cursors." [0]
What are examples of legitimate use-cases for supporting custom cursors? If you're considering using a custom cursors, keep in mind that not all users keep the normal cursor size. At least on macOS, you can increase the size from the Accessibility panel.
Hopefully the web can start providing access to more built-in accessibility features. One such feature that was added recently is Reduced Motion Media Query [1]. Wouldn't it be great to have a media query for "Increase contrast"? I can't be the only one that's occasionally frustrated from websites that mix 50 shades of barely readable gray.
> What are examples of legitimate use-cases for supporting custom cursors?
We build web applications serving expert users for which this is essential. For precise selection the default cursor often occludes important information. Think of how confusing something like Photoshop, AutoCAD or Maya would be without contextual cursors.
It would be sensible, however, to place behind a permission in the same way as location or notification APIs. Unfortunately most browsers' UX for permissions is awful.
I am certain in my heart that the most reasonable use case is to replace the cursor with a detailed gauntlet cursor or severed hand as in Warcraft to let the user know whether they are The Alliance or Horde.
Kidding, of course. But damn I loved that sort of thing back when. Especially being able to do it with weird plugins as a fledgling "webmaster".
> What are examples of legitimate use-cases for supporting custom cursors?
Probably special cursors that indicate a different type of action that can be performed; like the hand-shaped pointer you get when hovering over a button or the various resize arrows, but custom. A tipped paint bucket for example on a website presenting a drawing application.
The repel could be dangerous too. There are plenty of features that websites are legally or ethically obligated to provide, but they would rather users not use them. I'm imagining email newsletters with really hard to click unsubscribe buttons.
Pretty smart once you figure out how it works. Wonder if there's some kind of advanced click-jacking attack you could achieve with a technique like this.
I was thinking about this. You can accumulate the position difference and trick the user into clicking anywhere. I'll try to do that right now and update the demo :)
In latest Firefox, I keep getting it to show the real and fake cursor by switching tabs, hovering a link in another tab, and switching back. Doesn't work every time though.
If you shift+right click in firefox (and keep the menu open but ignore it), you can see both the real and fake cursor at the same time to see what is really happening
This is pretty ingenious. I wonder if something like this can have an effect on call to action click rates. But I guess if the user notices then they're more likely to be pissed.
[+] [-] jamesfisher|9 years ago|reply
See by comparison this hack I made a few months ago [1], which uses a dynamic CSS cursor image (drawn in JS). The interesting thing it shows is that CSS cursors can escape the viewport, leading to possible security issues.
[1]: https://jameshfisher.github.io/cursory-hack/
[+] [-] chias|9 years ago|reply
[+] [-] nsgi|9 years ago|reply
[+] [-] TheAceOfHearts|9 years ago|reply
What are examples of legitimate use-cases for supporting custom cursors? If you're considering using a custom cursors, keep in mind that not all users keep the normal cursor size. At least on macOS, you can increase the size from the Accessibility panel.
Hopefully the web can start providing access to more built-in accessibility features. One such feature that was added recently is Reduced Motion Media Query [1]. Wouldn't it be great to have a media query for "Increase contrast"? I can't be the only one that's occasionally frustrated from websites that mix 50 shades of barely readable gray.
[0] https://developer.apple.com/library/content/documentation/Ap...
[1] https://developer.apple.com/library/content/releasenotes/Gen...
[+] [-] aschampion|9 years ago|reply
We build web applications serving expert users for which this is essential. For precise selection the default cursor often occludes important information. Think of how confusing something like Photoshop, AutoCAD or Maya would be without contextual cursors.
It would be sensible, however, to place behind a permission in the same way as location or notification APIs. Unfortunately most browsers' UX for permissions is awful.
[+] [-] lawik|9 years ago|reply
Kidding, of course. But damn I loved that sort of thing back when. Especially being able to do it with weird plugins as a fledgling "webmaster".
[+] [-] Freak_NL|9 years ago|reply
Probably special cursors that indicate a different type of action that can be performed; like the hand-shaped pointer you get when hovering over a button or the various resize arrows, but custom. A tipped paint bucket for example on a website presenting a drawing application.
[+] [-] sharpercoder|9 years ago|reply
[+] [-] Nemo157|9 years ago|reply
[+] [-] Mystrl|9 years ago|reply
[+] [-] Aaron1011|9 years ago|reply
[+] [-] rocqua|9 years ago|reply
[+] [-] Jaruzel|9 years ago|reply
[+] [-] ohadron|9 years ago|reply
[+] [-] Gabriel_Martin|9 years ago|reply
[+] [-] rosalinekarr|9 years ago|reply
[+] [-] pharrlax|9 years ago|reply
[+] [-] fapjacks|9 years ago|reply
[+] [-] Aldo_MX|9 years ago|reply
[+] [-] qprs|9 years ago|reply
[+] [-] unknown|9 years ago|reply
[deleted]
[+] [-] bluepnume|9 years ago|reply
[+] [-] javierbyte|9 years ago|reply
[+] [-] homakov|9 years ago|reply
[+] [-] panic|9 years ago|reply
[+] [-] Nition|9 years ago|reply
[+] [-] biggerfisch|9 years ago|reply
http://i.imgur.com/eMg5tXR.png
[+] [-] Aardwolf|9 years ago|reply
I like how it seems to work like a vector field
[+] [-] Fry-kun|9 years ago|reply
[+] [-] mburst|9 years ago|reply
[+] [-] 19eightyfour|9 years ago|reply
[+] [-] askjdlkasdjsd|9 years ago|reply
[+] [-] jv22222|9 years ago|reply
[+] [-] wingerlang|9 years ago|reply
OSX non retina
[+] [-] sml156|9 years ago|reply
[+] [-] cyberferret|9 years ago|reply
[+] [-] Sunset|9 years ago|reply
[+] [-] lutusp|9 years ago|reply
[+] [-] ars|9 years ago|reply
[+] [-] gruez|9 years ago|reply