This commit is contained in:
Eric Villnow 2025-10-03 21:26:38 -05:00
commit a796176a17
8 changed files with 947 additions and 0 deletions

25
viewManager.js Normal file
View file

@ -0,0 +1,25 @@
// viewManager.js
const ViewManager = (() => {
const mainBody = document.querySelector(".main-body");
const modal = document.getElementById("trackModal");
function load(templateFn, data) {
if (!mainBody) return;
mainBody.innerHTML = templateFn(data);
}
function showModal(templateFn, data) {
if (!modal) return;
modal.innerHTML = templateFn(data);
modal.style.display = "block";
}
function hideModal() {
if (!modal) return;
modal.style.display = "none";
modal.innerHTML = "";
}
return { load, showModal, hideModal };
})();