show quote

This commit is contained in:
Settel 2021-08-15 18:52:15 +02:00
parent 5f5033e846
commit 2dd280ce25
7 changed files with 112 additions and 9 deletions

View File

@ -31,5 +31,11 @@ export default {
.gamecontrols {
padding: 8px 1em;
border-bottom: 1px solid #808080;
button {
font-family: Dosis;
padding: 0 1rem;
font-size: 18px;
}
}
</style>

View File

@ -0,0 +1,46 @@
<template>
<div class="play">
<div class="play__quote-container">
<Quote :text="quote" />
</div>
</div>
</template>
<script>
export default {
computed: {
gamePhase() {
return this.$store.state.game.phase
},
quote() {
return this.$store.state.round.quote
},
},
}
</script>
<style lang="scss">
html,
body,
#__nuxt,
#__layout,
.layout-default,
.page-play {
height: 100%;
}
.play {
position: relative;
height: 100%;
&__quote-container {
display: flex;
position: absolute;
left: 35%;
top: 35%;
width: 30%;
height: 30%;
align-items: center;
}
}
</style>

View File

@ -0,0 +1,29 @@
<template>
<div class="quote">
<div class="quote__quote">{{ text }}</div>
</div>
</template>
<script>
export default {
props: ['text'],
}
</script>
<style lang="scss">
.quote {
&__quote {
text-align: justify;
font-family: Dosis;
font-size: 24px;
color: #ffffff;
&:before {
content: '„';
}
&:after {
content: '“';
}
}
}
</style>

View File

@ -1,14 +1,12 @@
<template>
<div>
<div class="page-play">
<GameControls />
<EngineDebug />
<ReadySet v-if="gameState === 'ready-set'" :text="gamePhase" />
<template v-if="gameState === 'idle'">
<ReadySet text="waiting ..." />
</template>
<div v-if="gameState === 'play'">
<h2>Play</h2>
<div v-if="gameState === 'idle'" class="page-play__waiting">
waiting for gamemaster to start game ...
</div>
<ReadySet v-if="gameState === 'ready-set'" :text="gamePhase" />
<Play v-if="gameState === 'play'" />
</div>
</template>
@ -30,3 +28,15 @@ export default {
},
}
</script>
<style lang="scss">
.page-play {
&__waiting {
margin-top: 60px;
text-align: center;
font-family: Dosis;
font-size: 24px;
color: #ffffff;
}
}
</style>

View File

@ -3,4 +3,5 @@ export default function(data) {
store.commit('engine/setJson', data)
store.commit('game/setStateAndPhase', data.game)
store.commit('round/setRound', data.game.round)
}

View File

@ -1,6 +1,6 @@
export const state = () => ({
state: "...",
phase: "...",
state: "",
phase: "",
})
export const mutations = {

11
client/src/store/round.js Normal file
View File

@ -0,0 +1,11 @@
export const state = () => ({
quote: "",
sources: [],
})
export const mutations = {
setRound(state, { quote, sources }) {
state.quote = quote
state.sources = sources
},
}