mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 13:47:33 +01:00
* add achievements to user * add placeholder strings * add to achievements to common script * add onboarding achievements category * add notifications * more notifications * award achievements * wip notification panel * add achievements icons and copy * do not count onboarding tasks for the created task achievement * add notes * sprites, fixes and completion status and reward * add onboarding panel * add toggle * fix toggle size * fix tests * fix typo * add notification * start adding modal * fix remove button positionin, timeout, progress bar * modal + fixes * disable broken social links from level up modal * change toggle icon color on hover * add border bottom to onboarding guide panel * add collapse animation * expanded onboarding on first open * onboarding: flip toggle colors * onboarding: show progress bar all the time * onboarding: fix panel closing on click * onboarding modal: add close icon and fix padding * wip: add migration for existing users * fix titles in guide * fix achievements copy * do not award completed task achievement when direction is down * start implementing new achievements * start migrating client * remove social links from achievements modals * prevent skipping tutorial + fix achievement notification * sync fixes * start redesign achievement modal * misc fixes to achievements, polish generic achievement modal and hatched pet modal * add special badge for onboarding * fix badge condition * modals fixes * hatched pet modal: add close icon * fix badge typo * fix justin button * new scrolling behavior for dropdowns * fix strings capitalization * add common tests * add api unit tests * add date check * achievements modal polishing * typos * add toggle for achievements categories * typo * fix test * fix edit avatar modal cannot be closed * finish migration and correct launch date * fix migration * migration fixes * fix tests
143 lines
2.6 KiB
Vue
143 lines
2.6 KiB
Vue
<template>
|
|
<b-modal
|
|
id="hatchedPet-modal"
|
|
:hide-header="true"
|
|
>
|
|
<span
|
|
class="close-icon svg-icon inline icon-10"
|
|
@click="close()"
|
|
v-html="icons.close"
|
|
></span>
|
|
<div
|
|
v-if="pet != null"
|
|
class="content"
|
|
>
|
|
<div
|
|
v-once
|
|
class="dialog-header title"
|
|
>
|
|
{{ $t('hatchedPetGeneric') }}
|
|
</div>
|
|
<div class="inner-content">
|
|
<div class="pet-background d-flex align-items-center">
|
|
<div :class="pet.class"></div>
|
|
</div>
|
|
<h4 class="title">
|
|
{{ pet.name }}
|
|
</h4>
|
|
<div
|
|
v-if="!hideText"
|
|
v-markdown="$t('hatchedPetHowToUse', { stableUrl: '/inventory/stable' })"
|
|
class="text"
|
|
></div>
|
|
<button
|
|
class="btn btn-primary"
|
|
@click="close()"
|
|
>
|
|
{{ $t('onward') }}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<div
|
|
slot="modal-footer"
|
|
class="clearfix"
|
|
></div>
|
|
</b-modal>
|
|
</template>
|
|
|
|
<style lang="scss">
|
|
@import '~@/assets/scss/colors.scss';
|
|
@import '~@/assets/scss/modal.scss';
|
|
|
|
#hatchedPet-modal {
|
|
@include centeredModal();
|
|
|
|
.modal-dialog {
|
|
width: 330px;
|
|
}
|
|
|
|
.modal-footer {
|
|
padding-top: 0px;
|
|
}
|
|
|
|
.content {
|
|
text-align: center;
|
|
}
|
|
|
|
.inner-content {
|
|
margin: 24px auto auto;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
}
|
|
|
|
.pet-background {
|
|
width: 112px;
|
|
height: 112px;
|
|
border-radius: 4px;
|
|
background-color: $gray-700;
|
|
}
|
|
|
|
.Pet {
|
|
margin: auto;
|
|
}
|
|
|
|
.dialog-header {
|
|
color: $purple-200;
|
|
margin-top: 16px;
|
|
}
|
|
|
|
.text {
|
|
margin-bottom: 24px;
|
|
min-height: 0;
|
|
|
|
&.markdown {
|
|
p {
|
|
margin-bottom: 0px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
import markdownDirective from '@/directives/markdown';
|
|
import svgClose from '@/assets/svg/close.svg';
|
|
|
|
export default {
|
|
directives: {
|
|
markdown: markdownDirective,
|
|
},
|
|
props: {
|
|
hideText: {
|
|
type: Boolean,
|
|
},
|
|
},
|
|
data () {
|
|
return {
|
|
pet: null,
|
|
icons: Object.freeze({
|
|
close: svgClose,
|
|
}),
|
|
};
|
|
},
|
|
mounted () {
|
|
this.$root.$on('hatchedPet::open', this.openDialog);
|
|
},
|
|
destroyed () {
|
|
this.$root.$off('hatchedPet::open', this.openDialog);
|
|
},
|
|
methods: {
|
|
openDialog (item) {
|
|
this.pet = item;
|
|
this.$root.$emit('bv::show::modal', 'hatchedPet-modal');
|
|
},
|
|
close () {
|
|
this.$emit('closed', this.item);
|
|
this.$root.$emit('bv::hide::modal', 'hatchedPet-modal');
|
|
this.pet = null;
|
|
},
|
|
},
|
|
};
|
|
</script>
|