From ab464a528351f7905dcc4d146b8df07b8358fc19 Mon Sep 17 00:00:00 2001 From: elijahr2411 Date: Fri, 27 Jan 2023 22:03:19 -0500 Subject: [PATCH] Add some kewl icons and a send chat button --- dist/index.html | 37 +++++++++++++++++++------------------ src/index.js | 11 ++++++++--- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/dist/index.html b/dist/index.html index b2d2a97..3ddf6bf 100644 --- a/dist/index.html +++ b/dist/index.html @@ -36,22 +36,22 @@ @@ -65,21 +65,21 @@

- - - - + + + +
- - - - - - + + + + + +
@@ -87,7 +87,7 @@
- +
Users Online () Users Online ()
@@ -104,6 +104,7 @@
Username +
diff --git a/src/index.js b/src/index.js index 07baab4..c5c4e34 100644 --- a/src/index.js +++ b/src/index.js @@ -25,6 +25,7 @@ const buttons = { endTurn: window.document.getElementById("endTurnBtn"), qemuMonitor: window.document.getElementById("qemuMonitorBtn"), qemuMonitorSend: window.document.getElementById("qemuMonitorSendBtn"), + sendChat: window.document.getElementById("sendChatBtn"), } var hasTurn = false; var vm; @@ -205,7 +206,7 @@ class CollabVMClient { curr.turn = -1; curr.element.classList = ""; }); - buttons.takeTurn.innerText = "Take Turn"; + buttons.takeTurn.innerHTML = " Take Turn"; turn = -1; if (!msgArr.includes(username)) turnstatus.innerText = ""; @@ -254,9 +255,9 @@ class CollabVMClient { } } if (turn === -1) { - buttons.takeTurn.innerText = "Take Turn"; + buttons.takeTurn.innerHTML = " Take Turn"; } else { - buttons.takeTurn.innerText = "End Turn"; + buttons.takeTurn.innerHTML = " End Turn"; } this.reloadUsers(); break; @@ -596,6 +597,10 @@ chatinput.addEventListener("keypress", (e) => { chatinput.value = ""; } }); +buttons.sendChat.addEventListener('click', () => { + vm.chat(chatinput.value); + chatinput.value = ""; +}); buttons.changeUsername.addEventListener('click', () => { var newuser = window.prompt("Enter new username", window.username); if (newuser == null) return;