const loader = document.querySelector(".loader")

function toggleLoadingBar() {
    if (loader.hasAttribute("hidden")) {
        loader.removeAttribute("hidden")
    } else {
        loader.setAttribute("hidden", "")
    }
}

function showLoadingBar() {
    if (loader.hasAttribute("hidden")) {
        loader.removeAttribute("hidden")
    }
}

function hideLoadingBar() {
    if (!loader.hasAttribute("hidden")) {
        loader.setAttribute("hidden", "")
    }
}

window.addEventListener("wheel", (e) => {
    if (e.ctrlKey) {
        e.preventDefault()
    }
}, { passive: false })

window.onpopstate = (event) => {
    window.history.pushState(null, document.title, window.location.href)
}