diff --git a/kolibri/core/assets/src/views/CorePage/AppBarPage.vue b/kolibri/core/assets/src/views/CorePage/AppBarPage.vue index 1cea45d6330..704fece352f 100644 --- a/kolibri/core/assets/src/views/CorePage/AppBarPage.vue +++ b/kolibri/core/assets/src/views/CorePage/AppBarPage.vue @@ -4,17 +4,20 @@ here or in router, but somewhere -->
- - - + + + + +
- + + + { this.appBarHeight = this.$refs.appBar.$el.scrollHeight || 0; }); + window.addEventListener('scroll', this.handleScroll); + }, + beforeUnmount() { + window.removeEventListener('scroll', this.handleScroll); }, methods: { findFirstEl() { @@ -157,6 +177,19 @@ this.$refs.sideNav.focusFirstEl(); }); }, + handleScroll() { + const scrollTop = window.scrollY; + //Is user scrolling up? + if (scrollTop > this.lastScrollTop) { + this.hideAppBars = false; + } else { + this.hideAppBars = true; + } + + setTimeout(() => { + this.lastScrollTop = scrollTop; + }, 100); + }, }, }; @@ -167,6 +200,30 @@ @import '~kolibri-design-system/lib/styles/definitions'; + .v-leave { + opacity: 1; + } + + .v-leave-active { + transition: opacity 0.5s; + } + + .v-leave-to { + opacity: 0; + } + + .v-enter { + opacity: 0; + } + + .v-enter-active { + transition: opacity 0.5s; + } + + .v-enter-to { + opacity: 1; + } + .app-bar { @extend %dropshadow-8dp;