Use emojis as cursors 您所在的位置:网站首页 dai/ita:image/svg+xml;utf8, Use emojis as cursors

Use emojis as cursors

2024-06-30 06:19| 来源: 网络整理| 查看: 265

I've built a simple tool that generates the CSS required to use emojis as cursors.

https://www.emojicursor.app/

Doesn't this exist already?

Sort of. Other solutions currently out there are either using:

Pre-generated image files, or Using JavaScript with canvas to generate the images on the fly

There are pros and cons to both.

Pre-generated image files are the most consistent and have the largest cross browser support, but they require more preparation a head of time to create the image files and the emoji style used may not be consistent with the users system and familiarity.

Using JavaScript and canvas is a way to use the installed system emojis, but does require JavaScript to run before the cursors are available.

What's the new technique?

The key difference with this technique is using SVG, and treating the emojis as text. By using inline SVG in the cursor url property we can use the system emoji style, and not have an external image or JavaScript dependancies. Additionally it is trivial to wrap this in less or sass to generate different emoji cursors, or adjust the parameters.

The largest downside to this technique is lack of browser support. No IE or Edge.

Git repo

The code is MIT licensed and available here:

https://github.com/kylekelly/emoji-cursor



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有