2017-07-18 04:18:17 +00:00
|
|
|
<template lang="pug">
|
2017-07-29 22:08:36 +00:00
|
|
|
.standard-page.container
|
|
|
|
|
.row(v-for='(category, key) in achievements')
|
|
|
|
|
h2.col-12 {{ $t(key+'Achievs') }}
|
|
|
|
|
.col-3.text-center(v-for='achievment in category.achievements')
|
|
|
|
|
div.achievement-container(:data-popover-html='achievment.title + achievment.text',
|
|
|
|
|
popover-placement='achievPopoverPlacement',
|
|
|
|
|
popover-append-to-body='achievAppendToBody')
|
|
|
|
|
div(popover-trigger='mouseenter',
|
|
|
|
|
:data-popover-html='achievment.title + achievment.text',
|
|
|
|
|
popover-placement='achievPopoverPlacement',
|
|
|
|
|
popover-append-to-body='achievAppendToBody')
|
|
|
|
|
.achievement(:class='achievment.icon + "2x"', v-if='achievment.earned')
|
|
|
|
|
.counter.badge.badge-info.stack-count(v-if='achievment.optionalCount') {{achievment.optionalCount}}
|
|
|
|
|
.achievement(class='achievement-unearned2x', v-if='!achievment.earned')
|
2017-07-18 04:18:17 +00:00
|
|
|
.row
|
2017-07-29 22:08:36 +00:00
|
|
|
.col-6
|
|
|
|
|
h2 Challeges Won
|
2017-07-18 04:18:17 +00:00
|
|
|
div(v-for='chal in user.achievements.challenges')
|
|
|
|
|
span {{chal}}
|
2017-07-29 22:08:36 +00:00
|
|
|
.col-6
|
|
|
|
|
h2 Quests Completed
|
2017-07-18 04:18:17 +00:00
|
|
|
div(v-for='(value, key) in user.achievements.quests')
|
|
|
|
|
span {{ content.quests[k].text() }}
|
|
|
|
|
span {{ value }}
|
|
|
|
|
</template>
|
|
|
|
|
|
2017-07-29 22:08:36 +00:00
|
|
|
<style lang="scss" scoped>
|
2017-07-18 04:18:17 +00:00
|
|
|
h2 {
|
|
|
|
|
margin-top: 2em;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.achievement-container {
|
|
|
|
|
margin-bottom: 1em;
|
2017-07-29 22:08:36 +00:00
|
|
|
padding: 2em;
|
|
|
|
|
background: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.achievement {
|
|
|
|
|
margin: 0 auto;
|
2017-07-18 04:18:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.counter.badge {
|
|
|
|
|
color: #fff;
|
|
|
|
|
position: absolute;
|
2017-07-29 22:08:36 +00:00
|
|
|
top: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
background-color: #ff944c;
|
2017-07-18 04:18:17 +00:00
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { mapState } from 'client/libs/store';
|
|
|
|
|
|
|
|
|
|
import achievementsLib from '../../../common/script/libs/achievements';
|
|
|
|
|
import Content from '../../../common/script/content';
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
data () {
|
|
|
|
|
return {
|
|
|
|
|
achievements: {},
|
|
|
|
|
content: Content,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
mounted () {
|
|
|
|
|
this.achievements = achievementsLib.getAchievementsForProfile(this.user);
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
...mapState({user: 'user.data'}),
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|