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
2 changes: 1 addition & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="css/404.css">
<title>404 - Page Not Found</title>
<link rel="icon" href="favicon.png" type="image/png" />
<link rel="icon" type="image/svg+xml" href="img/favicon.svg">
</head>


Expand Down
240 changes: 36 additions & 204 deletions cart.html
Original file line number Diff line number Diff line change
@@ -1,204 +1,36 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cart - ChaatBazar</title>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/delivery-tracker.css">
<link rel="icon" href="favicon.png" type="image/png" />

<style>
.cart-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px;
border-bottom: 1px solid #ddd;
}

.cart-controls button {
margin: 0 4px;
padding: 6px 10px;
cursor: pointer;
border: none;
border-radius: 5px;
background: #ff6b35;
color: white;
}

#total-price {
font-size: 20px;
font-weight: bold;
margin-top: 20px;
}

#checkout-btn {
margin-top: 20px;
padding: 10px 15px;
background: #ff6b35;
color: white;
border: none;
cursor: pointer;
border-radius: 6px;
}

.empty-cart {
text-align: center;
color: #777;
padding: 20px;
}
</style>
</head>

<body>

<header>
<div class="header-inner container" role="banner">
<a href="index.html" class="logo" aria-label="ChaatBazaar Home"><img src="img/logo.png" alt="ChaatBazaar Logo" class="navbar-logo-img" />ChaatBazaar</a>
<nav role="navigation" aria-label="Primary Navigation">
<a href="index.html" class="nav-link">Home</a>
<div class="dropdown" tabindex="0" aria-haspopup="true" aria-expanded="false">
<a href="menu.html" class="dropdown-toggle nav-link">Menu</a>
<div class="dropdown-menu" role="menu" aria-label="Menu Categories">
<a href="menu.html" role="menuitem" tabindex="-1" onclick="filterCategory('All')">All</a>
<a href="menu.html" role="menuitem" tabindex="-1" onclick="filterCategory('Snacks')">Snacks</a>
<a href="menu.html" role="menuitem" tabindex="-1" onclick="filterCategory('Chaat')">Chaat</a>
<a href="menu.html" role="menuitem" tabindex="-1" onclick="filterCategory('Beverages')">Beverages</a>
</div>
</div>
<a href="about.html" class="nav-link">About</a>
<a href="favorites.html" class="nav-link">Favorites (<span id="fav-count">0</span>)</a>
<a href="orders.html" class="nav-link">Orders</a>
<a href="cart.html" class="nav-link cart-btn-modern active" id="cart-open-btn" aria-label="Cart">
<span class="cart-icon-wrapper">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" class="cart-svg-icon"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>
<span id="cart-count" class="cart-badge">0</span>
</span>
<span class="cart-text">Cart</span>
</a>
<div class="search-bar" role="search">
<input type="search" placeholder="Search menu..." aria-label="Search menu" id="search-input" autocomplete="off" />
<button aria-label="Search" id="search-btn">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="search-svg"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>
</button>
<div class="search-suggestions" id="search-suggestions" style="display: none;"></div>
</div>
<button id="theme-toggle" class="theme-toggle" aria-label="Toggle Theme">
<span class="theme-toggle-track">
<span class="theme-toggle-icon sun-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="5"></circle><line x1="12" y1="1" x2="12" y2="3"></line><line x1="12" y1="21" x2="12" y2="23"></line><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line><line x1="1" y1="12" x2="3" y2="12"></line><line x1="21" y1="12" x2="23" y2="12"></line><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line></svg>
</span>
<span class="theme-toggle-icon moon-icon">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
</span>
<span class="theme-toggle-thumb"></span>
</span>
</button>
<div id="authNavItem" class="auth-nav-item">
<a href="login.html" class="login-btn-nav">Login</a>
</div>
</nav>
</div>
</header>

<section class="cart-page">
<h1>Your Cart</h1>

<div class="delivery-info" style="background:#fff3e0;border-left:4px solid #FF7B54;padding:1rem;margin-bottom:1.5rem;border-radius:4px;">
<p style="margin:0;color:#5d4037;font-size:0.95rem;">
<strong>📍 Location Required:</strong> We deliver within 5 km of India Gate, New Delhi.
</p>
</div>

<div id="cart-items"></div>

<p id="total-price"></p>

<button id="checkout-btn">Checkout</button>
</section>

<div id="toast-notification" class="toast-notification"></div>
<script src="js/cart-manager.js"></script>
<script src="js/recently-viewed.js"></script>
<script src="js/delivery-tracker.js"></script>
<script src="js/geolocation.js"></script>
<script src="js/sanitization.js"></script>
<script src="js/loyalty.js"></script>
<script src="js/translations.js"></script>
<script src="js/i18n.js"></script>
<script src="js/main.js"></script>
<script src="js/auth.js"></script>
<footer>
<div class="social-icons">
<a href="#"><i class="fa-brands fa-facebook"></i></a>
<a href="#"><i class="fa-brands fa-instagram"></i></a>
<a href="#"><i class="fa-brands fa-twitter"></i></a>
<a href="#"><i class="fa-brands fa-github"></i></a>
</div>
</footer>

<!-- ================= CART MANAGER (IMPORTANT: LOAD FIRST) ================= -->
<script src="js/cart-manager.js"></script>

<!-- ================= CART UI LOGIC ================= -->
<script>
function renderCart() {
const container = document.getElementById("cart-items");
const totalEl = document.getElementById("total-price");

const items = window.cartManager.getItems();

container.innerHTML = "";

if (!items || items.length === 0) {
container.innerHTML = `<p class="empty-cart">Your cart is empty 🛒</p>`;
totalEl.innerText = "";
return;
}

items.forEach((cartItem) => {
container.innerHTML += `
<div class="cart-item">

<div>
<b>${cartItem.item.name}</b><br/>
<small>₹${cartItem.item.price} × ${cartItem.quantity}</small>
</div>

<div class="cart-controls">
<button onclick="window.cartManager.decreaseQuantity('${cartItem.item.id}')">-</button>
<button onclick="window.cartManager.increaseQuantity('${cartItem.item.id}')">+</button>
<button onclick="window.cartManager.removeItem('${cartItem.item.id}')">Remove</button>
</div>

</div>
`;
});

totalEl.innerText =
"Total: ₹" + window.cartManager.getTotalPrice();
}

// Initial render
window.addEventListener("load", renderCart);

// Live update when cart changes
window.cartManager.subscribe(renderCart);
</script>

<!-- Optional scripts -->
<script src="js/accessibility.js"></script>
<script src="js/geolocation.js"></script>
<script src="js/sanitization.js"></script>
<script src="js/loyalty.js"></script>
<script src="js/translations.js"></script>
<script src="js/i18n.js"></script>
<script src="js/main.js"></script>
<script src="js/delivery-tracker.js"></script>

</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Cart - ChaatBazar</title>
<link rel="icon" type="image/svg+xml" href="img/favicon.svg">
<link rel="stylesheet" href="css/style.css">
</head>
<body>

<header>
<div class="logo">ChaatBazar 🍴</div>
<nav>
<a href="index.html">Home</a>
<a href="menu.html">Menu</a>
<a href="cart.html">Cart</a>
<a href="index.html#about">About</a>
<a href="orders.html">Orders</a>
</nav>
</header>

<section class="cart-page">
<h1>Your Cart</h1>
<div id="cart-items"></div>
<p id="total-price"></p>
<button onclick="checkout()">Checkout</button>
</section>

<footer>
<p>&copy; 2026 ChaatBazar. All rights reserved.</p>
</footer>

<script src="js/main.js"></script>
</body>
</html>
75 changes: 75 additions & 0 deletions img/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading