commit 5e6523991a176723f61b7508c4aef2fd3d11d0a0
parent c9705550b8d7268853297144a292104e70a2820a
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Mon, 4 Dec 2023 18:08:23 -0500
cleanup
Diffstat:
1 file changed, 17 insertions(+), 16 deletions(-)
diff --git a/pkg/web/handlers/poker.go b/pkg/web/handlers/poker.go
@@ -453,6 +453,23 @@ body {
#dealBtn { position: absolute; top: 400px; left: 50px; }
#unSitBtn { position: absolute; top: 430px; left: 50px; }
</style>`)
+
+ drawSeats := func() {
+ seated, _ := g.IsSeated(authUser.Username.String())
+ for i, p := range g.Players {
+ if p != "" || seated {
+ send(`<style>.takeSeat` + strconv.Itoa(i+1) + ` { display: none; }</style>`)
+ } else {
+ send(`<style>.takeSeat` + strconv.Itoa(i+1) + ` { display: block; }</style>`)
+ }
+ if p != "" {
+ send(`<style>#seat` + strconv.Itoa(i+1) + `:before { content: "` + p + `"; }</style>`)
+ } else {
+ send(`<style>#seat` + strconv.Itoa(i+1) + `:before { content: ""; }</style>`)
+ }
+ }
+ }
+
cardsHtml := ""
for i := 52; i >= 1; i-- {
cardsHtml += `<div class="card-holder" id="card` + strconv.Itoa(i) + `"><div class="back"></div><div class="card"><div class=inner></div></div></div>`
@@ -491,22 +508,6 @@ Loop:
continue
}
- drawSeats := func() {
- seated, _ := g.IsSeated(authUser.Username.String())
- for i, p := range g.Players {
- if p != "" || seated {
- send(`<style>.takeSeat` + strconv.Itoa(i+1) + ` { display: none; }</style>`)
- } else {
- send(`<style>.takeSeat` + strconv.Itoa(i+1) + ` { display: block; }</style>`)
- }
- if p != "" {
- send(`<style>#seat` + strconv.Itoa(i+1) + `:before { content: "` + p + `"; }</style>`)
- } else {
- send(`<style>#seat` + strconv.Itoa(i+1) + `:before { content: ""; }</style>`)
- }
- }
- }
-
if _, ok := payload.(PokerSeatLeftEvent); ok {
drawSeats()
c.Response().Flush()