add otp page, mailer.js
This commit is contained in:
1 parent
515dd5a62c
commit
9fbc958d87
6 files changed
+186
-17
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
@@ -1 +1,56 @@
|
||||
<h1>Hello World!</h1>
|
||||
<div class="otp-page">
|
||||
<div class="otp-content">
|
||||
|
||||
<div class="is-flex is-flex-direction-column is-align-items-center">
|
||||
<img src="../assets/sop/lock.png" class="image is-128x128">
|
||||
<h1 class="title is-5">OTP Code Verification</h1>
|
||||
<p class="subtitle is-6 mt-1">Code expires in 5 minutes</p>
|
||||
</div>
|
||||
|
||||
<div class="is-flex is-justify-content-center is-align-items-center mt-3">
|
||||
<a class="ml-5 mr-5">Resend Email</a>
|
||||
<a class="ml-5 mr-5">Change Email</a>
|
||||
</div>
|
||||
|
||||
<div class="is-flex is-justify-content-center is-align-items-center p-5">
|
||||
<div class="inputs" id="inputs">
|
||||
<input class="input is-rounded otp-input ml-2 mr-2" type="text" maxlength="1" inputmode="numeric">
|
||||
<input class="input is-rounded otp-input ml-2 mr-2" type="text" maxlength="1" inputmode="numeric">
|
||||
<input class="input is-rounded otp-input ml-2 mr-2" type="text" maxlength="1" inputmode="numeric">
|
||||
<input class="input is-rounded otp-input ml-2 mr-2" type="text" maxlength="1" inputmode="numeric">
|
||||
<input class="input is-rounded otp-input ml-2 mr-2" type="text" maxlength="1" inputmode="numeric">
|
||||
<input class="input is-rounded otp-input ml-2 mr-2" type="text" maxlength="1" inputmode="numeric">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
|
||||
.box {
|
||||
min-width: 500px !important;
|
||||
position: relative !important;
|
||||
left: 50% !important;
|
||||
transform: translateX(-50%) !important;
|
||||
}
|
||||
|
||||
.input {
|
||||
max-width: 50px !important;
|
||||
}
|
||||
|
||||
.otp-page {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
}
|
||||
|
||||
.input {
|
||||
align-text: center;
|
||||
}
|
||||
|
||||
.otp-content {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
+42
-1
@@ -106,6 +106,8 @@
|
||||
</body>
|
||||
|
||||
<style>
|
||||
|
||||
|
||||
.min-height-screen {
|
||||
min-height: 100vh;
|
||||
}
|
||||
@@ -161,7 +163,45 @@
|
||||
|
||||
<script>
|
||||
|
||||
async function transition_sign_up() {
|
||||
async function listen_for_otp() {
|
||||
|
||||
const inputs = document.getElementById("inputs");
|
||||
|
||||
inputs.addEventListener("input", function (e) {
|
||||
const target = e.target;
|
||||
const val = target.value;
|
||||
|
||||
if (isNaN(val)) {
|
||||
target.value = "";
|
||||
return;
|
||||
}
|
||||
|
||||
if (val != "") {
|
||||
const next = target.nextElementSibling;
|
||||
if (next) {
|
||||
next.focus();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
inputs.addEventListener("keyup", function (e) {
|
||||
const target = e.target;
|
||||
const key = e.key.toLowerCase();
|
||||
|
||||
if (key == "backspace" || key == "delete") {
|
||||
target.value = "";
|
||||
const prev = target.previousElementSibling;
|
||||
if (prev) {
|
||||
prev.focus();
|
||||
}
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
async function transition_sign_up() {
|
||||
document.getElementById('form').classList.add('registering');
|
||||
document.getElementById('login-btn').classList.add('btnfade');
|
||||
document.getElementById('register-btn').classList.add('btnfade');
|
||||
@@ -198,6 +238,7 @@
|
||||
|
||||
if (response.ok) {
|
||||
form.innerHTML = html;
|
||||
listen_for_otp();
|
||||
} else {
|
||||
try {
|
||||
document.getElementById('notif').remove();
|
||||
|
||||
Reference in new issue
Block a user