-
Notifications
You must be signed in to change notification settings - Fork 0
/
verify.html
160 lines (143 loc) · 5.69 KB
/
verify.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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<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>Restaurant-Ecommerce</title>
<meta name="description" content="Restaurant-Ecommerce" />
<meta name="keywords" content="Restaurant-Ecommerce" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/css/intlTelInput.css"
/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/js/intlTelInput.min.js"></script>
<link rel="stylesheet" href="css/bootstrap.css" />
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.rtl.min.css"
integrity="sha384-gXt9imSW0VcJVHezoNQsP+TNrjYXoGcrqBZJpry9zJt8PCQjobwmhMGaDHTASo9N"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="./css/owl.carousel.min.css" />
<link rel="stylesheet" href="./css/owl.theme.default.min.css" />
<link rel="stylesheet" href="./css/all.min.css" />
<link rel="stylesheet" href="./css/style.css" />
</head>
<body>
<nav class="navbar navbar-expand-lg bg-body-tertiary">
<div class="container">
<a class="navbar-brand" href="index.html">Logo</a>
<button
class="navbar-toggler collapsed"
type="button"
data-bs-toggle="collapse"
data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="toggler-icon top-bar"></span>
<span class="toggler-icon middle-bar"></span>
<span class="toggler-icon bottom-bar"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link" aria-current="page" href="index.html">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="menu.html">Menu</a>
</li>
<li class="nav-item">
<a class="nav-link" href="contact_us.html">Contact Us</a>
</li>
</ul>
<div class="end_nav">
<a href="carts.html">
<img src="./images/shop.png" alt="shop" />
</a>
<button class="btn_page2" type="button">English</button>
<a href="login.html" class="btn_page">Log In</a>
</div>
</div>
</div>
</nav>
<section class="sign_out registration registration2 container">
<h2 style="margin-bottom: 62px;">Verify Your Email Address </h2>
<p>Please enter the verification code we sent to your Email Address</p>
<form action="">
<div class="passcode-wrapper">
<input id="codeBox1" type="number" maxlength="1" onkeyup="onKeyUpEvent(1, event)" onfocus="onFocusEvent(1)">
<input id="codeBox2" type="number" maxlength="1" onkeyup="onKeyUpEvent(2, event)" onfocus="onFocusEvent(2)">
<input id="codeBox3" type="number" maxlength="1" onkeyup="onKeyUpEvent(3, event)" onfocus="onFocusEvent(3)">
<input id="codeBox4" type="number" maxlength="1" onkeyup="onKeyUpEvent(4, event)" onfocus="onFocusEvent(4)">
</div>
<p id="counter" class="counter red">02:00 s</p>
<h4>If you don’t receive a code! <button id="resend" disabled>Resend</button></h4>
<input type="submit" id="ss" class="btn_page" value="Verify">
</form>
</section>
<script src="js/popper.min.js"></script>
<script src="js/jquery-3.6.1.min.js"></script>
<script src="js/bootstrap.js"></script>
<script>
const time = document.getElementById("counter");
const resend = document.getElementById("resend");
const ss = document.getElementById("ss");
const starttime = 2;
let secound = starttime*60;
const myTimeout = setInterval(udtime, 1000);
/*ss.addEventListener('click' , function (e) {
e.preventDefault();
const myTimeout = setInterval(udtime, 1000);
})*/
function udtime (){
const min = Math.floor(secound / 60);
let sec = secound % 60;
sec = sec <10 ? "0" + sec : sec
if(min === 0 && sec == "00" ){
clearInterval(myTimeout);
resend.disabled = false
resend.classList.add("resend")
time.classList.add("red")
}
else{
resend.classList.remove("resend")
time.classList.remove("red")
}
time.innerHTML = `0${min} : ${sec} s`;
secound -- ;
}
</script>
<script>
function getCodeBoxElement(index) {
return document.getElementById('codeBox' + index);
}
function onKeyUpEvent(index, event) {
const eventCode = event.which || event.keyCode;
if (getCodeBoxElement(index).value.length === 1) {
if (index !== 4) {
getCodeBoxElement(index+ 1).focus();
} else {
getCodeBoxElement(index).blur();
// Submit code
console.log('submit code ');
}
}
if (eventCode === 8 && index !== 1) {
getCodeBoxElement(index - 1).focus();
}
}
function onFocusEvent(index) {
for (item = 1; item < index; item++) {
const currentElement = getCodeBoxElement(item);
if (!currentElement.value) {
currentElement.focus();
break;
}
}
}
</script>
</body>
</html>