How to be Annoying with CSS Cursors (and a sprinkle of JS)

PUBLISHED: APR 19, 2022 | 1.22k words, 6 minute read β€” TIL

Looking for a new way to annoy1 your website visitors? Of course you are! How about changing their cursors to an emoji – and we won’t stop there. We’ll make that emoji change based on where they are on the page, wild stuffπŸ€ͺ!

Why πŸ”—︎

Thanks to the wonderful CSS tips a friend unwittingly sent me, I was forced by the hands of fate to adopt the emoji cursor on my own site. If you don’t like it, you’ll have to take it up with them.

How can I do this too ??? πŸ”—︎

The most important bit is adding classes you can easily reference with the emoji cursor changes. Feel free to choose whatever πŸ–Ό suits your fancy.

.}.}.}eeemmmooojcjcjciuiuiu-r-r-rcscscsuououorrrrrrs:s:s:ooorururu-r-r-r-l-l-ld(a(u(e"s"p"fdtdsdaaraiautotdtlacaeat:a:-:itidi{mmoma{awaggngeee//{/sssvvvggg+++xxxmmmlll;;;uuutttfff888,,,<<<sssvvvgggxxxmmmlllnnnsss==='''hhhttttttppp::://////wwwwwwwww...www333...ooorrrggg///222000000000///sssvvvggg'''wwwiiidddttthhh==='''444000'''hhheeeiiiggghhhttt==='''444888'''vvviiieeewwwpppooorrrttt==='''000000111000000111000000'''ssstttyyyllleee==='''fffiiillllll:::bbblllaaaccckkk;;;fffooonnnttt---sssiiizzzeee:::222444pppxxx;;;'''>>><<<ttteeexxxtttyyy==='''555000%%%'''>>>πŸƒπŸ±πŸ™ƒβ€β€<β™‚πŸš€/️<t</e/txtetex>xt<t>/><s</v/sgsv>vg"g>)>",")),a,uatauout;too;;

To make it change based on position, it’s a simple little function added in one of your js files:

ld}eotcuemeei}levvfeneemtnn(.ttlci}}=o..ofnxycn(edm;;aOsclootntuesecuilrdlelusoycsoeemenuom{mem.brrs..nopesTocctvaoomll.etarpeaaghnTHtsse=nnoahsstaopliLLEfmyHfniilueia)gssennlttmc=gf{wet=i==nio=ttonh[[Bne""y(hvieeIeoemmmdvmnaoo(e{etgjj"n.eiibtpy--o)acccdg<luuy{earr",(sss)wsoo;dierrens--fd--aoauuwspl.tstirisnodncetea-ortdH"ore]wuinng"nh]etr/2)

And the last piece since I got lazy and wanted to just use an id, though you could definitely do it cleaner by making the elem lookup go find body without it:

<bodyid="body"class="emoji-cursor--default">

That’s it πŸ”—︎

Now you have everything necessary in your toolkit to ensure your visitors leave more perplexed than they came.


  1. Of course you are, what a dumb questions. ↩︎


See Also