Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show EquipGearModal on Item-Click - misc fixes
- Loading branch information
Showing
5 changed files
with
201 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,6 @@ | |
line-height: 1.2; | ||
text-align: center; | ||
color: $gray-50; | ||
display: inline-block; | ||
} | ||
|
||
.text { | ||
|
172 changes: 172 additions & 0 deletions
172
website/client/components/inventory/equipment/equipGearModal.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
<template lang="pug"> | ||
b-modal#equipgear-modal( | ||
:visible="true", | ||
v-if="item != null", | ||
:hide-header="true", | ||
@change="onChange($event)" | ||
) | ||
div.close | ||
span.svg-icon.inline.icon-10(aria-hidden="true", v-html="icons.close", @click="hideDialog()") | ||
|
||
div.content(v-if="item != null") | ||
|
||
div.inner-content | ||
avatar( | ||
:member="user", | ||
:avatarOnly="true", | ||
:withBackground="true", | ||
:overrideAvatarGear="memberOverrideAvatarGear(item)" | ||
) | ||
|
||
h4.title {{ itemText }} | ||
div.text(v-html="itemNotes") | ||
|
||
equipmentAttributesGrid.bordered( | ||
:item="item", | ||
v-if="attributesGridVisible" | ||
) | ||
|
||
button.btn.btn-primary(@click="equipItem()") {{ $t(isEquipped ? 'unequip' : 'equip') }} | ||
|
||
div.clearfix(slot="modal-footer") | ||
|
||
|
||
</template> | ||
<style lang="scss"> | ||
@import '~client/assets/scss/colors.scss'; | ||
@import '~client/assets/scss/modal.scss'; | ||
#equipgear-modal { | ||
@include centeredModal(); | ||
.content { | ||
text-align: center; | ||
} | ||
.item-wrapper { | ||
margin-bottom: 0 !important; | ||
} | ||
.inner-content { | ||
margin: 33px auto auto; | ||
width: 282px; | ||
} | ||
.bordered { | ||
border-radius: 2px; | ||
background-color: #f9f9f9; | ||
margin-bottom: 24px; | ||
padding: 24px 24px 10px; | ||
} | ||
.avatar { | ||
display: inline-block; | ||
cursor: inherit; | ||
} | ||
.content-text { | ||
font-family: 'Roboto', sans-serif; | ||
font-size: 14px; | ||
font-weight: normal; | ||
line-height: 1.43; | ||
width: 400px; | ||
} | ||
button.btn.btn-primary { | ||
margin-top: 24px; | ||
margin-bottom: 24px; | ||
} | ||
} | ||
</style> | ||
|
||
<script> | ||
import { mapState } from 'client/libs/store'; | ||
import bModal from 'bootstrap-vue/lib/components/modal'; | ||
import svgClose from 'assets/svg/close.svg'; | ||
import Avatar from 'client/components/avatar'; | ||
import EquipmentAttributesGrid from 'client/components/shops/market/equipmentAttributesGrid.vue'; | ||
export default { | ||
components: { | ||
bModal, | ||
Avatar, | ||
EquipmentAttributesGrid, | ||
}, | ||
data () { | ||
return { | ||
icons: Object.freeze({ | ||
close: svgClose, | ||
}), | ||
}; | ||
}, | ||
computed: { | ||
...mapState({ | ||
content: 'content', | ||
user: 'user.data', | ||
}), | ||
itemText () { | ||
if (this.item.text instanceof Function) { | ||
return this.item.text(); | ||
} else { | ||
return this.item.text; | ||
} | ||
}, | ||
itemNotes () { | ||
if (this.item.notes instanceof Function) { | ||
return this.item.notes(); | ||
} else { | ||
return this.item.notes; | ||
} | ||
}, | ||
attributesGridVisible () { | ||
if (this.costumeMode) { | ||
return false; | ||
} | ||
if (this.item.str === 0 | ||
&& this.item.int === 0 | ||
&& this.item.per === 0 | ||
&& this.item.con === 0) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
}, | ||
methods: { | ||
onChange ($event) { | ||
this.$emit('change', $event); | ||
}, | ||
equipItem () { | ||
this.$emit('equipItem', this.item); | ||
this.hideDialog(); | ||
}, | ||
hideDialog () { | ||
this.$root.$emit('hide::modal', 'equipgear-modal'); | ||
}, | ||
memberOverrideAvatarGear (gear) { | ||
return { | ||
[gear.type]: gear.key, | ||
}; | ||
}, | ||
}, | ||
props: { | ||
item: { | ||
type: Object, | ||
}, | ||
priceType: { | ||
type: String, | ||
}, | ||
costumeMode: { | ||
type: Boolean, | ||
}, | ||
isEquipped: { | ||
type: Boolean, | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters