knowyt/client/src/components/Player.vue

63 lines
1.2 KiB
Vue
Raw Normal View History

<template>
<div class="player">
<div :class="['player__row', { 'player__row__idle': this.player.isIdle }]">
<div class="player__status">
<span v-if="gamePhase === 'select-quote'">{{ hasSelected ? '' : '' }}</span>
</div>
<div class="player__name">
{{ player.name }}
</div>
<div class="player__score">
{{ player.score || 0 }}
</div>
</div>
</div>
</template>
<script>
export default {
props: ['player'],
computed: {
gamePhase() {
return this.$store.state.game.phase
},
hasSelected() {
return this.$store.state.round.selections[this.player.id]
},
},
}
</script>
<style lang="scss">
2021-11-28 16:24:22 +00:00
@import '~/assets/css/components';
.player {
&__row {
display: flex;
2021-11-28 19:28:43 +00:00
color: $secondary-box-text-color;
font-family: Dosis;
font-size: 18px;
&__idle {
2021-11-28 19:28:43 +00:00
color: $secondary-box-disabled-text-color;
}
}
&__name {
display: inline;
flex-grow: 1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&__status {
width: 20px;
}
&__score {
width: 32px;
margin-left: 16px;
text-align: right;
}
}
</style>