-
Notifications
You must be signed in to change notification settings - Fork 0
/
payment.html
386 lines (324 loc) · 7.67 KB
/
payment.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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
<!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 href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet">
<link rel="stylesheet" href="style.css">
<style>
* {
box-sizing: border-box;
}
html,
body {
font-family: 'Montserrat', sans-serif;
display: flex;
width: 100%;
height: 100%;
background: #f4f4f4;
justify-content: center;
align-items: center;
}
/*
--- Checkout Panel
*/
.checkout-panel {
display: flex;
flex-direction: column;
width: 940px;
height: 766px;
background-color: rgb(255, 255, 255);
box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .2);
}
/* Panel Body */
.panel-body {
padding: 45px 80px 0;
flex: 1;
}
.title {
font-weight: 700;
margin-top: 0;
margin-bottom: 40px;
color: #2e2e2e;
}
/* Progress Bar */
.progress-bar {
display: flex;
margin-bottom: 50px;
justify-content: space-between;
}
.step {
box-sizing: border-box;
position: relative;
z-index: 1;
display: block;
width: 25px;
height: 25px;
margin-bottom: 30px;
border: 4px solid #fff;
border-radius: 50%;
background-color: #efefef;
}
.step:after {
position: absolute;
z-index: -1;
top: 5px;
left: 22px;
width: 225px;
height: 6px;
content: '';
background-color: #efefef;
}
.step:before {
color: #2e2e2e;
position: absolute;
top: 40px;
}
.step:last-child:after {
content: none;
}
.step.active {
background-color: #f62f5e;
}
.step.active:after {
background-color: #f62f5e;
}
.step.active:before {
color: #f62f5e;
}
.step.active + .step {
background-color: #f62f5e;
}
.step.active + .step:before {
color: #f62f5e;
}
.step:nth-child(1):before {
content: 'Delivery';
}
.step:nth-child(2):before {
right: -40px;
content: 'Confirmation';
}
.step:nth-child(3):before {
right: -30px;
content: 'Payment';
}
.step:nth-child(4):before {
right: 0;
content: 'Finish';
}
/* Payment Method */
.payment-method {
display: flex;
margin-bottom: 60px;
justify-content: space-between;
}
.method {
display: flex;
flex-direction: column;
width: 382px;
height: 122px;
padding-top: 20px;
cursor: pointer;
border: 1px solid transparent;
border-radius: 2px;
background-color: rgb(249, 249, 249);
justify-content: center;
align-items: center;
}
.blue-border {
border: 1px solid rgb(110, 178, 251);
}
.card-logos {
display: flex;
width: 150px;
justify-content: space-between;
align-items: center;
}
.radio-input {
margin-top: 20px;
}
input[type='radio'] {
display: inline-block;
}
/* Input Fields */
.input-fields {
display: flex;
justify-content: space-between;
}
.input-fields label {
display: block;
margin-bottom: 10px;
color: #b4b4b4;
}
.warning {
border-color: #f62f5e !important;
}
.info {
font-size: 12px;
font-weight: 300;
display: block;
margin-top: 50px;
opacity: .5;
color: #2e2e2e;
}
div[class*='column'] {
width: 382px;
}
input[type='text'],
input[type='password'] {
font-size: 16px;
width: 100%;
height: 50px;
padding-right: 40px;
padding-left: 16px;
color: rgba(46, 46, 46, .8);
border: 1px solid rgb(225, 225, 225);
border-radius: 4px;
outline: none;
}
input[type='text']:focus,
input[type='password']:focus {
border-color: rgb(119, 219, 119);
}
#date { background: url(img/icons_calendar_black.png) no-repeat 90%; }
#cardholder { background: url(img/icons_person_black.png) no-repeat 95%; }
#cardnumber { background: url(img/icons_card_black.png) no-repeat 95%; }
#verification { background: url(img/icons_lock_black.png) no-repeat 90%; }
.small-inputs {
display: flex;
margin-top: 20px;
justify-content: space-between;
}
.small-inputs div {
width: 182px;
}
/* Panel Footer */
.panel-footer {
display: flex;
width: 100%;
height: 96px;
padding: 0 80px;
background-color: rgb(239, 239, 239);
justify-content: space-between;
align-items: center;
}
/* Buttons */
.btn {
font-size: 16px;
width: 163px;
height: 48px;
cursor: pointer;
transition: all .2s ease-in-out;
letter-spacing: 1px;
border: none;
border-radius: 23px;
}
.back-btn {
color: #f62f5e;
background: #fff;
}
.next-btn {
color: #fff;
background: #f62f5e;
}
.btn:focus {
outline: none;
}
.btn:hover {
transform: scale(1.1);
}
</style>
</head>
<body>
<div class="checkout-panel">
<div class="panel-body">
<h2 class="title">Checkout</h2>
<div class="progress-bar">
<div class="step active"></div>
<div class="step active"></div>
<div class="step"></div>
<div class="step"></div>
</div>
<div class="payment-method">
<label for="card" class="method card">
<div class="card-logos">
<img src="img/visa_logo.png"/>
<img src="img/mastercard_logo.png"/>
</div>
<div class="radio-input">
<input id="card" type="radio" name="payment">
<p>Pay <span id="total1">£340.00</span> with credit card </p>
</div>
</label>
<label for="paypal" class="method paypal">
<img src="img/paypal_logo.png"/>
<div class="radio-input">
<input id="paypal" type="radio" name="payment">
<p>Pay <span id="total2">£340.00</span> with PayPal </p>
</div>
</label>
</div>
<div class="input-fields">
<div class="column-1">
<label for="cardholder">Cardholder's Name</label>
<input type="text" id="cardholder" />
<div class="small-inputs">
<div>
<label for="date">Valid thru</label>
<input type="text" id="date" placeholder="MM / YY" />
</div>
<div>
<label for="verification">CVV / CVC *</label>
<input type="password" id="verification"/>
</div>
</div>
</div>
<div class="column-2">
<label for="cardnumber">Card Number</label>
<input type="password" id="cardnumber"/>
<span class="info">* CVV or CVC is the card security code, unique three digits number on the back of your card separate from its number.</span>
</div>
</div>
</div>
<div class="panel-footer">
<a href="./checkout.html"> <button class="btn back-btn">Back</button> </a>
<a href="./final.html"><button class="btn next-btn">CONFIRM</button></a>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script src="script.js"></script>
</body>
<script>
$(document).ready(function() {
// Radio box border
$('.method').on('click', function() {
$('.method').removeClass('blue-border');
$(this).addClass('blue-border');
});
// Validation
var $cardInput = $('.input-fields input');
$('.next-btn').on('click', function(e) {
$cardInput.removeClass('warning');
$cardInput.each(function() {
var $this = $(this);
if (!$this.val()) {
$this.addClass('warning');
}
});
});
});
let card = document.getElementById('total1')
let paypal = document.getElementById('total2')
let incart1 = JSON.parse(localStorage.getItem('incart1'))
// console.log(incart1)
let sum=0;
for(let i=0;i<incart1.length;i++){
sum+=incart1[i].price*incart1[i].quantity;
}
card.innerText = sum
paypal.innerText = sum
</script>
</html>