-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathheader.js
24 lines (22 loc) · 881 Bytes
/
header.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
document.write(
`
<header id="header">
<a class="header-logo" href="/index.html">
<a class="header-link" href="/team.html">TEAM</a>
<a class="header-link" href="/missions.html">MISSIONS</a>
<a class="header-link" href="https://newsletter.huskysat.org">NEWSLETTER</a>
<a class="header-link" href="/sponsors.html">SPONSORS</a>
<a class="header-link" href="/events.html">EVENTS</a>
<a id="header-join-us" class="button-link" href="/join.html">APPLY</a>
<button class="header-hamburger-button" onclick="document.getElementById('header').classList.toggle('open')">\u2630</button>
</header>
`
);
var header = document.getElementById('header');
document.addEventListener('scroll', function (e) {
if (window.scrollY > 0) {
header.classList.add("header-scrolled");
} else {
header.classList.remove("header-scrolled");
}
});