From 2bd5feaaab778d9d88590b85c820a34ed148001d Mon Sep 17 00:00:00 2001 From: LQ63 Date: Thu, 4 Dec 2025 02:26:02 +0100 Subject: [PATCH] feat(ui): Modals vue Readded modals with vue syntax. Removed not working alert component. Cleaned up. --- knockoutwhistweb/public/javascripts/events.js | 216 +++++------------- .../public/javascripts/interact.js | 4 +- 2 files changed, 63 insertions(+), 157 deletions(-) diff --git a/knockoutwhistweb/public/javascripts/events.js b/knockoutwhistweb/public/javascripts/events.js index 7836265..7a3de21 100644 --- a/knockoutwhistweb/public/javascripts/events.js +++ b/knockoutwhistweb/public/javascripts/events.js @@ -1,54 +1,4 @@ var canPlayCard = false; -var isInitialized = false; -const AlertsComponent = { - template: ` -
-
- - -
-
- `, - data() { - return { - alerts: [] - }; - }, - methods: { - alertMessage(message) { - const alertData = { - id: Date.now(), - message: message, - isVisible: true, - }; - this.alerts.push(alertData); - - setTimeout(() => { - this.removeAlert(alertData.id); - }, 5000); - }, - removeAlert(id) { - const index = this.alerts.findIndex(alert => alert.id === id); - if (index !== -1) { - this.alerts.splice(index, 1); - } - } - } -}; - - - const PlayerHandComponent = { data() { return { @@ -230,11 +180,7 @@ const ScoreBoardComponent = { this.playerScores = this.calculateNewScores(playersin, tricklist); - if (typeof globalThis.alertMessage === 'function') { - globalThis.alertMessage(`${playerwon} won the trick!`); - } else { - console.error("ALERT MESSAGE FAILED: globalThis.alertMessage is NOT a function."); - } + } } }; @@ -370,13 +316,23 @@ const LobbyComponent = { isHost: false, maxPlayers: 0, players: [], + showKickedModal: false, + kickedEventData: null, + showSessionClosedModal: false, + sessionClosedEventData: null, }; }, template: `
-