From caf96d1d04c2ba7a2f87a7a93b631a3a9e418554 Mon Sep 17 00:00:00 2001 From: videogame hacker Date: Fri, 5 Nov 2021 20:57:10 +0000 Subject: [PATCH] Small tweaks --- frontend/index.html | 4 ++-- frontend/main.js | 16 +++++++++------- frontend/styles.css | 3 ++- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 8831bab..2427707 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -3,7 +3,7 @@ watch party :D - + @@ -47,6 +47,6 @@ - + diff --git a/frontend/main.js b/frontend/main.js index f119e7b..cdde8de 100644 --- a/frontend/main.js +++ b/frontend/main.js @@ -253,14 +253,16 @@ const setupChatboxEvents = (socket) => { const input = chatForm.querySelector("input"); const content = input.value; - input.value = ""; + if (content.trim().length) { + input.value = ""; - socket.send(JSON.stringify({ - "op": "ChatMessage", - "data": { - "message": content, - } - })); + socket.send(JSON.stringify({ + "op": "ChatMessage", + "data": { + "message": content, + } + })); + } }); } diff --git a/frontend/styles.css b/frontend/styles.css index c465622..42240a8 100644 --- a/frontend/styles.css +++ b/frontend/styles.css @@ -118,7 +118,8 @@ button.small-button { display: none; } -.user-join { +.user-join, +.user-leave { font-style: italic; }