Skip to content
Merged
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
11 changes: 6 additions & 5 deletions src/controllers/accountController.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const getUserAccount = asyncHandler(async (req, res) => {
title: 'My Audify Account',
header: req.session.user ? 'partials/login_header' : 'partials/header',
viewName: 'users/userAccount',
activePage: 'Home',
activePage: 'account',
isAdmin: false,
user,
});
Expand Down Expand Up @@ -51,7 +51,7 @@ const getAddresses = asyncHandler(async (req, res) => {
title: 'Manage Address',
header: req.session.user ? 'partials/login_header' : 'partials/header',
viewName: 'users/manageAddress',
activePage: 'Home',
activePage: 'account',
isAdmin: false,
addresses,
});
Expand All @@ -71,7 +71,8 @@ const getAddressDetails = asyncHandler(async (req, res) => {
const addAddress = asyncHandler(async (req, res) => {
const userId = req.session.user;
await accountService.createAddress(userId, req.body);
res.redirect('/account/addresses');
const redirectTo = req.body.redirectTo || '/account/addresses';
res.redirect(redirectTo);
});

const updateDefaultAddress = asyncHandler(async (req, res) => {
Expand Down Expand Up @@ -105,7 +106,7 @@ const editAddressPage = asyncHandler(async (req, res) => {
title: 'Edit Address',
header: req.session.user ? 'partials/login_header' : 'partials/header',
viewName: 'users/editAddress',
activePage: 'Home',
activePage: 'account',
isAdmin: false,
address,
});
Expand Down Expand Up @@ -144,7 +145,7 @@ const walletTransactions = asyncHandler(async (req, res) => {
title: 'My Audify Account',
header: req.session.user ? 'partials/login_header' : 'partials/header',
viewName: 'users/walletTransaction',
activePage: 'Home',
activePage: 'account',
isAdmin: false,
user,
});
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/cartController.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const getCart = asyncHandler(async (req, res) => {
title: 'Cart',
header: req.session.user ? 'partials/login_header' : 'partials/header',
viewName: 'users/cart',
activePage: 'Shop',
activePage: 'shop',
isAdmin: false,
cart,
});
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/checkoutController.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const getCheckoutPage = asyncHandler(async (req, res) => {
title: 'Checkout',
header: 'partials/login_header',
viewName: 'users/checkout',
activePage: 'Shop',
activePage: 'checkout',
isAdmin: false,
cart,
addresses,
Expand Down Expand Up @@ -128,7 +128,7 @@ const getPaymentPage = asyncHandler(async (req, res) => {
title: 'Payment',
header: 'partials/login_header',
viewName: 'users/payment',
activePage: 'Shop',
activePage: 'checkout',
isAdmin: false,
cart,
walletBalance,
Expand Down
6 changes: 3 additions & 3 deletions src/controllers/orderController.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const getOrderSuccessPage = asyncHandler(async (req, res) => {
title: 'Order Success',
header: 'partials/login_header',
viewName: 'users/orderSuccess',
activePage: 'Order',
activePage: 'checkout',
isAdmin: false,
order,
});
Expand Down Expand Up @@ -50,7 +50,7 @@ const getOrderHistory = asyncHandler(async (req, res) => {
title: 'Order History',
header: 'partials/login_header',
viewName: 'users/orderHistory',
activePage: 'Order History',
activePage: 'account',
isAdmin: false,
orders,
});
Expand All @@ -66,7 +66,7 @@ const getOrderDetail = asyncHandler(async (req, res) => {
title: 'Order Detail',
header: 'partials/login_header',
viewName: 'users/orderDetail',
activePage: 'Order',
activePage: 'account',
isAdmin: false,
order,
});
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/shopController.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ const getWishList = asyncHandler(async (req, res) => {
title: 'Wishlist',
header: req.session.user ? 'partials/login_header' : 'partials/header',
viewName: 'users/wishlist',
activePage: 'Shop',
activePage: 'shop',
isAdmin: false,
wishlist,
});
Expand Down
183 changes: 110 additions & 73 deletions src/public/css/error-pages.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
:root {
--error-bg: #090909;
--error-surface: #111111;
--error-border: #2a2a2a;
--error-text: #f0f0f0;
--error-muted: #a8a8a8;
--error-accent: #4f3b70;
--error-accent-hover: #5d4685;
--error-bg: #f8fafc;
--error-card-bg: #ffffff;
--error-primary: #2563eb;
--error-primary-hover: #1d4ed8;
--error-text: #0f172a;
--error-text-secondary: #64748b;
--error-border: #e2e8f0;
--error-radius: 24px;
}

*,
Expand All @@ -17,130 +18,166 @@
body.error-page {
margin: 0;
min-height: 100vh;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-family:
'Inter',
system-ui,
-apple-system,
sans-serif;
color: var(--error-text);
background:
radial-gradient(
circle at 15% 20%,
rgba(79, 59, 112, 0.14),
transparent 34%
),
radial-gradient(circle at 85% 80%, rgba(79, 59, 112, 0.1), transparent 30%),
var(--error-bg);
background-color: var(--error-bg);
display: flex;
align-items: center;
justify-content: center;
overflow-x: hidden;
}

.error-shell {
min-height: 100vh;
display: grid;
place-items: center;
padding: 1rem;
width: 100%;
padding: 24px;
display: flex;
justify-content: center;
}

.error-card {
width: min(100%, 620px);
border: 1px solid var(--error-border);
border-radius: 18px;
background: linear-gradient(180deg, #121212, #0d0d0d);
box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
padding: 1.5rem;
width: min(100%, 500px);
background: var(--error-card-bg);
border-radius: var(--error-radius);
padding: 60px 40px;
box-shadow:
0 10px 25px -5px rgba(0, 0, 0, 0.05),
0 8px 10px -6px rgba(0, 0, 0, 0.05);
text-align: center;
position: relative;
overflow: hidden;
}

/* Decorative background circle */
.error-card::before {
content: '';
position: absolute;
top: -50px;
right: -50px;
width: 150px;
height: 150px;
background: rgba(37, 99, 235, 0.03);
border-radius: 50%;
}

.error-code {
margin: 0 0 0.4rem;
color: #cbbce5;
letter-spacing: 0.08em;
font-size: 0.78rem;
font-weight: 600;
font-size: 6rem;
font-weight: 800;
margin: 0;
background: linear-gradient(135deg, #2563eb, #6366f1);
-webkit-background-clip: text;
background-clip: text;
-webkit-text-fill-color: transparent;
line-height: 1;
letter-spacing: -2px;
}

.error-title {
margin: 0;
font-size: clamp(1.5rem, 3vw, 2.1rem);
font-weight: 650;
line-height: 1.2;
font-size: 1.75rem;
font-weight: 700;
margin: 16px 0 12px;
color: var(--error-text);
}

.error-description {
margin: 0.7rem 0 0;
color: var(--error-muted);
font-size: 1rem;
color: var(--error-text-secondary);
line-height: 1.6;
margin: 0 auto 32px;
max-width: 320px;
}

.error-meta {
margin: 0.9rem 0 0;
color: #cdcdcd;
font-size: 0.92rem;
line-height: 1.5;
font-size: 0.875rem;
color: #ef4444;
background: #fef2f2;
padding: 8px 16px;
border-radius: 8px;
display: inline-block;
margin-bottom: 24px;
}

.error-details {
margin-top: 0.9rem;
border: 1px solid #2f2f2f;
border-radius: 10px;
background: #121212;
padding: 0.65rem 0.75rem;
text-align: left;
margin-bottom: 24px;
}

.error-details summary {
color: #d7d7d7;
font-size: 0.875rem;
color: var(--error-text-secondary);
cursor: pointer;
padding: 8px 0;
font-weight: 500;
}

.error-details summary:hover {
color: var(--error-primary);
}

.error-details pre {
margin: 0.65rem 0 0;
color: #c8c8c8;
font-size: 0.8rem;
margin-top: 12px;
padding: 16px;
background: #f1f5f9;
border-radius: 12px;
font-size: 0.75rem;
color: #475569;
max-height: 200px;
overflow-y: auto;
white-space: pre-wrap;
word-break: break-word;
max-height: 220px;
overflow: auto;
word-break: break-all;
}

.error-actions {
margin-top: 1.1rem;
display: flex;
gap: 0.6rem;
flex-wrap: wrap;
gap: 12px;
justify-content: center;
}

.error-btn {
border: 1px solid transparent;
border-radius: 11px;
text-decoration: none;
min-height: 42px;
padding: 0.58rem 0.95rem;
padding: 12px 24px;
border-radius: 12px;
font-weight: 600;
font-size: 0.9375rem;
transition: all 0.2s ease;
border: none;
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
cursor: pointer;
font-size: 0.9rem;
font-weight: 600;
}

.error-btn-primary {
background: var(--error-accent);
color: #fff;
background-color: var(--error-primary);
color: #ffffff;
}

.error-btn-primary:hover {
background: var(--error-accent-hover);
background-color: var(--error-primary-hover);
transform: translateY(-1px);
box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.error-btn-secondary {
background: #191919;
color: #ececec;
border-color: #343434;
background-color: #f1f5f9;
color: #475569;
}

.error-btn-secondary:hover {
border-color: #4a4a4a;
color: #fff;
background-color: #e2e8f0;
color: #1e293b;
}

@media (max-width: 576px) {
.error-card {
border-radius: 14px;
padding: 1.15rem;
padding: 40px 24px;
}

.error-code {
font-size: 4.5rem;
}

.error-actions {
Expand Down
25 changes: 0 additions & 25 deletions src/public/css/filter.css

This file was deleted.

3 changes: 0 additions & 3 deletions src/public/css/footer.css

This file was deleted.

Loading
Loading