-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
37 lines (34 loc) · 1.33 KB
/
index.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
32
33
34
35
36
37
<!DOCTYPE html>
<html>
<head>
<link href="https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i&display=swap" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/style.css" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Timmy Chan</title>
</head>
<body>
<h1>Check out my portfolio at heroku</h1>
<a href="http://timmychan97.herokuapp.com/">timmychan97.herokuapp.com</a>
<p>Redirecting in <span id="counter"></span>...</p>
<script>
onload = () => {
const countDown = 5;
let count = countDown;
const counter = document.getElementById("counter");
counter.innerHTML = count--;
const interval = setInterval(_ => {
counter.innerHTML = count--;
if (count < 0){
clearInterval(interval);
}
}, 1000);
setTimeout(_ => {
// In Chrome, location.href does not push the state to history. I think it is a bug.
// We use assign instead
location.assign("http://timmychan97.herokuapp.com/");
}, countDown * 1000);
}
</script>
</body>
</html>