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" href="img/logo.png" type="image/png" />
</head>


Expand Down
12 changes: 2 additions & 10 deletions cart.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,7 @@ <h2>Have a promo code?</h2>
</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="footer-container">
Expand Down Expand Up @@ -265,6 +256,7 @@ <h3>Contact Us</h3>

<!-- Optional scripts -->
<script src="js/accessibility.js"></script>
<script src="js/recently-viewed.js"></script>
<script src="js/geolocation.js"></script>
<script src="js/sanitization.js"></script>
<script src="js/loyalty.js"></script>
Expand Down
203 changes: 203 additions & 0 deletions css/dashboard.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
/* css/dashboard.css */

.dashboard-main {
padding: 3rem 1.5rem;
max-width: 1000px;
margin: 0 auto;
}

.dashboard-page-header {
text-align: center;
margin-bottom: 2.5rem;
}

.dashboard-page-header h2 {
font-size: 2.2rem;
color: #2d2a26;
margin-bottom: 0.5rem;
}

.dashboard-page-header p {
color: #666;
font-size: 1.1rem;
}

/* Stats Row */
.dashboard-stats-row {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1.5rem;
margin-bottom: 2.5rem;
}

.stat-card {
background: white;
border-radius: 20px;
padding: 1.5rem;
text-align: center;
box-shadow: 0 10px 25px rgba(0,0,0,0.05);
border: 1px solid rgba(255, 107, 53, 0.15);
transition: transform 0.3s ease, box-shadow 0.3s ease;
position: relative;
overflow: hidden;
}

.stat-card::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 4px;
background: linear-gradient(90deg, #ff6b35, #ffb347);
}

.stat-card:hover {
transform: translateY(-5px);
box-shadow: 0 15px 30px rgba(255, 107, 53, 0.1);
}

.stat-icon {
font-size: 2.5rem;
margin-bottom: 1rem;
}

.stat-value {
font-size: 2rem;
font-weight: 700;
color: #2d2a26;
margin-bottom: 0.5rem;
}

.stat-label {
color: #666;
font-weight: 500;
text-transform: uppercase;
letter-spacing: 1px;
font-size: 0.85rem;
}

/* Sections */
.dashboard-section {
background: white;
border-radius: 24px;
padding: 2rem;
box-shadow: 0 10px 30px rgba(0,0,0,0.03);
margin-bottom: 2rem;
border: 1px solid #f0f0f0;
}

.dashboard-section-title {
font-size: 1.5rem;
color: #2d2a26;
margin-bottom: 1.5rem;
display: flex;
align-items: center;
gap: 0.5rem;
}

/* Order History */
.order-list {
display: flex;
flex-direction: column;
gap: 1rem;
}

.order-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1.25rem;
border-radius: 16px;
background: #fdfdfd;
border: 1px solid #eaeaea;
transition: all 0.2s ease;
}

.order-item:hover {
border-color: #ff6b35;
background: #fff8f5;
}

.order-info h4 {
margin: 0 0 0.25rem;
color: #2d2a26;
}

.order-info p {
margin: 0;
color: #777;
font-size: 0.9rem;
}

.order-status {
padding: 0.4rem 1rem;
border-radius: 99px;
font-size: 0.85rem;
font-weight: 600;
}

.order-status.delivered {
background: #e6f4ea;
color: #1e8e3e;
}

.order-status.processing {
background: #fef7e0;
color: #f29900;
}

/* Address Form */
.address-form {
display: flex;
flex-direction: column;
gap: 1rem;
}

.address-form input,
.address-form textarea {
width: 100%;
padding: 0.8rem 1rem;
border: 1px solid #ddd;
border-radius: 12px;
font-family: inherit;
font-size: 1rem;
}

.address-form input:focus,
.address-form textarea:focus {
outline: none;
border-color: #ff6b35;
}

.btn-save-address {
align-self: flex-start;
background: #ff6b35;
color: white;
border: none;
padding: 0.8rem 1.5rem;
border-radius: 99px;
font-weight: 600;
cursor: pointer;
transition: background 0.3s ease;
}

.btn-save-address:hover {
background: #e55a2a;
}

/* Empty States */
.empty-state {
text-align: center;
padding: 2rem;
color: #888;
}

/* Responsive */
@media (max-width: 768px) {
.order-item {
flex-direction: column;
align-items: flex-start;
gap: 1rem;
}
}
141 changes: 117 additions & 24 deletions dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<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/auth.css" />
<link rel="icon" href="favicon.png" type="image/png" />
<link rel="stylesheet" href="css/dashboard.css" />
<link rel="icon" href="img/logo.png" type="image/png" />
</head>
<body data-page-type="dashboard">
<header>
Expand Down Expand Up @@ -40,35 +41,127 @@
</div>
</header>

<main class="auth-main" role="main" aria-label="Dashboard page">
<div class="food-animation-bg" aria-hidden="true">
<span class="floating-food samosa">🥟</span>
<span class="floating-food pani-puri">🫓</span>
<span class="floating-food chaat">🍲</span>
<span class="floating-food chai">☕</span>
<span class="floating-food lassi">🥛</span>
<main class="dashboard-main container" role="main" aria-label="Dashboard page">
<div class="dashboard-page-header">
<h2>Welcome back, <span id="dashboard-user-name">User</span>! 👋</h2>
<p>Manage your orders, loyalty points, and account settings.</p>
</div>

<section class="auth-wrapper">
<div class="dashboard-card">
<div class="dashboard-page-header">
<div class="dashboard-eyebrow">Dashboard</div>
<h2>Dashboard - Coming Soon</h2>
<p>Hi, <span id="dashboard-user-name">User</span>.</p>
</div>

<div class="dashboard-message">
<strong>Coming Soon:</strong> this area will hold order history, saved preferences, rewards, and quick actions for your account.
</div>
<div class="dashboard-stats-row">
<div class="stat-card">
<div class="stat-icon">📦</div>
<div class="stat-value" id="stat-orders">0</div>
<div class="stat-label">Total Orders</div>
</div>
<div class="stat-card">
<div class="stat-icon">⭐</div>
<div class="stat-value" id="stat-points">0</div>
<div class="stat-label">Loyalty Points</div>
</div>
<div class="stat-card">
<div class="stat-icon">🛒</div>
<div class="stat-value" id="stat-cart">0</div>
<div class="stat-label">Items in Cart</div>
</div>
</div>

<div class="profile-actions">
<a href="profile.html" class="profile-action-link">View Profile</a>
<a href="index.html" class="profile-action-link secondary">Back to Home</a>
</div>
<div class="dashboard-section">
<h3 class="dashboard-section-title">🛍️ Recent Orders</h3>
<div id="dashboard-orders-list" class="order-list">
<!-- Orders injected here -->
</div>
</section>
</div>

<div class="dashboard-section">
<h3 class="dashboard-section-title">📍 Default Delivery Address</h3>
<form id="address-form" class="address-form">
<textarea id="delivery-address-input" rows="3" placeholder="Enter your full delivery address..."></textarea>
<button type="button" id="save-address-btn" class="btn-save-address">Save Address</button>
</form>
</div>

<div class="profile-actions" style="margin-bottom: 2rem;">
<a href="profile.html" class="profile-action-link">View Profile</a>
<a href="orders.html" class="profile-action-link">All Orders</a>
<a href="menu.html" class="profile-action-link secondary">Order Food</a>
</div>
</main>

<div id="toast-notification" class="toast-notification"></div>

<script src="js/loyalty.js"></script>
<script src="js/cart-manager.js"></script>
<script src="js/auth.js"></script>
<script>
document.addEventListener("DOMContentLoaded", () => {
// 1. User Name
const user = JSON.parse(sessionStorage.getItem("chaatUser"));
if (user && user.name) {
document.getElementById("dashboard-user-name").textContent = user.name;
}

// 2. Orders count & list
const orders = JSON.parse(localStorage.getItem("chaatOrders") || "[]");
document.getElementById("stat-orders").textContent = orders.length;

const ordersList = document.getElementById("dashboard-orders-list");
if (orders.length === 0) {
ordersList.innerHTML = `<div class="empty-state">No orders yet. Time to crave some chaat!</div>`;
} else {
ordersList.innerHTML = "";
orders.slice(0, 3).forEach(order => {
ordersList.innerHTML += `
<div class="order-item">
<div class="order-info">
<h4>Order #${order.id || Math.floor(Math.random()*10000)}</h4>
<p>${new Date(order.date || Date.now()).toLocaleDateString()} • ₹${order.total || 0}</p>
</div>
<div class="order-status ${order.status === 'Delivered' ? 'delivered' : 'processing'}">
${order.status || 'Processing'}
</div>
</div>
`;
});
}

// 3. Loyalty Points
if (window.loyalty) {
document.getElementById("stat-points").textContent = window.loyalty.getBalance();
}

// 4. Cart Items
if (window.cartManager) {
const cartItems = window.cartManager.getItems();
const totalCartItems = cartItems.reduce((acc, curr) => acc + curr.quantity, 0);
document.getElementById("stat-cart").textContent = totalCartItems;
} else {
const cart = JSON.parse(localStorage.getItem("chaatCart") || "[]");
const totalCartItems = cart.reduce((acc, curr) => acc + curr.quantity, 0);
document.getElementById("stat-cart").textContent = totalCartItems;
}

// 5. Address Logic
const addressInput = document.getElementById("delivery-address-input");
addressInput.value = localStorage.getItem("defaultAddress") || "";

document.getElementById("save-address-btn").addEventListener("click", () => {
localStorage.setItem("defaultAddress", addressInput.value);

let toast = document.getElementById("toast-notification");
if (!toast) {
toast = document.createElement("div");
toast.id = "toast-notification";
toast.className = "toast-notification";
document.body.appendChild(toast);
}

toast.textContent = "Address saved successfully! ✅";
toast.style.display = "block";
setTimeout(() => {
toast.style.display = "none";
}, 3000);
});
});
</script>
</body>
</html>
Loading