generated from chetanbhasney02/Website
-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path404.html
31 lines (28 loc) · 849 Bytes
/
404.html
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
<!DOCTYPE html>
<html>
<head>
<title>404 - Page Not found</title>
</head>
<body>
<div style="text-align: center">
<h1>Oops! 404 - Page not found</h1>
<p>Redirecting to home in <span id="countdown"></span></p>
</div>
<script>
//Redirects to home after a delay
let remainingSeconds = 5;
const countDown = document.getElementById("countdown");
if (countDown)
countDown.innerHTML = remainingSeconds;
const intervalId = setInterval(() => {
remainingSeconds--;
if (remainingSeconds === 0) {
window.location.href = "/";
window.clearInterval(intervalId);
} else if (countDown) {
countDown.innerHTML = remainingSeconds;
}
}, 1000);
</script>
</body>
</html>