-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
39 lines (36 loc) · 1.09 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
38
39
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.tailwindcss.com"></script>
<style>
.text-10xl {
font-size: 20rem; /* 128px */
line-height: 1;
}
</style>
</head>
<body>
<div class="h-screen grid place-content-center bg-black">
<div class="text-10xl font-bold text-white" id="counter">1</div>
</div>
<script>
const element = document.getElementById("counter");
const setText = (text) => {
element.innerHTML = text;
}
const count = () => {
setTimeout(() => {
setText(counter);
counter += 1;
count();
}, 491);
}
let counter = 1;
window.addEventListener("click", function(event) {
count();
});
</script>
</body>
</html>