-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdashboard.html
More file actions
97 lines (84 loc) · 2.1 KB
/
dashboard.html
File metadata and controls
97 lines (84 loc) · 2.1 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dashboard</title>
<link rel="stylesheet" href="styles.css">
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f4f8;
margin: 0;
padding: 0;
}
#dashboard {
max-width: 900px;
margin: 50px auto;
padding: 30px;
background-color: white;
border-radius: 20px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
h1 {
color: #007bff;
font-size: 2.5em;
margin-bottom: 20px;
}
.card {
background-color: #ffffff;
padding: 20px;
border-radius: 15px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
margin-bottom: 20px;
}
.card h2 {
color: #007bff;
font-size: 1.8em;
}
.card p {
color: #333;
font-size: 1.2em;
}
footer {
text-align: center;
margin-top: 50px;
color: #007bff;
}
.logout-btn {
background-color: #ff4d4d;
color: white;
padding: 12px 20px;
border-radius: 25px;
font-size: 1em;
border: none;
cursor: pointer;
}
.logout-btn:hover {
background-color: #e60000;
}
</style>
</head>
<body>
<section id="dashboard" class="section">
<h1>Dashboard</h1>
<div class="card">
<h2>Welcome back, <span id="dashboardUserName"></span>!</h2>
<p>This is your personalized dashboard.</p>
</div>
<button class="logout-btn" onclick="logout()">Logout</button>
</section>
<footer>
<p>© 2024 Your Website</p>
</footer>
<script>
const dashboardUserName = localStorage.getItem('username');
document.getElementById('dashboardUserName').textContent = dashboardUserName;
function logout() {
localStorage.removeItem('username');
localStorage.removeItem('loggedIn');
window.location.href = "index.html"; // Redirect to the login page
}
</script>
</body>
</html>