mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
Navbar should stay on top when scrolled all the way and also should have no shadow #587
This commit is contained in:
parent
ef75247f79
commit
60387e9436
@ -16,6 +16,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
transform: translateY(0);
|
transform: translateY(0);
|
||||||
transition: transform 0s;
|
transition: transform 0s;
|
||||||
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hide-navbar {
|
.hide-navbar {
|
||||||
|
@ -104,11 +104,10 @@ export class FrameComponent {
|
|||||||
const down = this.lastScroll.any < scrollPosition;
|
const down = this.lastScroll.any < scrollPosition;
|
||||||
const upDelay = up && this.lastScroll.down > scrollPosition + window.innerHeight * Config.Gallery.NavBar.NavbarShowDelay;
|
const upDelay = up && this.lastScroll.down > scrollPosition + window.innerHeight * Config.Gallery.NavBar.NavbarShowDelay;
|
||||||
const downDelay = down && this.lastScroll.up < scrollPosition - window.innerHeight * Config.Gallery.NavBar.NavbarHideDelay;
|
const downDelay = down && this.lastScroll.up < scrollPosition - window.innerHeight * Config.Gallery.NavBar.NavbarHideDelay;
|
||||||
|
|
||||||
//we are the top where the navbar by default lives
|
//we are the top where the navbar by default lives
|
||||||
if (this.navContainer.nativeElement.offsetHeight > scrollPosition) {
|
if (this.navContainer.nativeElement.offsetHeight > scrollPosition) {
|
||||||
// do not force move navbar up when we are scrolling up from bottom
|
// do not force move navbar up when we are scrolling up from bottom
|
||||||
if (this.shouldHideNavbar != false) {
|
if (this.shouldHideNavbar != false || scrollPosition <= 0) {
|
||||||
this.navbarKeepTop = true;
|
this.navbarKeepTop = true;
|
||||||
}
|
}
|
||||||
if (down) { // scroll down
|
if (down) { // scroll down
|
||||||
|
Loading…
Reference in New Issue
Block a user