"use strict";

/** @type {HTMLElement} */
let headerElement = null;

const onPageScrolled = function () {
    if (window.pageYOffset > 0) {
        headerElement.classList.replace("header__normal", "header__scrolled");
    } else {
        headerElement.classList.replace("header__scrolled", "header__normal");
    }
}

const init = function () {
    headerElement = document.querySelector("header");
    window.addEventListener("scroll", _ => onPageScrolled());
}

document.addEventListener("DOMContentLoaded", function (event) {
    init()
});