diff --git a/app.js b/app.js index a56dc17..7553ff4 100644 --- a/app.js +++ b/app.js @@ -4,8 +4,8 @@ const IntroText = document.querySelector(".IntroText") const MenuBtn = document.querySelector("#MenuBtn") const Nav = document.querySelector("nav") const CardsHolder = document.querySelector(".CardsHolder") +const ProductsCategory = document.querySelector("#ProductsCategory") /// animations - // anime js 1. Display Image // anime({ // targets: '.DisplayImage', @@ -79,14 +79,11 @@ function GetProducts(){ fetch("./products.json") .then(response => response.json()) .then(data =>{ - console.log(data); data.map(data=>{ - console.log(data.name); // create card for each data CreateProductCard(data.image, data.name, data.company, data.make, data.cost) }) }); - } @@ -106,4 +103,25 @@ function CreateProductCard(Pimage, PName, PCompany, PMake, PCost){ CardsHolder.append(newCard); } -// Displaying Products depending on the category the user wants \ No newline at end of file +// Displaying Products depending on the category the user wants +// ProductsCategory.addEventListener('change', ()=>{ +// console.log(ProductsCategory.value); +// let categoryChoice = ProductsCategory.value; +// fetch("./products.json") +// .then(response => response.json()) +// .then(data =>{ +// data.map(data=>{ +// if(data.category === categoryChoice){ +// CardsHolder.innerHTML = ""; +// let FilteredData = data; +// console.table(FilteredData); +// // FilteredData.map(FilteredData=>{ +// // // create card for each data +// // CreateProductCard(FilteredData.image, FilteredData.name, FilteredData.company, FilteredData.make, FilteredData.cost) +// // }) +// } +// }) + +// }); + +// }) \ No newline at end of file diff --git a/index.html b/index.html index 225e789..ac5bcb7 100644 --- a/index.html +++ b/index.html @@ -60,11 +60,11 @@

Our Products

diff --git a/products.json b/products.json index b05a4e2..424f906 100644 --- a/products.json +++ b/products.json @@ -1,7 +1,7 @@ [ { "name":"Nikon D56 Camera", - "image":"./images/Camera1.png", + "image":"images/Camera1.png", "company": "Camera", "make": "CM001 Brand New", "cost": "20000", @@ -9,7 +9,7 @@ }, { "name":"Canon ED6s ", - "image":"./images/Canon Camera1.png", + "image":"images/Canon Camera1.png", "company": "Canon", "make": "EDS 5500 Brand New", "cost": "60000", @@ -17,7 +17,7 @@ }, { "name":"Sony 4K", - "image":"./images/HdCamera1.png", + "image":"images/HdCamera1.png", "company": "Sony", "make": "HD4K Brand New", "cost": "90000", @@ -25,7 +25,7 @@ }, { "name":"Canon 4K", - "image":"./images/HdCamera2 Canon.png", + "image":"images/HdCamera2 Canon.png", "company": "Canon", "make": "4K Brand New", "cost": "97000", @@ -33,7 +33,7 @@ }, { "name":"Nikon Camera", - "image":"./images/Nikon Camera1.png", + "image":"images/Nikon Camera1.png", "company": "Nikon", "make": "D5600 Brand New", "cost": "45000", @@ -41,7 +41,7 @@ }, { "name":"NikonD67 Camera", - "image":"./images/Nikon Camera2.png", + "image":"images/Nikon Camera2.png", "company": "Nikon", "make": " Brand New", "cost": "37000", @@ -49,7 +49,7 @@ }, { "name":"Portable Sony Camera", - "image":"./images/PortableCamera1.png", + "image":"images/PortableCamera1.png", "company": "Sony", "make": "4X Portable Brand New", "cost": "17000", @@ -57,7 +57,7 @@ }, { "name":"Samsung Shoot", - "image":"./images/Samsung Camera1.png", + "image":"images/Samsung Camera1.png", "company": "Samsung", "make": "35ES Brand New", "cost": "32000", @@ -65,7 +65,7 @@ }, { "name":"Sony Full HD", - "image":"./images/SonyCamera1.png", + "image":"images/SonyCamera1.png", "company": "Sony", "make": "EY1 Full HD Brand New", "cost": "47770", @@ -73,7 +73,7 @@ }, { "name":"Canon2 Camera", - "image":"./images/Nikon Camera2.png", + "image":"images/Nikon Camera2.png", "company": "Canon", "make": " Brand New", "cost": "37000", @@ -81,7 +81,7 @@ }, { "name":"RichTonics White", - "image":"./images/Headphone1.png", + "image":"images/Headphone1.png", "company": "RichTonics", "make": " White E1 ", "cost": "1500", @@ -89,7 +89,7 @@ }, { "name":"RichTonics black with Mic", - "image":"./images/Headphone2.png", + "image":"images/Headphone2.png", "company": "RichTonics", "make": " Black 001 Brand New", "cost": "1700", @@ -97,7 +97,7 @@ }, { "name":"Bull Reds", - "image":"./images/Headphone3.png", + "image":"images/Headphone3.png", "company": "Bull", "make": "Red,Brand New", "cost": "2000", @@ -105,7 +105,7 @@ }, { "name":"Bull Yellows", - "image":"./images/Headphone4.png", + "image":"images/Headphone4.png", "company": "Bull", "make": "Yellow Brand New", "cost": "2000", @@ -113,7 +113,7 @@ }, { "name":"Bull White Super", - "image":"./images/Headphone5.png", + "image":"images/Headphone5.png", "company": "Bull", "make": "White Brand", "cost": "2100", @@ -121,7 +121,7 @@ }, { "name":"Rich Blues", - "image":"./images/Headphone6.png", + "image":"images/Headphone6.png", "company": "Bull", "make": "Blue 03S Brand New", "cost": "900", @@ -129,7 +129,7 @@ }, { "name":"Black Fire ", - "image":"./images/Headphone7.png", + "image":"images/Headphone7.png", "company": "Bull", "make": "Black Brand New", "cost": "2900", @@ -137,7 +137,7 @@ }, { "name":"Girly Cherrys", - "image":"./images/Headphone8.png", + "image":"images/Headphone8.png", "company": "Bull", "make": "Pink Brand New", "cost": "2000", @@ -145,7 +145,7 @@ }, { "name":"Fer Racers Headphones", - "image":"./images/Headphone9.png", + "image":"images/Headphone9.png", "company": "Bull", "make": "Red Brand New", "cost": "5000", @@ -153,7 +153,7 @@ }, { "name":"OrangeRiches with Mic", - "image":"./images/Headphone10.png", + "image":"images/Headphone10.png", "company": "Bull", "make": "Orange Brand New", "cost": "7000", @@ -161,7 +161,7 @@ }, { "name":"Samsung S10 2019", - "image":"./images/Phone1.png", + "image":"images/Phone1.png", "company": "Samsung", "make": "S10 Black Brand New", "cost": "20000", @@ -169,7 +169,7 @@ }, { "name":"Iphane5 mini", - "image":"./images/Phone2.png", + "image":"images/Phone2.png", "company": "Apple", "make": "i5 mini Black Brand New", "cost": "15000", @@ -177,7 +177,7 @@ }, { "name":"Iphane 5", - "image":"./images/Phone3.png", + "image":"images/Phone3.png", "company": "Apple", "make": "i5 Black Brand New", "cost": "20000", @@ -185,7 +185,7 @@ }, { "name":"Iphane 6", - "image":"./images/Phone4.png", + "image":"images/Phone4.png", "company": "Apple", "make": "i6 Black Brand New", "cost": "23000", @@ -193,7 +193,7 @@ }, { "name":"iphane 5 Silk", - "image":"./images/Phone5.png", + "image":"images/Phone5.png", "company": "Apple", "make": "Silver Grey Brand New", "cost": "25000", @@ -201,7 +201,7 @@ }, { "name":"iphane 5 White", - "image":"./images/Phone6.png", + "image":"images/Phone6.png", "company": "Apple", "make": "White-black Brand New", "cost": "25000", @@ -209,7 +209,7 @@ }, { "name":"iphane 7", - "image":"./images/Phone7.png", + "image":"images/Phone7.png", "company": "Apple", "make": "Pink-White Brand New", "cost": "27000", @@ -217,7 +217,7 @@ }, { "name":"iphane8 mini", - "image":"./images/Phone8.png", + "image":"images/Phone8.png", "company": "Apple", "make": "red, blue,white Brands", "cost": "25000", @@ -225,7 +225,7 @@ }, { "name":"iphoneX", - "image":"./images/Phone9.png", + "image":"images/Phone9.png", "company": "Apple", "make": "Black,Blue,Grey White Brands", "cost": "35000", @@ -233,7 +233,7 @@ }, { "name":"iphone9 mini", - "image":"./images/Phone10.png", + "image":"images/Phone10.png", "company": "Apple", "make": "White Brand New", "cost": "35000", @@ -241,7 +241,7 @@ }, { "name":"ZP Colored Printer", - "image":"./images/Printer1.png", + "image":"images/Printer1.png", "company": "ZP", "make": "Colored Photo Printer", "cost": "10000", @@ -249,7 +249,7 @@ }, { "name":"ZP Printer", - "image":"./images/Printer2.png", + "image":"images/Printer2.png", "company": "ZP", "make": "B&W Printer", "cost": "7900", @@ -257,7 +257,7 @@ }, { "name":"QP BLue Laser Printer", - "image":"./images/Printer3.png", + "image":"images/Printer3.png", "company": "QP", "make": "Coloured Printer", "cost": "11900", @@ -265,7 +265,7 @@ }, { "name":"AB Printer", - "image":"./images/Printer4.png", + "image":"images/Printer4.png", "company": "AB", "make": "B&W Printer", "cost": "6400", @@ -273,7 +273,7 @@ }, { "name":"ZPB Laser Printer", - "image":"./images/Printer5.png", + "image":"images/Printer5.png", "company": "ZP", "make": "Brand 091 Laser Printer", "cost": "8900", @@ -281,7 +281,7 @@ }, { "name":"ZP Black Printer", - "image":"./images/Printer6.png", + "image":"images/Printer6.png", "company": "ZP", "make": "ZPH1 Printer", "cost": "7900", @@ -289,7 +289,7 @@ }, { "name":"ZP Office Printer", - "image":"./images/Printer7.png", + "image":"images/Printer7.png", "company": "ZP", "make": "Multipurpose Printer", "cost": "17000", @@ -297,7 +297,7 @@ }, { "name":"Canon Photo Printer", - "image":"./images/Printer8.png", + "image":"images/Printer8.png", "company": "ZP", "make": "CNH2 Photo Printer", "cost": "17800", @@ -305,7 +305,7 @@ }, { "name":"Canon office Printer", - "image":"./images/Printer9.png", + "image":"images/Printer9.png", "company": "ZP", "make": "CNH2 Office Printer", "cost": "19900", @@ -313,7 +313,7 @@ }, { "name":"Canon-B01 Photo Printer", - "image":"./images/Printer10.png", + "image":"images/Printer10.png", "company": "ZP", "make": "CNH1B01 Photo Printer", "cost": "9900", @@ -321,7 +321,7 @@ }, { "name":"Apple Desktop", - "image":"./images/ComputerA1.png", + "image":"images/ComputerA1.png", "company": "Apple", "make": "Desktop Monitor", "cost": "66900", @@ -329,7 +329,7 @@ }, { "name":"Apple MiniDesktop", - "image":"./images/ComputerA2.png", + "image":"images/ComputerA2.png", "company": "Apple", "make": "Desktop Monitor", "cost": "60900", @@ -337,7 +337,7 @@ }, { "name":"Mackbook", - "image":"./images/ComputerA3.png", + "image":"images/ComputerA3.png", "company": "Apple", "make": "Mackbook AZ1", "cost": "89900", @@ -345,7 +345,7 @@ }, { "name":"Abus Gaming Computer", - "image":"./images/ComputerG1.png", + "image":"images/ComputerG1.png", "company": "Abus", "make": "8th Gen Blue Brand", "cost": "55500", @@ -353,7 +353,7 @@ }, { "name":"IGG Gaming Computer", - "image":"./images/ComputerG2.png", + "image":"images/ComputerG2.png", "company": "IGG", "make": "8th Gen Red Brand", "cost": "56900", @@ -361,7 +361,7 @@ }, { "name":"RichTonics Gaming Computer", - "image":"./images/ComputerG3.png", + "image":"images/ComputerG3.png", "company": "Richtonics", "make": "6th Gen Gaming Computer", "cost": "44999", @@ -369,7 +369,7 @@ }, { "name":"RichTonicsHC Gaming Computer", - "image":"./images/ComputerG4.png", + "image":"images/ComputerG4.png", "company": "Richtonics", "make": "6th Gen GamingHC Computer", "cost": "47999", @@ -377,7 +377,7 @@ }, { "name":"RichTonicsRD Gaming Computer", - "image":"./images/ComputerG5.png", + "image":"images/ComputerG5.png", "company": "Richtonics", "make": "6th Gen Red Gaming Computer", "cost": "41999", @@ -385,7 +385,7 @@ }, { "name":"RichTonics Water Cooled Computer", - "image":"./images/ComputerG6.png", + "image":"images/ComputerG6.png", "company": "Richtonics", "make": "9th Gen UltraGaming Computer", "cost": "74999",