-
Notifications
You must be signed in to change notification settings - Fork 2
/
cardpayment.html
185 lines (169 loc) · 4.88 KB
/
cardpayment.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
<!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">
<link rel="shortcut icon" href="images/logo5.jpg" type="image/x-icon">
<title>Fashion Hub | Card Payment</title>
<link rel="shortcut icon" href="/images/favicon.jpg" type="image/x-icon">
<style>
*{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
body{
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background-color: azure;
}
.container{
width: 750px;
height: 500px;
border: 1px solid;
background-color: white;
display: flex;
flex-direction: column;
padding: 40px;
justify-content:space-around;
}
.container h1{
text-align: center;
}
.first-row{
display: flex;
}
.owner{
width: 100%;
margin-right: 40px;
}
.input-field{
border: 1px solid #999;
}
.input-field input{
width: 100%;
border:none;
outline: none;
padding: 10px;
}
.selection{
display: flex;
justify-content: space-between;
align-items: center;
}
.selection select{
padding: 10px 20px;
}
#input{
background-color: rgb(226, 79, 136);
color: white;
text-align: center;
text-transform: uppercase;
text-decoration: none;
padding: 10px;
font-size: 18px;
transition: 0.5s;
border: none;
}
#input:hover{
background-color: black;
}
.cards img{
width: 100px;
}
@media screen and (min-width:600px) and (max-width:900px) {
.container{
width: 550px;
height: 400px;
}
.cards img{
width: 70px;
}
}
</style>
</head>
<body>
<div class="container">
<h1>Confirm Your Payment</h1>
<div class="first-row">
<div class="owner">
<h3>Name on the card</h3>
<div class="input-field">
<input type="text" placeholder="Card Holder Name">
</div>
</div>
<div class="cvv">
<h3>CVV</h3>
<div class="input-field">
<input type="number" id="cvv" placeholder="CVV">
</div>
</div>
</div>
<div class="second-row">
<div class="card-number">
<h3>Card Number</h3>
<div class="input-field">
<input type="number" placeholder="Card Number (Must have 16 digits)" id="number">
</div>
</div>
</div>
<div class="third-row">
<h3>Expiry date</h3>
<div class="selection">
<div class="date">
<select name="months" id="months">
<option value="month">Select</option>
<option value="Jan">Jan</option>
<option value="Feb">Feb</option>
<option value="Mar">Mar</option>
<option value="Apr">Apr</option>
<option value="May">May</option>
<option value="Jun">Jun</option>
<option value="Jul">Jul</option>
<option value="Aug">Aug</option>
<option value="Sep">Sep</option>
<option value="Oct">Oct</option>
<option value="Nov">Nov</option>
<option value="Dec">Dec</option>
</select>
<select name="years" id="years">
<option value="year">Select</option>
<option value="2023">2023</option>
<option value="2024">2024</option>
<option value="2025">2025</option>
<option value="2026">2026</option>
<option value="2027">2027</option>
<option value="2028">2028</option>
<option value="2029">2029</option>
<option value="2030">2030</option>
</select>
</div>
<div class="cards">
<img src="images/mc.png" alt="">
<img src="images/vi.png" alt="">
<img src="images/pp.png" alt="">
</div>
</div>
</div>
<input type="submit" onclick="confirm()" id="input">
</div>
</body>
</html>
<script>
let cardNum=document.getElementById('number');
let cvv=document.getElementById('cvv');
function confirm(){
if(cardNum.value.length==16 && cvv.value.length==3){
alert('Payment successful')
window.location='orderplaced.html'
}
else {
alert('Incorrect credentials')
}
}
</script>