Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,339 changes: 1,181 additions & 158 deletions data/menu.json

Large diffs are not rendered by default.

Binary file added img/dishes/karnataka/1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/karnataka/2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/karnataka/3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/karnataka/4.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/karnataka/5.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/karnataka/6.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/kerala/1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/kerala/2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/kerala/3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/kerala/4.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/kerala/5.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/kerala/6.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/madhya-pradesh/1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/madhya-pradesh/2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/madhya-pradesh/3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/madhya-pradesh/4.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/madhya-pradesh/5.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/madhya-pradesh/6.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/maharashtra/1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/maharashtra/2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/maharashtra/3.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/maharashtra/4.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/maharashtra/5.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/maharashtra/6.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/manipur/1.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/dishes/manipur/2.jpeg
Binary file added img/dishes/manipur/3.jpeg
Binary file added img/dishes/manipur/4.jpeg
Binary file added img/dishes/manipur/5.jpeg
Binary file added img/dishes/manipur/6.jpeg
Binary file added img/dishes/meghalaya/1.jpeg
Binary file added img/dishes/meghalaya/2.jpeg
Binary file added img/dishes/meghalaya/3.jpeg
Binary file added img/dishes/meghalaya/4.jpeg
Binary file added img/dishes/meghalaya/5.jpeg
Binary file added img/dishes/meghalaya/6.jpeg
Binary file added img/dishes/mizoram/1.jpeg
Binary file added img/dishes/mizoram/2.jpeg
Binary file added img/dishes/mizoram/3.jpeg
Binary file added img/dishes/mizoram/4.jpeg
Binary file added img/dishes/mizoram/5.jpeg
Binary file added img/dishes/mizoram/6.jpeg
Binary file added img/dishes/nagaland/1.jpeg
Binary file added img/dishes/nagaland/2.jpeg
Binary file added img/dishes/nagaland/3.jpeg
Binary file added img/dishes/nagaland/4.jpeg
Binary file added img/dishes/nagaland/5.jpeg
Binary file added img/dishes/nagaland/6.jpeg
Binary file added img/dishes/odisha/1.jpeg
Binary file added img/dishes/odisha/2.jpeg
Binary file added img/dishes/odisha/3.jpeg
Binary file added img/dishes/odisha/4.jpeg
Binary file added img/dishes/odisha/5.jpeg
Binary file added img/dishes/odisha/6.jpeg
Binary file added img/dishes/punjab/1.jpeg
Binary file added img/dishes/punjab/2.jpeg
Binary file added img/dishes/punjab/3.jpeg
Binary file added img/dishes/punjab/4.jpeg
Binary file added img/dishes/punjab/5.jpeg
Binary file added img/dishes/punjab/6.jpeg
138 changes: 17 additions & 121 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,51 +312,31 @@ function createCard(item, highlightQuery = "") {
loading="lazy" />

<div class="card-content">

<div class="card-meta">
<span class="rating" title="Rating: ${item.rating || 5.0}">${ratingStars} ${item.rating || '5.0'}</span>
<span class="spice" title="Spice level: ${item.spice}">${spiceIcon}</span>
<span class="spice" title="Spice level: ${item.spice}">${spiceIcon}</span>
</div>

<h3>${highlightedName}</h3>

<p>${highlightedDesc}</p>
<div class="card-tags">${dietaryTags}</div>
${outOfStockBadge}
</div>

<div class="card-footer">
newFeatures
<div class="price-section">
<span class="original-price">
₹${item.originalPrice}
</span>

<span class="price">
${formatPrice(item.price)}
</span>

<span class="discount-badge">
${Math.round(((item.originalPrice - item.price) / item.originalPrice) * 100)}% OFF
</span>
</div>

<button class="add-btn" aria-label="Add ${item.name} to cart">
Add
</button>
</div>

<span class="price">${formatPrice(item.price)}</span>
<div class="price-section">
${item.originalPrice ? `<span class="original-price">₹${item.originalPrice}</span>` : ''}
<span class="price">${formatPrice(item.price)}</span>
${item.originalPrice ? `<span class="discount-badge">${Math.round(((item.originalPrice - item.price) / item.originalPrice) * 100)}% OFF</span>` : ''}
</div>
<button class="add-btn"
aria-label="Add ${item.name} to cart"
${buttonDisabled}
style="background-color:${buttonColor}"
>
Add
</button>

</div>
main
`;

const addBtn = card.querySelector(".add-btn");
Expand Down Expand Up @@ -415,7 +395,6 @@ function renderRecentlyViewed() {
recentItems.forEach(item => recentlyViewedContainer.appendChild(createCard(item)));
}

newFeatures
// Unified Interactive Filter Engine =====
function renderFavorites() {
const favoritesContainer = document.getElementById("favorites-container");
Expand Down Expand Up @@ -952,7 +931,6 @@ window.reorderOrder = function (orderId) {
sidebar.classList.add("open");
}
};
newFeatures

// Cart Operations

Expand All @@ -961,8 +939,7 @@ window.reorderOrder = function (orderId) {


// ===== Toast Notification =====

main

function showToast(message) {
const toast = document.getElementById("toast-notification");
if (!toast) return;
Expand Down Expand Up @@ -1007,28 +984,23 @@ function addToCart(id) {

function removeFromCart(id) {
const cartIndex = cart.findIndex(ci => ci.item.id === id);
if (cartIndex === -1) return;

const removedItem = cart[cartIndex].item;
cartManager.decreaseQuantity(id);
const cartItem = cart.find(
(ci) => ci.item.id === id
);

if (!cartItem) return;
if (cartIndex === -1) return false;

const removedItem = cartItem.item;
const removedItem = cart[cartIndex].item;

if (
typeof cartManager.decreaseQuantity ===
"function"
) {
if (typeof cartManager.decreaseQuantity === "function") {
cartManager.decreaseQuantity(id);
} else {
cartManager.removeItem(id);
}

cart = cartManager.getItems();
updateCartCount();
updateFavCount();
renderCart();
showToast(`🗑️ ${removedItem.name} removed from cart`);
return true;
};
}

window.placeOrderFromCheckout = function (customerDetails, pricingInfo) {
if (cart.length === 0) {
Expand Down Expand Up @@ -1110,21 +1082,6 @@ window.placeOrderFromCheckout = function (customerDetails, pricingInfo) {
return newOrder;
};


window.reorderOrder = function (orderId) {
const pastOrder = orders.find(o => o.id === orderId);
if (!pastOrder) return;

pastOrder.items.forEach(orderItem => {
cartManager.addItem(orderItem.item, orderItem.quantity);
});

updateCartCount();
updateFavCount();
renderCart();
showToast(`🗑️ ${removedItem.name} removed from cart`);
}

// ===== Event Listeners =====

function setupFilterButtons() {
Expand Down Expand Up @@ -1536,67 +1493,6 @@ async function init() {
window.location.href = `orders.html?delivery=${result.deliveryAvailable}`;
}
});
);

recognition.onresult = (
event
) => {
const transcript =
event.results[0][0].transcript;

searchInput.value = transcript;

applyAllFilters();

voiceBtn.innerHTML = "🎤";

// Bind interactive UI listeners immediately for instant input responsiveness (high INP)
setupCartToggle();
setupFilterButtons();
setupCouponListeners();
setupOrderNowScroll();
setupSearchSuggestions();
setupSearch();
setupAdvancedFilters();
setupContactForm();
setupNewsletterForm();
setupActiveNavbar();
setupDropdownFilterLinks();

if (checkoutBtn) {
checkoutBtn.addEventListener("click", (e) => {
e.preventDefault();
if (cart.length === 0) {
alert("Your cart is empty!");
return;
}
window.location.href = "orders.html";
});
}
voiceBtn.classList.remove(
"listening"
);
};

recognition.onerror = () => {
voiceBtn.innerHTML = "🎤";

voiceBtn.classList.remove(
"listening"
);

alert(
"Voice recognition failed."
);
};

recognition.onend = () => {
voiceBtn.innerHTML = "🎤";

voiceBtn.classList.remove(
"listening"
);
};
}

// Load menu data, then render
Expand Down