Skip to content

Commit

Permalink
update header at the initi
Browse files Browse the repository at this point in the history
  • Loading branch information
math-pixel committed Sep 19, 2024
1 parent 06ecac1 commit 1d03402
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/header.astro
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ const { href, title } = Astro.props;

<script>
let header:any = document.getElementById('main-header');

if (window.scrollY > 50) {
header.classList.add("global-color");
} else {
header.classList.remove("global-color");
}

window.addEventListener('scroll', () => {
if (window.scrollY > 50) {
Expand Down

0 comments on commit 1d03402

Please sign in to comment.