-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlashoopa_ecommerce.js
50 lines (47 loc) · 1.2 KB
/
lashoopa_ecommerce.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const products = [
{
id:0,
name:'Enm Leather Jackets L-size',
image:'./ecommerce3_photo4.jfif'
},
{
id:1,
name:'Enm Leather Jackets L-size',
image:'./ecommerce3_photo4.jfif'
},
{
id:2,
name:'Enm Leather Jackets L-size',
image:'./ecommerce3_photo4.jfif'
},
{
id:3,
name:'Enm Leather Jackets L-size',
image:'./ecommerce3_photo4.jfif'
},
{
id:4,
name:'Enm Leather Jackets L-size',
image:'./ecommerce3_photo4.jfif'
}
];
const products_set = [...new Set(products.map((items) =>{
return items;
}))];
document.getElementById('products').innerHTML = products_set.map((items) =>{
var {id,name,image} = items;
console.log(image);
return(
`<div class="box">
<img src="${image}" alt="">
<div class="contents">
<span>${name}</span>
<span>$1414</span>
</div>
<div class='gap'>
<button class='btn btn-primary'>Buy</buttton>
<button class='btn btn-secondary'>Add to Cartt</buttton>
</div>
</div>`
)
}).join('');