use twemoji instead of raw unicode

This commit is contained in:
Elijah Steres 2021-01-02 17:36:19 -05:00
parent 6e999bae44
commit 5abd7f2c3a
4 changed files with 11 additions and 3 deletions

View File

@ -62,3 +62,7 @@ h2 {
#link_div > a:hover { #link_div > a:hover {
color: white; color: white;
} }
img.emoji {
height: 14px;
}

View File

@ -7,7 +7,6 @@ $(document).ready(function (){
}); });
socket.on("states_update", function (json) { //json is an object containing all game updates socket.on("states_update", function (json) { //json is an object containing all game updates
console.log(json)
var searchparams = new URLSearchParams(window.location.search); var searchparams = new URLSearchParams(window.location.search);
var exists = false; var exists = false;
for (game of json) { for (game of json) {
@ -17,7 +16,10 @@ $(document).ready(function (){
} }
} }
if (!exists) { if (!exists) {
// inform the user the game has ended $('game').remove()
$('#game_container').text("The game you're looking for either doesn't exist or has already ended.")
} }
twemoji.parse(document.body);
}); });
}); });

View File

@ -89,9 +89,10 @@ const insertEmpty = (grid) => {
const insertGame = (gridboxnum, game) => { const insertGame = (gridboxnum, game) => {
var thisBox = grid.children[gridboxnum]; var thisBox = grid.children[gridboxnum];
thisBox.innerHTML = game.html;
thisBox.className = "game"; thisBox.className = "game";
thisBox.timestamp = game.timestamp; thisBox.timestamp = game.timestamp;
thisBox.innerHTML = game.html;
twemoji.parse(thisBox);
}; };
const insertLeague = (league) => { const insertLeague = (league) => {

View File

@ -1,6 +1,7 @@
<html lang="en-US"> <html lang="en-US">
<head> <head>
<script src="//code.jquery.com/jquery-3.5.1.min.js"></script> <script src="//code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://twemoji.maxcdn.com/v/latest/twemoji.min.js" crossorigin="anonymous"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.0.4/socket.io.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/3.0.4/socket.io.js"></script>
<script type="text/javascript" async src="https://platform.twitter.com/widgets.js"></script> <script type="text/javascript" async src="https://platform.twitter.com/widgets.js"></script>