commit 4403f142ef161557b9ac283c70e06062aa9f16fa
parent b9b6ab1d48f96e01b6dd1b95e208c526b57acd8b
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Mon, 18 Dec 2023 01:16:28 -0500
UI
Diffstat:
1 file changed, 24 insertions(+), 9 deletions(-)
diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go
@@ -1652,24 +1652,32 @@ func buildPayloadHtml(g *PokerGame, authUser *database.User, payload any) (html
return
}
+func buildGameDiv(g *PokerGame, authUser *database.User, playerBuyIn database.PokerChip) (html string) {
+ roomID := g.RoomID
+ html += `<div id="game">`
+ html += `<div id="table"></div>`
+ html += buildSeatsHtml(g, authUser, playerBuyIn)
+ html += buildCardsHtml()
+ html += buildActionsDiv(roomID)
+ html += buildDealerTokenHtml(g)
+ html += buildMainPotHtml(g)
+ html += buildWinnerHtml()
+ html += buildCountdownsHtml()
+ html += `</div>`
+ return
+}
+
func buildBaseHtml(g *PokerGame, authUser *database.User, playerBuyIn database.PokerChip) (html string) {
ongoing := g.Ongoing
roomID := g.RoomID
html += hutils.HtmlCssReset
html += pokerCss
//html += `<script>document.onclick = function(e) { console.log(e.x, e.y); };</script>` // TODO: dev only
- html += `<div id="table"></div>`
- html += buildSoundsHtml(authUser)
//html += buildDevHtml()
+ html += buildGameDiv(g, authUser, playerBuyIn)
+ html += buildSoundsHtml(authUser)
html += buildHelpHtml()
- html += buildCardsHtml()
- html += buildSeatsHtml(g, authUser, playerBuyIn)
- html += buildActionsDiv(roomID)
- html += buildDealerTokenHtml(g)
html += `<iframe src="/poker/` + roomID.String() + `/logs" id="eventLogs"></iframe>`
- html += buildMainPotHtml(g)
- html += buildWinnerHtml()
- html += buildCountdownsHtml()
if ongoing != nil {
@@ -2211,6 +2219,13 @@ body {
#soundsStatus {
position: absolute; top: 10px; left: 10px;
}
+#game {
+ position: absolute;
+ left: 0px;
+ top: 0px;
+ width: 760px;
+ height: 400px;
+}
#table {
position: absolute; top: 20px; left: 20px; width: 750px; height: 400px; border-radius: 300px;
background: radial-gradient(#449144, #008a00);