From: Geoffrey Allott Date: Sun, 28 Mar 2021 21:24:55 +0000 (+0100) Subject: display pot size X-Git-Url: https://git.pointlesshacks.com/?a=commitdiff_plain;h=f66bd4f6f200c7e14936dc55dcdf52451283fca5;p=pokerwave.git display pot size --- diff --git a/site/modules/poker.js b/site/modules/poker.js index fedc9a0..171af01 100644 --- a/site/modules/poker.js +++ b/site/modules/poker.js @@ -72,6 +72,14 @@ export class TexasHoldEm { felt.setAttribute("fill", "green"); this.svg.append(felt); + const pot_size = document.createElementNS(svgns, "text"); + pot_size.setAttribute("x", "400"); + pot_size.setAttribute("y", "250"); + pot_size.classList.add("pot-size"); + this.pot_size_text = document.createTextNode(""); + pot_size.append(this.pot_size_text); + this.svg.append(pot_size); + const controls = document.createElementNS(svgns, "rect"); controls.setAttribute("x", "310"); controls.setAttribute("y", "410"); @@ -309,6 +317,7 @@ export class TexasHoldEm { this.bet_slider.classList.toggle("active", can_bet); this.bet_size_text.textContent = this.min_bet(); this.bet_slider_thumb.setAttribute("x", 360); + this.pot_size_text.textContent = this.pot || ""; for (const [username, [user, stack, active, bet]] of this.user_icons) { if (!this.seats.has(username)) { this.svg.removeChild(user); diff --git a/site/style/poker.css b/site/style/poker.css index beb9a58..cfa37ac 100644 --- a/site/style/poker.css +++ b/site/style/poker.css @@ -32,6 +32,12 @@ text-anchor: middle; } +.pot-size { + pointer-events: none; + text-anchor: middle; + font-size: 14pt; +} + .bet-size { pointer-events: none; text-anchor: middle;