From 2063a32bb99b604d5714ac932eeeaa6654be8d6f Mon Sep 17 00:00:00 2001 From: Felix Hamann Date: Sun, 10 Jun 2018 23:43:03 +0200 Subject: [PATCH] fixed navbar-glitch for edge-case pages --- templates/widgets/navbar.julius | 4 ++-- templates/widgets/navbar.lucius | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/templates/widgets/navbar.julius b/templates/widgets/navbar.julius index 8a608aaff..4991dec3f 100644 --- a/templates/widgets/navbar.julius +++ b/templates/widgets/navbar.julius @@ -6,7 +6,7 @@ window.utils.stickynav = function(nav) { var ticking = false; - init(); + init(); function init() { nav.style.paddingLeft = document.body.getBoundingClientRect().width < 999 ? '90px' : ''; window.setTimeout(function() { @@ -19,6 +19,7 @@ // checks scroll direction and shows/hides navbar accordingly function checkScroll() { var sticky = window.scrollY > 0; + sticky = sticky && window.innerHeight < (document.scrollingElement.scrollHeight - 50); nav.classList.toggle('navbar--sticky', sticky); ticking = false; } @@ -38,7 +39,6 @@ } - })(); document.addEventListener('DOMContentLoaded', function() { diff --git a/templates/widgets/navbar.lucius b/templates/widgets/navbar.lucius index 2e531867a..fd38cf6a0 100644 --- a/templates/widgets/navbar.lucius +++ b/templates/widgets/navbar.lucius @@ -17,7 +17,7 @@ top: 0; left: 0; overflow: hidden; - transition: height 0.2s ease; + transition: height 0.2s cubic-bezier(0.03, 0.43, 0.58, 1); box-shadow: 0 0 4px rgba(0, 0, 0, 0.2); } @@ -80,7 +80,7 @@ align-items: center; height: var(--header-height); color: var(--color-lightwhite); - transition: height .2s ease; + transition: height .2s cubic-bezier(0.03, 0.43, 0.58, 1); } .navbar__link-label { @@ -138,12 +138,12 @@ } .navbar--animated { - transition: all .2s ease; + transition: all .2s cubic-bezier(0.03, 0.43, 0.58, 1); } .navbar__pushdown { height: var(--header-height); - transition: height .2s ease; + transition: height .2s cubic-bezier(0.03, 0.43, 0.58, 1); } .navbar--sticky + .navbar__pushdown {