Compare commits

..

2 Commits

Author SHA1 Message Date
Said Achmiz
43a09369f2 Improved nav UI hiding behavior on mobile 2020-02-11 23:47:35 -05:00
Said Achmiz
a2e3a0a561 Slight tweak to mobile nav UI layout 2020-02-11 23:42:01 -05:00
2 changed files with 16 additions and 10 deletions

View File

@ -368,7 +368,7 @@ article {
} }
@media only screen and (max-width: 960px) { @media only screen and (max-width: 960px) {
article { article {
margin-top: 2rem; margin-top: 3rem;
} }
} }
@supports (-webkit-hyphens:auto) or (-ms-hyphens:auto) or (hyphens:auto) { @supports (-webkit-hyphens:auto) or (-ms-hyphens:auto) or (hyphens:auto) {

View File

@ -394,16 +394,22 @@ function updateSiteNavUIState(event) {
if (!GW.scrollState.siteNavUI[0].hasClass("hidden")) toggleSiteNavUI(); if (!GW.scrollState.siteNavUI[0].hasClass("hidden")) toggleSiteNavUI();
} }
// On mobile, make site nav UI translucent on ANY scroll down. // Make site nav UI translucent when scrolling down.
// if (GW.mediaQueries.mobileNarrow.matches)
GW.scrollState.siteNavUI.forEach(element => { GW.scrollState.siteNavUI.forEach(element => {
if (GW.scrollState.unbrokenDownScrollDistance > 0) element.addClass("translucent-on-scroll"); if (GW.scrollState.unbrokenDownScrollDistance > 0) element.addClass("translucent-on-scroll");
else element.removeClass("hidden"); else element.removeClass("hidden");
}); });
// Show site nav UI when scrolling a full page up, or to the top. // On desktop, show site nav UI when scrolling a full page up, or to the
if ((GW.scrollState.unbrokenUpScrollDistance > window.innerHeight || // the top of the page.
GW.scrollState.lastScrollTop == 0)) showSiteNavUI(); // On mobile, show site nav UI translucent on ANY scroll up.
if (GW.mediaQueries.mobileNarrow.matches) {
if (GW.scrollState.unbrokenUpScrollDistance > 0)
showSiteNavUI();
} else if ( GW.scrollState.unbrokenUpScrollDistance > window.innerHeight
|| GW.scrollState.lastScrollTop == 0) {
showSiteNavUI();
}
} }
function toggleSiteNavUI() { function toggleSiteNavUI() {