aboutsummaryrefslogtreecommitdiff
path: root/src/quiz-bunny/index.html
diff options
context:
space:
mode:
authorMark Powers <markppowers0@gmail.com>2020-04-18 19:20:04 -0500
committerMark Powers <markppowers0@gmail.com>2020-04-18 19:20:04 -0500
commit91da735599e1e941fc866a7b9818c4ff16536086 (patch)
tree76ce820b58a63c12993bf71981167e3830392bb4 /src/quiz-bunny/index.html
parentecd8d064a370ce0b9d4a353f6151638b60838208 (diff)
Create quiz bunny
Diffstat (limited to 'src/quiz-bunny/index.html')
-rw-r--r--src/quiz-bunny/index.html83
1 files changed, 83 insertions, 0 deletions
diff --git a/src/quiz-bunny/index.html b/src/quiz-bunny/index.html
new file mode 100644
index 0000000..eadba94
--- /dev/null
+++ b/src/quiz-bunny/index.html
@@ -0,0 +1,83 @@
+<!doctype html>
+<html lang="en">
+
+<head>
+ <title>Quiz Bunny</title>
+ <meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+ <link rel="shortcut icon" href="/favicon.ico">
+ <!-- <script src="https://cdn.jsdelivr.net/npm/vue"></script> -->
+ <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
+ <script src="/quiz-bunny/main.js"></script>
+ <link rel="stylesheet" type="text/css" href="/quiz-bunny/styles.css">
+</head>
+
+<body>
+ <div id="data">
+ <div v-if="!game" class="center">
+ <h1>
+ Quiz Bunny
+ </h1>
+ <div>
+ <div>
+ <input style="width: 340px;" type="text" placeholder="username" v-model="username">
+ </div>
+ <div>
+ <input style="width: 100%;" type="button" value="Host game" v-on:click="hostGame"
+ :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="button" value="Join game" v-on:click="joinGame"
+ :disabled="username.length == 0 || gameCode.length == 0">
+ </div>
+ </div>
+ </div>
+ <div v-if="game" class="center">
+ <div v-if="!game.gameStarted">
+ <h1>Game Code:</h1>
+ <h2>{{game.gameCode}}</h2>
+ <h1>Players</h1>
+ <ul v-for="player in game.players">
+ <li>{{player}}</li>
+ </ul>
+ <div v-if="game.host">
+ <input type="button" value="Start game" v-on:click="startGame">
+ </div>
+ </div>
+ <div v-else>
+ <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="button" value="Submit" v-on:click="submitAnswer" :disabled="submitText.length == 0"
+ v-if="!game.submitted">
+ </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">
+ </div>
+ </div>
+ <div v-if="game.state == STATES.WAITING" class="waiting">
+ <h1>Results:</h1>
+ <h2>{{game.prompt}}</h2>
+ <div v-for="(answer, i) in game.answers">
+ <span>{{answer.text}}</span><span>{{answer.voteCount}} votes</span>
+ </div>
+ <input type="button" value="Ready" v-on:click="ready" :disabled="game.ready">
+ </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>
+ </ol>
+ <input type="button" value="Leave" v-on:click="leave">
+ </div>
+ </div>
+ </div>
+ </div>
+</body>
+
+</html> \ No newline at end of file