updated directory structure to fix root Service Worker issues and performance improvements

This commit is contained in:
Keep Creating Online
2025-02-05 16:54:40 -05:00
parent 03c28dacab
commit b6b61e4e15
94 changed files with 2265 additions and 79 deletions

39
js/disclaimer.js Normal file
View File

@@ -0,0 +1,39 @@
// js/disclaimer.js
class DisclaimerModal {
constructor() {
// Initialize elements when the disclaimer HTML is in the DOM.
this.init();
}
init() {
this.modal = document.getElementById("disclaimerModal");
this.acceptButton = document.getElementById("acceptDisclaimer");
if (this.acceptButton) {
this.acceptButton.addEventListener("click", () => {
this.hide();
});
}
}
hide() {
if (this.modal) {
this.modal.classList.add("hidden");
}
localStorage.setItem("hasSeenDisclaimer", "true");
}
show() {
// In case the modal hasn't been initialized yet.
if (!this.modal) {
this.init();
}
if (!localStorage.getItem("hasSeenDisclaimer") && this.modal) {
this.modal.classList.remove("hidden");
}
}
}
// Create and export a default instance.
const disclaimerModal = new DisclaimerModal();
export default disclaimerModal;