From 7c16615c791c8af73af2c7f74809e8cbcc52f875 Mon Sep 17 00:00:00 2001 From: Djalim Simaila Date: Sun, 2 Apr 2023 14:51:30 +0200 Subject: [PATCH 1/3] added feedback on some button clics --- truthinquiry/static/js/game_lobby.js | 3 ++- truthinquiry/static/js/game_start_page.js | 13 ++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/truthinquiry/static/js/game_lobby.js b/truthinquiry/static/js/game_lobby.js index f53ad68..0442cc1 100644 --- a/truthinquiry/static/js/game_lobby.js +++ b/truthinquiry/static/js/game_lobby.js @@ -81,7 +81,8 @@ function displayInvalidNickNameErrorMessage(errorMessage) { /** * Start a game in the history mode. */ -function startHistoryGame() { +function startHistoryGame(event) { + event.target.textContent = "Chargement..."; makeAPIRequest("startGame"); } diff --git a/truthinquiry/static/js/game_start_page.js b/truthinquiry/static/js/game_start_page.js index e22eb10..99ca08e 100644 --- a/truthinquiry/static/js/game_start_page.js +++ b/truthinquiry/static/js/game_start_page.js @@ -112,26 +112,26 @@ function areInputsValid(checkRoomCode) { /** * Handler for the multiplayer room creation button */ -function createMultiPlayerRoom() { +function createMultiPlayerRoom(event) { if (!areInputsValid(false)) { return; } hideInvalidInputErrorMessage(); - + event.target.textContent = "Chargement..."; startGame(); } /** * Handler for the join room button */ -function joinMultiPlayerRoom() { +function joinMultiPlayerRoom(event) { if (!areInputsValid(true)) { return; } hideInvalidInputErrorMessage(); - + event.target.textContent = "Chargement..."; joinGame(); } @@ -208,14 +208,13 @@ function changeTheme() { * This function launches a single player game. It sends the api request to * create a game then it immediately start the game by sendind the startGame api */ -async function startSoloGame(){ +async function startSoloGame(event){ if (!areInputsValid(false)) { return; } - + event.target.textContent = "Chargement..."; hideInvalidInputErrorMessage(); - username = document.getElementById("game_username").value; let data = {} data["username"] = username; From 019a4f9bc1766a714616a05848b1f8346c58ccd8 Mon Sep 17 00:00:00 2001 From: Djalim Simaila Date: Sun, 2 Apr 2023 14:57:55 +0200 Subject: [PATCH 2/3] added a little wait message on emotion and culprit choosing page --- truthinquiry/static/js/game.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/truthinquiry/static/js/game.js b/truthinquiry/static/js/game.js index 6a4847e..0baba23 100644 --- a/truthinquiry/static/js/game.js +++ b/truthinquiry/static/js/game.js @@ -281,8 +281,9 @@ function renderAnswerSelectionPanel() { button.appendChild(document.createTextNode("Couplable")); - button.addEventListener("click", () => { + button.addEventListener("click", (event) => { disableCulpritButtons(culpritChoices, suspect); + event.target.textContent = "attente des autres joueurs..."; sendAnswers(); }); From 1dfbbfd1c13ed2f1f4b05f1e651fb053a71cf8f5 Mon Sep 17 00:00:00 2001 From: Djalim Simaila Date: Sun, 2 Apr 2023 15:05:37 +0200 Subject: [PATCH 3/3] fixed back button not being shown in title screen --- truthinquiry/static/css/game_ui_start.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/truthinquiry/static/css/game_ui_start.css b/truthinquiry/static/css/game_ui_start.css index 6d2802d..c7cfec4 100644 --- a/truthinquiry/static/css/game_ui_start.css +++ b/truthinquiry/static/css/game_ui_start.css @@ -8,9 +8,9 @@ input, .action_button, .game_mode_item_title { font-family: "Titan One", sans-serif; } -.back_button, .theme_switcher_btn { - height: var(--header-actions-side); - width: var(--header-actions-side); +#back_button, .theme_switcher_btn { + height: 2em; + width: 5em; } .game_begin, .game_mode_item, .game_mode_item_input_text_single_line, .game_mode_items, .game_mode_selection {