Skip to content

Instantly share code, notes, and snippets.

@stanwmusic
Created December 2, 2019 11:07
Show Gist options
  • Save stanwmusic/bdef4ae3755e7b282eb42e4cd90f5983 to your computer and use it in GitHub Desktop.
Save stanwmusic/bdef4ae3755e7b282eb42e4cd90f5983 to your computer and use it in GitHub Desktop.
The Great Wall of Gitmoji
<div class="๐Ÿ˜€"></div>
$.getJSON('https://api.github.com/emojis', function(emoji) {
$.each(emoji, function(key, value) {
$('.๐Ÿ˜€').append('<img src="' + value + '" title="' + key + '">');
});
});
$(document).on('click', '.๐Ÿ˜€ img', function () {
var code = $(this).attr('title');
prompt('Copy to clipboard: Ctrl+C, Enter', ':' + code + ':');
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
.๐Ÿ˜€ {
display:grid;
grid-column-gap:1rem;
grid-row-gap:1rem;
grid-template-columns:repeat(auto-fit, minmax(30px, 1fr));
padding:1rem;
}
.๐Ÿ˜€ img {
cursor:pointer;
height:auto;
max-width:100%;
width:100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment