-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
49 lines (43 loc) · 1.69 KB
/
script.js
File metadata and controls
49 lines (43 loc) · 1.69 KB
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
// === Loader: Hide after full page load ===
window.addEventListener('load', () => {
const loader = document.getElementById('loader');
if (loader) loader.style.display = 'none';
});
// === DOMContentLoaded Events ===
document.addEventListener('DOMContentLoaded', () => {
// === Welcome Popup: Only on first visit ===
const hasVisited = localStorage.getItem("hasVisited");
const popup = document.getElementById('welcomePopup');
if (!hasVisited && popup) {
setTimeout(() => {
popup.classList.remove('hidden');
}, 1000); // Show after 1 second
localStorage.setItem("hasVisited", "true");
}
// === Quotes: Rotate every 5 seconds ===
const quotes = [
"Dream big. Work hard. Stay focused. 💪",
"Small progress is still progress. 🚀",
"Believe you can and you're halfway there. ✨",
"Push yourself, because no one else will do it for you. 🔥",
"Great things never come from comfort zones. 🧠",
"Success is not for the lazy. 👊",
"Stay positive, work hard, make it happen. 🎯",
"Wake up with determination, go to bed with satisfaction. 🌟"
];
let quoteIndex = 0;
const quoteDisplay = document.getElementById('quoteDisplay');
function showQuote() {
if (quoteDisplay) {
quoteDisplay.textContent = quotes[quoteIndex];
quoteIndex = (quoteIndex + 1) % quotes.length;
}
}
showQuote(); // Initial load
setInterval(showQuote, 5000); // Change every 5 sec
});
// === Close Popup Function ===
function closePopup() {
const popup = document.getElementById('welcomePopup');
if (popup) popup.classList.add('hidden');
}