diff options
author | Mark Powers <markppowers0@gmail.com> | 2020-04-19 12:48:46 -0500 |
---|---|---|
committer | Mark Powers <markppowers0@gmail.com> | 2020-04-19 12:48:46 -0500 |
commit | de1eda15955f5d6ee311475355b886214d43f53c (patch) | |
tree | d4cdebb46869c115f982215780647f9439bf5e8e /src/quiz-bunny/index.html | |
parent | 91da735599e1e941fc866a7b9818c4ff16536086 (diff) |
Add prompt and add waiting for list
Diffstat (limited to 'src/quiz-bunny/index.html')
-rw-r--r-- | src/quiz-bunny/index.html | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/src/quiz-bunny/index.html b/src/quiz-bunny/index.html index eadba94..127db65 100644 --- a/src/quiz-bunny/index.html +++ b/src/quiz-bunny/index.html @@ -27,7 +27,8 @@ :disabled="username.length == 0"> </div> <div> - <input type="text" placeholder="game code" v-model="gameCode" style="width: 250px;" v-on:keyup.enter="joinGame"> + <input type="text" placeholder="game code" v-model="gameCode" style="width: 250px;" + v-on:keyup.enter="joinGame"> <input type="button" value="Join game" v-on:click="joinGame" :disabled="username.length == 0 || gameCode.length == 0"> </div> @@ -39,7 +40,7 @@ <h2>{{game.gameCode}}</h2> <h1>Players</h1> <ul v-for="player in game.players"> - <li>{{player}}</li> + <li>{{player.name}}</li> </ul> <div v-if="game.host"> <input type="button" value="Start game" v-on:click="startGame"> @@ -49,15 +50,33 @@ <div v-if="game.state == STATES.TYPING" class="typing"> <h1>Answer:</h1> <h2>{{game.prompt}}</h2> - <input type="text" placeholder="answer" v-model="submitText" :disabled="game.submitted" v-on:keyup.enter="submitAnswer"> + <input type="text" placeholder="answer" v-model="submitText" :disabled="game.submitted" + v-on:keyup.enter="submitAnswer"> <input type="button" value="Submit" v-on:click="submitAnswer" :disabled="submitText.length == 0" v-if="!game.submitted"> + <div class="readyList"> + <h4>Waiting:</h4> + <ul> + <li v-for="player in nonReady(game.players)"> + {{player.name}} + </li> + </ul> + </div> </div> <div v-if="game.state == STATES.VOTING" class="voting"> <h1>Vote:</h1> <h2>{{game.prompt}}</h2> <div v-for="(answer, i) in game.answers"> - <input style="width: 100%" type="button" :value="answer" v-on:click="submitVote(i)" :disabled="game.voted"> + <input style="width: 100%" type="button" :value="answer" v-on:click="submitVote(i)" + :disabled="game.voted"> + </div> + <div class="readyList"> + <h4>Waiting:</h4> + <ul> + <li v-for="player in nonReady(game.players)"> + {{player.name}} + </li> + </ul> </div> </div> <div v-if="game.state == STATES.WAITING" class="waiting"> @@ -67,11 +86,20 @@ <span>{{answer.text}}</span><span>{{answer.voteCount}} votes</span> </div> <input type="button" value="Ready" v-on:click="ready" :disabled="game.ready"> + <div class="readyList"> + <h4>Waiting:</h4> + <ul> + <li v-for="player in nonReady(game.players)"> + {{player.name}} + </li> + </ul> + </div> </div> <div v-if="game.state == STATES.OVER"> <h1>Scores:</h1> <ol> - <li v-for="(score, i) in game.scores"><span>{{score.name}}</span><span>{{score.score}}</span></li> + <li v-for="(score, i) in game.scores"><span>{{score.name}}</span><span>{{score.score}}</span> + </li> </ol> <input type="button" value="Leave" v-on:click="leave"> </div> |