Feat: add namecheck and tailwind css

This commit is contained in:
Grail Finder
2025-05-04 11:32:39 +03:00
parent 5dbb80121d
commit ca9b077070
10 changed files with 107 additions and 5 deletions

View File

@ -1,8 +1,17 @@
{{define "main"}}
<!-- user has no username -> login form -->
{{ if eq .Username "" }}
{{template "login"}}
<!-- user has name but no room id => suggest to create room -->
{{ else if eq .Room.ID "" }}
<div id="hello-user">
<p>Hello {{.Username}}</p>
</div>
<div id="create-room" class="create-room-div">
<button button id="create-form-btn" type="submit" class="justify-center rounded-md bg-indigo-600 px-3 py-1.5 text-sm font-semibold leading-6 text-white shadow-sm hover:bg-indigo-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600" hx-get="/room/createform" hx-swap="outerHTML">SHOW ROOM CREATE FORM</button>
</div>
<!-- check if user in the room -->
{{else}}
<!-- user has room id => send him to his room -->
{{template "room" .}}
{{end}}
{{end}}