Skip to content

Commit

Permalink
Merge pull request #140 from odracirdev/develop
Browse files Browse the repository at this point in the history
fix(styles): 🐛 fix navbar hidding
  • Loading branch information
Zyruks authored Jun 8, 2024
2 parents 343a4f8 + 9b9504c commit c8bab3d
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/components/Navbar.astro
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,6 @@ const ITEMS = [
color: #b1b3d0;
}

.hide-navbar {
transform: translateY(-200%);
}

.dots {
display: flex;

Expand Down Expand Up @@ -306,20 +302,4 @@ const ITEMS = [
burgerMenu.setAttribute(dataStatus, 'open');
}
});

let lastScrollPosition = 0;

window.addEventListener('scroll', () => {
let currentScroll = window.scrollY;

if (currentScroll - lastScrollPosition > 0) {
// The scroll direction goin to hide the navbar on desktop
document.querySelector('.nav-container').classList.add('hide-navbar');
} else {
// The scroll direction goin to show the navbar on desktop
document.querySelector('.nav-container').classList.remove('hide-navbar');
}
// Set the last scroll position to the current scroll position
lastScrollPosition = currentScroll;
});
</script>

0 comments on commit c8bab3d

Please sign in to comment.