commit a105bf0871c29647f1986494900dca064acb739e
parent e458e986db49bd5f28c0914bfd50be25ed0a729f
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Tue, 5 Dec 2023 19:21:50 -0500
cleanup
Diffstat:
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/pkg/web/handlers/poker.go b/pkg/web/handlers/poker.go
@@ -756,6 +756,16 @@ func buildMainPotHtml(g *PokerGame) string {
return html
}
+func buildActionsBtns(roomID string) string {
+ return `
+<div style="position: absolute; top: 400px; left: 200px;">
+ <iframe src="/poker/` + roomID + `/bet" id="betBtn"></iframe>
+ <iframe src="/poker/` + roomID + `/call" id="callBtn"></iframe>
+ <iframe src="/poker/` + roomID + `/check" id="checkBtn"></iframe>
+ <iframe src="/poker/` + roomID + `/fold" id="foldBtn"></iframe>
+</div>`
+}
+
func buildSeatsHtml(g *PokerGame) string {
seats := `
<div>`
@@ -992,14 +1002,7 @@ func PokerHandler(c echo.Context) error {
send(cardsHtml)
send(buildTakeSeatHtml(authUser, g, roomID))
send(buildSeatsHtml(g))
- turnAction := `
-<div style="position: absolute; top: 400px; left: 200px;">
- <iframe src="/poker/` + roomID + `/bet" id="betBtn"></iframe>
- <iframe src="/poker/` + roomID + `/call" id="callBtn"></iframe>
- <iframe src="/poker/` + roomID + `/check" id="checkBtn"></iframe>
- <iframe src="/poker/` + roomID + `/fold" id="foldBtn"></iframe>
-</div>`
- send(turnAction)
+ send(buildActionsBtns(roomID))
send(buildYourCardsHtml(authUser, g))
actions := `<iframe src="/poker/` + roomID + `/deal" id="dealBtn"></iframe>`
actions += `<iframe src="/poker/` + roomID + `/unsit" id="unSitBtn"></iframe>`