-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can i use it my blog ? #5
Comments
This is just one way of doing it. You can add the proper image style on top of your template: <style>
img.emoji {
height: 1em;
width: 1em;
margin: 0 .05em 0 .1em;
vertical-align: -0.1em;
}
</style> Plus the twemoji library <script src="//twemoji.maxcdn.com/twemoji.min.js"></script> And at the bottom of the template, where there are usually other scripts, you can: <script>
(function (div) {
for (var i = 0, re = /\bblog-posts\b/; i < div.length; i++) {
if (re.test(div[i].className)) {
twemoji.parse(div[i]);
}
}
}(document.getElementsByTagName('div')));
// it could be faster and simpler via
// document.querySelectorAll('.blog-posts')
// but I wanted to avoid errors with older browsers
</script> This should replace all emoji chars in your posts with images, by default 36x36 png. However, you need to be able to write emoji in your posts, using as example a compatible mobile device, since this project is about reading with emoji, and not writing them. It would be awesome to have a plugin based on Hope this helped. |
great example :) like it |
i want to use in blogspot blog can you tell me how can i do this ?
http://t.co/Qmx3f3ObFR
The text was updated successfully, but these errors were encountered: