coocy / Emoji
在网页中显示emoji表情符号
Stars: ✭ 177
Programming Languages
javascript
184084 projects - #8 most used programming language
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 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
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
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
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.js
和emoji
文件夹到你的项目中。
使用:
<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>
$('#text').emoji();
重新生成代码和表情图片
需要安装Node.js和ImageMagick
输出脚本output.js
放在src
文件夹中,
重新输出:
node src/output.js
output.js
会执行以下动作:
- 从原始的emoji字典文件生成emoji.js中的替换正则表达式
- 生成index.html中的字符列表
- 使用原始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].