Chore: make create room page prettier
This commit is contained in:
parent
6d5f4047e2
commit
d0857233f4
2 changed files with 14 additions and 4 deletions
14
index.html
14
index.html
|
@ -97,9 +97,19 @@
|
|||
</div>
|
||||
|
||||
<div x-show="!$store.localState.room">
|
||||
<hgroup>
|
||||
<h1>
|
||||
Whose turn is it?
|
||||
</h1>
|
||||
<h2>Please create or join a room</h2>
|
||||
</hgroup>
|
||||
<form x-data="JoinForm()" @submit.prevent="submitForm">
|
||||
<input type="text" x-model="formData.name" placeholder="Name" />
|
||||
<input type="text" x-model="formData.room" placeholder="Room" />
|
||||
<label for="joinForm_name">Name:</label>
|
||||
<input id="joinForm_name" type="text" x-model="formData.name" placeholder="Name" />
|
||||
<small>How others will see you</small>
|
||||
<label for="joinForm_room">Room:</label>
|
||||
<input id="joinForm_room" type="text" x-model="formData.room" placeholder="Room" />
|
||||
<small>Make sure, this is exactly the same for all players</small>
|
||||
<button type="submit">Join</button>
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -84,7 +84,7 @@ document.addEventListener("alpine:init", () => {
|
|||
iterations: 5000,
|
||||
});
|
||||
|
||||
const topicPrefix = `im.dorian.whos-turn-is-it.${btoa(
|
||||
const topicPrefix = `im.dorian.whose-turn-is-it.${btoa(
|
||||
Alpine.store("localState").room
|
||||
)}`;
|
||||
this._gameStateTopic = CryptoJS.SHA256(
|
||||
|
@ -114,7 +114,7 @@ document.addEventListener("alpine:init", () => {
|
|||
// reset game if not connected after 5 seconds
|
||||
that.clear();
|
||||
}
|
||||
}, 1000 * 5);
|
||||
}, 1000 * 4);
|
||||
|
||||
that._client.subscribe(that._gameStateTopic);
|
||||
that._client.subscribe(that._currentPlayerTopic);
|
||||
|
|
Loading…
Reference in a new issue