feat: toggling Create/Join room button
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
||||
<title>Untitled</title>
|
||||
<title>Untitled!!!</title>
|
||||
<meta name="description" content="" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<script
|
||||
@@ -43,7 +43,11 @@
|
||||
type="text"
|
||||
name="roomName"
|
||||
value=""
|
||||
placeholder="room name"
|
||||
placeholder="room name!!!"
|
||||
hx-trigger="keyup changed delay:500ms"
|
||||
hx-post="/login/room-name-check"
|
||||
hx-target="#formButton"
|
||||
hx-swap="outerHTML"
|
||||
/>
|
||||
<input
|
||||
id="roomPassword"
|
||||
@@ -70,9 +74,13 @@
|
||||
placeholder="personal password"
|
||||
/>
|
||||
</div>
|
||||
<button class="col-span-full"
|
||||
hx-post="/login/submit"
|
||||
>Join / Create</button>
|
||||
{{ block "formButton" .IsRoomExisting }}
|
||||
{{ if not . }}
|
||||
<button id="formButton" class="col-span-full" hx-post="/login/create">Create Room</button>
|
||||
{{ else }}
|
||||
<button id="formButton" class="col-span-full" hx-post="/login/join">Join Room</button>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</form>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
Reference in New Issue
Block a user