Skip to content

Commit

Permalink
Merge pull request #37 from LoneStanding/main
Browse files Browse the repository at this point in the history
Made UI cleaner and added 1 funtionality
  • Loading branch information
tushargupta1504 authored Oct 2, 2024
2 parents 75b2434 + 955d89d commit d0409f3
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ <h5>Aligarh</h5>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe"
crossorigin="anonymous"></script>
<script src="./index.js"></script>
</body>

</html>
16 changes: 16 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
let lastScrollTop = 0;
const navbar = document.querySelector('.navbar');

window.addEventListener('scroll', function() {
let scrollTop = window.pageYOffset || document.documentElement.scrollTop;

if (scrollTop > lastScrollTop) {
// Scrolling down
navbar.style.top = '-80px'; // Adjust height accordingly
} else {
// Scrolling up
navbar.style.top = '0';
}

lastScrollTop = scrollTop;
});
9 changes: 9 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
font-family: var(--font);
}

::-webkit-scrollbar {
display: none;
}

* {
-ms-overflow-style: none;
scrollbar-width: none;
}

header {
background: url('img/headerbg.jpg') center/cover
}
Expand Down

0 comments on commit d0409f3

Please sign in to comment.