Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ded/emojize
Unicode to emoji conversion utility for Node.js
https://github.com/ded/emojize
Last synced: 8 days ago
JSON representation
Unicode to emoji conversion utility for Node.js
- Host: GitHub
- URL: https://github.com/ded/emojize
- Owner: ded
- Created: 2014-05-03T19:55:30.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-09-18T16:31:56.000Z (about 9 years ago)
- Last Synced: 2024-09-16T10:40:49.630Z (about 2 months ago)
- Language: CSS
- Homepage:
- Size: 7.44 MB
- Stars: 109
- Watchers: 10
- Forks: 21
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-fonts - emojize - High resolution, unicode (emoji) to html conversion utility (Emojis)
README
## Emojize
High resolution, unicode (emoji) to html conversion utility``` sh
npm install emojize --save
`````` js
var convert = require('emojize').emojize
var html = convert('Haay 😜. Just getting ☕. But maybe 🍻 at 🕘🌜 is that 🆒')
```### Browser usage with Ender
``` sh
ender add emojize
```#### Note
Use of this library requires `` encoding if used in a browser.``` html
```
``` js
var convert = require('emojize').emojize
document.getElementById('content').innerHTML = convert('Haay 😜')
```### Sprite vs Image
`emojize` defaults to sprite based conversion which ultimately requires the developer to include the `sprite/emoji.css` and upload the `emoji.png` along side the file. You could otherwise include all images found in [`img/`](img/) and pass in flag to the second argument to `emojize```` js
var emo = require('emojize')
emo.base('images/emojis/')
emo.emojize('Haay 😜', true)/**
* outputs:
* 'Haay '
*/
```### Examples
``` sh
make build
make example
open http://localhost:3000/example.jade
```![Screenshot](http://cl.ly/image/0L3I2y2v0A3D/Screen%20Shot%202014-05-03%20at%202.19.32%20PM.png)
### Sizing
Each emoji defaults to `64px` × `64px` which may not always be desired. Thus, consider the following practice. Example assumes LESS.``` css
.quarter { zoom: 0.25 }
.half { zoom: 0.5 }
.three-quarter { zoom: 0.75 }
.full { zoom: 1 }@media screen and (max-width: 768px) {
.emoji {
.quarter()
}
}@media screen and (max-width: 992px) {
.emoji {
.half()
}
}
@media screen and (max-width: 1200px) {
.emoji {
.three-quarter()
}
}
@media screen and (max-width: 1600px) {
.emoji {
.full()
}
}```
#### Credits
Much thanks to [Gemoji project](https://github.com/github/gemoji) for high resolution images and [Apple Inc.](http://apple.com) for Artwork. See [License](https://github.com/github/gemoji/blob/master/LICENSE)Happy Emojizing!