TheTiffinFood/script.js
AnuragJangid18 6c756ac7ba Add pricing page and update meal card interactions
- Introduced a new pricing page with mode-specific pricing options.
- Updated meal card data attributes and descriptions for clarity.
- Enhanced meal card interactions to navigate to the pricing page.
- Removed toast notifications for a cleaner user experience.
- Added pricing styles for better layout and responsiveness.
2026-10-08 03:41:40 +05:30

18 lines
584 B
JavaScript

document.querySelectorAll(".meal-card").forEach((card) => {
const openPricing = () => {
window.location.href = `pricing.html?mode=${encodeURIComponent(card.dataset.mode)}`;
};
card.querySelector(".card-action").addEventListener("click", openPricing);
card.addEventListener("click", (event) => {
if (event.target.closest(".card-action")) return;
openPricing();
});
card.addEventListener("keydown", (event) => {
if ((event.key === "Enter" || event.key === " ") && event.target === card) {
event.preventDefault();
openPricing();
}
});
});