fix(shops): lots of layout corrections

This commit is contained in:
Sabe Jones
2024-05-15 17:28:39 -05:00
parent 4d38880249
commit 7e7ce44c77
14 changed files with 166 additions and 153 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

View File

@@ -0,0 +1,90 @@
.featured-label {
margin: 24px auto;
}
.group {
display: inline-block;
width: 33%;
margin-bottom: 24px;
.items {
border-radius: 2px;
background-color: #edecee;
display: inline-block;
padding: 8px;
}
.item-wrapper {
margin-bottom: 0;
}
.items > div:not(:last-of-type) {
margin-right: 16px;
}
}
.timeTravelers {
.standard-page {
position: relative;
}
.badge-pin:not(.pinned) {
display: none;
}
.item:hover .badge-pin {
display: block;
}
.avatar {
cursor: default;
margin: 0 auto;
}
.featuredItems {
height: 216px;
.background {
background-repeat: repeat-x;
width: 100%;
position: absolute;
top: 0;
left: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.background-open, .background-closed {
height: 216px;
}
.content {
display: flex;
flex-direction: column;
}
.npc {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 216px;
background-repeat: no-repeat;
&.closed {
background-repeat: no-repeat;
}
.featured-label {
position: absolute;
bottom: -14px;
margin: 0;
left: 78px;
}
}
}
}

View File

@@ -60,9 +60,8 @@ h1 {
h2 { h2 {
font-size: 20px; font-size: 20px;
line-height: 28px; line-height: 1.4;
margin-bottom: 16px; margin-bottom: 16px;
color: $purple-300;
} }
h3, h4 { h3, h4 {

View File

@@ -200,7 +200,7 @@ export default {
margin-top: -5px; margin-top: -5px;
} }
} }
&.color, &.bangs, &.beard, &.flower { &.color, &.bangs, &.beard, &.flower, &.mustache {
background-position-x: -6px; background-position-x: -6px;
background-position-y: -12px; background-position-y: -12px;
} }

View File

@@ -573,10 +573,14 @@
} }
#avatar-modal { #avatar-modal {
h2 {
color: $purple-300;
}
.avatar { .avatar {
cursor: auto; cursor: auto;
&:not(.new-user) { &:not(.new-user)[class*=background] {
box-shadow: 0px 1px 3px 0px rgba(26, 24, 29, 0.12), 0px 1px 2px 0px rgba(26, 24, 29, 0.24); box-shadow: 0px 1px 3px 0px rgba(26, 24, 29, 0.12), 0px 1px 2px 0px rgba(26, 24, 29, 0.24);
} }

View File

@@ -444,7 +444,7 @@ export default {
const isSearched = !searchText || item.text() const isSearched = !searchText || item.text()
.toLowerCase() .toLowerCase()
.indexOf(searchText) !== -1; .indexOf(searchText) !== -1;
if (isSearched) { if (isSearched && item) {
itemsArray.push({ itemsArray.push({
...item, ...item,
class: `${group.classPrefix}${item.key}`, class: `${group.classPrefix}${item.key}`,

View File

@@ -33,6 +33,12 @@
class="npc" class="npc"
:style="{'background-image': imageURLs.npc}" :style="{'background-image': imageURLs.npc}"
> >
<div class="featured-label">
<span class="rectangle"></span><span
v-once
class="text"
>{{ $t('customizationsNPC') }}</span><span class="rectangle"></span>
</div>
</div> </div>
</div> </div>
<div class="p-4"> <div class="p-4">
@@ -81,6 +87,7 @@
<style lang="scss" scoped> <style lang="scss" scoped>
@import '~@/assets/scss/colors.scss'; @import '~@/assets/scss/colors.scss';
@import '~@/assets/scss/shops.scss';
h1 { h1 {
color: $purple-200; color: $purple-200;
@@ -90,6 +97,11 @@
height: 216px; height: 216px;
} }
.featured-label {
margin-left: 52px;
margin-top: 200px;
}
.npc { .npc {
background-repeat: no-repeat; background-repeat: no-repeat;
} }
@@ -131,16 +143,9 @@ export default {
return Object.values(this.viewOptions).some(g => g.selected); return Object.values(this.viewOptions).some(g => g.selected);
}, },
imageURLs () { imageURLs () {
const currentEvent = this.currentEventList?.find(event => Boolean(event.season));
if (!currentEvent) {
return {
background: 'url(/static/npc/normal/market_background.png)',
npc: 'url(/static/npc/normal/market_banner_npc.png)',
};
}
return { return {
background: `url(/static/npc/${currentEvent.season}/market_background.png)`, background: 'url(/static/npc/normal/customizations_background.png)',
npc: `url(/static/npc/${currentEvent.season}/market_banner_npc.png)`, npc: 'url(/static/npc/normal/customizations_npc.png)',
}; };
}, },
shop () { shop () {

View File

@@ -400,6 +400,10 @@ export default {
featuredGearBought: false, featuredGearBought: false,
currentEvent: null, currentEvent: null,
backgroundUpdate: new Date(), backgroundUpdate: new Date(),
imageURLs: {
background: '',
npc: '',
},
}; };
}, },
computed: { computed: {
@@ -470,29 +474,16 @@ export default {
} }
return []; return [];
}, },
anyFilterSelected () { anyFilterSelected () {
return Object.values(this.viewOptions).some(g => g.selected); return Object.values(this.viewOptions).some(g => g.selected);
}, },
imageURLs () {
if (!this.seasonal.opened || !this.currentEvent || !this.currentEvent.season) {
return {
background: 'url(/static/npc/normal/seasonal_shop_closed_background.png)',
npc: 'url(/static/npc/normal/seasonal_shop_closed_npc.png)',
};
}
return {
background: `url(/static/npc/${this.currentEvent.season}/seasonal_shop_opened_background.png)`,
npc: `url(/static/npc/${this.currentEvent.season}/seasonal_shop_opened_npc.png)`,
};
},
}, },
watch: { watch: {
searchText: _throttle(function throttleSearch () { searchText: _throttle(function throttleSearch () {
this.searchTextThrottled = this.searchText.toLowerCase(); this.searchTextThrottled = this.searchText.toLowerCase();
}, 250), }, 250),
}, },
mounted () { async mounted () {
this.$store.dispatch('common:setTitle', { this.$store.dispatch('common:setTitle', {
subSection: this.$t('seasonalShop'), subSection: this.$t('seasonalShop'),
section: this.$t('shops'), section: this.$t('shops'),
@@ -502,8 +493,10 @@ export default {
this.backgroundUpdate = new Date(); this.backgroundUpdate = new Date();
}); });
this.triggerGetWorldState(); await this.triggerGetWorldState();
this.currentEvent = _find(this.currentEventList, event => Boolean(['winter', 'spring', 'summer', 'fall'].includes(event.season))); this.currentEvent = _find(this.currentEventList, event => Boolean(['winter', 'spring', 'summer', 'fall'].includes(event.season)));
this.imageURLs.background = `url(/static/npc/${this.currentEvent.season}/seasonal_shop_opened_background.png)`;
this.imageURLs.npc = `url(/static/npc/${this.currentEvent.season}/seasonal_shop_opened_npc.png)`;
}, },
beforeDestroy () { beforeDestroy () {
this.$root.$off('buyModal::boughtItem'); this.$root.$off('buyModal::boughtItem');

View File

@@ -99,6 +99,8 @@
:item-margin="24" :item-margin="24"
:type="category.identifier" :type="category.identifier"
:fold-button="false" :fold-button="false"
:no-items-label="$t('allEquipmentOwned')"
:click-handler="false"
> >
<template <template
slot="item" slot="item"
@@ -163,105 +165,10 @@
</div> </div>
</template> </template>
<!-- eslint-disable max-len --> <style lang="scss" scoped>
<style lang="scss">
@import '~@/assets/scss/colors.scss'; @import '~@/assets/scss/colors.scss';
@import '~@/assets/scss/shops.scss';
// these styles may be applied to other pages too
.featured-label {
margin: 24px auto;
}
.group {
display: inline-block;
width: 33%;
margin-bottom: 24px;
.items {
border-radius: 2px;
background-color: #edecee;
display: inline-block;
padding: 8px;
}
.item-wrapper {
margin-bottom: 0;
}
.items > div:not(:last-of-type) {
margin-right: 16px;
}
}
.timeTravelers {
.standard-page {
position: relative;
}
.badge-pin:not(.pinned) {
display: none;
}
.item:hover .badge-pin {
display: block;
}
.avatar {
cursor: default;
margin: 0 auto;
}
.featuredItems {
height: 216px;
.background {
background-repeat: repeat-x;
width: 100%;
position: absolute;
top: 0;
left: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.background-open, .background-closed {
height: 216px;
}
.content {
display: flex;
flex-direction: column;
}
.npc {
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 216px;
background-repeat: no-repeat;
&.closed {
background-repeat: no-repeat;
}
.featured-label {
position: absolute;
bottom: -14px;
margin: 0;
left: 78px;
}
}
}
}
</style> </style>
<!-- eslint-enable max-len -->
<script> <script>
import _filter from 'lodash/filter'; import _filter from 'lodash/filter';
@@ -328,6 +235,11 @@ export default {
backgroundUpdate: new Date(), backgroundUpdate: new Date(),
currentEvent: null, currentEvent: null,
imageURLs: {
background: '',
npc: '',
},
}; };
}, },
computed: { computed: {
@@ -388,19 +300,6 @@ export default {
anyFilterSelected () { anyFilterSelected () {
return Object.values(this.viewOptions).some(g => g.selected); return Object.values(this.viewOptions).some(g => g.selected);
}, },
imageURLs () {
if (!this.currentEvent || !this.currentEvent.season || this.currentEvent.season === 'thanksgiving') {
return {
background: 'url(/static/npc/normal/time_travelers_background.png)',
npc: this.closed ? 'url(/static/npc/normal/time_travelers_closed_banner.png)'
: 'url(/static/npc/normal/time_travelers_open_banner.png)',
};
}
return {
background: `url(/static/npc/${this.currentEvent.season}/time_travelers_background.png)`,
npc: `url(/static/npc/${this.currentEvent.season}/time_travelers_open_banner.png)`,
};
},
}, },
watch: { watch: {
searchText: _throttle(function throttleSearch () { searchText: _throttle(function throttleSearch () {
@@ -421,6 +320,14 @@ export default {
} }
}); });
this.currentEvent = _find(this.currentEventList, event => Boolean(['winter', 'spring', 'summer', 'fall'].includes(event.season))); this.currentEvent = _find(this.currentEventList, event => Boolean(['winter', 'spring', 'summer', 'fall'].includes(event.season)));
if (!this.currentEvent || !this.currentEvent.season || this.currentEvent.season === 'thanksgiving' || this.closed) {
this.imageURLs.background = 'url(/static/npc/normal/time_travelers_background.png)';
this.imageURLs.npc = this.closed ? 'url(/static/npc/normal/time_travelers_closed_banner.png)'
: 'url(/static/npc/normal/time_travelers_open_banner.png)';
} else {
this.imageURLs.background = `url(/static/npc/${this.currentEvent.season}/time_travelers_background.png)`;
this.imageURLs.npc = `url(/static/npc/${this.currentEvent.season}/time_travelers_open_banner.png)`;
}
}, },
beforeDestroy () { beforeDestroy () {
this.$root.$off('buyModal::boughtItem'); this.$root.$off('buyModal::boughtItem');

View File

@@ -14,11 +14,18 @@
</div> </div>
<div v-if="items.length === 0"> <div v-if="items.length === 0">
<p <p
v-if="clickHandler"
class="empty-state" class="empty-state"
@click.stop.prevent="$emit('emptyClick', $event)" @click.stop.prevent="$emit('emptyClick', $event)"
v-html="noItemsLabel" v-html="noItemsLabel"
> >
</p> </p>
<p
v-else
class="empty-state"
v-html="noItemsLabel"
>
</p>
</div> </div>
<show-more-button <show-more-button
v-if="foldButton && items.length > itemsPerRow" v-if="foldButton && items.length > itemsPerRow"
@@ -57,27 +64,31 @@ export default {
}, },
mixins: [openedItemRowsMixin], mixins: [openedItemRowsMixin],
props: { props: {
items: { clickHandler: {
type: Array, type: Boolean,
default: true,
}, },
type: { foldButton: {
type: String, type: Boolean,
default: true,
},
itemMargin: {
type: Number,
}, },
itemWidth: { itemWidth: {
type: Number, type: Number,
}, },
itemMargin: { items: {
type: Array,
},
maxItemsPerRow: {
type: Number, type: Number,
}, },
noItemsLabel: { noItemsLabel: {
type: String, type: String,
}, },
maxItemsPerRow: { type: {
type: Number, type: String,
},
foldButton: {
type: Boolean,
default: true,
}, },
}, },
data () { data () {

View File

@@ -1,6 +1,6 @@
<template> <template>
<button <button
class="btn btn-flat btn-show-more mt-2" class="btn btn-flat btn-show-more mt-2 mb-3"
@click="$emit('click')" @click="$emit('click')"
> >
<span class="button-text"> <span class="button-text">

View File

@@ -135,5 +135,7 @@
"checkNextSeason": "Be sure to check back later for next season's options!", "checkNextSeason": "Be sure to check back later for next season's options!",
"noItemsOwned": "You don't own any of these items", "noItemsOwned": "You don't own any of these items",
"visitCustomizationsShop": "Head over to the <a href='/shops/customizations'>Customizations Shop</a> to browse the many ways you can customize your avatar!", "visitCustomizationsShop": "Head over to the <a href='/shops/customizations'>Customizations Shop</a> to browse the many ways you can customize your avatar!",
"lookingForMore": "Looking for more?" "lookingForMore": "Looking for more?",
"allEquipmentOwned": "You own all of these items. You can find them in your <a href='/inventory/equipment'>Equipment</a>. Be sure to check back later for next month's options!",
"customizationsNPC": "Felicitus Fennec"
} }

View File

@@ -364,7 +364,9 @@ shops.getTimeTravelersCategories = function getTimeTravelersCategories (user, la
backgroundCategory.items.push(item); backgroundCategory.items.push(item);
} }
} }
categories.push(backgroundCategory); if (backgroundCategory.length > 0) {
categories.push(backgroundCategory);
}
for (const type of Object.keys(stable)) { for (const type of Object.keys(stable)) {
const category = { const category = {