-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
25 lines (20 loc) · 784 Bytes
/
Copy pathscript.js
File metadata and controls
25 lines (20 loc) · 784 Bytes
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
// Splash screen: auto-enter after a short pause, or let visitors skip it.
const splash = document.getElementById('splash-screen');
if (splash) {
const AUTO_DELAY_MS = 2000;
const FADE_DURATION_MS = 800;
let leaving = false;
function enterSite() {
if (leaving) return;
leaving = true;
clearTimeout(autoTimer);
splash.classList.add('fade-out');
setTimeout(function () {
window.location.href = 'main.html';
}, FADE_DURATION_MS);
}
const autoTimer = setTimeout(enterSite, AUTO_DELAY_MS);
document.addEventListener('click', enterSite, { once: true });
document.addEventListener('touchstart', enterSite, { once: true });
document.addEventListener('keydown', enterSite, { once: true });
}