File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
lires_web/src/components/common Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change 5252 _currentDarkTheme .value = ! _currentDarkTheme .value ;
5353 }
5454
55+ const mainDiv = ref (null as HTMLDivElement | null );
56+ let lastScrollTop = 0 ;
57+ window .addEventListener (' scroll' , function () {
58+ const scrollTop = window .scrollY || document .documentElement .scrollTop ;
59+ if (scrollTop > lastScrollTop ) {
60+ // Scrolling down
61+ mainDiv .value ! .classList .add (' hidden' );
62+ } else {
63+ // Scrolling up
64+ mainDiv .value ! .classList .remove (' hidden' );
65+ }
66+ lastScrollTop = scrollTop ;
67+ });
68+
5569 </script >
5670
5771<template >
58- <div class =" main shadow" >
72+ <div class =" main-banner shadow" ref = " mainDiv " >
5973 <div class =" button" >
6074 <BannerIcon v-if =" props.returnHome" :iconSrc =" homeIcon" labelText =" Home" shortcut =" ctrl+h"
6175 @onClick =" ()=>{router.push('/')}" title =" home" />
7791</template >
7892
7993<style scoped>
80- div .main {
94+ div .main-banner {
8195 position : fixed ;
8296 top : 10px ;
8397 left : 10px ;
94108 font-size : small ;
95109 height : 30px ;
96110 z-index : 1 ;
111+ transition : top 0.25s ease-in-out ;
112+ }
113+ div .main-banner.hidden {
114+ top : -30px ;
97115 }
98116 div .button {
99117 display : flex ;
You can’t perform that action at this time.
0 commit comments