From 4208fd5e325fe14c72daa7750188b6b8208c743c Mon Sep 17 00:00:00 2001 From: Helen Chong <119173961+helenclx@users.noreply.github.com> Date: Thu, 18 Apr 2024 13:22:55 +0800 Subject: [PATCH] Make the navbar sticky effect smoother --- src/_includes/main/navbar.njk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_includes/main/navbar.njk b/src/_includes/main/navbar.njk index d3e5bb1d..659f8916 100644 --- a/src/_includes/main/navbar.njk +++ b/src/_includes/main/navbar.njk @@ -67,7 +67,7 @@ window.addEventListener("scroll", () => { const scrollPosition = window.scrollY || document.documentElement.scrollTop; const stickyLine = hero.scrollHeight - navbar.scrollHeight; - if (scrollPosition > stickyLine) { + if (scrollPosition > stickyLine + 55) { navbar.classList.add("nav--sticky"); } else { navbar.classList.remove("nav--sticky");