-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
318 lines (284 loc) · 18.3 KB
/
index.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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/css/all.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/styles.css">
<title>RR Shopware: Where casuals meet formals</title>
</head>
<body class="bg-light">
<!-- shop header -->
<div class="container-fluid mb-md-3 mb-1 bg-white shadow">
<div class="row">
<div class="col-md-4 col-12 mx-auto d-flex justify-content-center align-items-center border-end shop_title">
<p class=""><span class="fw-bold">RR </span><span>Shopware</span></p>
</div>
<div class="col-md-8 col-12 mx-auto d-flex justify-content-between align-items-center tagline">
<p><span>Casuals... which are awesome for formal meetings</span></p>
<p><span><a href="https://api.whatsapp.com/send?phone=+4915753284088&text=Hi%2C%20Coder! Love to work for us?" target="_new">Feedback <i class="fab fa-whatsapp"></i></a></span></p>
</div>
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-md-10 col-11 mx-auto">
<div class="row mt-5 gx-3">
<!-- left side div -->
<div class="col-md-12 col-lg-8 col-11 mx-auto main_cart mb-lg-0 mb-5 shadow">
<div class="card p-4">
<h2 class="py-4 font-weight-bold">Cart (2 items)</h2>
<div class="row">
<!-- image div -->
<div
class="col-md-5 col-11 mx-auto bg-white d-flex justify-content-center align-items-center shadow product_img">
<img src="images/shirt-blue.jpg" class="img-fluid" alt="blue shirt">
</div>
<!-- cart product details -->
<div class="col-md-7 col-11 mx-auto px-4 mt-2">
<div class="row">
<!-- Product name -->
<div class="col-6 card-title">
<h1 class="mb-4 product_name">Blue Shirt</h1>
<p class="mb-2">Shirt - Blue</p>
<p class="mb-2">colour - Blue</p>
<p class="mb-2">Size - M</p>
<p class="mb-3">Rate - $20</p>
</div>
<!-- quantity inc/dec -->
<div class="col-6">
<ul class="pagination justify-content-end set_quantity">
<li class="page-item">
<button class="page-link fas fa-minus"
onclick="decreaseNumber('quantity1','itemCost1')">
</button>
</li>
<li class="page-item"><input type="text" name="" class="page-link"
value="0" id="quantity1">
</li>
<li class="page-item">
<button class="page-link fas fa-plus"
onclick="increaseNumber('quantity1','itemCost1')">
</button>
</li>
</ul>
</div>
</div>
<!-- remove, move, price -->
<div class="row">
<div class="col-8 d-flex justify-content-between remove_wish">
<p><i class="fas fa-trash-alt"></i>Remove from Cart</p>
<p><i class="fas fa-heart"></i>Add to Wishlist</p>
</div>
<div class="col-4 d-flex justify-content-end price_money">
<h3>$<span id="itemCost1">0.00</span></h3>
</div>
</div>
</div>
</div>
</div>
<hr />
<!-- item 2 start here; separation -->
<div class="card p-4">
<div class="row">
<!-- image div -->
<div
class="col-md-5 col-11 mx-auto bg-white d-flex justify-content-center align-items-center shadow product_img">
<img src="images/shirt-green.jpg" class="img-fluid" alt="blue shirt">
</div>
<!-- cart product details -->
<div class="col-md-7 col-11 mx-auto px-4 mt-2">
<div class="row">
<!-- Product name -->
<div class="col-6 card-title">
<h1 class="mb-4 product_name">Green Shirt</h1>
<p class="mb-2">Shirt - Green</p>
<p class="mb-2">colour - Green</p>
<p class="mb-2">Size - M</p>
<p class="mb-3">Rate - $15</p>
</div>
<!-- quantity inc/dec -->
<div class="col-6">
<ul class="pagination justify-content-end set_quantity">
<li class="page-item"><button class="page-link fas fa-minus"
onclick="decreaseNumber('quantity2','itemCost2')"></button>
</li>
<li class="page-item"><input type="text" class="page-link" value="0"
id="quantity2"></li>
<li class="page-item"><button class="page-link fas fa-plus"
onclick="increaseNumber('quantity2','itemCost2')"></button>
</li>
</ul>
</div>
</div>
<!-- remove, move, price -->
<div class="row">
<div class="col-8 d-flex justify-content-between remove_wish">
<p><i class="fas fa-trash-alt"></i>Remove from Cart</p>
<p><i class="fas fa-heart"></i>Add to Wishlist</p>
</div>
<div class="col-4 d-flex justify-content-end price_money">
<h3>$<span id="itemCost2">0.00</span></h3>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- right side div -->
<div class="col-md-12 col-lg-4 col-11 mx-auto mt-lg-0 mt-md-5">
<div class="right_side p-3 shadow bg-white">
<h2 class="product_name mb-5">The total amount of</h2>
<div class="price_indiv d-flex justify-content-between">
<p>Product amount</p>
<p>$<span id="product_total_amt">0.00</span></p>
</div>
<div class="price_indiv d-flex justify-content-between">
<p>Shipping charge</p>
<p>$<span id="shipping_charge">50.00</span></p>
</div>
<hr />
<div class="total-amt d-flex justify-content-between fw-bold">
<p> Total amount (incl. taxes)</p>
<p>$<span id="total_cart_amt">0.00</span></p>
</div>
<button class="btn btn-primary text-uppercase"
onclick="alert('It is a demo! Chill!')">checkout</button>
</div>
<!-- discount code -->
<div class="discount_code mt-3 shadow">
<div class="card">
<div class="card-body">
<a class="d-flex justify-content-between" data-bs-toggle="collapse"
href="#collapseExample" aria-expanded="false"
aria-controls="collapseExample">
add a discount code
<span><i class="fas fa-chevron-down pt-1"></i></span>
</a>
<div class="collapse" id="collapseExample">
<div class="mt-3">
<input type="text" name="" id="discount_code1"
class="form-control fw-bold" placeholder="Enter discount code">
<small id="error_trw" class="text-dark mt-3"></small>
</div>
<button class="btn btn-primary btn-sm mt-3"
onclick="discountCode()">Apply</button>
</div>
</div>
</div>
</div>
<div class="mt-3 shadow p-3 bg-white">
<div class="pt-4">
<h5 class="mb-4">Expected delivery date</h5>
<p id="expectedDeliveryDate"></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Optional JavaScript; choose one of the two! -->
<!-- Option 1: Bootstrap Bundle with Popper -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<!-- Option 2: Separate Popper and Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>
<script>
var product_total_amt = document.getElementById('product_total_amt');
var total_cart_amt = document.getElementById('total_cart_amt');
var shipping_charge = document.getElementById('shipping_charge');
var discount_code1 = document.getElementById('discount_code1');
var p_delivery_date = document.getElementById('expectedDeliveryDate');
var blue_shirt_rate = 20.0;
var green_shirt_rate = 15.0;
const decreaseNumber = (qty, cost) => {
const itemQuantity = document.getElementById(qty);
const costForItem = document.getElementById(cost);
if (itemQuantity.value <= 0) {
itemQuantity.value = 0;
} else {
let decrement = 10000;
if('quantity1' === qty) decrement = blue_shirt_rate;
else if ('quantity2' === qty) decrement = green_shirt_rate;
itemQuantity.value = parseInt(itemQuantity.value) - 1;
itemQuantity.style.background = '#fff';
itemQuantity.style.color = 'black';
costForItem.innerHTML = parseInt(costForItem.innerHTML) - decrement;
product_total_amt.innerHTML = parseInt(product_total_amt.innerHTML) - decrement;
total_cart_amt.innerHTML = parseInt(product_total_amt.innerHTML)
+ parseInt(shipping_charge.innerHTML);
}
}
const increaseNumber = (qty, cost) => {
const itemQuantity = document.getElementById(qty);
const totalCostForItem = document.getElementById(cost);
if (itemQuantity.value >= 5) {
itemQuantity.value = 5;
itemQuantity.style.background = 'red';
itemQuantity.style.color = '#fff';
alert('Maximum 5 allowed');
} else {
let increment = 10000;
if('quantity1' === qty) increment = blue_shirt_rate;
else if ('quantity2' === qty) increment = green_shirt_rate;
itemQuantity.value = parseInt(itemQuantity.value) + 1;
totalCostForItem.innerHTML = parseInt(totalCostForItem.innerHTML) + increment;
product_total_amt.innerHTML = parseInt(product_total_amt.innerHTML) + increment;
total_cart_amt.innerHTML = parseInt(product_total_amt.innerHTML)
+ parseInt(shipping_charge.innerHTML);
}
}
hasCouponBeenUsed = false;
const discountCode = () => {
let totalAmountOld = parseInt(total_cart_amt.innerHTML);
if (!hasCouponBeenUsed && 'raj' === discount_code1.value) {
hasCouponBeenUsed = true;
totalAmountOld = parseInt(total_cart_amt.innerHTML);
let totalAmountNew = totalAmountOld - 10;
total_cart_amt.innerHTML = totalAmountNew;
error_trw.innerHTML = 'Hurray!';
} else if ('raj' !== discount_code1.value) {
if(hasCouponBeenUsed) {
total_cart_amt.innerHTML = parseInt(total_cart_amt.innerHTML) + 10;
hasCouponBeenUsed = false;
}
error_trw.innerHTML = discount_code1.value? 'Coupon code not applicable!': 'No coupon code entered!';
} }
function formatDate(date) {
dArray = (date.toString()).split(' ');
[dayOfWeek,month,dayOfMonth,year,timeOfDay,...timezone] = dArray;
timezone = ''+timezone;
timezone = timezone.replace(/,/g,' ');
return dayOfWeek+' '+dayOfMonth+'.'+month+'.'+year
+' '+timeOfDay+' '+timezone;
}
(function setExpectedDeliveryDate() {
var date = new Date();
date.setDate(date.getDate() + 7);
console.log(date);
date = formatDate(date);
p_delivery_date.innerHTML = date;
})();
</script>
<div class="container-fluid bg-white mt-md-4 mt-2">
<div class="row">
<div class="col-md-4 col-12 mx-0 px-auto pt-2 mb-1 border-end d-flex flex-row-reverse">
<a href="https://github.com/rishiraj88?tab=repositories" target="_new"><p id="about">About Me <i class="fa fa-user"></i></p></a>
</div>
<div class="col-md-4 col-12 mx-0 px-auto pt-2 mb-1 border-end d-flex justify-content-center">
<a href="tel:+49-1575-328-4088" target="_new"><p id="about">Phone <i class="fa fa-phone"></i></p></a>
</div>
<div class="col-md-4 col-12 mx-0 px-auto pt-2 mb-1 d-flex flex-row">
<a href="https://www.linkedin.com/in/rishirajopenminds/" target="_new"><p>Social <i class="fa fa-network-wired"></i></p></a>
</div>
</div>
</div>
</body>
</html>