-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdashboard.html
36 lines (35 loc) · 1.34 KB
/
dashboard.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
<!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">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Poppins">
<link rel="stylesheet" href="styles/style.css">
<title>Buggy Calculator</title>
</head>
<body>
<div id="dashboard-navbar">
<h3>Buggy Website</h3>
<a href="Buggy Website.html" id="sign-out">Sign out</a>
</div>
<h1 id="welcome-h1">Welcome {FullName}, best of luck for your interview</h1>
<script>
// Redirect user if he is signed out
const loggedin = localStorage.getItem("loggedin");
if(loggedin == 0) {
window.location = "Buggy Website.html";
}
// Sign out functionality
const signOutButton = document.querySelector("#sign-out");
signOutButton.addEventListener("click", (event) => {
localStorage.setItem("loggedin", 0);
localStorage.setItem("fullName", null);
});
// Set fullname in h1 functionality
const fullName = localStorage.getItem("fullName");
const h1 = document.querySelector("#welcome-h1");
h1.innerHTML = `Welcome ${fullName ? fullName : "N/A"}, best of luck for your interview`;
</script>
</body>
</html>