-
Notifications
You must be signed in to change notification settings - Fork 0
/
cart_page5.html
120 lines (102 loc) · 3.52 KB
/
cart_page5.html
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="navBar\components\nav.css">
<link rel="icon" href="images/Screenshot 2022-12-14 075742.png" type="image/icon type">
<link rel="stylesheet" href="Slider Module/slider.css">
<script src="Slider Module/slider.js"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.2/css/bootstrap.min.css" />
<script src="https://kit.fontawesome.com/24c494a6b6.js" crossorigin="anonymous" ></script>
<style>
#container5{
display: grid;
grid-template-columns: repeat(4,1fr);
grid-template-rows: auto;
gap: 8px;
/* margin-top: 2%; */
}
#container5>div{
box-shadow: rgba(0, 0, 0, 0.07) 0px 1px 1px, rgba(0, 0, 0, 0.07) 0px 2px 2px, rgba(0, 0, 0, 0.07) 0px 4px 4px, rgba(0, 0, 0, 0.07) 0px 8px 8px, rgba(0, 0, 0, 0.07) 0px 16px 16px;
text-align: center;
}
#container5>div:hover{
cursor: pointer;
background-color: rgb(218, 193, 159);
box-shadow: rgba(0, 0, 0, 0.09) 0px 2px 1px, rgba(0, 0, 0, 0.09) 0px 4px 2px, rgba(0, 0, 0, 0.09) 0px 8px 4px, rgba(0, 0, 0, 0.09) 0px 16px 8px, rgba(0, 0, 0, 0.09) 0px 32px 16px;
}
#container5>div>img{
width:70%;
}
#container5>div>img:hover{
width: 75%;
}
button{
width: 150px;
height: 25px;
background-color: rgb(170, 187, 182);
border-radius: 20px;
margin-bottom: 5%;
}
button:hover{
cursor: pointer;
color: rgb(51, 9, 9);
font-weight: bold;
background-color: rgb(57, 79, 121);
}
/* Medium screens */
@media all and (min-width: 451px) and (max-width: 750px) {
#container5{
grid-template-columns: repeat(2,1fr);
}
}
/* Small screens */
@media all and (min-width: 100px) and (max-width: 450px) {
#container5{
grid-template-columns: repeat(1,1fr);
}
}
</style>
</head>
<body>
<div class="header">
</div>
<div id="container5"></div>
</body>
</html>
<script type="module">
import { navBar } from "./navBar/components/nav.js";
let header = document.querySelector(".header")
header.innerHTML = navBar();
let items5 = JSON.parse(localStorage.getItem("cartproduct5"));
console.log(items5)
displayTable(items5);
function displayTable(array){
console.log(array)
document.querySelector("#container5").innerHTML="";
array.forEach((element) => {
let div=document.createElement("div")
let img=document.createElement("img")
img.setAttribute("src",element.image)
// let name=document.createElement("h5")
// name.innerText=element.name;
let detail=document.createElement("p")
detail.innerText=element.pro_detail.substring(1,50);
let id=document.createElement("h4")
id.innerText=`id: ${element.id}`;
let price=document.createElement("h4")
price.innerText=`Price:- ${element.price}`;
// let review=document.createElement("h4")
// review.innerText=`rating: ${element.review_num}`;
// let shiping=document.createElement("p")
// shiping.innerText=`ship: ${element.free_ship}`;
div.append(img,detail,id,price)
document.querySelector("#container5").append(div)
});
// localStorage.clear("cartproduct5")
}
</script>