Skip to content

Commit

Permalink
updates to menu vis
Browse files Browse the repository at this point in the history
  • Loading branch information
chinacomx committed Jun 3, 2024
1 parent 8e05c03 commit 4655479
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion assets/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ header {
position: fixed;
width: 100%;
top: 0;
display: none;
left: 0;
display: none; /* Hide initially */
transition: top 0.3s; /* Smooth transition */
}

header.show {
display: block; /* Show when scrolled */
}

header nav ul {
Expand Down
4 changes: 2 additions & 2 deletions assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ document.addEventListener("DOMContentLoaded", function() {
const header = document.getElementById("header");
window.addEventListener("scroll", function() {
if (window.scrollY > window.innerHeight) {
header.style.display = "block";
header.classList.add("show");
} else {
header.style.display = "none";
header.classList.remove("show");
}
});
});

0 comments on commit 4655479

Please sign in to comment.