Skip to content

Commit

Permalink
feat: group the buttons by type
Browse files Browse the repository at this point in the history
  • Loading branch information
wheresalice committed May 22, 2021
1 parent 38a8814 commit 5b8321f
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 14 deletions.
32 changes: 20 additions & 12 deletions assets/room.js
Expand Up @@ -3,18 +3,26 @@ const app = new Vue({
data: {
user: '',
room: undefined,
moods: [
"Agree",
"Agree and volunteer",
"Response",
"Direct response",
"Technical point",
"Language",
"Speak up",
"Slow down",
"I'm confused",
"Veto"
],
moods: {
"Consent": [
"Agree",
"Agree and volunteer",
"Veto",
"Stand aside",
],
"Requests": [
"Language",
"Speak up",
"Slow down",
"I'm confused",

],
"Responses": [
"Response",
"Direct response",
"Technical point",
]
},
userMoods: []
},
computed: {
Expand Down
8 changes: 6 additions & 2 deletions room.html
Expand Up @@ -17,10 +17,14 @@
<div id="app">
<input v-model="user" placeholder="username"> <span v-on:click="deleteUserMood(user)">×</span>
<p>Room number: <span id="roomnumber">{{ room }}</span></p>
<button v-for="(mood, index) in moods" v-on:click="sendMood(mood)" v-bind:disabled="!isReady">{{ mood }}</button>
<div v-for="(value, key) in moods" class="moodgroup">
{{key}}:
<button v-for="(mood, index) in moods[key]" v-on:click="sendMood(mood)" v-bind:disabled="!isReady" class="mood-button">{{ mood }}</button>
</div>
<hr>
<div class="mood-list">
<article class="mood" v-for="(item, index) in userMoods" v-on:click="deleteUserMood(item.username)"><span
id="mooduser">{{item.username}}</span> :: <span id="mood">{{item.mood}}</span></article>
class="mood__username">{{item.username}}</span> :: <span class="mood__mood">{{item.mood}}</span></article>
</div>
</div>
<div class="footer">
Expand Down
Binary file modified screenshot.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5b8321f

Please sign in to comment.