Skip to content

chore: update time travelers shop to display seasonal backgrounds #15445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions website/client/src/assets/scss/shops.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,10 @@

.background {
background-repeat: repeat-x;

width: 100%;
position: absolute;

top: 0;
left: 0;

display: flex;
flex-direction: column;
justify-content: center;
Expand All @@ -67,6 +64,12 @@
flex-direction: column;
}

.shop-message {
position: relative;
height: 76px;
margin: 71px auto;
}

.npc {
position: absolute;
left: 0;
Expand Down
37 changes: 23 additions & 14 deletions website/client/src/components/shops/timeTravelers/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,36 @@
<div class="featuredItems">
<div
class="background"
:class="{'background-closed': closed, 'background-open': !closed }"
:class="{'background-open': open }"
:style="{'background-image': imageURLs.background}"
>
<div
class="npc"
:class="{'closed': closed }"
:style="{'background-image': imageURLs.npc}"
>
<div class="featured-label">
<div
class="featured-label">
<span class="rectangle"></span><span
v-once
class="text"
>{{ $t('timeTravelers') }}</span><span class="rectangle"></span>
</div>
</div><div
v-if="closed"
</div>
<div
class="content"
>
<div class="featured-label with-border closed">
<span class="rectangle"></span><span
>
<div
v-if="!open || !subscriber"
:class="{'background-open': !open }"
class="shop-message featured-label with-border closed">
<span
class="rectangle">
</span>
<span
v-once
class="text"
>{{ $t('timeTravelersPopoverNoSubMobile') }}</span><span class="rectangle"></span>
>{{ $t('timeTravelersPopoverNoSubMobile') }}</span><span class="rectangle">
</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -234,8 +241,12 @@ export default {
currentEventList: 'worldState.data.currentEventList',
}),

closed () {
return this.user.purchased.plan.consecutive.trinkets === 0;
open () {
return this.user.purchased.plan.consecutive.trinkets > 0;
},

subscriber () {
return this.user.purchased.plan.consecutive.count >= 1;
},

shop () {
Expand Down Expand Up @@ -302,10 +313,8 @@ export default {
}
});
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) {
if (!this.currentEvent || !this.currentEvent.season || this.currentEvent.season === 'thanksgiving') {
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)`;
Expand Down
2 changes: 1 addition & 1 deletion website/common/locales/en/subscriber.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"subGemName": "Subscriber Gems",
"maxBuyGems": "You have bought all the Gems you can this month. More become available within the first three days of each month. Thanks for subscribing!",
"timeTravelers": "Time Travelers",
"timeTravelersPopoverNoSubMobile": "Looks like you’ll need a Mystic Hourglass to open the time portal and summon the Mysterious Time Travelers.",
"timeTravelersPopoverNoSubMobile": "Subscribers receive a rare Mystic Hourglass every month to use in the Time Travelers Shop!",
"timeTravelersPopover": "Your Mystic Hourglass has opened our time portal! Choose what you’d like us to fetch from the past or future.",
"mysticHourglassNeededNoSub": "This item requires a Mystic Hourglass. You earn Mystic Hourglasses by being a Habitica subscriber.",
"mysterySetNotFound": "Mystery set not found, or set already owned.",
Expand Down
Loading