dkforest

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

commit 8da652b0bb8a22c769c0452e1364f8f939ebcf9e
parent 0620e97e7c7da2f610b7788c73f4d93de3815613
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Wed,  6 Dec 2023 15:15:39 -0500

improve ui

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

diff --git a/pkg/web/handlers/poker/poker.go b/pkg/web/handlers/poker/poker.go @@ -690,7 +690,7 @@ func PokerCheckHandler(c echo.Context) error { default: } } - return c.HTML(http.StatusOK, `<form method="post"><button>Check</button></form>`) + return c.HTML(http.StatusOK, cssReset+`<form method="post"><button>Check</button></form>`) } func PokerBetHandler(c echo.Context) error { @@ -716,7 +716,7 @@ func PokerBetHandler(c echo.Context) error { default: } } - html := ` + html := cssReset + ` <form method="post"> <input type="number" name="betValue" value="` + itoa(bet) + `" style="width: 90px;" /><button type="submit" name="bet" value="bet">Bet</button><br /> <button type="submit" name="bet" value="bet50">50</button> @@ -739,7 +739,7 @@ func PokerCallHandler(c echo.Context) error { default: } } - return c.HTML(http.StatusOK, `<form method="post"><button>Call</button></form>`) + return c.HTML(http.StatusOK, cssReset+`<form method="post"><button>Call</button></form>`) } func PokerFoldHandler(c echo.Context) error { @@ -755,7 +755,7 @@ func PokerFoldHandler(c echo.Context) error { default: } } - return c.HTML(http.StatusOK, `<form method="post"><button>Fold</button></form>`) + return c.HTML(http.StatusOK, cssReset+`<form method="post"><button>Fold</button></form>`) } func PokerDealHandler(c echo.Context) error { @@ -769,7 +769,9 @@ func PokerDealHandler(c echo.Context) error { if c.Request().Method == http.MethodPost { g.Deal(db, roomID, authUser) } - return c.HTML(http.StatusOK, `<form method="post"><button>Deal</button></form>`) + html := cssReset + html += `<form method="post"><button>Deal</button></form>` + return c.HTML(http.StatusOK, html) } func PokerUnSitHandler(c echo.Context) error { @@ -797,11 +799,13 @@ func PokerUnSitHandler(c echo.Context) error { newLogEvent(g, roomLogsTopic, fmt.Sprintf("%s un-sit", authUser.Username.String())) } } - return c.HTML(http.StatusOK, `<form method="post"><button>UnSit</button></form>`) + html := cssReset + html += `<form method="post"><button>UnSit</button></form>` + return c.HTML(http.StatusOK, html) } func PokerSitHandler(c echo.Context) error { - html := `<form method="post"><button>SIT</button></form>` + html := cssReset + `<form method="post"><button>SIT</button></form>` authUser := c.Get("authUser").(*database.User) pos, _ := strconv.Atoi(c.Param("pos")) if pos < 1 || pos > NbPlayers {