-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathotp.html
114 lines (100 loc) · 3.23 KB
/
otp.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
<!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" type="image/x-icon" href="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRdeXTVDu67JZDJNNRO9MhA7OBpUHYgEC54aw&usqp=CAU">
<style>
*{
font-family: "Proxima Vara", Arial, Arial, Helvetica, sans-serif;
}
body {
margin: 0;
padding: 0;
height: 100vh;
background: #000000;
background-image: url(https://i.pinimg.com/564x/da/0e/13/da0e1380f2814c04228bb099dafb5bb0.jpg);
background-size: cover;
}
.container {
display: flex;
flex-flow: column;
height: 100%;
align-items: space-around;
justify-content: center;
}
.userInput {
display: flex;
justify-content: center;
}
input {
margin: 10px;
height: 30px;
width: 65px;
border: none;
text-align: center;
font-family: arimo;
font-size: 1.1rem;
background: #eef2f3;
}
button {
width: 150px;
height: 40px;
margin: 25px auto 0px auto;
font-size: 1.1rem;
border: none;
border-radius: 5px;
letter-spacing: 2px;
cursor: pointer;
background-color: #16385f;
color: white;
}
h1 {
text-align: center;
font-family: arimo;
color: honeydew;
}
</style>
</head>
<body>
<div class="container">
<h1>ENTER OTP</h1>
<div class="userInput">
<input type="text" id="1st" maxlength="1" onkeyup="clickEvent(this,'2nd')">
<input type="text" id="2nd" maxlength="1" onkeyup="clickEvent(this,'3rd')">
<input type="text" id="3rd" maxlength="1" onkeyup="clickEvent(this,'4th')">
<input type="text" id="4th" maxlength="1">
</div>
<button> CONFIRM</button>
<button onclick="resendOtp()"> RESEND OTP</button>
</div>
</body>
</html>
<script type="text/javascript">
alert("Your Dummy OTP is 1 9 9 9")
function clickEvent(first, last) {
if (first.value.length) {
document.getElementById(last).focus();
}
}
document.querySelector("button").addEventListener("click", next)
function next() {
var st = document.getElementById("1st").value;
var sec = document.getElementById("2nd").value;
var rd = document.getElementById("3rd").value;
var th = document.getElementById("4th").value;
console.log(st + sec + rd + th)
if (st == 1 && sec == 9 && rd == 9 && th == 9) {
window.location.href = "lastpage.html"
} else if (st == "" || sec == "" || rd == "" || th == "") {
alert("Entered otp")
} else {
alert("Entered wrong otp")
}
}
function resendOtp() {
alert("Your Dummy OTP is 1 9 9 9")
}
</script>