mirror of
https://github.com/em-squared/5e-drs.git
synced 2025-10-30 13:14:20 +00:00
scroll to top + navbar hide on mobile
This commit is contained in:
parent
001a5b8770
commit
83ebe6d06b
2 changed files with 18 additions and 1 deletions
|
|
@ -13,7 +13,13 @@
|
|||
<DefaultGlobalLayout/>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
</v-container>
|
||||
<v-fab-transition>
|
||||
<v-btn color="primary" class="d-print-none" fab bottom right fixed @click="toTop" v-show="toTopButton" v-scroll="onScroll">
|
||||
<v-icon class="d-print-none">mdi-chevron-up</v-icon>
|
||||
</v-btn>
|
||||
</v-fab-transition>
|
||||
</v-content>
|
||||
|
||||
<v-bottom-sheet v-model="cookieConsentDialog" persistent>
|
||||
|
|
@ -48,6 +54,7 @@ export default {
|
|||
data () {
|
||||
return {
|
||||
cookieConsentDialog: true,
|
||||
toTopButton: false
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -109,6 +116,16 @@ export default {
|
|||
setCookieConsent () {
|
||||
Cookies.set('heros-et-dragons-cookies', 'compris')
|
||||
this.cookieConsentDialog = false
|
||||
},
|
||||
|
||||
onScroll (e) {
|
||||
if (typeof window === 'undefined') return
|
||||
const top = window.pageYOffset || e.target.scrollTop || 0
|
||||
this.toTopButton = top > 20
|
||||
},
|
||||
|
||||
toTop () {
|
||||
this.$vuetify.goTo(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue