Skip to content

Commit

Permalink
Add checks to scrollbar to handle auth preload state
Browse files Browse the repository at this point in the history
  • Loading branch information
daniellrgn committed Dec 3, 2024
1 parent e10058f commit 727ad62
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/routes/(app)/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,17 @@
function scrollFunction() {
if (window.scrollY > 40) {
document.getElementById("nav-image")?.classList.add("scrolling");
document.getElementsByClassName("navbar")[0].classList.add("scrolling");
document.getElementsByClassName("navbar")?.[0].classList.add("scrolling");
let es = document.getElementsByClassName("nav-text");
if (es.length == 0) return;
for(let i = 0; i < es.length; i++) {
es[i].classList.add("scrolling");
}
} else if (window.scrollY == 0) {
document.getElementById("nav-image")?.classList.remove("scrolling");
document.getElementsByClassName("navbar")[0].classList.remove("scrolling");
document.getElementsByClassName("navbar")?.[0].classList.remove("scrolling");
let es = document.getElementsByClassName("nav-text");
if (es.length == 0) return;
for(let i = 0; i < es.length; i++) {
es[i].classList.remove("scrolling");
}
Expand Down

0 comments on commit 727ad62

Please sign in to comment.