footer: add footer loader

This commit is contained in:
2026-06-03 03:42:39 +07:00
parent b7c10621b1
commit 42429b1509
29 changed files with 39 additions and 101 deletions
@@ -1,10 +1,4 @@
////views/productPages/productMain/productMain.js
// Load footer
fetch("components/footer/footer.html")
.then((response) => response.text())
.then((data) => {
document.getElementById("footer").innerHTML = data;
});
// Product page specific JavaScript
document.addEventListener("DOMContentLoaded", function () {
@@ -36,7 +30,7 @@ document.addEventListener("DOMContentLoaded", function () {
if (hash) {
// Find the tab with matching data-category
const tab = document.querySelector(
`.category-tab[data-category="${hash}"]`
`.category-tab[data-category="${hash}"]`,
);
if (tab) {
// Remove active class from all tabs and contents