forked from gauravkrs/Blinkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
data.html
287 lines (240 loc) · 7.13 KB
/
data.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
<!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="icon" href="https://blinkit.com/images/apple-touch-icon-change-60x60-1be1e81.png">
<link rel="stylesheet" href="./CSS/login.css"/>
<style>
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;1,800&family=Source+Serif+4:wght@200;300;400;700&display=swap');
#LOgin{
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
/* margin: auto; */
/* margin-top: 100px; */
width: 700px;
box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px;
position: absolute;
margin: 100px 27.5% 0px 27% ;
}
.PHoneVErHeading>h2{
color: rgb(5, 4, 4);
text-align: center;
font-weight: 400;
margin-top: 20px;
font-family: 'Montserrat', sans-serif;
}
.LOginDEtails{
background-color: #f9f9f9;
width: 100%;
border : solid rgb(253, 247, 247) 2px;
/* border: solid red 2px; */
}
#otpMob{
box-sizing: border-box;
border: 1px solid #ccc;
-webkit-transition: 0.5s;
transition: 0.5s;
outline: none;
text-align: center;
}
#otpMob:focus{
border: 1px solid rgb(160, 156, 156);
}
.LOginDEtails p{
width: 40px;
font-weight: 400;
font-size: 22px;
padding:0px 10px 0px 10px;
color: rgb(61, 61, 61);
margin-top: 50px;
/* border: solid red 2px; */
}
.LOginInput input{
height: 50px;
width: 390px;
border: #ccc 2px solid;
border-radius: 3px;
font-size: 18px;
color: rgb(34, 33, 33);
}
.NExtBUtton button{
height: 53px;
width: 400px;
margin-top: 30px;
background-color: #ccc;
border-radius: 3px;
border: none;
color: #fff;
/* cursor: pointer; */
font-family: inherit;
font-size: 14px;
outline: none;
padding: 13px 12px;
margin-bottom: 25px;
}
.PHoneVErHeading{
background-color: rgb(255,255,255);
}
.LOginDEtailsHEad{
text-align: center;
padding: 10px 150px;
}
/* <------------Extra for otp---------> */
.back{
color: #318616;;
border: none;
background-color: inherit;
font-size: 18px;
cursor: pointer;
margin: 25px 25px;
}
#otp{
width:69px;
box-sizing: border-box;
border: 2px solid #ccc;
-webkit-transition: 0.5s;
transition: 0.5s;
outline: none;
text-align: center;
}
#otp:focus{
border: 2px solid rgb(160, 156, 156);
}
.resendCode{
/* color:#318616;; */
display: block;
cursor: pointer;
font: 18px;
margin-top: 0px;
margin-bottom: 40px;
}
@media (max-width:1020px){
body{
background-color: #eee;
}
#LOgin{
background-color: #eee;
/* height: px; */
width: 100%;
margin: -10px -10px;
margin-right: 0px;
}
.PHoneVErHeading{
margin-top: 75px;
}
.PHoneVErHeading>h2{
color: #333;
background-color: #eee;
justify-content: center;
width: auto;
}
.LOginDEtails{
background-color: #eee;
height: auto;
width: 97%;
align-self: center;
border : none
}
.LOginDEtails div{
background-color: #eee;
height: auto;
width: 100%;
}
.LOginDEtails p{
padding:0px 10px;
margin-top: 60px;
color: rgb(61, 61, 61);
}
.LOginInput input,.NExtBUtton button{
width: 95%;
}
}
</style>
</head>
<body>
<div id="LOgin">
<button class="back" onclick="window.location.href='login.html'"> < back</button>
<div class="PHoneVErHeading">
<h2>
Phone Number Verification
</h2>
</div>
<div class="LOginDEtails">
<div align="center">
<p style="width: 60%;max-width: 400px;">
</p>
</div>
<div class="LOginDEtailsF" >
<form align="center">
<div class="LOginInput" style="display: flex; justify-content: center; column-gap: 30px;" >
<input id="otp" type="tel" placeholder="" value="" oninput="checkinput()" />
<input id="otp" type="tel" placeholder="" value="" oninput="checkinput()" />
<input id="otp" type="tel" placeholder="" value="" oninput="checkinput()" />
<input id="otp" type="tel" placeholder="" value="" oninput="checkinput()" />
</div>
<div class="NExtBUtton">
<!-- <button onclick="submitOTP()">Next</button> -->
<button id="letsgo" type="submit">Next</button>
<a class="resendCode" onclick="resendCode()"></a>
</div>
</form>
</div>
</div>
</div>
</body>
</html>
<script>
let mob=JSON.parse(localStorage.getItem('mobile'))
// Appending para of mobile number
let loginDetails = document.querySelector(".LOginDEtails>div>p")
loginDetails.innerText=`Enter 4 digit code sent to your phone +91-${mob}`
// Timer to resend code (otp)
var resendTimer = document.querySelector(".resendCode")
const resendCode = ()=>{
resendTimer.innerText=""
let i=30;
let time = setInterval((resendTimer)=>{
if(i>0){
// console.log(i)
document.querySelector(".resendCode").style.color='grey';
document.querySelector(".resendCode").innerText = `Resend Code (in ${i} secs)`
}
else{
clearInterval(time);
document.querySelector(".resendCode").innerText = "Resend Code";
document.querySelector(".resendCode").style.color='#318616';
document.querySelector(".resendCode").style.textDecoration = "underline"
document.querySelector("button").style.cursor="pointer";
}
i--;
},1000)
}
// call of timer
resendCode();
// button highlighting on complete fillup
const checkinput =()=>{
var otps = document.querySelectorAll("#otp")
if(otps[0].value!="" && otps[1].value!="" && otps[2].value!="" && otps[3].value!=""){
document.querySelector("#letsgo").style.backgroundColor="#318616"
}
}
// form submission
document.querySelector("form").addEventListener('submit',(event)=>{
event.preventDefault(event)
let otps = document.querySelectorAll("#otp")
if(otps[0].value==1 && otps[1].value==2 && otps[2].value==3 && otps[3].value==4){
alert("redirecting to home page")
window.location.href = "index.html"
}else{
otps[0].style.border = "2px solid red";
otps[1].style.border = "2px solid red";
otps[2].style.border = "2px solid red";
otps[3].style.border = "2px solid red";
alert("verification failed")
event.preventDefault(event)
}
})
</script>
<!-- end -->