dkforest

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

commit b10ed9d632b9610e934a7f2f7e2b76805993cdd5
parent 2376c0a18ac187dbcac69dfc1fc41f251785ee44
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Tue,  5 Dec 2023 16:15:22 -0500

fix color

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

diff --git a/pkg/web/handlers/poker.go b/pkg/web/handlers/poker.go @@ -623,10 +623,20 @@ func buildYourCardsHtml(authUser *database.User, g *PokerGame) string { } html += `<style>` if len(cards) >= 1 { - html += `#yourCard1:before { content: "` + cards[0].Name + `"; }` + color := "black" + if strings.Contains(cards[0].Name, "♥") || + strings.Contains(cards[0].Name, "♦") { + color = "darkred" + } + html += `#yourCard1:before { content: "` + cards[0].Name + `"; color: ` + color + `; }` } if len(cards) == 2 { - html += `#yourCard2:before { content: "` + cards[1].Name + `"; }` + color := "black" + if strings.Contains(cards[1].Name, "♥") || + strings.Contains(cards[1].Name, "♦") { + color = "darkred" + } + html += `#yourCard2:before { content: "` + cards[1].Name + `"; color: ` + color + `; }` } html += `</style>` }