From 28dabd91d9ab01dbc6570512668903329fccf50c Mon Sep 17 00:00:00 2001 From: milon8561 Date: Wed, 20 Dec 2023 03:32:34 -0500 Subject: [PATCH] appended messages, keybinds, player colours --- back-end.js | 10 +- iframe-containers/opp-containers.html | 5 + iframe-containers/self-containers.html | 5 + index.html | 81 +++--- resources/css/index.css | 242 +++++++++++------- resources/css/opp-containers.css | 44 +++- resources/css/self-containers.css | 44 +++- .../actions/container/deck-actions.js | 36 ++- .../js/front-end/actions/container/general.js | 46 ++++ .../actions/container/hand-actions.js | 27 +- .../js/front-end/actions/general/VSTAR-GX.js | 41 ++- .../front-end/actions/general/flip-board.js | 19 +- .../js/front-end/actions/general/flip-coin.js | 2 +- .../js/front-end/actions/general/reset.js | 8 +- .../js/front-end/actions/general/setup.js | 2 +- .../js/front-end/actions/general/take-turn.js | 2 +- .../context-menu/active-bench-buttons.js | 5 +- .../context-menu/deck-buttons.js | 9 +- .../context-menu/hand-buttons.js | 14 +- .../context-menu/prizes-buttons.js | 17 +- .../home-header/header-buttons.js | 10 +- .../js/front-end/event-listeners/index.js | 1 - .../p1-chatbox/chat-buttons.js | 18 +- .../event-listeners/p2/chat-buttons.js | 18 +- .../event-listeners/p2/room-buttons.js | 24 +- .../side-button-container/side-buttons.js | 15 -- .../front-end/event-listeners/table/index.js | 3 +- .../event-listeners/table/table-buttons.js | 19 ++ .../event-listeners/update/update-stadium.js | 4 +- .../js/front-end/image-logic/click-events.js | 2 + resources/js/front-end/image-logic/drag.js | 23 +- .../initialization/html-elements/buttons.js | 11 +- .../perspective/player-perspective.js | 2 +- .../js/front-end/key-toggles/key-shortcuts.js | 32 ++- .../front-end/setup/chatbox/location-name.js | 48 ++++ .../js/front-end/setup/chatbox/messages.js | 10 +- .../setup/home-header/header-toggle.js | 17 +- .../js/front-end/setup/sizing/resizer.js | 4 +- .../js/front-end/socket/event-listeners.js | 10 +- 39 files changed, 683 insertions(+), 247 deletions(-) delete mode 100644 resources/js/front-end/event-listeners/side-button-container/side-buttons.js create mode 100644 resources/js/front-end/event-listeners/table/table-buttons.js create mode 100644 resources/js/front-end/setup/chatbox/location-name.js diff --git a/back-end.js b/back-end.js index c4c0208..3d6590f 100644 --- a/back-end.js +++ b/back-end.js @@ -30,14 +30,14 @@ io.on('connection', (socket) => { const otherPlayerUsernames = otherPlayerInfo.map(([_, player]) => player.username); + socket.on('disconnect', () => { + players.delete(socket.id); + socket.broadcast.to(id).emit('leaveGameMessage', username); + }); + if (otherPlayerUsernames.length < 2){ socket.emit('joinGame', otherPlayerUsernames); socket.broadcast.to(id).emit('joinMessage', username); - - socket.on('disconnect', () => { - players.delete(socket.id); - socket.broadcast.to(id).emit('leaveGameMessage', username); - }); } else { socket.emit('roomReject'); }; diff --git a/iframe-containers/opp-containers.html b/iframe-containers/opp-containers.html index 9d3ba91..1f3d942 100644 --- a/iframe-containers/opp-containers.html +++ b/iframe-containers/opp-containers.html @@ -31,6 +31,11 @@
+
+ + +
+
Opponent moving cards...
diff --git a/iframe-containers/self-containers.html b/iframe-containers/self-containers.html index bf94349..b446598 100644 --- a/iframe-containers/self-containers.html +++ b/iframe-containers/self-containers.html @@ -31,6 +31,11 @@
+
+ + +
+
Move attached cards
diff --git a/index.html b/index.html index 462f41f..cb45e8f 100644 --- a/index.html +++ b/index.html @@ -14,46 +14,43 @@
-
-
- -
- - - - - +
+ +
+ + +
- - - - + + + +
- -