Giter Site home page Giter Site logo

javascript-forks / henrikjoretag.emoji-images Goto Github PK

View Code? Open in Web Editor NEW

This project forked from henrikjoreteg/emoji-images

0.0 2.0 0.0 7.66 MB

replace stuff like :heart: with <img> tags of corresponding images per: http://www.emoji-cheat-sheet.com/

JavaScript 100.00%

henrikjoretag.emoji-images's Introduction

#emoji-images.js

Because sometimes you want to send a ❤️ to someone.

What is this?

Takes text, replaces all the texts here: http://www.emoji-cheat-sheet.com with an <img> tag containing the image.

The images are all in the folder. Host those somewhere, pass the URL to the function. See below:

How to use it

var string = 'a string containing emoji strings like :heart: and :trollface:';

// the emoji function takes:
// 1. The input string
// 2. The url where the png files live
// 3. (optionally) a size to specify as the height of the <img> tag.
var emojified = emoji(string, 'http://url.com/where-you-put-the-pngs-folder/', 30); 

It's bundled to work as a CommonJS module, AMD module or expose itself as a global as a fallback.

install

Grab it here or on npm:

npm install emoji-images

I want it all in a super simple text processing (without the CSS and DOM stuff).

Also, that solution embeds pngs as data-uri's in css documents. I don't want to do that because then I have to send all that image data to the browser even if they never get used.

Is it ready to use?

Um... works for me™ (and in use on andbang.com)

License

MIT

henrikjoretag.emoji-images's People

Contributors

henrikjoreteg avatar lluchs avatar

Watchers

James Cloos avatar Brenton House avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.