2025-12-13 22:59:42 -06:00
|
|
|
<!DOCTYPE html>
|
|
|
|
|
<html lang="en">
|
|
|
|
|
<head>
|
|
|
|
|
<meta charset="UTF-8" />
|
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
|
<title>Product Details - Sky Art Shop</title>
|
|
|
|
|
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
|
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
|
|
|
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
|
|
|
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css" />
|
|
|
|
|
<link rel="stylesheet" href="/assets/css/main.css" />
|
|
|
|
|
<link rel="stylesheet" href="/assets/css/navbar.css" />
|
|
|
|
|
<link rel="stylesheet" href="/assets/css/shopping.css" />
|
|
|
|
|
<link rel="stylesheet" href="/assets/css/shopping.css" />
|
|
|
|
|
</head>
|
|
|
|
|
<body>
|
|
|
|
|
<!-- Modern Navigation -->
|
|
|
|
|
<nav class="modern-navbar">
|
|
|
|
|
<div class="navbar-wrapper">
|
|
|
|
|
<div class="navbar-brand">
|
|
|
|
|
<a href="/home.html" class="brand-link">
|
|
|
|
|
<img src="/uploads/images/8ba675b9-c4e6-41e6-8f14-382b9ee1d019.jpg" alt="Sky Art Shop Logo" class="brand-logo" />
|
|
|
|
|
<span class="brand-name">Sky Art Shop</span>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="navbar-menu">
|
|
|
|
|
<ul class="nav-menu-list">
|
|
|
|
|
<li class="nav-item"><a href="/home.html" class="nav-link">Home</a></li>
|
|
|
|
|
<li class="nav-item"><a href="/shop.html" class="nav-link">Shop</a></li>
|
|
|
|
|
<li class="nav-item"><a href="/portfolio.html" class="nav-link">Portfolio</a></li>
|
|
|
|
|
<li class="nav-item"><a href="/about.html" class="nav-link">About</a></li>
|
|
|
|
|
<li class="nav-item"><a href="/blog.html" class="nav-link">Blog</a></li>
|
|
|
|
|
<li class="nav-item"><a href="/contact.html" class="nav-link">Contact</a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="navbar-actions">
|
|
|
|
|
<div class="action-item wishlist-dropdown-wrapper">
|
|
|
|
|
<button class="action-btn" id="wishlistToggle" aria-label="Wishlist">
|
|
|
|
|
<i class="bi bi-heart"></i>
|
|
|
|
|
<span class="action-badge" id="wishlistCount">0</span>
|
|
|
|
|
</button>
|
|
|
|
|
<div class="action-dropdown wishlist-dropdown" id="wishlistPanel">
|
|
|
|
|
<div class="dropdown-head">
|
|
|
|
|
<h3>My Wishlist</h3>
|
|
|
|
|
<button class="dropdown-close" id="wishlistClose"><i class="bi bi-x-lg"></i></button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="dropdown-body" id="wishlistContent">
|
|
|
|
|
<p class="empty-state">Your wishlist is empty</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="dropdown-foot">
|
|
|
|
|
<a href="/shop.html" class="btn-outline">Continue Shopping</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="action-item cart-dropdown-wrapper">
|
|
|
|
|
<button class="action-btn" id="cartToggle" aria-label="Shopping Cart">
|
|
|
|
|
<i class="bi bi-cart3"></i>
|
|
|
|
|
<span class="action-badge" id="cartCount">0</span>
|
|
|
|
|
</button>
|
|
|
|
|
<div class="action-dropdown cart-dropdown" id="cartPanel">
|
|
|
|
|
<div class="dropdown-head">
|
|
|
|
|
<h3>Shopping Cart</h3>
|
|
|
|
|
<button class="dropdown-close" id="cartClose"><i class="bi bi-x-lg"></i></button>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="dropdown-body" id="cartContent">
|
|
|
|
|
<p class="empty-state">Your cart is empty</p>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="dropdown-foot">
|
|
|
|
|
<div class="cart-summary">
|
|
|
|
|
<span class="summary-label">Subtotal:</span>
|
|
|
|
|
<span class="summary-value" id="cartSubtotal">$0.00</span>
|
|
|
|
|
</div>
|
|
|
|
|
<a href="/checkout.html" class="btn-primary-full">Proceed to Checkout</a>
|
|
|
|
|
<a href="/shop.html" class="btn-text">Continue Shopping</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<button class="mobile-toggle" id="mobileMenuToggle" aria-label="Menu">
|
|
|
|
|
<span class="toggle-line"></span>
|
|
|
|
|
<span class="toggle-line"></span>
|
|
|
|
|
<span class="toggle-line"></span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="mobile-menu" id="mobileMenu">
|
|
|
|
|
<div class="mobile-menu-header">
|
|
|
|
|
<span class="mobile-brand">Sky Art Shop</span>
|
|
|
|
|
<button class="mobile-close" id="mobileMenuClose"><i class="bi bi-x-lg"></i></button>
|
|
|
|
|
</div>
|
|
|
|
|
<ul class="mobile-menu-list">
|
|
|
|
|
<li><a href="/home.html" class="mobile-link">Home</a></li>
|
|
|
|
|
<li><a href="/shop.html" class="mobile-link">Shop</a></li>
|
|
|
|
|
<li><a href="/portfolio.html" class="mobile-link">Portfolio</a></li>
|
|
|
|
|
<li><a href="/about.html" class="mobile-link">About</a></li>
|
|
|
|
|
<li><a href="/blog.html" class="mobile-link">Blog</a></li>
|
|
|
|
|
<li><a href="/contact.html" class="mobile-link">Contact</a></li>
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</nav>
|
|
|
|
|
<div id="loading" style="text-align: center; padding: 100px 20px; font-size: 18px; color: #6b7280;">
|
|
|
|
|
<i class="bi bi-hourglass-split" style="font-size: 48px; display: block; margin-bottom: 20px;"></i>
|
|
|
|
|
Loading product...
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div id="productDetail" style="display: none;"></div>
|
|
|
|
|
|
|
|
|
|
<script src="/assets/js/shopping.js"></script>
|
|
|
|
|
<script>
|
|
|
|
|
async function loadProduct() {
|
|
|
|
|
const params = new URLSearchParams(window.location.search);
|
|
|
|
|
const productId = params.get('id');
|
|
|
|
|
|
|
|
|
|
if (!productId) {
|
|
|
|
|
document.getElementById('loading').innerHTML = '<p>Product not found</p><a href="/shop.html">Back to Shop</a>';
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
2025-12-19 20:44:46 -06:00
|
|
|
const response = await fetch(`/api/products/${productId}`);
|
2025-12-13 22:59:42 -06:00
|
|
|
const data = await response.json();
|
|
|
|
|
|
|
|
|
|
if (!data.success || !data.product) {
|
|
|
|
|
throw new Error('Product not found');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const product = data.product;
|
2025-12-19 20:44:46 -06:00
|
|
|
document.title = `${product.name} - Sky Art Shop`;
|
2025-12-13 22:59:42 -06:00
|
|
|
|
2025-12-19 20:44:46 -06:00
|
|
|
document.getElementById('productDetail').innerHTML = `
|
2025-12-13 22:59:42 -06:00
|
|
|
<div style="font-family: 'Roboto', sans-serif;">
|
|
|
|
|
<nav style="background: white; padding: 16px 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);">
|
|
|
|
|
<div style="max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 20px;">
|
|
|
|
|
<a href="/home.html" style="font-size: 20px; font-weight: 600; color: #1a1a1a; text-decoration: none;">Sky Art Shop</a>
|
|
|
|
|
<span style="color: #d1d5db;">/</span>
|
|
|
|
|
<a href="/shop.html" style="color: #6b7280; text-decoration: none;">Shop</a>
|
|
|
|
|
<span style="color: #d1d5db;">/</span>
|
2025-12-19 20:44:46 -06:00
|
|
|
<span style="color: #6b7280;">${product.name}</span>
|
2025-12-13 22:59:42 -06:00
|
|
|
</div>
|
|
|
|
|
</nav>
|
|
|
|
|
|
|
|
|
|
<div style="max-width: 1200px; margin: 40px auto; padding: 0 24px;">
|
|
|
|
|
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 60px; margin-bottom: 60px;">
|
|
|
|
|
<div>
|
|
|
|
|
<div style="background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.1);">
|
2025-12-19 20:44:46 -06:00
|
|
|
<img src="${product.imageurl || '/assets/images/placeholder.jpg'}"
|
|
|
|
|
alt="${product.name}"
|
2025-12-13 22:59:42 -06:00
|
|
|
style="width: 100%; height: auto; display: block;"
|
|
|
|
|
onerror="this.src='/assets/images/placeholder.jpg'" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div style="padding: 20px 0;">
|
2025-12-19 20:44:46 -06:00
|
|
|
<h1 style="font-size: 36px; font-weight: 700; color: #1a1a1a; margin: 0 0 16px 0; line-height: 1.2;">${product.name}</h1>
|
2025-12-13 22:59:42 -06:00
|
|
|
|
|
|
|
|
<div style="display: flex; align-items: baseline; gap: 16px; margin-bottom: 24px;">
|
2025-12-19 20:44:46 -06:00
|
|
|
<p style="font-size: 36px; font-weight: 700; color: #6b46c1; margin: 0;">$${parseFloat(product.price).toFixed(2)}</p>
|
|
|
|
|
${product.stockquantity > 0 ?
|
|
|
|
|
`<span style="color: #10b981; font-weight: 500;">In Stock (${product.stockquantity} available)</span>` :
|
|
|
|
|
`<span style="color: #ef4444; font-weight: 500;">Out of Stock</span>`
|
2025-12-13 22:59:42 -06:00
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
|
2025-12-19 20:44:46 -06:00
|
|
|
${product.shortdescription ? `
|
|
|
|
|
<p style="font-size: 18px; color: #4b5563; line-height: 1.6; margin-bottom: 24px;">${product.shortdescription}</p>
|
|
|
|
|
` : ''}
|
2025-12-13 22:59:42 -06:00
|
|
|
|
2025-12-19 20:44:46 -06:00
|
|
|
${product.description ? `
|
2025-12-13 22:59:42 -06:00
|
|
|
<div style="margin-bottom: 32px;">
|
|
|
|
|
<h3 style="font-size: 18px; font-weight: 600; color: #1a1a1a; margin-bottom: 12px;">Description</h3>
|
2025-12-19 20:44:46 -06:00
|
|
|
<p style="color: #6b7280; line-height: 1.7;">${product.description}</p>
|
2025-12-13 22:59:42 -06:00
|
|
|
</div>
|
2025-12-19 20:44:46 -06:00
|
|
|
` : ''}
|
2025-12-13 22:59:42 -06:00
|
|
|
|
2025-12-19 20:44:46 -06:00
|
|
|
${product.category ? `
|
2025-12-13 22:59:42 -06:00
|
|
|
<p style="margin-bottom: 16px;">
|
|
|
|
|
<span style="font-weight: 500; color: #6b7280;">Category:</span>
|
2025-12-19 20:44:46 -06:00
|
|
|
<span style="display: inline-block; margin-left: 8px; padding: 4px 12px; background: #f3f4f6; border-radius: 6px; font-size: 14px;">${product.category}</span>
|
2025-12-13 22:59:42 -06:00
|
|
|
</p>
|
2025-12-19 20:44:46 -06:00
|
|
|
` : ''}
|
2025-12-13 22:59:42 -06:00
|
|
|
|
2025-12-19 20:44:46 -06:00
|
|
|
${product.color ? `
|
2025-12-13 22:59:42 -06:00
|
|
|
<p style="margin-bottom: 24px;">
|
|
|
|
|
<span style="font-weight: 500; color: #6b7280;">Color:</span>
|
2025-12-19 20:44:46 -06:00
|
|
|
<span style="margin-left: 8px;">${product.color}</span>
|
2025-12-13 22:59:42 -06:00
|
|
|
</p>
|
2025-12-19 20:44:46 -06:00
|
|
|
` : ''}
|
2025-12-13 22:59:42 -06:00
|
|
|
|
|
|
|
|
<div style="display: flex; gap: 12px; margin-top: 32px;">
|
|
|
|
|
<button onclick="addToCart()"
|
|
|
|
|
style="flex: 1; padding: 16px 32px; background: #6b46c1; color: white; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px;"
|
|
|
|
|
onmouseover="this.style.background='#5936a3'"
|
|
|
|
|
onmouseout="this.style.background='#6b46c1'">
|
|
|
|
|
<i class="bi bi-cart-plus" style="font-size: 20px;"></i>
|
|
|
|
|
Add to Cart
|
|
|
|
|
</button>
|
|
|
|
|
<button onclick="addToWishlist()"
|
|
|
|
|
style="width: 56px; padding: 16px; background: transparent; color: #6b46c1; border: 2px solid #6b46c1; border-radius: 8px; font-size: 20px; cursor: pointer; transition: all 0.2s;"
|
|
|
|
|
onmouseover="this.style.background='#f3f0ff'"
|
|
|
|
|
onmouseout="this.style.background='transparent'">
|
|
|
|
|
<i class="bi bi-heart"></i>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<a href="/shop.html" style="display: inline-block; margin-top: 24px; color: #6b46c1; text-decoration: none; font-weight: 500;">
|
|
|
|
|
<i class="bi bi-arrow-left"></i> Back to Shop
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2025-12-19 20:44:46 -06:00
|
|
|
`;
|
2025-12-13 22:59:42 -06:00
|
|
|
|
|
|
|
|
document.getElementById('loading').style.display = 'none';
|
|
|
|
|
document.getElementById('productDetail').style.display = 'block';
|
|
|
|
|
|
|
|
|
|
// Store product data
|
|
|
|
|
window.currentProduct = product;
|
|
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
console.error('Error loading product:', error);
|
|
|
|
|
document.getElementById('loading').innerHTML = '<p style="color: #ef4444;">Error loading product</p><a href="/shop.html" style="color: #6b46c1; text-decoration: none; font-weight: 500;">Back to Shop</a>';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function addToCart() {
|
|
|
|
|
if (window.currentProduct && window.shoppingManager) {
|
|
|
|
|
shoppingManager.addToCart(window.currentProduct, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function addToWishlist() {
|
|
|
|
|
if (window.currentProduct && window.shoppingManager) {
|
|
|
|
|
shoppingManager.addToWishlist(window.currentProduct);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
loadProduct();
|
|
|
|
|
</script>
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|