diff --git a/website/client/app.vue b/website/client/app.vue index 7002bdb5c8..dbf6de6ce1 100644 --- a/website/client/app.vue +++ b/website/client/app.vue @@ -15,15 +15,16 @@ div router-view(v-if="!isUserLoggedIn || isStaticPage") template(v-else) template(v-if="isUserLoaded") - div.resting-banner(v-if="showRestingBanner") + div.resting-banner(v-show="showRestingBanner", ref="restingBanner") span.content - span.label {{ $t('innCheckOutBanner') }} - span.separator | + span.label.d-inline.d-sm-none {{ $t('innCheckOutBannerShort') }} + span.label.d-none.d-sm-inline {{ $t('innCheckOutBanner') }} + span.separator | span.resume(@click="resumeDamage()") {{ $t('resumeDamage') }} div.closepadding(@click="hideBanner()") span.svg-icon.inline.icon-10(aria-hidden="true", v-html="icons.close") notifications-display - app-menu(:class='{"restingInn": showRestingBanner}') + app-menu(:class='{"restingInn": showRestingBanner}' :style="{ marginTop: bannerHeight + 'px' }") .container-fluid app-header(:class='{"restingInn": showRestingBanner}') buyModal( @@ -102,7 +103,7 @@ div @@ -223,6 +220,7 @@ export default { loading: true, currentTipNumber: 0, bannerHidden: false, + bannerHeight: 0, }; }, computed: { @@ -413,7 +411,6 @@ export default { this.$store.watch(state => state.title, (title) => { document.title = title; }); - this.$nextTick(() => { // Load external scripts after the app has been rendered Analytics.load(); @@ -431,6 +428,14 @@ export default { this.hideLoadingScreen(); + window.addEventListener('resize', this.setBannerOffset); + // Adjust the positioning of the header banners + this.$watch('showRestingBanner', () => { + this.$nextTick(() => { + this.setBannerOffset(); + }); + }, {immediate: true}); + // Adjust the timezone offset if (this.user.preferences.timezoneOffset !== this.browserTimezoneOffset) { this.$store.dispatch('user:set', { @@ -457,6 +462,7 @@ export default { this.$root.$off('bv::show::modal'); this.$root.$off('buyModal::showItem'); this.$root.$off('selectMembersModal::showItem'); + window.removeEventListener('resize', this.setBannerOffset); }, mounted () { // Remove the index.html loading screen and now show the inapp loading @@ -615,10 +621,22 @@ export default { }, hideBanner () { this.bannerHidden = true; + this.setBannerOffset(); }, resumeDamage () { this.$store.dispatch('user:sleep'); }, + setBannerOffset () { + let contentPlacement = 0; + if (this.showRestingBanner && this.$refs.restingBanner !== undefined) { + contentPlacement = this.$refs.restingBanner.clientHeight; + } + this.bannerHeight = contentPlacement; + let smartBanner = document.getElementsByClassName('smartbanner')[0]; + if (smartBanner !== undefined) { + smartBanner.style.top = `${contentPlacement}px`; + } + }, }, }; diff --git a/website/client/components/settings/site.vue b/website/client/components/settings/site.vue index 66b7efe19b..26410ec7ef 100644 --- a/website/client/components/settings/site.vue +++ b/website/client/components/settings/site.vue @@ -4,7 +4,7 @@ reset-modal delete-modal h1.col-12 {{ $t('settings') }} - .col-6 + .col-sm-6 .form-horizontal h5 {{ $t('language') }} select.form-control(:value='user.preferences.language', @@ -105,7 +105,7 @@ p(v-html="$t('timezoneUTC', {utc: timezoneOffsetToUtc})") p(v-html="$t('timezoneInfo')") - .col-6 + .col-sm-6 h2 {{ $t('registration') }} .panel-body div diff --git a/website/common/locales/en/groups.json b/website/common/locales/en/groups.json index 75bc3e23cd..4a7c0d5c96 100644 --- a/website/common/locales/en/groups.json +++ b/website/common/locales/en/groups.json @@ -6,6 +6,7 @@ "innText": "You're resting in the Inn! While checked-in, your Dailies won't hurt you at the day's end, but they will still refresh every day. Be warned: If you are participating in a Boss Quest, the Boss will still damage you for your Party mates' missed Dailies unless they are also in the Inn! Also, your own damage to the Boss (or items collected) will not be applied until you check out of the Inn.", "innTextBroken": "You're resting in the Inn, I guess... While checked-in, your Dailies won't hurt you at the day's end, but they will still refresh every day... If you are participating in a Boss Quest, the Boss will still damage you for your Party mates' missed Dailies... unless they are also in the Inn... Also, your own damage to the Boss (or items collected) will not be applied until you check out of the Inn... so tired...", "innCheckOutBanner": "You are currently checked into the Inn. Your Dailies won't damage you and you won't make progress towards Quests.", + "innCheckOutBannerShort": "You are checked into the Inn.", "resumeDamage": "Resume Damage", "helpfulLinks": "Helpful Links", "communityGuidelinesLink": "Community Guidelines",