dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit c8a49c6fe8d27497fffe3967fd3b01947e1eabdd
parent dcbb90b8837f255dfdc53f4ab33a4caddb67ffce
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Tue, 19 Dec 2023 19:47:56 -0500

cleanup

Diffstat:
Mpkg/web/handlers/poker/poker.go | 34+++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -1544,21 +1544,6 @@ func buildDealerTokenHtml(g *PokerGame) (html string) { return } -func buildDevHtml() (html string) { - return `<div class="dev_seat1_card1"></div> -<div class="dev_seat2_card1"></div> -<div class="dev_seat3_card1"></div> -<div class="dev_seat4_card1"></div> -<div class="dev_seat5_card1"></div> -<div class="dev_seat6_card1"></div> -<div class="dev_community_card1"></div> -<div class="dev_community_card2"></div> -<div class="dev_community_card3"></div> -<div class="dev_community_card4"></div> -<div class="dev_community_card5"></div> -` -} - func BuildPayloadHtml(g *PokerGame, authUser *database.User, payload any) (html string) { switch evt := payload.(type) { case GameStartedEvent: @@ -1643,6 +1628,21 @@ func BuildBaseHtml(g *PokerGame, authUser *database.User) (html string) { return } +func buildDevHtml() (html string) { + return `<div class="dev_seat1_card1"></div> +<div class="dev_seat2_card1"></div> +<div class="dev_seat3_card1"></div> +<div class="dev_seat4_card1"></div> +<div class="dev_seat5_card1"></div> +<div class="dev_seat6_card1"></div> +<div class="dev_community_card1"></div> +<div class="dev_community_card2"></div> +<div class="dev_community_card3"></div> +<div class="dev_community_card4"></div> +<div class="dev_community_card5"></div> +` +} + func buildSoundsHtml(authUser *database.User) (html string) { html += ` <div id="soundsStatus"> @@ -1946,8 +1946,8 @@ func drawCountDownStyle(evt PokerWaitTurnEvent) string { remainingSecs := int((MaxUserCountdown*time.Second - time.Since(evt.CreatedAt)).Seconds()) if evt.Idx >= 0 && evt.Idx <= 5 { idxStr := itoa(evt.Idx + 1) - html += `#seat` + idxStr + ` { background-color: rgba(200, 45, 45, 0.7); }` - html += `#countdown` + idxStr + ` { --duration: ` + itoa(remainingSecs) + `; display: block; animation: time calc(var(--duration) * 1s) steps(1000, start) forwards; }` + html += fmt.Sprintf(`#seat%s { background-color: rgba(200, 45, 45, 0.7); }`, idxStr) + html += fmt.Sprintf(`#countdown%s { --duration: %s; display: block; animation: time calc(var(--duration) * 1s) steps(1000, start) forwards; }`, idxStr, itoa(remainingSecs)) } html += "</style>" return html