All Projects → coocy → Emoji

coocy / Emoji

在网页中显示emoji表情符号

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Emoji

Laravel Emojione
Laravel package to make it easy to use the gorgeous emojis from EmojiOne
Stars: ✭ 133 (-24.86%)
Mutual labels:  emoji
Spacymoji
💙 Emoji handling and meta data for spaCy with custom extension attributes
Stars: ✭ 151 (-14.69%)
Mutual labels:  emoji
Emoji
💌 Find the emoji that echoes your mind.
Stars: ✭ 2,072 (+1070.62%)
Mutual labels:  emoji
Emoji Commit Messages
🌵 A fun paradigm to encourage cleaner commits.
Stars: ✭ 138 (-22.03%)
Mutual labels:  emoji
Whatsbook
Create books from WhatsApp group chats with Python and LaTeX
Stars: ✭ 147 (-16.95%)
Mutual labels:  emoji
Github Complete.vim
Vim input completion for GitHub
Stars: ✭ 161 (-9.04%)
Mutual labels:  emoji
Emojipanel
😀 A customisable Javascript emoji picker
Stars: ✭ 129 (-27.12%)
Mutual labels:  emoji
Quill Emoji
Quill module toolbar extension for emoji
Stars: ✭ 175 (-1.13%)
Mutual labels:  emoji
Uitextviewdiyemojiexample
Example of insert custom emoji image in to UITextView. And get the represent string back after editing.
Stars: ✭ 148 (-16.38%)
Mutual labels:  emoji
Emoji Ime Dictionary
日本語で絵文字入力をするための IME 追加辞書 📙 Google 日本語入力などで日本語から絵文字への変換を可能にする IME 拡張辞書です
Stars: ✭ 172 (-2.82%)
Mutual labels:  emoji
Gacp
💬Git add, commit, push with Conventional Commits and Gitmoji.
Stars: ✭ 139 (-21.47%)
Mutual labels:  emoji
Gemoji
Info on GitHub emoji: gemoji
Stars: ✭ 146 (-17.51%)
Mutual labels:  emoji
Padroes De Commits
📄 Padrão de commits para repositórios.
Stars: ✭ 164 (-7.34%)
Mutual labels:  emoji
Emojipackage
表情包资源合集,张张都是经典
Stars: ✭ 1,789 (+910.73%)
Mutual labels:  emoji
Mojibar
🍊 Emoji searcher but as a menubar app.
Stars: ✭ 2,040 (+1052.54%)
Mutual labels:  emoji
Git Commit Emoji Cn
😁 git commit message emoji 使用指南
Stars: ✭ 1,702 (+861.58%)
Mutual labels:  emoji
Vue Twemoji Picker
Vue Twemoji Picker - A fast plug-n-play Twemoji Picker (+textarea for Twemoji rendering) for Vue. Support Unicode Emoji 13.0.
Stars: ✭ 154 (-12.99%)
Mutual labels:  emoji
Emoji.json
Just an emoji.json
Stars: ✭ 175 (-1.13%)
Mutual labels:  emoji
Emojicpp
Emoji 😄 for c++ developers 👍
Stars: ✭ 174 (-1.69%)
Mutual labels:  emoji
Twemoji
Emoji for everyone. https://twemoji.twitter.com/
Stars: ✭ 13,604 (+7585.88%)
Mutual labels:  emoji

Emoji.js

使用前端转换方式在不支持emoji表情符号的设备和浏览器中使用图片显示emoji表情符号,转换后的表情符号可以自适应文字大小(最大不超过20px,如果需要自定义的图片尺寸,请参见'重新生成代码和表情图片')。

每个emoji表情符号会被替换成对应的表情图片,在正常分辨率屏幕的设备上加载的图片尺寸为20×20,在高清屏上加载的图片尺寸为40×40。

为什么不使用CSS Sprites?

使用CSS Sprites虽然会减少请求数量,但是合并后图片过大,并且需要额外的css文件来定义sprites,
在大部分使用场景下,如果文本中的emoji数量有限的话使用单张图片替换是更好的方案。

Demo: http://coocy.github.io/emoji

安装:

拷贝emoji.jsemoji文件夹到你的项目中。

使用:

<html>
<head>
    <title>Title</title>
    <script type="text/javascript" src="emoji.js"></script>
</head>
<body>
    <div id="text">...</div>
    <script type="text/javascript">
        //转换包含emoji文本内容的DOM对象
        var el = document.getElementById('text');
        html = Emoji.emoji(el);
    </script>
</body>
</html>

如果页面使用了jQuery或者Zepto,可以这样调用:

$('#text').emoji();

重新生成代码和表情图片

需要安装Node.jsImageMagick

输出脚本output.js放在src文件夹中, 重新输出:

node src/output.js

output.js会执行以下动作:

  1. 从原始的emoji字典文件生成emoji.js中的替换正则表达式
  2. 生成index.html中的字符列表
  3. 使用原始emoji图片生成压缩后的图片,包括1x和2x两种尺寸

如果需要调整生成的emoji图片大小,修改output.js中的maxEmojiSize变量值,然后执行输出脚本

CREDITS

参考了php-emoji项目: https://github.com/iamcal/php-emoji

emoji字典和图片来自emoji-data项目: https://github.com/iamcal/emoji-data

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].