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.
This commit is contained in:
parent
3f6d7bd638
commit
6c756ac7ba
6 changed files with 130 additions and 20 deletions
48
pricing.js
Normal file
48
pricing.js
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
const pricing = {
|
||||
balanced: {
|
||||
name: "Balanced",
|
||||
description: "A little bit of everything, dialed into a rhythm you can actually keep.",
|
||||
prices: [5000, 4000, 2000],
|
||||
},
|
||||
bulk: {
|
||||
name: "Bulk",
|
||||
description: "Intentional calories, complex carbs and protein in a bigger, bolder box.",
|
||||
prices: [6000, 5000, 2500],
|
||||
},
|
||||
protein: {
|
||||
name: "Protein",
|
||||
description: "Pure protein power for the work you put in, from first rep to last.",
|
||||
prices: [6500, 5500, 3000],
|
||||
},
|
||||
lean: {
|
||||
name: "Lean",
|
||||
description: "Minimal fats. Maximum clarity. Light, clean meals to help you move sharper.",
|
||||
prices: [7000, 6000, 3500],
|
||||
},
|
||||
};
|
||||
|
||||
const options = [
|
||||
{ label: "Breakfast, lunch & dinner", detail: "3 meals a day" },
|
||||
{ label: "Lunch & dinner", detail: "2 meals a day" },
|
||||
{ label: "Dinner", detail: "1 meal a day" },
|
||||
];
|
||||
|
||||
const mode = new URLSearchParams(window.location.search).get("mode") || "balanced";
|
||||
const selected = pricing[mode] || pricing.balanced;
|
||||
|
||||
document.title = `${selected.name} mode pricing — The Tiffin Food`;
|
||||
document.querySelector("#mode-title").textContent = `${selected.name} mode`;
|
||||
document.querySelector("#mode-description").textContent = selected.description;
|
||||
document.querySelector("#pricing-options").innerHTML = options
|
||||
.map((option, index) => `
|
||||
<article class="price-card">
|
||||
<div>
|
||||
<p class="price-index">0${index + 1}</p>
|
||||
<h3>${option.label}</h3>
|
||||
<p>${option.detail}</p>
|
||||
</div>
|
||||
<strong>₹${selected.prices[index].toLocaleString("en-IN")}<span>/ month</span></strong>
|
||||
<a class="button button-primary" href="mailto:hello@thetiffinfood.com?subject=${encodeURIComponent(`${selected.name} mode — ${option.label}`)}">Choose this box <span>↗</span></a>
|
||||
</article>
|
||||
`)
|
||||
.join("");
|
||||
Loading…
Add table
Add a link
Reference in a new issue