From 4ddf4e865b980a45c27e7db097209236e97ff61a Mon Sep 17 00:00:00 2001 From: Arne van Iterson Date: Sat, 24 Aug 2019 15:11:22 +0200 Subject: [PATCH] Fancy mode activated --- index.html | 63 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 45 insertions(+), 18 deletions(-) diff --git a/index.html b/index.html index 9feb1d8..f3e684e 100644 --- a/index.html +++ b/index.html @@ -9,6 +9,7 @@ $(function () { // Create socket var socket = io(); + const date = new Date(); // Wait for server response and identify client socket.on('user_identify', function(){ @@ -28,32 +29,58 @@ // Receive messages from server socket.on('message_receive', function(msg){ - $('.message_container').append($('').html(msg.username + ': ' + msg.message)); - $('.message_container').append($('
')); + document.getElementById('message_container').innerHTML += + `
+ +
+ ${msg.username} + ${date.getHours() + ':' + date.getMinutes()} + ${msg.message} +
+
`; }); });
-
+