feat: FRO-3 FRO-4 Added vue compontents to ingame and lobby #100

Merged
Janis merged 4 commits from feat/FRO-3 into main 2025-12-04 08:00:58 +01:00
5 changed files with 703 additions and 493 deletions
Showing only changes of commit ecb9d91991 - Show all commits

View File

@@ -59,8 +59,7 @@ const PlayerHandComponent = {
}, },
computed: { computed: {
isHandInactive() { isHandInactive() {
console.log("isHandInactive got executed" + !canPlayCard) //TODO: Needs implementation
return !canPlayCard
} }
}, },
template: ` template: `
@@ -122,6 +121,8 @@ const PlayerHandComponent = {
easing: 'ease-in-out', easing: 'ease-in-out',
fill: 'forwards' fill: 'forwards'
}; };
const targetButton = this.$el.querySelector(`[data-card-id="${cardidx}"]`);
const cardElement = targetButton ? targetButton.closest('.handcard') : null;
const payload = { const payload = {
cardindex: cardidx.toString(), cardindex: cardidx.toString(),
@@ -138,8 +139,14 @@ const PlayerHandComponent = {
} }
).catch( ).catch(
(err) => { (err) => {
if (cardElement) {
cardElement.animate(wiggleKeyframes, wiggleTiming);
} else {
console.warn(`Could not find DOM element for card index ${cardidx} to wiggle.`);
}
this.isAwaitingResponse = false; this.isAwaitingResponse = false;
canPlayCard = true; canPlayCard = true;
} }
) )
}, },