From cf02d3a0ea50c123cfed83a1f619115d17ddabac Mon Sep 17 00:00:00 2001 From: Erzangel Date: Fri, 17 May 2024 19:47:26 +0200 Subject: [PATCH] feat: victory & defeat dialog --- components/GameBoard.vue | 14 ++++++ components/ResultDialog.vue | 96 +++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 components/ResultDialog.vue diff --git a/components/GameBoard.vue b/components/GameBoard.vue index c5aea63..4819050 100644 --- a/components/GameBoard.vue +++ b/components/GameBoard.vue @@ -38,12 +38,20 @@ watch( } }) + +const showResults = ref(false) +const isWinner = ref(false) + function showLoserScreen() { // playSound('/sounds/ding.mp3') + showResults.value = true + isWinner.value = false } function showWinnerScreen() { // playSound('/sounds/ding.mp3') + showResults.value = true + isWinner.value = true } @@ -61,6 +69,12 @@ function showWinnerScreen() { + + diff --git a/components/ResultDialog.vue b/components/ResultDialog.vue new file mode 100644 index 0000000..b658b39 --- /dev/null +++ b/components/ResultDialog.vue @@ -0,0 +1,96 @@ + + + + +