// retoor <retoor@molodetz.nl>

export class NotificationManager {
    constructor() {
        this.initHashScroll();
    }

    initHashScroll() {
        const hash = window.location.hash;
        if (!hash.startsWith("#comment-")) {
            return;
        }
        window.addEventListener("load", () => {
            const target = document.getElementById(hash.slice(1));
            if (!target) {
                return;
            }
            target.scrollIntoView({ block: "center" });
            target.classList.add("comment-highlight");
        });
    }
}
