(function () {
document.addEventListener("DOMContentLoaded", () => {
// Inject modal HTML
const modalHTML = `
`;
const div = document.createElement("div");
div.innerHTML = modalHTML;
document.body.appendChild(div);
});
// Global function to open the footer modal
window.showFitsFooterPopup = function (photoUrl, items) {
const modal = document.getElementById("fits-footer-modal");
const photo = document.getElementById("fits-footer-main-photo");
const container = document.getElementById("fits-footer-items");
if (!modal || !photo || !container) return;
photo.src = photoUrl;
container.innerHTML = "";
items.forEach(item => {
const el = document.createElement("div");
el.className = "fits-footer-item";
el.innerHTML = `
${item.name}
Price: $${parseFloat(item.price).toFixed(2)}
${item.store}
`;
container.appendChild(el);
});
modal.style.display = "flex";
};
})();