
var headerBackground = true;

window.addEventListener("scroll", function() {
    if (window.scrollY > window.innerHeight * 0.27) {
        if (headerBackground)
            document.querySelector("header").style.background = "black";
        headerBackground = false;
    } else {
        if (!headerBackground)
            document.querySelector("header").style.background = "";
        headerBackground = true;
    }
});

