diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d4b7a6..642aebe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ The complete changelog for the Costs to Expect REST API, our changelog follows the format defined at https://keepachangelog.com/en/1.0.0/ +## [0.17.0] - [2022-08-01] +### Added +- Added a modal that displays your final score. +### Changed +- Adjusted the timer for the player scores, down to ten seconds from thirty. + ## [0.16.0] - [2022-08-01] ### Added - Added ability to remove a player from an open game, deletes the score sheet, share token and assignment. diff --git a/config/app/config.php b/config/app/config.php index 6a30f0a..8366c1f 100644 --- a/config/app/config.php +++ b/config/app/config.php @@ -10,6 +10,6 @@ 'item_subtype_id' => env('ITEM_SUBTYPE_ID'), 'cookie_user' => env('SESSION_NAME_USER'), 'cookie_bearer' => env('SESSION_NAME_BEARER'), - 'version' => '0.16.0', + 'version' => '0.17.0', 'release_date' => '1st August 2022' ]; diff --git a/public/js/player-scores.js b/public/js/player-scores.js index fdb8d4b..678533e 100644 --- a/public/js/player-scores.js +++ b/public/js/player-scores.js @@ -18,5 +18,5 @@ }); } - poll(() => new Promise(() => fetchPlayerScores()), 1000 * 30) + poll(() => new Promise(() => fetchPlayerScores()), 1000 * 10) })(axios); \ No newline at end of file diff --git a/public/js/public-player-scores.js b/public/js/public-player-scores.js index 3266fff..17eeb23 100644 --- a/public/js/public-player-scores.js +++ b/public/js/public-player-scores.js @@ -18,5 +18,5 @@ }); } - poll(() => new Promise(() => fetchPlayerScores()), 1000 * 30) + poll(() => new Promise(() => fetchPlayerScores()), 1000 * 10) })(axios); \ No newline at end of file diff --git a/public/js/public-score-sheet.js b/public/js/public-score-sheet.js index 2aa1da5..b7605a3 100644 --- a/public/js/public-score-sheet.js +++ b/public/js/public-score-sheet.js @@ -13,6 +13,7 @@ let score_lower_upper = document.getElementById('lower-upper-total'); let score_lower = document.getElementById('lower-score'); let total_score = document.getElementById('total'); + let player_final_score = document.getElementById('final-score'); document.querySelectorAll('div.upper-section-scratch input[type="checkbox"].active').forEach(upper_scratch => { upper_scratch.addEventListener('change', function () { @@ -39,6 +40,8 @@ upper.value = 0; upper.disabled = true; + player_final_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; + disable_yahtzee_bonus(response.data.turns); document.querySelectorAll('label[for="' + this.value + '"] svg').forEach(dice => @@ -96,6 +99,7 @@ score_upper_total.innerText = response.data.score.upper + response.data.score.bonus; score_lower_upper.innerText = response.data.score.upper + response.data.score.bonus; total_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; + player_final_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; disable_yahtzee_bonus(response.data.turns); @@ -247,6 +251,8 @@ yahtzee_bonus_one.disabled = true; yahtzee_bonus_two.disabled = true; yahtzee_bonus_three.disabled = true; + + display_toast('done'); } } @@ -291,6 +297,7 @@ score_lower.innerText = response.data.score.lower; total_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; + player_final_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; disable_yahtzee_bonus(response.data.turns); @@ -327,6 +334,7 @@ score_lower.innerText = response.data.score.lower; total_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; + player_final_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; disable_yahtzee_bonus(response.data.turns); @@ -365,6 +373,8 @@ lower.disabled = true; lower.value = 0; + player_final_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; + disable_yahtzee_bonus(response.data.turns); display_toast(show_toast); @@ -400,6 +410,8 @@ lower.classList.add('disabled'); lower.disabled = true; + player_final_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; + disable_yahtzee_bonus(response.data.turns); document.querySelectorAll('p.' + element.id.toString().replace('scratch_', '') + '_dice svg').forEach(dice => diff --git a/public/js/score-sheet.js b/public/js/score-sheet.js index a5e73dc..bdcf6f8 100644 --- a/public/js/score-sheet.js +++ b/public/js/score-sheet.js @@ -18,6 +18,7 @@ let player_score_lower_upper = document.getElementById('lower-upper-total'); let player_score_lower = document.getElementById('lower-score'); let player_total_score = document.getElementById('total'); + let player_final_score = document.getElementById('final-score'); document.querySelectorAll('div.upper-section-scratch input[type="checkbox"].active').forEach(upper_scratch => { upper_scratch.addEventListener('change', function () { @@ -155,6 +156,8 @@ yahtzee_bonus_one.disabled = true; yahtzee_bonus_two.disabled = true; yahtzee_bonus_three.disabled = true; + + display_selected_toast('done'); } } @@ -205,6 +208,7 @@ player_score_lower.innerText = response.data.score.lower; player_total_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; + player_final_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; disable_yahtzee_bonus_if_game_over(response.data.turns); @@ -246,6 +250,7 @@ player_score_lower.innerText = response.data.score.lower; player_total_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; + player_final_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; disable_yahtzee_bonus_if_game_over(response.data.turns); @@ -285,6 +290,8 @@ lower.disabled = true; lower.value = 0; + player_final_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; + disable_yahtzee_bonus_if_game_over(response.data.turns); display_selected_toast(show_toast); @@ -322,6 +329,8 @@ lower.classList.add('disabled'); lower.disabled = true; + player_final_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; + display_selected_toast(show_toast); disable_yahtzee_bonus_if_game_over(response.data.turns); @@ -378,6 +387,7 @@ player_score_upper_total.innerText = response.data.score.upper + response.data.score.bonus; player_score_lower_upper.innerText = response.data.score.upper + response.data.score.bonus; player_total_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; + player_final_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; display_selected_toast(show_toast); @@ -420,6 +430,8 @@ upper.value = 0; upper.disabled = true; + player_final_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; + display_selected_toast(show_toast); disable_yahtzee_bonus_if_game_over(response.data.turns); @@ -458,6 +470,7 @@ player_score_lower.innerText = response.data.score.lower; player_total_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; + player_final_score.innerText = response.data.score.upper + response.data.score.bonus + response.data.score.lower; disable_yahtzee_bonus_if_game_over(response.data.turns); diff --git a/resources/views/components/toast.blade.php b/resources/views/components/toast.blade.php index f3bc053..b2fcfd3 100644 --- a/resources/views/components/toast.blade.php +++ b/resources/views/components/toast.blade.php @@ -35,4 +35,11 @@

{{ $toast_yahtzee_bonus_three['message'] }}

+ \ No newline at end of file diff --git a/resources/views/player-scores.blade.php b/resources/views/player-scores.blade.php index 5873846..ef3688a 100644 --- a/resources/views/player-scores.blade.php +++ b/resources/views/player-scores.blade.php @@ -5,7 +5,7 @@

Player Scores

- +
Player scores, delayed by thirty seconds.Player scores, delayed by ten seconds.
Name