-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscript.js
93 lines (72 loc) · 3.54 KB
/
script.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
// Pop up Section
const messages = [
"Electronic waste, or e-waste, refers to discarded electronic devices and equipment, including smartphones, laptops, tablets, televisions, and more. The generation of e-waste has been steadily increasing due to the rapid pace of technological advancement and consumer electronics turnover.",
"E-waste contains hazardous materials such as lead, mercury, cadmium, and various toxic chemicals. If not properly managed, these substances can leach into the environment, contaminating soil, water, and air. This poses significant risks to human health and the ecosystem.",
"Recycling e-waste helps recover valuable resources like precious metals (gold, silver, and palladium), copper, and rare earth elements. This reduces the need for mining and extraction of these materials, which can be both environmentally destructive and resource-intensive.",
"E-waste has become a global issue, with millions of tons generated each year. Many developed countries export their e-waste to developing nations, where it is often processed informally under unsafe conditions, leading to environmental and health concerns.",
"Formal e-waste recycling involves regulated processes in specialized facilities that ensure safe handling and disposal of hazardous materials. Informal recycling, often practiced in developing countries, involves unregulated, makeshift operations that can be harmful to both workers and the environment."
];
const popup = document.getElementById('popup');
const popupc = document.getElementById('popupc');
const close = document.getElementById('close');
let currentMessageIndex = 0;
function showPopup() {
const message = messages[currentMessageIndex % messages.length];
popupc.textContent = message;
popup.style.display = 'inline-flex';
currentMessageIndex++
};
function hidePopup() {
popup.style.display = 'none';
setTimeout(showPopup, 5000);
};
setTimeout(showPopup, 3000);
;
// Pop up Section
// About Section Counter
document.addEventListener("DOMContentLoaded", function () {
let valueDisplays = document.querySelectorAll(".num");
let interval = 1000;
valueDisplays.forEach((valueDisplay) => {
let startValue = 0;
let endValue = parseInt(valueDisplay.getAttribute("data-val"));
let duration = Math.floor(interval / endValue);
let counter = setInterval(function () {
startValue += 1;
valueDisplay.textContent = startValue;
if (startValue == endValue) {
clearInterval(counter);
}
}, duration);
});
});
// About Section Counter
const register_form = document.getElementById('Register');
const login_form = document.getElementById('login');
const signup_form = document.getElementById('signup');
const login_btn = document.getElementById('login-btn');
const logout_btn = document.getElementById('logout-btn');
const register_btn = document.getElementById('register-btn');
function register(){
register_form.style.display = 'block';
login_form.style.display = 'none';
signup_form.style.display = 'none';
login_btn.style.display = 'block';
register_btn.style.display = 'none';
}
function login(){
register_form.style.display = 'none';
login_form.style.display = 'block';
signup_form.style.display = 'none';
login_btn.style.display = 'none';
register_btn.style.display = 'block';
}
function signup(){
register_form.style.display = 'none';
login_form.style.display = 'none';
signup_form.style.display = 'block';
}
function Logout() {
localStorage.removeItem('token')
window.location.reload()
}