-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile.js
99 lines (78 loc) · 2.24 KB
/
profile.js
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
function showTheme()
{
// Check Local Storage then apply dark theme if it's active
const date = new Date();
const hour = date.getHours();
if (hour <= 5 || hour >= 20)
{
localStorage.setItem('darkMode', 'enabled');
document.body.classList.toggle('dark');
}
else
{
localStorage.setItem('darkMode', null);
document.body.classList.remove('dark');
}
}
function showContent()
{
document.body.style.visibility = 'visible';
document.body.style.opacity = 1;
}
window.addEventListener('DOMContentLoaded', function ()
{
showTheme();
showContent();
});
function ClearStorage()
{
sessionStorage.clear();
window.location.href = './logout.php';
}
function ShowNavMenu()
{
document.getElementsByClassName('hidden-menu-container')[0].style.display = "flex";
document.getElementsByClassName('div-button-menu')[0].style.display = "none";
}
function CloseNavMenu()
{
document.getElementsByClassName('hidden-menu-container')[0].style.display = "none";
document.getElementsByClassName('div-button-menu')[0].style.display = "block";
}
var button_nav = document.getElementsByClassName("mobile-nav-toggle");
var ul_nav = document.getElementById("navbar-links");
var background = document.querySelector(".blurred-background");
function SlideOutMenu()
{
const visibility = ul_nav.getAttribute('data-visible');
if (visibility == "false")
{
ul_nav.setAttribute('data-visible', 'true');
background.style.visibility ="visible";
background.style.opacity ="1";
}
else
{
ul_nav.setAttribute('data-visible', 'false');
background.style.visibility ="hidden";
background.style.opacity ="0";
}
}
let resizeTimer;
window.onresize = function() {
document.body.classList.add("resize-animation-stopper");
clearTimeout(resizeTimer);
resizeTimer = setTimeout(() => {
document.body.classList.remove("resize-animation-stopper");
}, 400);
}
var user_age = parseInt(document.getElementById("age").innerHTML);
const root = document.documentElement;
//not in mobile
if (window.screen.width > 414)
{
if (user_age > 65)
{
root.style.setProperty('font-size', '1.2rem');
}
}