Skip to content

Commit

Permalink
Merge pull request #484 from RahulScripted/main
Browse files Browse the repository at this point in the history
Nav Bar shadow added when scrolled
  • Loading branch information
PriyaGhosal authored Oct 11, 2024
2 parents 6810f6b + 11080aa commit bc66774
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,8 @@ document.getElementById('postForm').addEventListener('submit', function (e) {

window.addEventListener("scroll", function () {
let navbar = document.getElementById("main-head");
if (window.scrollY > 100) {
navbar.classList.add("shadow");
} else {
navbar.classList.remove("shadow");
}
if (window.scrollY > 100) navbar.classList.add("shadow");
else navbar.classList.remove("shadow");
});

function initMap() {
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ button {
}
.main-head.shadow {
background-color: #000;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
nav {
display: flex;
Expand Down

0 comments on commit bc66774

Please sign in to comment.