-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser.html
More file actions
80 lines (78 loc) · 2.32 KB
/
Copy pathuser.html
File metadata and controls
80 lines (78 loc) · 2.32 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>User Profile</title>
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/remixicon/4.6.0/remixicon.min.css"
/>
<style>
body {
background-color: #730302;
color: white;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
text-align: center;
font-family: Arial, sans-serif;
}
.container {
background-color: white;
color: #730302;
padding: 20px;
border-radius: 15px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
width: 100%;
max-width: 400px;
text-align: center;
}
.fa-house {
position: absolute;
top: 10px;
left: 10px;
color: white;
font-size: 25px;
}
</style>
</head>
<body>
<a href="./index.html"><i class="fa-solid fa-house"></i></a>
<div class="container">
<h2><i class="ri-user-fill"></i></h2>
<p><strong>Name:</strong> <span id="userName"></span></p>
<p>
<strong>Email <i class="ri-mail-fill"></i>:</strong>
<span id="userEmail"></span>
</p>
<p>
<strong>RecentBuy <i class="ri-shopping-cart-fill"></i> : </strong
><span id="totalbuy"></span>
</p>
</div>
<script>
document.addEventListener("DOMContentLoaded", function () {
const userName = document.getElementById("userName");
const userEmail = document.getElementById("userEmail");
const userbuy = document.getElementById("totalbuy");
const storedUser = JSON.parse(localStorage.getItem("user"));
if (storedUser) {
userName.textContent = storedUser.username || "N/A";
userEmail.textContent = storedUser.email || "N/A";
userbuy.textContent = localStorage.getItem("totalbuy") || 0;
} else {
userName.textContent = "N/A";
userEmail.textContent = "N/A";
userbuy.textContent = localStorage.getItem("totalbuy") || 0;
}
});
</script>
<script
src="https://kit.fontawesome.com/db7a431a79.js"
crossorigin="anonymous"
></script>
</body>
</html>