cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <div id="test-1">
  Here are emojis that use the default prefix and suffix:
  :smile:
  :wink:
  :delicious:
</div>
<br/>
<div id="test-2">
  Here are emojis that use a custom prefix and suffix: 
  --smile--
  --wink--
  --delicious--
</div>
<br/>
<div id="test-3">
  Here are emojis that work in a certain class:
  :smile: (that shouldn't work)
  <span class="emojify-emoji">:smile: :wink: :delicious:</span> (those should work)
</div>
            
          
!
            
              
(function(){var emojify=function(prefix,suffix){prefix=(prefix===undefined)?':':prefix;suffix=(suffix===undefined)?':':suffix;if(this===HTMLElement||this===NodeList||this===HTMLCollection){return new emojify(prefix,suffix)}this.parent=this;this.emojis={'smile':'1F60A','frown':'1F621','pouting':'1F621','grin':'1F600','grinning':'1F600','bigsmile':'1F604','laughcry':'1F602','wink':'1F609','kiss':'1F617','hearteyes':'1F60D','tongueout':'1F61B','tongueoutwink':'1F61C','cry':'1F622','crying':'1F622','angry':'1F623','scream':'1F631','schocked':'1F632','gasp':'1F632','unamused':'1F612','confused':'1F615','noexpression':'1F611','smilewithhorns':'1F608','relieved':'1F60C','sunglasses':'1F60E','worried':'1F61F','fearful':'1F628','triumph':'1F624','sleeping':'1F634','dizzy':'1F635','nomouth':'1F636','blankstare':'1F636','medicalmask':'1F637','halo':'1F607','angel':'1F607','tonguelick':'1F60B','delicious':'1F60B',};this.replaceEmojis=function(elem){var html=elem.innerHTML;for(var emoji in this.emojis){html=html.replace(new RegExp(prefix+emoji+suffix,'g'),'&#x'+this.emojis[emoji]+';')}return html};this.replace=function(){if(this.parent instanceof NodeList||this.parent instanceof HTMLCollection){for(var i=0;i<this.parent.length;i++){this.parent[i].innerHTML=this.replaceEmojis(this.parent[i])}}else{this.parent.innerHTML=this.replaceEmojis(this.parent)}return};this.replace();return this};if(!HTMLElement.prototype.emojify){HTMLElement.prototype.emojify=emojify}if(!NodeList.prototype.emojify){NodeList.prototype.emojify=emojify}if(!HTMLCollection.prototype.emojify){HTMLCollection.prototype.emojify=emojify}}());
window.addEventListener('load', function(){
  // Default prefix and suffix 
  document.getElementById('test-1').emojify();

  // Custom prefix and suffix 
  document.getElementById('test-2').emojify('--', '--');

  // In a certain class only 
  document.getElementsByClassName('emojify-emoji').emojify();

});

            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console