dkforest

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

commit f63cc217b371f98b3efc029a42e25a4e6c767b3c
parent ae8f9e8f81f27eab60f76a3ab9f72f94b3671f06
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Wed,  6 Dec 2023 02:26:30 -0500

build actions div

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

diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -525,7 +525,7 @@ END: } func cardToPokerCard(name string) string { - r := strings.NewReplacer("♠", "s", "♥", "h", "♣", "c", "♦", "d") + r := strings.NewReplacer("♠", "s", "♥", "h", "♣", "c", "♦", "d", "10", "T") return r.Replace(name) } @@ -789,14 +789,16 @@ func buildCountdownsHtml() (html string) { return } -func buildActionsBtns(roomID string) string { - return ` -<div style="position: absolute; top: 430px; 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 buildActionsDiv(roomID string) (html string) { + html += `<div id="actionsDiv">` + html += `<iframe src="/poker/` + roomID + `/deal" id="dealBtn"></iframe>` + html += `<iframe src="/poker/` + roomID + `/unsit" id="unSitBtn"></iframe>` + html += `<iframe src="/poker/` + roomID + `/bet" id="betBtn"></iframe>` + html += `<iframe src="/poker/` + roomID + `/call" id="callBtn"></iframe>` + html += `<iframe src="/poker/` + roomID + `/check" id="checkBtn"></iframe>` + html += `<iframe src="/poker/` + roomID + `/fold" id="foldBtn"></iframe>` + html += `</div>` + return } func buildSeatsHtml(g *PokerGame) string { @@ -1075,8 +1077,9 @@ body { .takeSeat4 { position: absolute; top: 333px; left: 485px; } .takeSeat5 { position: absolute; top: 333px; left: 300px; } .takeSeat6 { position: absolute; top: 333px; left: 95px; } -#dealBtn { position: absolute; top: 430px; left: 50px; width: 80px; height: 30px; } -#unSitBtn { position: absolute; top: 460px; left: 50px; width: 80px; height: 30px; } +#actionsDiv { position: absolute; top: 450px; left: 0; } +#dealBtn { width: 80px; height: 30px; } +#unSitBtn { width: 80px; height: 30px; } #checkBtn { width: 60px; height: 30px; } #foldBtn { width: 50px; height: 30px; } #callBtn { width: 50px; height: 30px; } @@ -1213,11 +1216,8 @@ func PokerHandler(c echo.Context) error { send(buildCardsHtml()) send(buildTakeSeatHtml(authUser, g, roomID)) send(buildSeatsHtml(g)) - send(buildActionsBtns(roomID)) + send(buildActionsDiv(roomID)) send(buildYourCardsHtml(authUser, g)) - actions := `<iframe src="/poker/` + roomID + `/deal" id="dealBtn"></iframe>` - actions += `<iframe src="/poker/` + roomID + `/unsit" id="unSitBtn"></iframe>` - send(actions) send(`<iframe src="/poker/` + roomID + `/logs" id="eventLogs"></iframe>`) send(`<div id="errorMsg"></div>`) send(`<div id="seat1Pot"></div>`) // TODO