2021-08-15 16:52:15 +00:00
|
|
|
<template>
|
|
|
|
<div class="play">
|
2021-08-26 10:23:32 +00:00
|
|
|
<div class="play__layout">
|
2021-09-03 19:53:58 +00:00
|
|
|
<div :class="['play__layout-playground', cssLayoutClass ]">
|
2021-08-26 10:23:32 +00:00
|
|
|
<Quote :text="quote" />
|
2021-08-30 16:21:14 +00:00
|
|
|
<Sources :sources="sources" :selectable="selectable" />
|
|
|
|
<ConfirmButton v-if="selectable"/>
|
2021-08-26 10:23:32 +00:00
|
|
|
</div>
|
|
|
|
<div class="play__layout-right-column">
|
|
|
|
<PlayerList :players="players" />
|
|
|
|
</div>
|
|
|
|
</div>
|
2021-08-15 16:52:15 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
computed: {
|
2021-09-03 19:53:58 +00:00
|
|
|
cssLayoutClass() {
|
|
|
|
if (this.$store.state.game.phase === 'reveal-start-1') {
|
|
|
|
return 'play__layout-playground__flip-out'
|
|
|
|
} else if (this.$store.state.game.phase === 'reveal-start-2') {
|
|
|
|
return 'play__layout-playground__flip-in'
|
|
|
|
}
|
|
|
|
|
|
|
|
return
|
|
|
|
},
|
2021-08-15 16:52:15 +00:00
|
|
|
gamePhase() {
|
|
|
|
return this.$store.state.game.phase
|
|
|
|
},
|
|
|
|
quote() {
|
|
|
|
return this.$store.state.round.quote
|
|
|
|
},
|
2021-08-15 20:04:24 +00:00
|
|
|
sources() {
|
|
|
|
return this.$store.state.round.sources
|
|
|
|
},
|
2021-08-26 10:23:32 +00:00
|
|
|
players() {
|
|
|
|
return this.$store.state.players.players
|
|
|
|
},
|
2021-08-30 16:21:14 +00:00
|
|
|
selectable() {
|
|
|
|
const userId = this.$store.state.engine.user.id
|
|
|
|
const selection = this.$store.state.round.selections[userId]
|
|
|
|
|
|
|
|
if (this.$store.state.game.phase != 'select-quote') return false
|
|
|
|
if (typeof selection === 'undefined') return true
|
|
|
|
return !selection
|
|
|
|
},
|
2021-08-15 16:52:15 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
html,
|
|
|
|
body,
|
|
|
|
#__nuxt,
|
|
|
|
#__layout,
|
|
|
|
.layout-default,
|
|
|
|
.page-play {
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
|
|
|
|
.play {
|
|
|
|
position: relative;
|
2021-08-15 20:04:24 +00:00
|
|
|
width: 100%;
|
2021-08-15 16:52:15 +00:00
|
|
|
height: 100%;
|
2021-08-26 10:23:32 +00:00
|
|
|
|
|
|
|
&__layout {
|
|
|
|
display: flex;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
2021-09-03 19:53:58 +00:00
|
|
|
perspective: 1200px;
|
2021-08-26 10:23:32 +00:00
|
|
|
|
|
|
|
&-playground {
|
|
|
|
position: relative;
|
|
|
|
flex-grow: 1;
|
2021-09-03 19:53:58 +00:00
|
|
|
|
|
|
|
&__flip-out {
|
|
|
|
animation: flip-out .5s ease-in-out;
|
|
|
|
animation-fill-mode: forwards;
|
|
|
|
}
|
|
|
|
|
|
|
|
&__flip-in {
|
|
|
|
animation: flip-in .5s ease-in-out;
|
|
|
|
animation-fill-mode: forwards;
|
|
|
|
}
|
2021-08-26 10:23:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
&-right-column {
|
|
|
|
width: 200px;
|
|
|
|
margin: 16px 16px 0 0;
|
|
|
|
}
|
2021-09-03 19:53:58 +00:00
|
|
|
|
2021-08-26 10:23:32 +00:00
|
|
|
}
|
2021-09-03 19:53:58 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
@keyframes flip-out {
|
|
|
|
to { transform: rotateX(90deg); }
|
|
|
|
}
|
|
|
|
@keyframes flip-in {
|
|
|
|
from { transform: rotateX(90deg); }
|
|
|
|
to { transform: rotateX(0deg); }
|
2021-08-15 16:52:15 +00:00
|
|
|
}
|
|
|
|
</style>
|