9
9
<router-view />
10
10
</v-main >
11
11
12
- <!-- This is a replacement for the footer, it'll dissapear on scroll -->
13
- <v-app-bar
14
- padless
15
- color =" white"
16
- bottom
17
- fixed
18
- class =" hidden-xs-and-down"
19
- hide-on-scroll
20
- scroll-threshold =" 300"
21
- height =" 105"
12
+ <v-footer
22
13
v-if =" !(this.$route.name === 'Detail')"
14
+ fixed
15
+ padless
16
+ :class =" { 'footer--hidden': !showFooter }"
23
17
>
24
18
<v-card
25
19
flat
28
22
width =" 100%"
29
23
>
30
24
<v-card-text
31
- class =" py-1"
25
+ class =" ipfsPrimary lighten-1 py-1"
32
26
>
33
27
<v-btn
34
28
v-for =" (link, i) in footer_links"
39
33
>
40
34
<v-icon
41
35
:size =" $vuetify.breakpoint.smAndUp ? 24 : 18"
36
+ color =" white"
42
37
>
43
38
{{ link.icon }}
44
39
</v-icon >
45
40
</v-btn >
46
41
</v-card-text >
42
+ <v-divider
43
+ class =" ipfsPrimary lighten-4"
44
+ />
47
45
<v-card-text
48
46
class =" ipfsPrimary lighten-1 white--text text-center text-caption py-7"
49
47
style =" margin : auto ;"
63
61
</div >
64
62
</v-card-text >
65
63
</v-card >
66
- </v-app-bar >
64
+ </v-footer >
67
65
</v-app >
68
66
</template >
69
67
@@ -75,6 +73,8 @@ export default {
75
73
$el: ' #app' ,
76
74
77
75
data : () => ({
76
+ lastScrollPosition: 0 ,
77
+ showFooter: true ,
78
78
footer_links: [
79
79
{
80
80
icon: ' mdi-mastodon' ,
@@ -104,14 +104,34 @@ export default {
104
104
const isDark = window .matchMedia (' (prefers-color-scheme:dark)' ).matches ;
105
105
this .$vuetify .theme .dark = isDark;
106
106
},
107
+
108
+ onScroll () {
109
+ const currentScrollPosition = window .pageYOffset || document .documentElement .scrollTop ;
110
+ if (currentScrollPosition < 0 ) {
111
+ return ;
112
+ }
113
+ // Scroll threshold
114
+ if (Math .abs (currentScrollPosition - this .lastScrollPosition ) < 300 ) {
115
+ return ;
116
+ }
117
+ this .showFooter = currentScrollPosition < this .lastScrollPosition ;
118
+ this .lastScrollPosition = currentScrollPosition;
119
+ },
120
+
107
121
},
108
122
109
123
mounted () {
110
124
this .$nextTick (() => {
111
125
this .$el .removeAttribute (' hidden' );
112
126
this .setDefaultTheme ();
127
+ window .addEventListener (' scroll' , this .onScroll );
113
128
});
114
129
},
130
+
131
+ beforeDestroy () {
132
+ window .removeEventListener (' scroll' , this .onScroll );
133
+ },
134
+
115
135
};
116
136
</script >
117
137
@@ -124,6 +144,13 @@ export default {
124
144
font-weight : 500 ;
125
145
}
126
146
}
147
+ .v-footer {
148
+ transform : translate3d (0 , 0 , 0 );
149
+ transition : 200ms all ease-in-out ;
150
+ & .footer--hidden {
151
+ transform : translate3d (0 , 100% , 0 );
152
+ }
153
+ }
127
154
</style >
128
155
129
156
<style lang="scss">
0 commit comments