White Stripes
White Stripes Bedsheet — Polymix
Hotel-use white striped bedsheet in polymix fabric.
Enquire on WhatsApp
🛏
White Stripes
White Stripes Bedsheet — Pure Cotton
Hotel-use white striped bedsheet in pure cotton fabric.
Enquire on WhatsApp
`;
}
function placeholderContent(title) {
const safeTitle = escapeHtml(title);
const link = whatsappLink(
"Hello Ekta Mart, I am interested in " +
title +
". Please share product details and wholesale price."
);
return `
${safeTitle}
This product page is active and ready.
You can add its product variants and details here later.
Enquire on WhatsApp
`;
}
function openProductPage(product, title) {
if (!homePageContent || !productDetailPage) return;
homePageContent.hidden = true;
productDetailPage.hidden = false;
productPageTitle.textContent = title;
if (productPageKicker) {
productPageKicker.textContent = "EKTA MART PRODUCT";
}
if (product === "bedsheets") {
productPageIntro.textContent =
"Choose the white stripe bedsheet type required for your hotel or resort.";
productPageContent.innerHTML = bedsheetsContent();
} else {
productPageIntro.textContent =
"This product page is active and ready for its product details.";
productPageContent.innerHTML = placeholderContent(title);
}
if (primaryNav) {
primaryNav.classList.remove("open");
}
window.scrollTo({
top: 0,
behavior: "auto"
});
}
function showHomePage(targetSelector) {
if (!homePageContent || !productDetailPage) return;
productDetailPage.hidden = true;
homePageContent.hidden = false;
if (primaryNav) {
primaryNav.classList.remove("open");
}
requestAnimationFrame(function () {
const target =
document.querySelector(targetSelector || "#products");
if (target) {
target.scrollIntoView({
behavior: "smooth",
block: "start"
});
} else {
window.scrollTo({top: 0, behavior: "smooth"});
}
});
}
/* PRODUCT BUTTON EVENTS */
document.querySelectorAll("button.product-link").forEach(function (button) {
button.addEventListener("click", function () {
const product =
button.getAttribute("data-product") || "product";
const title =
button.getAttribute("data-title") ||
button.textContent.trim();
openProductPage(product, title);
});
});
/* BACK BUTTON */
if (productPageBack) {
productPageBack.addEventListener("click", function () {
showHomePage("#products");
});
}
/* NAVIGATION WHEN PRODUCT PAGE IS OPEN */
document.querySelectorAll('a[href^="#"]').forEach(function (link) {
link.addEventListener("click", function (event) {
if (!productDetailPage || productDetailPage.hidden) {
return;
}
const target = link.getAttribute("href");
if (!target || target === "#") return;
event.preventDefault();
showHomePage(target);
});
});
})();
Click here