diff --git a/data/products.json b/data/products.json index a90905c..b0d5472 100644 --- a/data/products.json +++ b/data/products.json @@ -8,13 +8,7 @@ "alt": "Modesty Panels", "category": "training-tables", "modelNo": "SE001", - "sizes": [ - "XS", - "S", - "M", - "L", - "XL" - ], + "sizes": ["XS", "S", "M", "L", "XL"], "colors": [ { "name": "Black", @@ -80,11 +74,7 @@ "alt": "Domino", "category": "training-tables", "modelNo": "TA002", - "sizes": [ - "S", - "M", - "L" - ], + "sizes": ["S", "M", "L"], "colors": [ { "name": "Natural", @@ -150,11 +140,7 @@ "alt": "Slim", "category": "training-tables", "modelNo": "ST003", - "sizes": [ - "M", - "L", - "XL" - ], + "sizes": ["M", "L", "XL"], "colors": [ { "name": "White", @@ -223,11 +209,7 @@ "category": "training-tables", "inStock": true, "modelNo": "ST004", - "sizes": [ - "M", - "L", - "XL" - ], + "sizes": ["M", "L", "XL"], "colors": [ { "name": "White", @@ -294,13 +276,7 @@ "category": "training-tables", "inStock": true, "modelNo": "SE005", - "sizes": [ - "XS", - "S", - "M", - "L", - "XL" - ], + "sizes": ["XS", "S", "M", "L", "XL"], "colors": [ { "name": "Black", @@ -367,13 +343,7 @@ "category": "screens", "inStock": true, "modelNo": "SC006", - "sizes": [ - "XS", - "S", - "M", - "L", - "XL" - ], + "sizes": ["XS", "S", "M", "L", "XL"], "colors": [ { "name": "Black", @@ -439,11 +409,7 @@ "category": "screens", "inStock": true, "modelNo": "SC007", - "sizes": [ - "S", - "M", - "L" - ], + "sizes": ["S", "M", "L"], "colors": [ { "name": "Natural", @@ -508,11 +474,7 @@ "category": "screens", "inStock": true, "modelNo": "SC008", - "sizes": [ - "M", - "L", - "XL" - ], + "sizes": ["M", "L", "XL"], "colors": [ { "name": "White", @@ -578,13 +540,7 @@ "category": "screens", "inStock": true, "modelNo": "SC009", - "sizes": [ - "XS", - "S", - "M", - "L", - "XL" - ], + "sizes": ["XS", "S", "M", "L", "XL"], "colors": [ { "name": "Black", @@ -650,13 +606,7 @@ "category": "executive-desks", "inStock": true, "modelNo": "ED010", - "sizes": [ - "XS", - "S", - "M", - "L", - "XL" - ], + "sizes": ["XS", "S", "M", "L", "XL"], "colors": [ { "name": "Black", @@ -722,11 +672,7 @@ "category": "executive-desks", "inStock": true, "modelNo": "ED011", - "sizes": [ - "S", - "M", - "L" - ], + "sizes": ["S", "M", "L"], "colors": [ { "name": "Natural", @@ -792,11 +738,7 @@ "category": "executive-desks", "inStock": true, "modelNo": "ED012", - "sizes": [ - "M", - "L", - "XL" - ], + "sizes": ["M", "L", "XL"], "colors": [ { "name": "White", @@ -863,13 +805,7 @@ "category": "executive-desks", "inStock": true, "modelNo": "ED013", - "sizes": [ - "XS", - "S", - "M", - "L", - "XL" - ], + "sizes": ["XS", "S", "M", "L", "XL"], "colors": [ { "name": "Black", @@ -936,13 +872,7 @@ "category": "executive-desks", "inStock": true, "modelNo": "ED014", - "sizes": [ - "XS", - "S", - "M", - "L", - "XL" - ], + "sizes": ["XS", "S", "M", "L", "XL"], "colors": [ { "name": "Black", @@ -1009,11 +939,7 @@ "category": "conference-chairs", "inStock": true, "modelNo": "CC015", - "sizes": [ - "S", - "M", - "L" - ], + "sizes": ["S", "M", "L"], "colors": [ { "name": "Natural", @@ -1082,11 +1008,7 @@ "category": "conference-chairs", "inStock": true, "modelNo": "CC016", - "sizes": [ - "M", - "L", - "XL" - ], + "sizes": ["M", "L", "XL"], "colors": [ { "name": "White", @@ -1153,11 +1075,7 @@ "category": "conference-chairs", "inStock": true, "modelNo": "CC017", - "sizes": [ - "S", - "M", - "L" - ], + "sizes": ["S", "M", "L"], "colors": [ { "name": "Natural", @@ -1224,11 +1142,7 @@ "category": "conference-chairs", "inStock": true, "modelNo": "CC018", - "sizes": [ - "M", - "L", - "XL" - ], + "sizes": ["M", "L", "XL"], "colors": [ { "name": "White", @@ -1295,10 +1209,7 @@ "category": "conference-chairs", "inStock": true, "modelNo": "CC019", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Blue", @@ -1365,10 +1276,7 @@ "category": "conference-chairs", "inStock": true, "modelNo": "CC020", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Blue", @@ -1436,11 +1344,7 @@ "category": "conference-chairs", "inStock": true, "modelNo": "CC021", - "sizes": [ - "M", - "L", - "XL" - ], + "sizes": ["M", "L", "XL"], "colors": [ { "name": "White", @@ -1507,13 +1411,7 @@ "category": "conference-chairs", "inStock": true, "modelNo": "CC022", - "sizes": [ - "XS", - "S", - "M", - "L", - "XL" - ], + "sizes": ["XS", "S", "M", "L", "XL"], "colors": [ { "name": "Black", @@ -1575,13 +1473,7 @@ "category": "visitors-chair", "inStock": true, "modelNo": "VC023", - "sizes": [ - "XS", - "S", - "M", - "L", - "XL" - ], + "sizes": ["XS", "S", "M", "L", "XL"], "colors": [ { "name": "Black", @@ -1648,11 +1540,7 @@ "category": "visitors-chair", "inStock": true, "modelNo": "VC024", - "sizes": [ - "S", - "M", - "L" - ], + "sizes": ["S", "M", "L"], "colors": [ { "name": "Natural", @@ -1719,11 +1607,7 @@ "category": "visitors-chair", "inStock": true, "modelNo": "VC025", - "sizes": [ - "S", - "M", - "L" - ], + "sizes": ["S", "M", "L"], "colors": [ { "name": "Natural", @@ -1792,10 +1676,7 @@ "category": "visitors-chair", "inStock": true, "modelNo": "VC026", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -1855,10 +1736,7 @@ "category": "visitors-chair", "inStock": true, "modelNo": "VC027", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Brown", @@ -1918,11 +1796,7 @@ "category": "visitors-chair", "inStock": true, "modelNo": "VC028", - "sizes": [ - "M", - "L", - "XL" - ], + "sizes": ["M", "L", "XL"], "colors": [ { "name": "White", @@ -1981,10 +1855,7 @@ "category": "soft-seating", "inStock": true, "modelNo": "SS029", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Grey", @@ -2046,10 +1917,7 @@ "category": "soft-seating", "inStock": true, "modelNo": "SS030", - "sizes": [ - "L", - "XL" - ], + "sizes": ["L", "XL"], "colors": [ { "name": "Black", @@ -2111,10 +1979,7 @@ "category": "soft-seating", "inStock": true, "modelNo": "SS031", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Green", @@ -2177,10 +2042,7 @@ "category": "soft-seating", "inStock": true, "modelNo": "SS032", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Blue", @@ -2243,10 +2105,7 @@ "category": "soft-seating", "inStock": true, "modelNo": "SS033", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "White", @@ -2306,10 +2165,7 @@ "category": "soft-seating", "inStock": true, "modelNo": "SS034", - "sizes": [ - "S", - "M" - ], + "sizes": ["S", "M"], "colors": [ { "name": "Yellow", @@ -2369,10 +2225,7 @@ "category": "soft-seating", "inStock": true, "modelNo": "SS035", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Navy", @@ -2438,10 +2291,7 @@ "category": "soft-seating", "inStock": true, "modelNo": "SS036", - "sizes": [ - "L", - "XL" - ], + "sizes": ["L", "XL"], "colors": [ { "name": "Orange", @@ -2500,10 +2350,7 @@ "category": "soft-seating", "inStock": true, "modelNo": "SS037", - "sizes": [ - "L", - "XL" - ], + "sizes": ["L", "XL"], "colors": [ { "name": "Gold", @@ -2567,10 +2414,7 @@ "category": "soft-seating", "inStock": true, "modelNo": "SS038", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Brown", @@ -2634,10 +2478,7 @@ "category": "barstools", "inStock": true, "modelNo": "BS039", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -2698,10 +2539,7 @@ "category": "barstools", "inStock": true, "modelNo": "BS040", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Anthracite", @@ -2761,10 +2599,7 @@ "category": "barstools", "inStock": true, "modelNo": "BS041", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Brown", @@ -2825,10 +2660,7 @@ "category": "barstools", "inStock": true, "modelNo": "BS042", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Chrome", @@ -2888,10 +2720,7 @@ "category": "barstools", "inStock": true, "modelNo": "BS043", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -2951,10 +2780,7 @@ "category": "work-station", "inStock": true, "modelNo": "WS044", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "White", @@ -3014,10 +2840,7 @@ "category": "work-station", "inStock": true, "modelNo": "WS045", - "sizes": [ - "L", - "XL" - ], + "sizes": ["L", "XL"], "colors": [ { "name": "White", @@ -3080,10 +2903,7 @@ "category": "work-station", "inStock": true, "modelNo": "WS046", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "White", @@ -3144,10 +2964,7 @@ "category": "work-station", "inStock": true, "modelNo": "WS047", - "sizes": [ - "L", - "XL" - ], + "sizes": ["L", "XL"], "colors": [ { "name": "White", @@ -3207,10 +3024,7 @@ "category": "work-station", "inStock": true, "modelNo": "WS048", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "White", @@ -3270,10 +3084,7 @@ "category": "work-station", "inStock": true, "modelNo": "WS049", - "sizes": [ - "L", - "XL" - ], + "sizes": ["L", "XL"], "colors": [ { "name": "White", @@ -3333,10 +3144,7 @@ "category": "executive-task-chair", "inStock": true, "modelNo": "ETC050", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -3396,10 +3204,7 @@ "category": "executive-task-chair", "inStock": true, "modelNo": "ETC051", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -3458,10 +3263,7 @@ "category": "executive-task-chair", "inStock": true, "modelNo": "ETC052", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -3521,10 +3323,7 @@ "category": "executive-task-chair", "inStock": true, "modelNo": "ETC053", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Amber", @@ -3586,10 +3385,7 @@ "category": "canteen-chairs", "inStock": true, "modelNo": "CC054", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "White", @@ -3650,10 +3446,7 @@ "category": "canteen-chairs", "inStock": true, "modelNo": "CC055", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -3713,10 +3506,7 @@ "category": "canteen-chairs", "inStock": true, "modelNo": "CC056", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Brown", @@ -3781,10 +3571,7 @@ "category": "canteen-chairs", "inStock": true, "modelNo": "CC057", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Anthracite", @@ -3844,10 +3631,7 @@ "category": "canteen-chairs", "inStock": true, "modelNo": "CC058", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Green", @@ -3910,10 +3694,7 @@ "category": "canteen-chairs", "inStock": true, "modelNo": "CC059", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -3974,10 +3755,7 @@ "category": "canteen-chairs", "inStock": true, "modelNo": "CC060", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Anthracite", @@ -4037,10 +3815,7 @@ "category": "storage", "inStock": true, "modelNo": "ST061", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "White", @@ -4107,10 +3882,7 @@ "category": "storage", "inStock": true, "modelNo": "ST062", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "White", @@ -4172,10 +3944,7 @@ "category": "storage", "inStock": true, "modelNo": "ST063", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Gray", @@ -4235,10 +4004,7 @@ "category": "training-chairs", "inStock": true, "modelNo": "TC064", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -4300,10 +4066,7 @@ "category": "training-chairs", "inStock": true, "modelNo": "TC065", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -4363,10 +4126,7 @@ "category": "training-chairs", "inStock": true, "modelNo": "TC066", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -4428,10 +4188,7 @@ "category": "training-chairs", "inStock": true, "modelNo": "TC067", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Blue", @@ -4496,10 +4253,7 @@ "category": "training-chairs", "inStock": true, "modelNo": "TC068", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -4559,10 +4313,7 @@ "category": "training-chairs", "inStock": true, "modelNo": "TC069", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -4620,10 +4371,7 @@ "category": "task-chairs", "inStock": true, "modelNo": "TC070", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -4681,16 +4429,13 @@ { "id": 71, "name": "Dot Pro", - "description": "Advanced task chair with Dot Pro design. Perfect for modern workspaces and tech environments with innovative features and contemporary styling.", + "description": "Sleek, modern swivel task chair with ergonomic comfort for daily use. Versatile for office or meeting spaces with durable construction and easy maintenance.", "image": "assets/images/products/categories/task-chairs/dot-pro/DOT-PRO_ATOM_02.webp", "alt": "Dot Pro", "category": "task-chairs", "inStock": true, "modelNo": "TC071", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -4701,6 +4446,16 @@ "name": "White", "value": "#FFFFFF", "selected": false + }, + { + "name": "Gray", + "value": "#808080", + "selected": false + }, + { + "name": "Navy", + "value": "#000080", + "selected": false } ], "selectedSize": "M", @@ -4712,12 +4467,19 @@ "assets/images/products/categories/task-chairs/dot-pro/DOT-PRO_ATOM_08.webp" ], "descriptionLong": [ - "Embrace advanced productivity with our Dot Pro task chair. This innovative piece combines contemporary design with cutting-edge features, perfect for modern workspaces and tech environments.", - "The Dot Pro task chair features innovative technology, contemporary styling, and advanced functionality. The modern design and tech-focused features create a dynamic environment while providing excellent comfort for extended work sessions and innovative workspaces." + "The Dot Pro swivel task chair represents the perfect fusion of sleek modern design and ergonomic comfort. Engineered for daily use in demanding work environments, this chair delivers exceptional support and versatility for both individual workstations and collaborative meeting spaces.", + "Featuring a contemporary aesthetic with clean lines and premium materials, the Dot Pro is designed for durability and easy maintenance. Available in both mesh and upholstered finishes, with optional headrest configurations, this chair adapts to your specific workspace needs. The robust construction ensures long-lasting performance while the ergonomic design promotes proper posture and comfort during extended work sessions.", + "Whether you're setting up a modern office workstation or furnishing a dynamic meeting room, the Dot Pro task chair provides the perfect balance of style, comfort, and functionality. Its versatile design makes it equally suitable for focused individual work and collaborative team environments." ], "additionalInformation": { - "Material": "Premium fabric, steel frame", - "Design": "Contemporary innovative aesthetic", + "Material": "Premium mesh or upholstered fabric, reinforced steel frame", + "Design": "Sleek modern swivel task chair with ergonomic features", + "Finish Options": "Mesh or upholstered finish available", + "Headrest": "Available with or without headrest", + "Use Cases": "Workstations and meeting rooms", + "Ergonomics": "Designed for daily use with proper posture support", + "Maintenance": "Easy to clean and maintain", + "Durability": "Robust construction for long-lasting performance", "Dimensions": "See size options", "Warranty": "4 years", "warrantyServiceType": "Standard warranty service", @@ -4753,10 +4515,7 @@ "category": "task-chairs", "inStock": true, "modelNo": "TC072", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -4819,10 +4578,7 @@ "category": "task-chairs", "inStock": true, "modelNo": "TC073", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -4884,10 +4640,7 @@ "category": "task-chairs", "inStock": true, "modelNo": "TC074", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -4948,10 +4701,7 @@ "category": "task-chairs", "inStock": true, "modelNo": "TC075", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -5015,10 +4765,7 @@ "category": "task-chairs", "inStock": true, "modelNo": "TC076", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -5079,11 +4826,7 @@ "category": "meeting-tables", "inStock": true, "modelNo": "MT077", - "sizes": [ - "M", - "L", - "XL" - ], + "sizes": ["M", "L", "XL"], "colors": [ { "name": "White", @@ -5142,11 +4885,7 @@ "category": "meeting-tables", "inStock": true, "modelNo": "MT078", - "sizes": [ - "M", - "L", - "XL" - ], + "sizes": ["M", "L", "XL"], "colors": [ { "name": "Brown", @@ -5206,11 +4945,7 @@ "category": "meeting-tables", "inStock": true, "modelNo": "MT079", - "sizes": [ - "M", - "L", - "XL" - ], + "sizes": ["M", "L", "XL"], "colors": [ { "name": "Black", @@ -5269,11 +5004,7 @@ "category": "meeting-tables", "inStock": true, "modelNo": "MT080", - "sizes": [ - "M", - "L", - "XL" - ], + "sizes": ["M", "L", "XL"], "colors": [ { "name": "White", @@ -5333,10 +5064,7 @@ "category": "occasional-tables", "inStock": true, "modelNo": "OT081", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -5396,10 +5124,7 @@ "category": "occasional-tables", "inStock": true, "modelNo": "OT082", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Brown", @@ -5459,10 +5184,7 @@ "category": "occasional-tables", "inStock": true, "modelNo": "OT083", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "White", @@ -5521,10 +5243,7 @@ "category": "occasional-tables", "inStock": true, "modelNo": "OT084", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "White", @@ -5581,10 +5300,7 @@ "category": "occasional-tables", "inStock": true, "modelNo": "OT085", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -5643,10 +5359,7 @@ "category": "occasional-tables", "inStock": true, "modelNo": "OT086", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "White", @@ -5708,10 +5421,7 @@ "category": "occasional-tables", "inStock": true, "modelNo": "OT087", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Brown", @@ -5770,10 +5480,7 @@ "category": "occasional-tables", "inStock": true, "modelNo": "OT088", - "sizes": [ - "M", - "L" - ], + "sizes": ["M", "L"], "colors": [ { "name": "Black", @@ -5907,4 +5614,4 @@ "currentPage": 1, "totalPages": 2 } -} \ No newline at end of file +} diff --git a/product-detail.html b/product-detail.html index dba5bfe..23448f2 100644 --- a/product-detail.html +++ b/product-detail.html @@ -217,38 +217,14 @@

- -
-

- Size -

-
- -
-
- - -
-

- Color -

-
- -
-
- -
+
-
+
+ + +
+
+ +
+
diff --git a/scripts/main.js b/scripts/main.js index d296e54..309303f 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -330,58 +330,58 @@ function addThumbnailClickListeners() { mainImg.setAttribute("data-enlarge-src", imageSrc); console.log("Main image updated to:", imageSrc); } + }); }); - }); -} + } -// Product detail page functionality + // Product detail page functionality async function initProductDetail() { - console.log("Product detail script running..."); + console.log("Product detail script running..."); console.log("Current URL:", window.location.href); - // Check if we're on the product detail page - const productTitle = document.querySelector("h1"); - if (!productTitle) { - console.log("No h1 found, not on product detail page"); - return; - } + // Check if we're on the product detail page + const productTitle = document.querySelector("h1"); + if (!productTitle) { + console.log("No h1 found, not on product detail page"); + return; + } console.log("Found h1 element:", productTitle); - // Get product ID from URL - const urlParams = new URLSearchParams(window.location.search); - const productId = parseInt(urlParams.get("id")); - console.log("Product ID from URL:", productId); + // Get product ID from URL + const urlParams = new URLSearchParams(window.location.search); + const productId = parseInt(urlParams.get("id")); + console.log("Product ID from URL:", productId); - if (!productId) { - console.log("No product ID found in URL"); - return; - } - - try { - // Load product data - const response = await fetch("data/products.json"); - const data = await response.json(); - const product = data.products.find((p) => p.id === productId); - - if (!product) { - console.error("Product not found:", productId); + if (!productId) { + console.log("No product ID found in URL"); return; } - console.log("Loading product:", product); + try { + // Load product data + const response = await fetch("data/products.json"); + const data = await response.json(); + const product = data.products.find((p) => p.id === productId); - // Update page title - document.title = `${product.name} - KHY`; + if (!product) { + console.error("Product not found:", productId); + return; + } - // Update the "Product Details" title with the actual product name - const productDetailsTitle = document.getElementById( - "product-details-title" - ); - if (productDetailsTitle) { - productDetailsTitle.textContent = product.name; - } + console.log("Loading product:", product); - // Update product title (the main product title, not the breadcrumb) + // Update page title + document.title = `${product.name} - KHY`; + + // Update the "Product Details" title with the actual product name + const productDetailsTitle = document.getElementById( + "product-details-title" + ); + if (productDetailsTitle) { + productDetailsTitle.textContent = product.name; + } + + // Update product title (the main product title, not the breadcrumb) const productTitle = document.getElementById("product-title"); console.log("Product title element:", productTitle); if (productTitle) { @@ -445,97 +445,148 @@ async function initProductDetail() { addThumbnailClickListeners(); } - // Update size options - const sizeContainer = document.getElementById("size-buttons-container"); - console.log("Size container:", sizeContainer); - if (sizeContainer && product.sizes) { - sizeContainer.innerHTML = product.sizes - .map( - (size, index) => ` - - ` - ) - .join(""); - console.log("Updated size options with", product.sizes.length, "sizes"); - } + // Update product specifications + const specificationsContainer = document.getElementById( + "product-specifications" + ); + console.log("Specifications container:", specificationsContainer); + if (specificationsContainer && product.additionalInformation) { + const specifications = []; + + // Add key specifications from additionalInformation + if (product.additionalInformation.Material) { + specifications.push({ + label: "Material", + value: product.additionalInformation.Material, + }); + } + + if (product.additionalInformation.Design) { + specifications.push({ + label: "Design", + value: product.additionalInformation.Design, + }); + } + + if (product.additionalInformation["Finish Options"]) { + specifications.push({ + label: "Finish Options", + value: product.additionalInformation["Finish Options"], + }); + } + + if (product.additionalInformation.Headrest) { + specifications.push({ + label: "Headrest", + value: product.additionalInformation.Headrest, + }); + } + + if (product.additionalInformation["Use Cases"]) { + specifications.push({ + label: "Use Cases", + value: product.additionalInformation["Use Cases"], + }); + } + + if (product.additionalInformation.Ergonomics) { + specifications.push({ + label: "Ergonomics", + value: product.additionalInformation.Ergonomics, + }); + } + + if (product.additionalInformation.Maintenance) { + specifications.push({ + label: "Maintenance", + value: product.additionalInformation.Maintenance, + }); + } + + if (product.additionalInformation.Durability) { + specifications.push({ + label: "Durability", + value: product.additionalInformation.Durability, + }); + } + + if (product.additionalInformation.Warranty) { + specifications.push({ + label: "Warranty", + value: product.additionalInformation.Warranty, + }); + } + + + // Render specifications + specificationsContainer.innerHTML = specifications + .map( + (spec) => ` +
+ + ${spec.label}: + + + ${spec.value} + +
+ ` + ) + .join(""); - // Update color options - const colorContainer = document.getElementById("color-buttons-container"); - console.log("Color container:", colorContainer); - if (colorContainer && product.colors) { - colorContainer.innerHTML = product.colors - .map( - (color, index) => ` - - ` - ) - .join(""); console.log( - "Updated color options with", - product.colors.length, - "colors" + "Updated specifications with", + specifications.length, + "items" ); - } - - // Update product metadata - find by text content - const allSpans = document.querySelectorAll("span"); - - // Find and update Model No. - const modelNoLabel = Array.from(allSpans).find( - (span) => span.textContent === "Model No." - ); - if (modelNoLabel && product.modelNo) { - const modelNoValue = - modelNoLabel.parentElement.querySelector("span:last-child"); - if (modelNoValue) { - modelNoValue.textContent = product.modelNo; } - } - // Find and update Category - const categoryLabel = Array.from(allSpans).find( - (span) => span.textContent === "Category" - ); - if (categoryLabel && product.category) { - const categoryValue = - categoryLabel.parentElement.querySelector("span:last-child"); - if (categoryValue) { - categoryValue.textContent = + // Update product metadata - find by text content + const allSpans = document.querySelectorAll("span"); + + // Find and update Model No. + const modelNoLabel = Array.from(allSpans).find( + (span) => span.textContent === "Model No." + ); + if (modelNoLabel && product.modelNo) { + const modelNoValue = + modelNoLabel.parentElement.querySelector("span:last-child"); + if (modelNoValue) { + modelNoValue.textContent = product.modelNo; + } + } + + // Find and update Category + const categoryLabel = Array.from(allSpans).find( + (span) => span.textContent === "Category" + ); + if (categoryLabel && product.category) { + const categoryValue = + categoryLabel.parentElement.querySelector("span:last-child"); + if (categoryValue) { + categoryValue.textContent = product.category.charAt(0).toUpperCase() + product.category.slice(1); + } } - } - // Find and update Dimensions - const dimensionsLabel = Array.from(allSpans).find( - (span) => span.textContent === "Dimension" - ); - console.log("Dimensions label found:", dimensionsLabel); - console.log("Product dimensions:", product.dimensions); + // Find and update Dimensions + const dimensionsLabel = Array.from(allSpans).find( + (span) => span.textContent === "Dimension" + ); + console.log("Dimensions label found:", dimensionsLabel); + console.log("Product dimensions:", product.dimensions); - if (dimensionsLabel && product.dimensions) { - const dimensionsValue = - dimensionsLabel.parentElement.querySelector("span:last-child"); - console.log("Dimensions value element:", dimensionsValue); - if (dimensionsValue) { - dimensionsValue.textContent = product.dimensions; - console.log("Updated dimensions to:", product.dimensions); + if (dimensionsLabel && product.dimensions) { + const dimensionsValue = + dimensionsLabel.parentElement.querySelector("span:last-child"); + console.log("Dimensions value element:", dimensionsValue); + if (dimensionsValue) { + dimensionsValue.textContent = product.dimensions; + console.log("Updated dimensions to:", product.dimensions); + } } - } - // Update description content + // Update description content const descriptionContainer = document.getElementById( "product-description-content" ); @@ -691,40 +742,40 @@ async function initProductDetail() { ? window.currentGalleryImages.length - 1 : window.currentGalleryIndex - 1; renderGalleryCarousel(); - }); - } + }); + } - // Update related products section - const relatedGrid = document.getElementById("related-grid"); - if (relatedGrid && product.category) { - console.log("Current product category:", product.category); - console.log( - "All products:", - data.products.map((p) => ({ - id: p.id, - name: p.name, - category: p.category, - })) - ); + // Update related products section + const relatedGrid = document.getElementById("related-grid"); + if (relatedGrid && product.category) { + console.log("Current product category:", product.category); + console.log( + "All products:", + data.products.map((p) => ({ + id: p.id, + name: p.name, + category: p.category, + })) + ); - // Filter related products by category (excluding current product) - const allRelatedProducts = data.products.filter( - (p) => p.category === product.category && p.id !== product.id - ); + // Filter related products by category (excluding current product) + const allRelatedProducts = data.products.filter( + (p) => p.category === product.category && p.id !== product.id + ); - console.log("All related products found:", allRelatedProducts); + console.log("All related products found:", allRelatedProducts); - let currentPage = 1; - const pageSize = 4; + let currentPage = 1; + const pageSize = 4; - function renderRelatedProducts() { - const start = 0; - const end = currentPage * pageSize; - const productsToShow = allRelatedProducts.slice(start, end); + function renderRelatedProducts() { + const start = 0; + const end = currentPage * pageSize; + const productsToShow = allRelatedProducts.slice(start, end); - relatedGrid.innerHTML = productsToShow - .map( - (p) => ` + relatedGrid.innerHTML = productsToShow + .map( + (p) => `
${
-              p.alt || p.name
-            } + p.alt || p.name + }" class="w-full h-full object-cover" />

${ @@ -744,37 +795,37 @@ async function initProductDetail() {

` - ) - .join(""); + ) + .join(""); - // Handle "Show More" button visibility + // Handle "Show More" button visibility + const showMoreBtn = document.getElementById("related-show-more"); + if (showMoreBtn) { + const hasMore = allRelatedProducts.length > end; + showMoreBtn.style.display = hasMore ? "inline-flex" : "none"; + showMoreBtn.classList.add( + "inline-flex", + "items-center", + "justify-center" + ); + } + } + + // Add event listener for "Show More" button const showMoreBtn = document.getElementById("related-show-more"); if (showMoreBtn) { - const hasMore = allRelatedProducts.length > end; - showMoreBtn.style.display = hasMore ? "inline-flex" : "none"; - showMoreBtn.classList.add( - "inline-flex", - "items-center", - "justify-center" - ); + showMoreBtn.addEventListener("click", () => { + currentPage += 1; + renderRelatedProducts(); + }); } - } - // Add event listener for "Show More" button - const showMoreBtn = document.getElementById("related-show-more"); - if (showMoreBtn) { - showMoreBtn.addEventListener("click", () => { - currentPage += 1; - renderRelatedProducts(); - }); + // Initial render + renderRelatedProducts(); } - - // Initial render - renderRelatedProducts(); + } catch (error) { + console.error("Error loading product data:", error); } - } catch (error) { - console.error("Error loading product data:", error); - } } // Product Comparison Page Functionality @@ -1286,7 +1337,7 @@ function initHeroCarousel() { // Ensure image always fits its container uniformly heroImage.style.height = "100%"; - heroImage.style.objectFit = "cover"; + heroImage.style.objectFit = "cover"; // Fade in new image heroImage.style.opacity = "1"; diff --git a/styles/main.css b/styles/main.css index 90de230..181d97b 100644 --- a/styles/main.css +++ b/styles/main.css @@ -783,6 +783,10 @@ video { margin-top: 2.5rem; } +.mt-2 { + margin-top: 0.5rem; +} + .mt-20 { margin-top: 5rem; } @@ -791,16 +795,12 @@ video { margin-top: 0.75rem; } -.mt-12 { - margin-top: 3rem; -} - .mt-6 { margin-top: 1.5rem; } -.mt-2 { - margin-top: 0.5rem; +.mr-4 { + margin-right: 1rem; } .box-border { @@ -891,22 +891,22 @@ video { height: 24rem; } -.h-\[145px\] { - height: 145px; +.h-\[22vh\] { + height: 22vh; } -.h-\[301px\] { - height: 301px; -} - -.h-\[446px\] { - height: 446px; +.h-\[29vh\] { + height: 29vh; } .h-\[64px\] { height: 64px; } +.h-\[6vh\] { + height: 6vh; +} + .h-auto { height: auto; } @@ -923,54 +923,6 @@ video { height: 100vh; } -.h-\[320px\] { - height: 320px; -} - -.h-\[220px\] { - height: 220px; -} - -.h-\[100px\] { - height: 100px; -} - -.h-\[25vh\] { - height: 25vh; -} - -.h-\[18vh\] { - height: 18vh; -} - -.h-\[7vh\] { - height: 7vh; -} - -.h-\[30vh\] { - height: 30vh; -} - -.h-\[22vh\] { - height: 22vh; -} - -.h-\[8vh\] { - height: 8vh; -} - -.h-\[29vh\] { - height: 29vh; -} - -.h-\[21vh\] { - height: 21vh; -} - -.h-\[6vh\] { - height: 6vh; -} - .h-\[31vh\] { height: 31vh; } @@ -983,6 +935,10 @@ video { height: 32vh; } +.h-\[25vh\] { + height: 25vh; +} + .h-\[95vh\] { height: 95vh; } @@ -1111,10 +1067,6 @@ video { max-width: 20rem; } -.max-w-4xl { - max-width: 56rem; -} - .max-w-full { max-width: 100%; } @@ -1248,14 +1200,14 @@ video { gap: 1.5rem; } -.gap-8 { - gap: 2rem; -} - .gap-7 { gap: 1.75rem; } +.gap-8 { + gap: 2rem; +} + .space-x-10 > :not([hidden]) ~ :not([hidden]) { --tw-space-x-reverse: 0; margin-right: calc(2.5rem * var(--tw-space-x-reverse)); @@ -1292,12 +1244,6 @@ video { margin-bottom: calc(0.25rem * var(--tw-space-y-reverse)); } -.space-y-16 > :not([hidden]) ~ :not([hidden]) { - --tw-space-y-reverse: 0; - margin-top: calc(4rem * calc(1 - var(--tw-space-y-reverse))); - margin-bottom: calc(4rem * var(--tw-space-y-reverse)); -} - .space-y-2 > :not([hidden]) ~ :not([hidden]) { --tw-space-y-reverse: 0; margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse))); @@ -1322,6 +1268,12 @@ video { margin-bottom: calc(2rem * var(--tw-space-y-reverse)); } +.space-y-3 > :not([hidden]) ~ :not([hidden]) { + --tw-space-y-reverse: 0; + margin-top: calc(0.75rem * calc(1 - var(--tw-space-y-reverse))); + margin-bottom: calc(0.75rem * var(--tw-space-y-reverse)); +} + .overflow-hidden { overflow: hidden; } @@ -1688,10 +1640,6 @@ video { padding-right: 1.5rem; } -.pt-0 { - padding-top: 0px; -} - .pt-12 { padding-top: 3rem; } @@ -1716,6 +1664,10 @@ video { text-align: center; } +.text-right { + text-align: right; +} + .text-justify { text-align: justify; } @@ -1772,6 +1724,10 @@ video { line-height: 1rem; } +.text-\[10px\] { + font-size: 10px; +} + .font-bold { font-weight: 700; } @@ -2051,6 +2007,10 @@ video { transition-timing-function: cubic-bezier(0, 0, 0.2, 1); } +.last\:border-b-0:last-child { + border-bottom-width: 0px; +} + .hover\:-translate-y-0\.5:hover { --tw-translate-y: -0.125rem; transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); @@ -2390,90 +2350,18 @@ video { margin-left: 2rem; } - .lg\:mt-16 { - margin-top: 4rem; - } - .lg\:mt-8 { margin-top: 2rem; } - .lg\:h-\[70vh\] { - height: 70vh; - } - - .lg\:h-\[90vh\] { - height: 90vh; - } - - .lg\:h-\[50vh\] { - height: 50vh; - } - - .lg\:h-\[600px\] { - height: 600px; - } - - .lg\:h-\[500px\] { - height: 500px; - } - - .lg\:h-\[85vh\] { - height: 85vh; - } - - .lg\:h-\[60vh\] { - height: 60vh; - } - .lg\:h-\[65vh\] { height: 65vh; } - .lg\:min-h-screen { - min-height: 100vh; - } - - .lg\:min-h-\[90vh\] { - min-height: 90vh; - } - - .lg\:min-h-\[100vh\] { - min-height: 100vh; - } - - .lg\:min-h-\[150vh\] { - min-height: 150vh; - } - - .lg\:min-h-\[900px\] { - min-height: 900px; - } - - .lg\:min-h-\[800px\] { - min-height: 800px; - } - - .lg\:min-h-\[700px\] { - min-height: 700px; - } - - .lg\:min-h-\[600px\] { - min-height: 600px; - } - - .lg\:min-h-\[60vh\] { - min-height: 60vh; - } - .lg\:min-h-\[65vh\] { min-height: 65vh; } - .lg\:min-h-\[80vh\] { - min-height: 80vh; - } - .lg\:w-36 { width: 9rem; } @@ -2510,18 +2398,6 @@ video { gap: 2rem; } - .lg\:space-y-10 > :not([hidden]) ~ :not([hidden]) { - --tw-space-y-reverse: 0; - margin-top: calc(2.5rem * calc(1 - var(--tw-space-y-reverse))); - margin-bottom: calc(2.5rem * var(--tw-space-y-reverse)); - } - - .lg\:space-y-6 > :not([hidden]) ~ :not([hidden]) { - --tw-space-y-reverse: 0; - margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse))); - margin-bottom: calc(1.5rem * var(--tw-space-y-reverse)); - } - .lg\:space-y-4 > :not([hidden]) ~ :not([hidden]) { --tw-space-y-reverse: 0; margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse))); @@ -2545,11 +2421,6 @@ video { padding-top: 12rem; } - .lg\:text-2xl { - font-size: 1.5rem; - line-height: 2rem; - } - .lg\:text-3xl { font-size: 1.875rem; line-height: 2.25rem; @@ -2570,11 +2441,6 @@ video { line-height: 1.75rem; } - .lg\:text-lg { - font-size: 1.125rem; - line-height: 1.75rem; - } - .lg\:leading-snug { line-height: 1.375; }