From 21948b23f4b10c6bbcd7b55d854563cce6285ca9 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Thu, 8 May 2025 12:31:44 +0300 Subject: [PATCH] Feat: join team --- components/index.html | 2 ++ components/playerlist.html | 7 ++++ components/room.html | 6 ++++ components/teampew.html | 3 +- handlers/actions.go | 20 ++++++++++++ handlers/auth.go | 14 ++++---- handlers/game.go | 66 +++++++++++++++++++++++++++++++++++--- main.go | 2 +- models/state.go | 14 ++++---- 9 files changed, 112 insertions(+), 22 deletions(-) create mode 100644 components/playerlist.html diff --git a/components/index.html b/components/index.html index f5ac36e..40a60b3 100644 --- a/components/index.html +++ b/components/index.html @@ -12,6 +12,8 @@ {{else}} +
{{template "room" .}} +
{{end}} {{end}} diff --git a/components/playerlist.html b/components/playerlist.html new file mode 100644 index 0000000..6be38df --- /dev/null +++ b/components/playerlist.html @@ -0,0 +1,7 @@ +{{define "teamlist"}} +
+{{range .}} +

{{.}}

+{{end}} +
+{{end}} diff --git a/components/room.html b/components/room.html index 5f21717..ac145db 100644 --- a/components/room.html +++ b/components/room.html @@ -5,9 +5,15 @@
+ {{template "teamlist" .Room.BlueGuessers}} + {{if eq .State.Team ""}} {{template "teampew" "blue"}} + {{end}} + {{if eq .State.Team ""}} {{template "teampew" "red"}} + {{end}} + {{template "teamlist" .Room.RedGuessers}}

diff --git a/components/teampew.html b/components/teampew.html index 5ee2386..ebe3c68 100644 --- a/components/teampew.html +++ b/components/teampew.html @@ -1,8 +1,7 @@ {{define "teampew"}} -

Join {{.}} Team

-
+