forked from jplip/self-care-front
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZ_profile.html
124 lines (120 loc) · 3.23 KB
/
Z_profile.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
---
permalink: /profile
---
<style>
.background {
width: 100%;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.card {
width: 400px;
background: #fff;
padding: 40px;
border-radius: 15px;
text-align: center;
color: #333;
}
.card h1 {
font-weight: 500;
color: #000;;
}
.card p {
font-size: 22px;
}
.card img{
width: 200px;
height: 200px;
border-radius: 50%;
margin-top: 40px;
margin-bottom: 30px;
}
body {
font-family: 'Poppins', sans-serif;
background-color: #f2f2f2;
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-image: url('e285661a023fb83c8d7f975980422c22.gif');
background-size: cover;
}
#edit {
display: block;
width: 200px;
background: #1e4f2b; /* Dark forest green */
color: #fff;
padding: 12px;
margin: 10px auto;
border-radius: 5px;
cursor: pointer;
border: none; /* Remove the border */
}
</style>
{% include sidebar.html %}
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<div class="background">
<div class="card">
<h1 id="name">Name</h1>
<p id="bio">Bio</p>
<img src="images/profile.webp">
<a id='edit' href="http://127.0.0.1:4100/self-care-front/edit">Edit Profile</a>
</div>
</div>
</body>
</html>
<script>
function edit() {
window.location.href = 'http://127.0.0.1:4100/self-care-front/edit';
}
function loadName() {
let name = document.getElementById('name')
name.textContent = '';
name.textContent = `${loggedInUserName}`;
}
function loadBio() {
let options = {
method: 'GET',
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
credentials: 'include'
};
fetch("http://127.0.0.1:8432/api/users/bio", options)
// Local: http://127.0.0.1:8010/api/users/diary
// Deployed: https://SanDiegoTravel.stu.nighthawkcodingsociety.com/api/users/diary
.then(response => {
if (response.ok) {
return response.json();
} else {
throw new Error('Network response was not ok.');
}
})
.then(response => {
let bio = document.getElementById("bio");
// Clear previous data
bio.innerHTML = response.trim(); // Paste fetched data directly into the bio element
})
.catch(error => {
console.error('Error fetching diary:', error);
// Handle error
});
}
function loadPFP() {
qdqdqdd
}
loadData() {
loadName();
loadBio();
loadPFP();
};
window.onload = loadData()
</script>