-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuserprof.html
220 lines (203 loc) · 6.94 KB
/
userprof.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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
<!DOCTYPE html>
<html lang="en">
<head>
<!-- <link rel="stylesheet" href="style.css" /> -->
<link rel="preconnect" href="https://fonts.gstatic.com" />
<link
href="https://fonts.googleapis.com/css2?family=Open+Sans+Condensed:wght@300&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="userprof.css" />
<!-- <script src="Navbar.js"></script> -->
<!-- <link rel="stylesheet" href="Navbar.css"> -->
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
jquery for navbar
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
-->
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
/>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-light bg-dark">
<a class="navbar-brand" href="index.html"
><img src="./assets/img/logo.png" width="120px"
/></a>
<button
class="navbar-toggler"
type="button"
data-toggle="collapse"
data-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent"
aria-expanded="false"
aria-label="Toggle navigation"
>
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home </a>
</li>
<li class="nav-item">
<a class="nav-link" href="#"></a>
</li>
<li class="nav-item">
<a class="nav-link" href="Restaurant.html">Search For Restaurant </a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a id="userlink" class="nav-link" href="userprof.html">
Username
</a>
</li>
<li class="nav-item">
<a id="signoutlink" class="nav-link" href="signup.html">
Sign Out
</a>
</li>
</ul>
</form>
</div>
</nav>
<!-- <section class="navigation">
<div class="nav-container">
<div class="brand">
<a href="./Homepage.html"
><img src="./assets/img/logo.png" width="120px"
/></a>
</div>
<nav>
<div class="nav-mobile">
<a id="nav-toggle" href="#!"><span></span></a>
</div>
<ul class="nav-list">
<li>
<a href="./Homepage.html">Home</a>
</li>
<li>
<a href="./Restaurant.html">Search</a>
</li>
<li>
</ul>
<form class="form-inline my-2 my-lg-0">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a id="userlink" class="nav-link" href="">
Username
</a>
</li> <li class="nav-item ">
<a id="signoutlink" class="nav-link" href="">
Sign Out
</a>
</li>
</ul>
</form>
</nav>
</div>
</section> -->
<div class="container1">
<div class="user-image">
<img
src="./assets/img/user-profile.webp"
alt="this image contains user-image"
/>
</div>
<div class="content">
<h3 class="name" id="hh">Please Login</h3>
<p class="username">Foodie</p>
<div class="links">
<a
class="a facebook"
href="https://www.facebook.com/gaganarora/"
target="_blank"
title="Facebook"
>
<i class="fab fa-facebook"></i>
</a>
<a
class="a git"
href="https://github.com/topics/gaganarora"
title="Github"
target="_blank"
>
<i class="fab fa-github-square"></i>
</a>
<a
class="a linkedin"
href="https://gaganarora/tag/linkedin/"
title="Linkedin"
target="_blank"
>
<i class="fab fa-linkedin"></i>
</a>
<a
class="a insta"
href="https://www.instagram.com/gaganarora/?hl=en"
target="_blank"
title="GFG_instagram"
>
<i class="fab fa-instagram-square"></i>
</a>
</div>
<p class="details">Loves Indian and Italian cuisine.</p>
<a class="effect effect-4" href="contact.html"> Contact us </a>
</div>
</div>
<!-- This is link of adding small images
which are used in the link section -->
<script
src="https://kit.fontawesome.com/704ff50790.js"
crossorigin="anonymous"
></script>
<script>
let userlink = document.getElementById("userlink");
let signoutlink = document.getElementById("signoutlink");
let header = document.getElementById("hh");
var currentUser = null;
function getUsername() {
let keepLoggedIn = localStorage.getItem("KeepLoggedIn");
if (keepLoggedIn == "yes") {
currentUser = JSON.stringify(localStorage.getItem("user"));
currentUser = JSON.parse(localStorage.getItem("user"));
} else {
currentUser = JSON.stringify(sessionStorage.getItem("user"));
currentUser = JSON.parse(sessionStorage.getItem("user"));
}
}
function Signout() {
sessionStorage.removeItem('user');
localStorage.removeItem('user');
localStorage.removeItem('keepLoggedIn');
window.location = "signup.html";
}
window.onload = function () {
getUsername();
if (currentUser == null) {
userlink.innerText = "Create New Account";
userlink.classList.replace("nav-link", "btn");
userlink.classList.add("btn-primary");
userlink.href = "signup.html";
signoutlink.innerText = "Login";
signoutlink.classList.replace("nav-link", "btn");
signoutlink.classList.add("btn-success");
signoutlink.href = "login.html";
} else {
// console.log(currentUser);
userlink.innerText = currentUser.username;
header.innerText = "welcome " + currentUser.fullname;
userlink.classList.replace("btn", "nav-link");
userlink.classList.remove("btn-primary");
userlink.href = "#";
signoutlink.innerText = "Sign Out";
signoutlink.classList.replace("btn", "nav-link");
signoutlink.classList.remove("btn-success");
signoutlink.href = "javascript:Signout()";
}
};
</script>
</body>
</html>