mirror of
				https://github.com/em-squared/5e-drs.git
				synced 2025-10-30 21:24:18 +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
				
			
		|  | @ -1,5 +1,5 @@ | |||
| <template> | ||||
|   <v-app-bar :clipped-left="$vuetify.breakpoint.lgAndUp" :clipped-right="$vuetify.breakpoint.lgAndUp" app color="#563f5a" dark> | ||||
|   <v-app-bar :clipped-left="$vuetify.breakpoint.lgAndUp" :clipped-right="$vuetify.breakpoint.lgAndUp" :hide-on-scroll="$vuetify.breakpoint.mdAndDown" app color="#563f5a" dark> | ||||
|     <v-app-bar-nav-icon @click.stop="setDrawer" /> | ||||
|     <v-toolbar-title class="ml-0 mr-4 pl-4"> | ||||
|       <v-btn class="hidden-sm-and-down site-title" text link :to="{ path: '/' }"><img src="/dragon_blanc.svg" /> {{ $site.title }}</v-btn> | ||||
|  |  | |||
|  | @ -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
	
	 Maxime Moraine
						Maxime Moraine