diff --git a/assets/css/styles.css b/assets/css/styles.css index a0ac1ec..2b9fffb 100644 --- a/assets/css/styles.css +++ b/assets/css/styles.css @@ -7,10 +7,13 @@ html { @apply font-sans; } - -/* 2. Site Header */ header { - @apply py-4 px-4 bg-yuika-blue-700; + @apply py-4 px-4; +} +/* 2. Site Header */ +.index-navbar { + z-index: 10; + @apply transition-bg; } .index-navbar header { background-color: transparent; @@ -161,7 +164,6 @@ footer { } .nav-fixed { - z-index: 10; @apply bg-yuika-blue-700; } diff --git a/assets/js/nav-collapse.js b/assets/js/nav-collapse.js index 4a15f0d..8610707 100644 --- a/assets/js/nav-collapse.js +++ b/assets/js/nav-collapse.js @@ -31,14 +31,10 @@ var progressMax = lastDocumentHeight - lastWindowHeight; // show/hide nav - if (lastScrollY >= trigger - 20) { - nav.classList.add('fixed'); + if (lastScrollY >= nav.getBoundingClientRect().bottom) { nav.classList.add('nav-fixed'); - nav.classList.remove('absolute'); } else { - nav.classList.remove('fixed'); nav.classList.remove('nav-fixed'); - nav.classList.add('absolute'); } ticking = false; diff --git a/author.hbs b/author.hbs index a68de18..acbab96 100644 --- a/author.hbs +++ b/author.hbs @@ -1,5 +1,6 @@ {{!< default}} {{#author}} +{{> "site-header"}}