2022-01-10 04:33:09 +00:00
|
|
|
<template>
|
|
|
|
<header
|
2022-01-10 10:15:23 +00:00
|
|
|
class="grid grid-cols-3 w-full font-semibold h-10 m-auto md:relative rounded-bl-full rounded-br-full px-4"
|
2022-01-10 04:33:09 +00:00
|
|
|
:class="colorClasses"
|
|
|
|
>
|
2022-01-10 10:15:23 +00:00
|
|
|
<div class="text-center pt-2 pb-1 border-r border-gray-600 select-none">
|
2022-01-10 23:19:34 +00:00
|
|
|
{{ $store.getters.gameMonth }}
|
|
|
|
{{ Math.floor($store.state.gameDate / 12) }}
|
2022-01-10 04:33:09 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div
|
2022-01-10 10:15:23 +00:00
|
|
|
class="text-center pt-2 pb-1 border-r border-gray-600 relative select-none"
|
2022-01-10 04:33:09 +00:00
|
|
|
>
|
|
|
|
<progress
|
|
|
|
class="absolute top-0 left-0 right-0 h-1 w-full"
|
2022-01-10 23:19:34 +00:00
|
|
|
:max="$store.state.playerAgeMax"
|
|
|
|
:value="$store.state.playerAge"
|
2022-01-10 04:33:09 +00:00
|
|
|
/>
|
2022-01-10 10:15:23 +00:00
|
|
|
{{ ageText }}
|
2022-01-10 04:33:09 +00:00
|
|
|
</div>
|
|
|
|
|
2022-01-10 10:15:23 +00:00
|
|
|
<div class="text-center pt-2 pb-1 select-none" v-text="maxAgeText" />
|
2022-01-10 04:33:09 +00:00
|
|
|
</header>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
computed: {
|
2022-01-10 10:15:23 +00:00
|
|
|
ageText() {
|
2022-01-10 23:19:34 +00:00
|
|
|
const year = Math.floor(this.$store.state.playerAge / 12)
|
|
|
|
const month = this.$store.state.playerAge % 12
|
2022-01-10 10:15:23 +00:00
|
|
|
|
2022-01-10 23:19:34 +00:00
|
|
|
return `${year}y${month}m`
|
2022-01-10 10:15:23 +00:00
|
|
|
},
|
|
|
|
maxAgeText() {
|
2022-01-10 23:19:34 +00:00
|
|
|
const year = Math.floor(this.$store.state.playerAgeMax / 12)
|
|
|
|
const month = this.$store.state.playerAgeMax % 12
|
2022-01-10 10:15:23 +00:00
|
|
|
|
|
|
|
return `${year}y${month}m max`
|
|
|
|
},
|
2022-01-10 04:33:09 +00:00
|
|
|
colorClasses() {
|
|
|
|
const { lightColor, darkColor } = this.$store.getters.activeTab
|
|
|
|
|
|
|
|
return `bg-${darkColor} text-${lightColor}`
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
header {
|
|
|
|
min-width: 18rem;
|
2022-01-10 06:18:15 +00:00
|
|
|
transition: background-color 2000ms, color 2000ms;
|
2022-01-10 04:33:09 +00:00
|
|
|
}
|
|
|
|
@media (min-width: 768px) {
|
|
|
|
header {
|
|
|
|
width: 32rem;
|
|
|
|
}
|
|
|
|
}
|
2022-01-10 10:15:23 +00:00
|
|
|
/* progress for all browsers */
|
2022-01-10 04:33:09 +00:00
|
|
|
progress::-webkit-progress-bar {
|
|
|
|
background-color: rgba(255, 255, 255, 0.1);
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
progress {
|
|
|
|
background-color: rgba(255, 255, 255, 0.1);
|
2022-01-10 10:15:23 +00:00
|
|
|
color: currentColor;
|
2022-01-10 04:33:09 +00:00
|
|
|
}
|
|
|
|
progress::-webkit-progress-value {
|
|
|
|
background-color: currentColor;
|
|
|
|
}
|
|
|
|
progress::-moz-progress-bar {
|
|
|
|
background-color: currentColor;
|
|
|
|
}
|
|
|
|
</style>
|