Skip to content

Commit

Permalink
Update index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
happylinze authored Jun 3, 2024
1 parent 7dd8657 commit 8f33386
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ layout: default
#back-to-top:hover {
background-color: rgba(240, 240, 240, 0.8);
}
.navbar-placeholder {
height: 60px;
}

/* @media screen and (max-width: 1440px) {
body {
Expand Down Expand Up @@ -143,30 +146,30 @@ layout: default
} */
</style>

<button id="back-to-top">Back to Top</button>
<button id="back-to-top"></button>

<script>
document.addEventListener('scroll', function() {
const navbar = document.getElementById('navbar');
if (window.scrollY > 50) {
navbar.classList.add('hidden');
} else {
navbar.classList.remove('hidden');
}
});

document.addEventListener('DOMContentLoaded', function() {
const navbar = document.getElementById('navbar');
navbar.addEventListener('mouseenter', function() {
navbar.classList.remove('hidden');
});

navbar.addEventListener('mouseleave', function() {
if (window.scrollY > 50) {
navbar.classList.add('hidden');
}
});
});
// document.addEventListener('scroll', function() {
// const navbar = document.getElementById('navbar');
// if (window.scrollY > 50) {
// navbar.classList.add('hidden');
// } else {
// navbar.classList.remove('hidden');
// }
// });

// document.addEventListener('DOMContentLoaded', function() {
// const navbar = document.getElementById('navbar');
// navbar.addEventListener('mouseenter', function() {
// navbar.classList.remove('hidden');
// });

// navbar.addEventListener('mouseleave', function() {
// if (window.scrollY > 50) {
// navbar.classList.add('hidden');
// }
// });
// });

var backToTopButton = document.getElementById("back-to-top");
window.addEventListener("scroll", function() {
Expand Down

0 comments on commit 8f33386

Please sign in to comment.