-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforgotpassword.html
106 lines (89 loc) · 3.07 KB
/
forgotpassword.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
<!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>ZEE5: Forgot Password</title>
<link rel="stylesheet" href="./components/navbar.css" />
<link rel="stylesheet" href="./components/footer.css" />
<link rel="stylesheet" href="./forgetpassword.css" />
</head>
<body>
<div id="sh_navbar"></div>
<div id="sh_result"></div>
<div id="sh_forgotMain">
<div id="sh_main">
<h4><a href="./index.html">X</a></h4>
<img
src="https://www.zee5.com/images/ZEE5_logo.svg?ver=2.51.89"
alt=""
/>
<h3>Forgot Password?</h3>
<form id="form">
<label for="">Enter Email</label> <br />
<input type="email" id="sh_email" /> <br />
<hr />
<button id="sh_forgotbtn">Click Here to Check</button>
</form>
</div>
<!-- <div id="sh_footer"></div> -->
</div>
<div id="sh_footer"></div>
</body>
</html>
<script type="module">
//<---------Navbar importing and appending and background fading------->
import {
navbar,
getData,
appendData,
main,
debouncing,
id,
} from "./components/navcom.js";
let navContainer = document.getElementById("sh_navbar");
navContainer.innerHTML = navbar();
document.getElementById("search").addEventListener("input", debouncing);
document.getElementById("search").addEventListener("focus", () => {
document.getElementById("sh_forgotMain").setAttribute("class", "sh_blury");
document.getElementById("sh_footer").setAttribute("class", "sh_blury");
});
document.getElementById("search").addEventListener("focusout", () => {
document.getElementById("sh_forgotMain").setAttribute("class", "");
document.getElementById("sh_footer").setAttribute("class", "");
});
//<--------Footer Importing and appending-------->
import footer from "./components/footer.js";
let footContainer = document.getElementById("sh_footer");
footContainer.innerHTML = footer();
//<---------Finding password functinality------->
let userData = JSON.parse(localStorage.getItem("users")) || [];
const form = document.querySelector("form");
form.addEventListener("submit", (event) => {
event.preventDefault();
let email = form.sh_email.value;
if (email === "") {
alert("Enter Email-Id");
return false;
}
let check = userData.filter((el) => {
return el.email === email;
});
if (check.length === 0) {
alert("User doesn't exists!");
} else {
alert(`Please Save Your Password ${check[0].password}`);
form.reset();
window.location.href = "./login.html";
}
});
//<----------Changing Color of checking Button-------->
form.addEventListener("input", () => {
let email = form.sh_email.value;
if (email !== "") {
document.getElementById("sh_forgotbtn").style.backgroundColor = "#350c59";
document.getElementById("sh_forgotbtn").style.color = "white";
}
});
</script>