From c948e5e800bb5cc90b81ed9d474a288490437ef1 Mon Sep 17 00:00:00 2001 From: LQ63 Date: Sun, 9 Nov 2025 17:19:17 +0100 Subject: [PATCH] feat(ui): Tricktable Added a trick-table displaying the players with their won tricks sorted by the person with the most tricks --- .../app/assets/stylesheets/main.less | 16 +++++ .../app/views/ingame/ingame.scala.html | 60 +++++++++++++------ 2 files changed, 57 insertions(+), 19 deletions(-) diff --git a/knockoutwhistweb/app/assets/stylesheets/main.less b/knockoutwhistweb/app/assets/stylesheets/main.less index 8daeda1..d449d2b 100644 --- a/knockoutwhistweb/app/assets/stylesheets/main.less +++ b/knockoutwhistweb/app/assets/stylesheets/main.less @@ -209,4 +209,20 @@ body { color: @color; font-size: 1.5em; font-family: Arial, serif; +} +.score-table { + background-color: rgba(255, 255, 255, 0.1); + border-radius: 8px; + padding: 10px; + margin-bottom: 20px; + backdrop-filter: blur(8px); + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); +} +.score-header { + font-weight: bold; + color: #ffffff; + border-bottom: 1px solid rgba(255, 255, 255, 0.3); +} +.score-row { + color: #ffffff; } \ No newline at end of file diff --git a/knockoutwhistweb/app/views/ingame/ingame.scala.html b/knockoutwhistweb/app/views/ingame/ingame.scala.html index ba204cb..c4640e2 100644 --- a/knockoutwhistweb/app/views/ingame/ingame.scala.html +++ b/knockoutwhistweb/app/views/ingame/ingame.scala.html @@ -11,15 +11,37 @@

Current Player

@gamelobby.getLogic.getCurrentPlayer.get.name

@if(!TrickUtil.isOver(gamelobby.getLogic.getCurrentMatch.get, gamelobby.getLogic.getPlayerQueue.get)) { -

Next Player

- @for(nextplayer <- gamelobby.getLogic.getPlayerQueue.get.duplicate()) { -

@nextplayer

- } +

Next Player

+ @for(nextplayer <- gamelobby.getLogic.getPlayerQueue.get.duplicate()) { +

@nextplayer

+ } } -
- @for((cardplayed, player) <- gamelobby.getLogic.getCurrentTrick.get.cards) { +
+ +
+

Tricks Won

+ +
+
PLAYER
+
TRICKS
+
+ + @for(player <- gamelobby.getLogic.getPlayerQueue.get.toList.sortBy { p => + -(gamelobby.getLogic.getCurrentRound.get.tricklist.filter { trick => trick.winner.contains(p) }.size) + }) { +
+
@player.name
+
+ @(gamelobby.getLogic.getCurrentRound.get.tricklist.filter { trick => trick.winner.contains(player) }.size) +
+
+ } + +
+
+ @for((cardplayed, player) <- gamelobby.getLogic.getCurrentTrick.get.cards) {
@@ -30,20 +52,20 @@
- } + } +
-

Trumpsuit

@gamelobby.getLogic.getCurrentRound.get.trumpSuit

First Card
- @if(gamelobby.getLogic.getCurrentTrick.get.firstCard.isDefined) { + @if(gamelobby.getLogic.getCurrentTrick.get.firstCard.isDefined) { @util.WebUIUtils.cardtoImage(gamelobby.getLogic.getCurrentTrick.get.firstCard.get) width="80px"/> - } else { + } else { @views.html.render.card.apply("images/cards/1B.png")("Blank Card") width="80px"/> - } + }
@@ -56,14 +78,14 @@
@for(i <- player.currentHand().get.cards.indices) { -
-
- - -
-
+
+
+ + +
+
}