Skip to content

Commit 03d3b18

Browse files
authored
Merge pull request #551 from Kaggle/poker-styling-17
[Poker] Make all player icons consistent (round + white background)
2 parents 2889ad8 + 037c803 commit 03d3b18

File tree

2 files changed

+62
-27
lines changed

2 files changed

+62
-27
lines changed

kaggle_environments/envs/open_spiel_env/games/repeated_poker/visualizer/default/src/repeated_poker_renderer.ts

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -588,44 +588,28 @@ export function renderer(options: LegacyRendererOptions): void {
588588
// --- Container Styles ---
589589
const container = document.createElement('div');
590590
container.className = 'final-screen-container';
591-
// Using inline styles here to ensure it looks acceptable immediately without CSS file updates.
592-
// You can move these to your style.css later, but as this is just a placeholder screen making it easy to clean up for now.
593-
container.style.cssText = `
594-
display: flex;
595-
flex-direction: column;
596-
align-items: center;
597-
justify-content: center;
598-
height: 100%;
599-
width: 100%;
600-
background: rgba(15, 23, 42, 0.95); /* Dark blue-gray background */
601-
color: white;
602-
font-family: sans-serif;
603-
padding: 40px;
604-
box-sizing: border-box;
605-
`;
606591

607592
// --- Winner Section ---
608593
const winnerSection = document.createElement('div');
609594
winnerSection.className = 'final-winner-section';
610-
winnerSection.style.cssText = 'text-align: center; margin-bottom: 60px; flex-shrink: 0;';
595+
winnerSection.classList.add('winner-section');
611596

612597
if (winner) {
613598
if (winner.thumbnail) {
614599
const thumb = document.createElement('img');
615600
thumb.src = winner.thumbnail;
616-
thumb.style.cssText =
617-
'width: 180px; height: 180px; border-radius: 50%; border: 6px solid #eab308; box-shadow: 0 0 30px rgba(234, 179, 8, 0.4); margin-bottom: 20px;';
601+
thumb.classList.add('winner-thumbnail');
618602
winnerSection.appendChild(thumb);
619603
}
620604

621605
const winnerName = document.createElement('div');
622606
winnerName.textContent = `${winner.name} Wins!`;
623-
winnerName.style.cssText = 'font-size: 3.5em; color: #eab308; font-weight: bold;';
607+
winnerName.classList.add('winner-name');
624608
winnerSection.appendChild(winnerName);
625609

626610
const finalStack = document.createElement('div');
627611
finalStack.textContent = `Final Rewards: ${winner.chipStack}`;
628-
finalStack.style.cssText = 'font-size: 2em; color: #9ca3af; margin-top: 10px;';
612+
finalStack.classList.add('winner-final-rewards');
629613
winnerSection.appendChild(finalStack);
630614
}
631615

kaggle_environments/envs/open_spiel_env/games/repeated_poker/visualizer/default/src/style.css

Lines changed: 58 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@
167167
}
168168

169169
.player-info-area.split-pot {
170-
border-color: #FF5C19;
170+
border-color: #ff5c19;
171171
}
172172

173173
.player-container-0 .player-info-area {
@@ -461,12 +461,12 @@
461461

462462
.bet-display.split-pot {
463463
opacity: 1;
464-
background-color: #FF5C19;
464+
background-color: #ff5c19;
465465
}
466466

467467
.bet-display.all-in {
468468
color: white;
469-
background-color: #B3261E;
469+
background-color: #b3261e;
470470
}
471471

472472
.blind-indicator {
@@ -590,6 +590,8 @@
590590
white-space: nowrap;
591591
}
592592

593+
/* LEGEND */
594+
593595
.legend {
594596
position: absolute;
595597
top: 20px;
@@ -619,10 +621,12 @@
619621
}
620622

621623
.legend-title-avatar {
622-
width: 32px;
623-
height: 32px;
624+
width: 24px;
625+
height: 24px;
624626
border-radius: 50%;
625627
margin-right: 8px;
628+
background-color: white;
629+
padding: 3px;
626630
}
627631

628632
.legend-body {
@@ -670,8 +674,55 @@
670674
}
671675

672676
.legend-avatar {
673-
width: 24px;
674-
height: 24px;
677+
width: 20px;
678+
height: 20px;
675679
border-radius: 50%;
676680
margin-right: 5px;
681+
background-color: white;
682+
padding: 2px;
683+
}
684+
685+
/* FINAL WINNER SECTION */
686+
687+
.final-screen-container {
688+
display: flex;
689+
flex-direction: column;
690+
align-items: center;
691+
justify-content: center;
692+
height: 100%;
693+
width: 100%;
694+
background: rgba(15, 23, 42, 0.95); /* Dark blue-gray background */
695+
color: white;
696+
font-family: sans-serif;
697+
padding: 40px;
698+
box-sizing: border-box;
699+
}
700+
701+
.winner-section {
702+
text-align: center;
703+
margin-bottom: 60px;
704+
flex-shrink: 0;
705+
}
706+
707+
.winner-thumbnail {
708+
width: 160px;
709+
height: 160px;
710+
border-radius: 50%;
711+
border: 6px solid #eab308;
712+
box-shadow: 0 0 30px rgba(234, 179, 8, 0.4);
713+
margin-bottom: 20px;
714+
background-color: white;
715+
padding: 10px;
716+
}
717+
718+
.winner-name {
719+
font-size: 3.5em;
720+
color: #eab308;
721+
font-weight: bold;
722+
}
723+
724+
.winner-final-rewards {
725+
font-size: 2em;
726+
color: #9ca3af;
727+
margin-top: 10px;
677728
}

0 commit comments

Comments
 (0)