-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathheader.php
595 lines (531 loc) · 14.7 KB
/
header.php
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
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
<?php session_start(); ?>
<!DOCTYPE html>
<style>
:root {
--rwgr: #043124;
--ssgr: #004e38;
--stgr: #008554;
--spgr: #55ba47;
--gvgr: #e6ea85;
--hgo: #e6b711;
--hgob: #fac606;
--hgobmd: #fcdc69;
--hgoblt: #fde89b;
--wgo: #dad490;
--wgomd: #e8e5bc;
--wgolt: #f2f0d9;
--brz: #cfb668;
--brzdk: #524829;
--white: #fff;
--graymin: #ddd;
--graylt: #aaa;
--graymd: #777;
--graydk: #333;
--black: #000;
--rwgr80a: rgba(4, 49, 36, 0.8);
--rwgr60a: rgba(4, 49, 36, 0.6);
--rwgr40a: rgba(4, 49, 36, 0.4);
--rwgr20a: rgba(4, 49, 36, 0.2);
--rwgr00a: rgba(4, 49, 36, 0);
--ssgr80a: rgba(0, 78, 56, 0.8);
--ssgr60a: rgba(0, 78, 56, 0.6);
--ssgr40a: rgba(0, 78, 56, 0.4);
--ssgr20a: rgba(0, 78, 56, 0.2);
--ssgr00a: rgba(0, 78, 56, 0);
--stgr80a: rgba(0, 133, 84, 0.8);
--stgr60a: rgba(0, 133, 84, 0.6);
--stgr40a: rgba(0, 133, 84, 0.4);
--stgr20a: rgba(0, 133, 84, 0.2);
--stgr00a: rgba(0, 133, 84, 0);
--spgr80a: rgba(0, 133, 84, 0.8);
--spgr60a: rgba(0, 133, 84, 0.6);
--spgr40a: rgba(0, 133, 84, 0.4);
--spgr20a: rgba(0, 133, 84, 0.2);
--spgr00a: rgba(0, 133, 84, 0);
--hgob80a: rgba(250, 198, 6, 0.8);
--hgob60a: rgba(250, 198, 6, 0.6);
--hgob40a: rgba(250, 198, 6, 0.4);
--hgob20a: rgba(250, 198, 6, 0.2);
--hgob00a: rgba(250, 198, 6, 0);
--wgo80a: rgba(218, 212, 144, 0.8);
--wgo60a: rgba(218, 212, 144, 0.6);
--wgo40a: rgba(218, 212, 144, 0.4);
--wgo20a: rgba(218, 212, 144, 0.2);
--wgo00a: rgba(218, 212, 144, 0);
--black80a: rgba(0, 0, 0, 0.8);
--black60a: rgba(0, 0, 0, 0.6);
--black40a: rgba(0, 0, 0, 0.4);
--black20a: rgba(0, 0, 0, 0.2);
--black00a: rgba(0, 0, 0, 0);
--white80a: rgba(255, 255, 255, 0.8);
--white60a: rgba(255, 255, 255, 0.6);
--white40a: rgba(255, 255, 255, 0.4);
--white20a: rgba(255, 255, 255, 0.2);
--white00a: rgba(255, 255, 255, 0);
--hero-dropshadow: 0 1px 2px rgba(0, 0, 0, .5);
--spotlt: rgb(230, 234, 133);
--spotbt: #ffffbb;
--all-corners: .25rem .25rem .25rem .25rem;
--tab-top-corners: 0.25rem 0.25rem 0 0;
--tab-bottom-corners: 0 0 .25rem .25rem;
::-webkit-input-placeholder {
font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
:-moz-placeholder {
font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
::-moz-placeholder {
font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
:-ms-input-placeholder {
font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
}
body {
margin:0;
font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}
* {
}
.title-shit{
padding: 1vh 0;
text-align: center;
background-color: var(--wgo);
color: black;
margin: 0px;
height: 20vh;
max-height: 100px;
display: flex;
justify-content: center;
align-items: center;
}
.title-shit h1{
padding: 2vh 2vw;
}
.top-nav {
overflow: hidden;
background-color: var(--white);
padding: 1vh 0 1vh;
box-sizing: border-box;
}
.top-nav-content-container {
width: 90%;
max-width: 1400px;
flex-wrap: nowrap;
margin: 0 auto;
display: flex;
}
.signin-box{
margin: auto;
width: 25%;
text-align: center;
border: 3px solid green;
padding: 10px;
}
.signin-box .img-container{
width: inherit;
height: inherit;
}
.signin-nav {
display: flex;
justify-content: space-between;
background-color: var(--rwgr);
width: 100%;
margin: 0 auto;
padding: 0.5rem;
box-sizing: border-box;
}
.signin-nav a, .account-dropdown{
padding: 0.5rem;
color: var(--white);
font-size: 1.25rem;
font-weight: 600;
text-align: center;
padding: 0.5rem 1.5rem;
text-decoration: none;
}
.signup-box {
margin: 16px auto 16px;
width : 25%;
padding: 20px 10px 50px;
text-align: center;
border: 1px solid green;
box-shadow: 3px 3px 3px grey;
background-color: white;
}
.signup-box .entry-label {
text-align: left;
}
.signup-box .form-container{
padding: 16px 16px 0;
display: flex;
flex-direction: column;
justify-content: center;
margin-bottom: 0;
}
.signup-box input:not([type="checkbox"]) {
width: 100%;
padding: 12px 20px;
margin: 8px 0;
display: inline-block;
border: 1px solid var(--black40a);
box-sizing: border-box;
}
.signup-box input[type="password"] {
/* margin-bottom: 0px;*/
}
.signup-button {
color: var(--rwgr);
}
.signup-box .password-validation{
display: flex;
flex-direction: column;
justify-content: left;
text-align: left;
font-size: 12px;
font-weight: bold;
display: none;
}
.signup-box .separator {
display: flex;
align-items: center;
text-align: center;
padding: 10px 0;
}
.signup-box .line {
flex-grow: 1;
height: 1px;
background-color: var(--black40a);
margin: 0 10px;
}
.signup-box .text {
color: var(--black40a);
}
.password-validation li{
color: red;
margin-top: 0px;
}
.existingAccount {
font-size: 1.25rem;
display: inline-block;
}
.top-nav a {
float: left;
display: block;
color: var(--black);
min-width: 7.5vw;
z-index: auto;
text-align: center;
padding: 0.5rem 1rem;
text-decoration: none;
font-size: 1.25rem;
font-weight: 600;
transition: color 1s;
box-sizing: border-box;
}
.top-nav .nav a:hover{
color: var(--brz);
}
.top-nav .icon {
display: none;
}
@media screen and (max-width: 1100px) {
.top-nav-content-container {
width: 90%; /* Adjusted width for better responsiveness */
}
.top-nav a {
min-width: auto; /* Allowing buttons to adjust their width based on content */
}
}
@media screen and (max-width: 600px) {
.top-nav-content-container {
flex-wrap: wrap; /* Allow items to wrap to the next line on small screens */
}
.top-nav a:not(:first-child),
.dropdown .dropbtn {
display: none;
}
.top-nav a.icon {
float: right;
display: block;
}
.top-nav.responsive {
position: relative;
}
.top-nav.responsive .icon {
position: absolute;
right: 0;
top: 0;
}
.top-nav.responsive a {
float: none;
display: block;
text-align: left;
}
.top-nav.responsive .dropdown {
float: none;
}
.top-nav.responsive .dropdown-content {
position: relative;
}
.top-nav.responsive .dropdown .dropbtn {
display: block;
width: 100%;
text-align: left;
}
.signin-box,
.signup-box {
width: 90%; /* Adjusted width for better responsiveness */
}
/* Additional styles to stack menu items vertically when the menu is open */
.top-nav.responsive .nav {
flex-direction: column;
align-items: stretch;
}
}
.buttonIndent {
text-indent: 20px
}
.signup-box button{
background-color: var(--stgr);
color: white;
padding: 14px 20px;
margin: 8px 0;
border: none;
cursor: pointer;
width: 100%;
font-size: 17px;
}
.top-nav .img {
/*height: 51px;
width: 500px;*/
max-height: 100%;
max-width: 100%;
width: auto;
height: auto;
border-style: none;
box-sizing: content-box;
line-height: 30px;
display: inline-flex;
align-self: center;
}
.account-dropdown {
position: relative;
display: flex;
justify-content: space-between; /* Changed from justify to justify-content */
background-color: var(--rwgr);
flex-wrap: nowrap;
font-weight: 600;
z-index: 1;
}
.account-dropdown a {
background-color: var(--stgr);
color: white;
border: none;
cursor: pointer;
font-size: 17px;
text-align: right;
}
/* Style for the dropdown button */
.dropbtn {
color: white;
font-size: 1.25rem;
border: none;
cursor: pointer;
display: flex;
align-items: center; /* Added to vertically center content */
}
/* Style for the dropdown content */
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
z-index: 2;
white-space: nowrap;
max-height: 200px;
overflow-y: auto;
/* Position the top of the dropdown at the bottom of the root element */
top: 100%;
bottom: auto;
right: 0;
left: auto;
}
/* Style for the buttons inside the dropdown */
.dropdown-content a {
display: block;
padding: 10px;
text-align: left;
}
/* Show the dropdown content when hovering over the dropdown button */
.account-dropdown:hover .dropdown-content {
display: block;
}
.success-overlay {
display: none; /*block is enabled*/
position: fixed;
top: 20%;
left: 50%;
transform: translateX(-50%);
background-color: var(--spgr80a);
color: white;
padding: 20px;
border-radius: 5px;
z-index: 999;
opacity: 1;
transition: opacity 1s ease-in-out;
cursor: pointer;
}
.success-overlay.hidden {
opacity: 0;
pointer-events: none;
}
</style>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
<?php
if(isset($_SESSION['Email']) && isset($_SESSION['FullName']) && isset($_SESSION['Login Success']) && $_SESSION['Login Success'] === TRUE){
echo "showLoginSuccessOverlay();";
$_SESSION['Login Success'] = FALSE;
}else if(isset($_SESSION['Signup Success']) && ($_SESSION['Signup Success'] === TRUE)){
echo "showSignupSuccessOverlay();";
$_SESSION['Signup Success'] = FALSE;
} else if(isset($_SESSION['Logout Success']) && $_SESSION['Logout Success'] === TRUE){
echo "showLogoutSuccessOverlay();";
$_SESSION['Logout Success'] = FALSE;
}
?>
});
function showLoginSuccessOverlay() {
var overlay = document.getElementById('login-success-overlay');
overlay.style.display = 'block';
setTimeout(function () {
overlay.classList.add('hidden');
}, 5000);
}
function showSignupSuccessOverlay() {
var overlay = document.getElementById('signup-success-overlay');
overlay.style.display = 'block';
setTimeout(function () {
overlay.classList.add('hidden');
}, 5000);
}
function showLogoutSuccessOverlay() {
var overlay = document.getElementById('logout-success-overlay');
overlay.style.display = 'block';
setTimeout(function () {
overlay.classList.add('hidden');
}, 5000);
}
function closeLoginOverlay(){
var overlay = document.getElementById('login-success-overlay');
overlay.classList.add('hidden');
}
function closeSignupOverlay(){
var overlay = document.getElementById('signup-success-overlay');
overlay.classList.add('hidden');
}
function closeLogoutOverlay(){
var overlay = document.getElementById('logout-success-overlay');
overlay.classList.add('hidden');
}
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en',
autoDisplay: false,
multianguagePage: true
}, 'google_translate_element');
}
function setLanguage(selectedLanguage) {
// Set the language in cookies
document.cookie = "selectedLanguage=" + selectedLanguage;
// Change the language of the Google Translate Element
var translateElement = document.querySelector('.goog-te-combo');
translateElement.value = selectedLanguage;
translateElement.dispatchEvent(new Event('change'));
}
function checkCookie() {
var cookieValue = document.cookie.replace(/(?:(?:^|.*;\s*)selectedLanguage\s*=\s*([^;]*).*$)|^.*$/, "$1");
if (cookieValue) {
// Use the stored language preference
setLanguage(cookieValue);
} else {
// Show the language selector popup
googleTranslateElementInit();
}
}
window.onload = checkCookie;
function showHamburgerMenu() {
var x = document.getElementById("top-nav");
if (x.className === "top-nav") {
x.className += " responsive";
} else {
x.className = "top-nav";
}
}
$(document).ready(function() {
// Perform an AJAX request to get the identicon based on the user's email
$.ajax({
type: 'GET',
url: '/account/generateUserIcon.php',
success: function(data) {
// Set the image source to the data received from the server
$('#identicon').attr('src', 'data:image/png;base64,' + data.image);
},
error: function() {
console.error('Failed to load identicon.');
}
});
});
</script>
<!--if(isset($_SESSION['Email']) && isset($_SESSION['FullName'])) {
echo "<a href=\"#/account/dashboard.php\">Dashboard</a>";
echo "<a href=\"/account/logout.php\">Logout</a>";
} else{
echo "<a href=\"/account/login.php\">Login</a>";
}
?>//-->
<div>
<div class="signin-nav">
<div id="google_translate_element" style="color: var(--white); align-content: center; float: right; margin-right: auto"></div>
<div id="user-account" style="display: none">Hello </div>
<!--a href="/account/login.php">Sign In</a//-->
<div id="login-success-overlay" class="success-overlay" onclick="closeLoginOverlay()">You have been logged in!</div>
<div id="signup-success-overlay" class="success-overlay" onclick="closeSuccessOverlay()">You have been signed up!</div>
<div id="logout-success-overlay" class="success-overlay" onclick="closeLogoutOverlay()" style="background-color: rgba(200, 0, 0, 0.8)">You have been logged out!</div>
<?php
if(isset($_SESSION['Email']) && isset($_SESSION['FullName'])) {
echo "<div class=\"account-dropdown\">
<div id=\"identicon-container\">
<img id=\"identicon\" style=\"max-width: 35px; max-height: 35px; border: 1px solid black; border-radius: 50%;\"class=\"dropbtn\">
</div>
<div class=\"dropdown-content\">
<a href=\"/account/dashboard.php\">Dashboard</a>
<a href=\"/account/logout.php\">Logout</a>
</div>
</div>";
} else{
echo "<a href=\"/account/login.php\">Log In</a>";
}
?>
</div>
<div style="clear: both;"></div>
<div class="top-nav" id="top-nav">
<div class="top-nav-content-container nav">
<img src="/assets/sac-state-logo-correct-500.png" class="img">
<a href="/">Home</a>
<a href="/events/events.php">Events</a>
<a href="/forum/forum.php">Community Forum</a>
<a href="/map.php">Map</a>
<a href="/faq.php">FAQ</a>
<a href="javascript:void(0);" style="font-size:15px;" class="icon" onclick="showHamburgerMenu()">☰</a>
</div>
</div>
<script type="text/javascript">
</script>
</div>
<?php
?>