2022-01-10 03:28:09 +00:00
|
|
|
<template>
|
2022-01-10 10:16:25 +00:00
|
|
|
<div class="container max-h-full h-full w-full mx-auto bg-gray-400 px-4">
|
2022-01-10 06:08:59 +00:00
|
|
|
<main
|
|
|
|
class="grid w-full h-full overflow-auto relative"
|
2022-01-10 10:16:25 +00:00
|
|
|
:class="`bg-${activeTab.color}`"
|
2022-01-10 06:08:59 +00:00
|
|
|
>
|
2022-01-10 04:33:09 +00:00
|
|
|
<time-header />
|
2022-01-10 03:28:09 +00:00
|
|
|
|
2022-01-10 07:11:55 +00:00
|
|
|
<key-art-stage />
|
2022-01-10 03:28:09 +00:00
|
|
|
|
2022-01-10 10:16:25 +00:00
|
|
|
<div class="grid grid-cols-6 gap-1 w-full h-10 relative">
|
2022-01-10 03:28:09 +00:00
|
|
|
<game-tab
|
2022-01-10 10:16:25 +00:00
|
|
|
v-for="tab in $store.state.tabs"
|
|
|
|
:key="tab.route"
|
2022-01-10 03:28:09 +00:00
|
|
|
:tab-data="tab"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div
|
2022-01-10 07:11:55 +00:00
|
|
|
class="tab-content px-4 w-full relative overflow-y-scroll"
|
2022-01-10 03:28:09 +00:00
|
|
|
:class="activeTabColorClasses"
|
|
|
|
>
|
2022-01-10 07:11:55 +00:00
|
|
|
<div
|
|
|
|
class="w-full text-2xl text-center pt-1 pb-2"
|
2022-01-10 10:16:25 +00:00
|
|
|
v-text="activeTab.title"
|
2022-01-10 07:11:55 +00:00
|
|
|
/>
|
2022-01-10 03:28:09 +00:00
|
|
|
|
|
|
|
<nuxt />
|
|
|
|
</div>
|
|
|
|
</main>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-01-10 10:16:25 +00:00
|
|
|
import { mapGetters } from 'vuex'
|
|
|
|
|
2022-01-10 03:28:09 +00:00
|
|
|
export default {
|
|
|
|
computed: {
|
2022-01-10 10:16:25 +00:00
|
|
|
...mapGetters(['activeTab']),
|
2022-01-10 03:28:09 +00:00
|
|
|
activeTabColorClasses() {
|
2022-01-10 10:16:25 +00:00
|
|
|
return `bg-${this.activeTab.lightColor} text-${this.activeTab.darkColor}`
|
2022-01-10 03:28:09 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
window.setInterval(() => {
|
2022-01-10 23:38:43 +00:00
|
|
|
if (this.$store.state.playerAge < this.$store.state.playerAgeMax)
|
|
|
|
this.gametick()
|
2022-01-10 10:16:25 +00:00
|
|
|
}, 100)
|
2022-01-10 03:28:09 +00:00
|
|
|
window.setInterval(() => {
|
2022-01-10 23:38:43 +00:00
|
|
|
if (this.$store.state.playerAge < this.$store.state.playerAgeMax)
|
|
|
|
this.$store.commit('tickGameDate')
|
2022-01-10 06:25:55 +00:00
|
|
|
}, 1000)
|
2022-01-10 03:28:09 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
gametick() {
|
2022-01-10 10:16:25 +00:00
|
|
|
this.$store.state.processes
|
|
|
|
.filter((p) => p.created)
|
|
|
|
.forEach((process, index) => {
|
|
|
|
if (process.completion >= process.completionRequired) {
|
|
|
|
this.$store.commit('addCurrency', process.baseReward)
|
|
|
|
this.$store.commit('setProcessCompletion', {
|
|
|
|
index,
|
|
|
|
value: 0,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
this.$store.commit('setProcessCompletion', {
|
|
|
|
index,
|
|
|
|
value: process.completion + 1,
|
|
|
|
})
|
2022-01-10 03:28:09 +00:00
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style>
|
|
|
|
html,
|
|
|
|
body,
|
|
|
|
#__nuxt,
|
|
|
|
#__layout {
|
|
|
|
height: 100%; /* 100vh is broken on mobile. this is the fix. */
|
|
|
|
width: 100vw;
|
|
|
|
}
|
|
|
|
|
|
|
|
html {
|
|
|
|
background: #e5e7eb;
|
|
|
|
overflow-y: hidden;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
main {
|
2022-01-10 07:11:55 +00:00
|
|
|
grid-template-rows: auto minmax(0, 2fr) auto minmax(0, 3fr);
|
2022-01-10 06:08:59 +00:00
|
|
|
transition: background-color 2000ms;
|
2022-01-10 03:28:09 +00:00
|
|
|
}
|
|
|
|
</style>
|