@@ -1,16 +1,44 @@ | |||||
<template> | <template> | ||||
<div class="battleground" v-if="battleground"> | <div class="battleground" v-if="battleground"> | ||||
<div>Welcome to {{ battleground.name }}</div> | <div>Welcome to {{ battleground.name }}</div> | ||||
<Objective></Objective> | |||||
<div id="objectives" class="objectives"> | |||||
<div class="row" v-for="objectiveRow in battleground.objectives"> | |||||
<template v-for="objective in objectiveRow"> | |||||
<Objective :objective="objective"></Objective> | |||||
</template> | |||||
</div> | |||||
</div> | |||||
<router-link to="/battlegrounds">Back to selector</router-link> | <router-link to="/battlegrounds">Back to selector</router-link> | ||||
</div> | </div> | ||||
</template> | </template> | ||||
<style lang="sass" scoped> | |||||
$border-style: 1px solid #66CCFF | |||||
.objectives | |||||
display: flex | |||||
flex-direction: column | |||||
height: 70vh | |||||
.row | |||||
display: flex | |||||
justify-content: space-between | |||||
flex-grow: 1 | |||||
&:first-child | |||||
border-top: $border-style | |||||
border-bottom: $border-style | |||||
.objective | |||||
&:first-child | |||||
border-left: $border-style | |||||
border-right: $border-style | |||||
</style> | |||||
<script> | <script> | ||||
import BATTLEGROUNDS from '../gameInfos/maps' | |||||
import BATTLEGROUNDS from '@/gameInfos/battlegrounds' | |||||
import Timer from '@/components/Battleground/Timer' | import Timer from '@/components/Battleground/Timer' | ||||
import Objective from '@/components/Battleground/Objective' | import Objective from '@/components/Battleground/Objective' | ||||
export default { | export default { | ||||
name: 'Battleground', | name: 'Battleground', | ||||
data () { | data () { | ||||
@@ -34,6 +62,3 @@ | |||||
} | } | ||||
</script> | </script> | ||||
<style lang="sass"> | |||||
</style> |
@@ -1,23 +1,30 @@ | |||||
<template> | <template> | ||||
<div class="objective" :click="onClick"> | |||||
<div>Here is the picture</div> | |||||
<div class="objective" > | |||||
<div> | |||||
{{ objective.name }} | |||||
<span v-if="objective.position"> ({{ objective.position }})</span> | |||||
</div> | |||||
<div>Here is the objective name</div> | |||||
<div><Timer ref="timer" initialTime="90" /></div> | |||||
<div><Timer ref="timer" :initialTime="objective.initialSpawnTime" /></div> | |||||
</div> | </div> | ||||
</template> | </template> | ||||
<style lang="sass" scoped> | |||||
.objective | |||||
width: 100% | |||||
text-align: center | |||||
</style> | |||||
<script> | <script> | ||||
import Timer from '@/components/Battleground/Timer' | import Timer from '@/components/Battleground/Timer' | ||||
export default { | export default { | ||||
name: 'Objective', | name: 'Objective', | ||||
props: { | |||||
objective: Object | |||||
}, | |||||
data () { | data () { | ||||
return { | return { | ||||
name: '', | |||||
initialSpawnTime: 90, | |||||
respawnTime: 120 | |||||
} | } | ||||
}, | }, | ||||
methods: { | methods: { | ||||
@@ -27,7 +34,3 @@ | |||||
} | } | ||||
} | } | ||||
</script> | </script> | ||||
<style scoped> | |||||
</style> |
@@ -30,7 +30,10 @@ | |||||
return (this.currentTime % 60).toLocaleString('en', {minimumIntegerDigits: 2}) | return (this.currentTime % 60).toLocaleString('en', {minimumIntegerDigits: 2}) | ||||
}, | }, | ||||
minutes: function () { | minutes: function () { | ||||
return (Math.floor(this.currentTime / 60) % 60) | |||||
let minutes = Math.floor(this.currentTime / 60) % 60 | |||||
return this.displayHours > 0 | |||||
? minutes.toLocaleString('en', {minimumIntegerDigits: 2}) | |||||
: minutes | |||||
}, | }, | ||||
hours: function () { | hours: function () { | ||||
return (Math.floor(this.currentTime / 3600) % 24) | return (Math.floor(this.currentTime / 3600) % 24) | ||||
@@ -12,7 +12,7 @@ | |||||
</template> | </template> | ||||
<script type="text/javascript"> | <script type="text/javascript"> | ||||
import MAPS from '../gameInfos/maps' | |||||
import MAPS from '../gameInfos/battlegrounds' | |||||
export default { | export default { | ||||
name: 'BattlegroundSelector', | name: 'BattlegroundSelector', | ||||