23 lines
No EOL
698 B
JavaScript
23 lines
No EOL
698 B
JavaScript
const logo = document.getElementById('logo');
|
|
const header = document.getElementById("header");
|
|
const menuIcon = document.getElementById("menu-icon");
|
|
const scrollHeaderListener = () => {
|
|
if (window.scrollY > 0) {
|
|
logo.className = "small-logo"
|
|
menuIcon.classList.add("small-icon")
|
|
} else {
|
|
logo.className = "logo"
|
|
menuIcon.classList.remove("small-icon")
|
|
}
|
|
};
|
|
|
|
window.addEventListener("scroll", scrollHeaderListener);
|
|
|
|
function unfoldHeader() {
|
|
var headerItems = document.getElementById("header-items");
|
|
if (headerItems.className === "header-items") {
|
|
headerItems.classList.add("responsive")
|
|
} else {
|
|
headerItems.classList.remove("responsive")
|
|
}
|
|
} |