2023-01-18 12:45:47 -06:00
|
|
|
window.onscroll = () => {
|
2023-01-18 15:44:59 -06:00
|
|
|
headerScroll()
|
2023-01-18 12:45:47 -06:00
|
|
|
}
|
|
|
|
|
2023-01-18 15:44:59 -06:00
|
|
|
const header = document.getElementsByTagName("header")[0]
|
|
|
|
const headerText = document.getElementsByTagName("h1")[0]
|
|
|
|
const headerButtons = document.getElementsByTagName("ul")[0].children
|
|
|
|
|
2023-01-18 12:45:47 -06:00
|
|
|
function headerScroll() {
|
2023-01-18 15:44:59 -06:00
|
|
|
if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {
|
|
|
|
header.style.padding = "5px"
|
|
|
|
headerText.style.fontSize = "16px"
|
|
|
|
headerText.style.padding = "5px"
|
|
|
|
for (const button of headerButtons) {
|
2023-02-06 13:39:43 -06:00
|
|
|
button.children[0].className = "navscroll"
|
2023-01-18 15:44:59 -06:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
header.style.padding = "10px"
|
|
|
|
headerText.style.fontSize = "32px"
|
|
|
|
headerText.style.padding = "10px"
|
|
|
|
for (const button of headerButtons) {
|
2023-02-06 13:39:43 -06:00
|
|
|
button.children[0].className = ""
|
2023-01-18 15:44:59 -06:00
|
|
|
}
|
|
|
|
}
|
2023-01-18 12:45:47 -06:00
|
|
|
}
|