-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcart.html
178 lines (147 loc) · 5.66 KB
/
cart.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=3, minimum-scale=0.5">
<title>Cart</title>
<link href="css/cart.css" rel="stylesheet">
</head>
<body>
<header>
<div class="container-nav">
<div class="logo">
<a href="home.html"><img id="logoimage" src="images/branding/logo.png" alt="logo"></a>
</div>
<nav id="navigation-normal">
<ul>
<li><a href="home.html">Home</a ></li>
<li><a href="shop.html">Shop</a ></li>
<li ><a href="about.html">About<div class="triangle"></div></a >
<ul class="secondary-style">
<li><a href="about.html">About Us</a></li>
<li><a href="news.html">News</a></li>
<li><a href="contact.html">Contact Us</a></li>
</ul>
</li>
<li><a href="cart.html">Cart</a ></li>
</ul>
</nav>
<nav id="navigation-hamburger">
<div id="menuToggle">
<input type="checkbox" id="checkbox-hamburger">
<span></span>
<span></span>
<span></span>
<ul id="menu">
<li ><a href="home.html">Home</a ></li>
<li id="hamburger-style-1"><a href="shop.html">Shop</a ></li>
<li id="hamburger-style-2"><a href="about.html">About Us</a></li>
<li><a href="news.html">News</a></li>
<li><a href="contact.html">Contact Us</a></li>
<li id="hamburger-style-3"><a href="cart.html">Cart</a ></li>
</ul>
</div>
</nav>
</div>
</header>
<div class="title">
<h1>Cart</h1>
</div>
<div class="checkout_cart">
<div class="list-titles">
<ul>
<li class="card_title" id="title1">Product</li>
<li class="card_title" id="title2">Quantity</li>
<li class="card_title" id="title3">Total</li>
</ul>
</div>
<div class="cart_item1">
<div class="cart_item1_image">
<img src="images/cart/mug1.png" alt="Everyday Mug | Stone" class="cart_image">
</div>
<div class="cart_item1_name">
<p>Everyday Mug | Stone</p>
</div>
<div class="cart_item1_amount">
<div class="quantity-selector">
<span class="minus">-</span>
<span class="num">1</span>
<span class="plus">+</span>
</div>
<script>
const plus = document.querySelector(".plus"),
minus = document.querySelector(".minus"),
num = document.querySelector(".num");
let a = 1;
plus.addEventListener("click",()=>{
a++;
console.log(a);
num.innerText = a;
});
minus.addEventListener("click",()=>{
if(a>1){
a--;
num.innerText = a;
}
});
</script>
</div>
<div class="cart_item1_price">
<p>$34</p>
</div>
</div>
<div class="cart_item2">
<div class="cart_item2_image">
<img src="images/cart/mug2.png" alt="Everyday Mug | Anthracite" class="cart_image">
</div>
<div class="cart_item2_name">
<p>Everyday Mug | Anthracite</p>
</div>
<div class="cart_item2_amount">
<div class="quantity-selector">
<span class="minus1">-</span>
<span class="num1">1</span>
<span class="plus1">+</span>
</div>
<script>
const plus1 = document.querySelector(".plus1"),
minus1 = document.querySelector(".minus1"),
num1 = document.querySelector(".num1");
let a1 = 1;
plus1.addEventListener("click",()=>{
a1++;
console.log(a1);
num1.innerText = a1;
});
minus1.addEventListener("click",()=>{
if(a1>1){
a1--;
num1.innerText = a1;
}
});
</script>
</div>
<div class="cart_item2_price">
<p>$27</p>
</div>
</div>
</div>
<div class="total">
<div class="total-price">
<p id="total-price-text">Total price:<strong> $61</strong></p>
</div>
<p>Shipping & taxes calculated at checkout</p>
<input type="button" id="checkout" onclick="location.href='checkout.html'" value="Check out">
</div>
<footer>
<div class="footer-container">
<div class="links-container">
<a href="styleguide.html" class="in-text-link">Style Guide</a>
<a href="styleguide.html#citations" class="in-text-link">Citation</a>
<a href="https://github.com/Fangljf/P02-Company.git" class="in-text-link">Git Repository</a>
</div>
<p>© 2023 Fang Ceramics.</p>
</div>
</footer>
</body>
</html>