"use strict";

document.addEventListener("DOMContentLoaded", () => {
    const goTop = document.querySelector(".goToTop");
    if (goTop) {
        window.addEventListener("scroll", () => {
            if (window.scrollY > 260) {
                goTop.classList.add("show");
            } else {
                goTop.classList.remove("show");
            }
        }, { passive: true });
        goTop.addEventListener("click", (event) => {
            event.preventDefault();
            window.scrollTo({ top: 0, behavior: "smooth" });
        });
    }
});
