0
0
Fork 0

Adjust button positioning in lobby and add a button randomization

This commit is contained in:
Oliver-Akins 2021-02-28 22:01:40 -07:00
parent 4c9db9414f
commit c7890776f9

View file

@ -24,9 +24,9 @@
</div> </div>
<div class="flex-row"> <div class="flex-row">
<button <button
@click.stop="exitGame()" @click.stop="randomizeTeams()"
> >
{{ $store.state.is_host ? `Delete` : `Leave`}} Game Randomize Teams
</button> </button>
<button <button
class="clickable" class="clickable"
@ -34,6 +34,12 @@
> >
Click to Start the Game Click to Start the Game
</button> </button>
<div class="new-line"></div>
<button
@click.stop="exitGame()"
>
{{ $store.state.is_host ? `Delete` : `Leave`}} Game
</button>
</div> </div>
</div> </div>
</template> </template>
@ -61,6 +67,9 @@ export default {
gameCode() { gameCode() {
return this.$store.state.game_code; return this.$store.state.game_code;
}, },
canRandomize() {
return this.$store.state.is_host;
},
}, },
methods: { methods: {
copySuccess() { copySuccess() {
@ -92,7 +101,12 @@ export default {
startGame() { startGame() {
this.$socket.client.emit(`StartGame`, { this.$socket.client.emit(`StartGame`, {
game_code: this.gameCode game_code: this.gameCode
}) });
},
randomizeTeams() {
this.$socket.client.emit(`RandomizeTeams`, {
game_code: this.gameCode
});
}, },
}, },
sockets: { sockets: {
@ -126,6 +140,7 @@ export default {
justify-content: center; justify-content: center;
align-items: stretch; align-items: stretch;
display: flex; display: flex;
flex-wrap: wrap;
} }
button { button {
@ -139,4 +154,10 @@ button {
} }
button:hover { background-color: var(--background2-darken); } button:hover { background-color: var(--background2-darken); }
button:focus { background-color: var(--background2-lighten); } button:focus { background-color: var(--background2-lighten); }
div.new-line {
width: 100% !important;
height: 0px;
}
</style> </style>