Co-authored-by: LQ63 <lkhermann@web.de> Reviewed-on: #82 Co-authored-by: Janis <janis.e.20@gmx.de> Co-committed-by: Janis <janis.e.20@gmx.de>
77 lines
5.0 KiB
HTML
77 lines
5.0 KiB
HTML
@(player: de.knockoutwhist.player.AbstractPlayer, gamelobby: logic.game.GameLobby)
|
|
|
|
<div id="selecttrumpsuit" class="game-field game-field-background">
|
|
<div class="ingame-stage blur-sides">
|
|
<div class="container py-4">
|
|
<div class="row justify-content-center">
|
|
<div class="col-12">
|
|
<div class="card shadow-sm">
|
|
<div class="card-header text-center">
|
|
<h3 class="mb-0">Select Trump Suit</h3>
|
|
</div>
|
|
<div class="card-body">
|
|
@if(player.equals(gamelobby.logic.getCurrentMatch.get.roundlist.last.winner.get)) {
|
|
<div class="alert alert-info" role="alert" aria-live="polite">
|
|
You (@player.toString) won the last round. Choose the trump suit for the next round.
|
|
</div>
|
|
|
|
<div class="row justify-content-center col-auto mb-5">
|
|
<div class="col-auto handcard">
|
|
<div class="btn btn-outline-light p-0 border-0 shadow-none" data-trump="0" style="border-radius: 6px" onclick="handleTrumpSelection(this, '@gamelobby.id')">
|
|
@util.WebUIUtils.cardtoImage(de.knockoutwhist.cards.Card(de.knockoutwhist.cards.CardValue.Ace, de.knockoutwhist.cards.Suit.Spades))
|
|
width="120px" style="border-radius: 6px"/>
|
|
</div>
|
|
</div>
|
|
<div class="col-auto handcard">
|
|
<div class="btn btn-outline-light p-0 border-0 shadow-none" data-trump="1" style="border-radius: 6px" onclick="handleTrumpSelection(this, '@gamelobby.id')">
|
|
@util.WebUIUtils.cardtoImage(de.knockoutwhist.cards.Card(de.knockoutwhist.cards.CardValue.Ace, de.knockoutwhist.cards.Suit.Hearts))
|
|
width="120px" style="border-radius: 6px"/>
|
|
</div>
|
|
</div>
|
|
<div class="col-auto handcard">
|
|
<div class="btn btn-outline-light p-0 border-0 shadow-none" data-trump="2" style="border-radius: 6px" onclick="handleTrumpSelection(this, '@gamelobby.id')">
|
|
@util.WebUIUtils.cardtoImage(de.knockoutwhist.cards.Card(de.knockoutwhist.cards.CardValue.Ace, de.knockoutwhist.cards.Suit.Diamonds))
|
|
width="120px" style="border-radius: 6px"/>
|
|
</div>
|
|
</div>
|
|
<div class="col-auto handcard">
|
|
<div class="btn btn-outline-light p-0 border-0 shadow-none" data-trump="3" style="border-radius: 6px" onclick="handleTrumpSelection(this, '@gamelobby.id')">
|
|
@util.WebUIUtils.cardtoImage(de.knockoutwhist.cards.Card(de.knockoutwhist.cards.CardValue.Ace, de.knockoutwhist.cards.Suit.Clubs))
|
|
width="120px" style="border-radius: 6px"/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row justify-content-center ingame-cards-slide" id="card-slide">
|
|
@for(i <- player.currentHand().get.cards.indices) {
|
|
<div class="col-auto" style="border-radius: 6px">
|
|
@util.WebUIUtils.cardtoImage(player.currentHand().get.cards(i)) width="120px" style="border-radius: 6px"/>
|
|
</div>
|
|
}
|
|
</div>
|
|
} else {
|
|
<div class="alert alert-warning" role="alert" aria-live="polite">
|
|
@gamelobby.logic.getCurrentMatch.get.roundlist.last.winner.get.name
|
|
is choosing a trumpsuit. The new round will start once a suit is picked.
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
function waitForFunction(name, checkInterval = 100) {
|
|
return new Promise(resolve => {
|
|
const timer = setInterval(() => {
|
|
if (typeof window[name] === "function") {
|
|
clearInterval(timer);
|
|
resolve(window[name]);
|
|
}
|
|
}, checkInterval);
|
|
});
|
|
}
|
|
waitForFunction("pollForUpdates").then(fn => fn('@gamelobby.id'));
|
|
connectWebSocket()
|
|
</script> |