Skip to content

Commit e17c91b

Browse files
Added Day 39
1 parent 78f6ea4 commit e17c91b

1 file changed

Lines changed: 96 additions & 0 deletions

File tree

public/39/index.html

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<link rel="icon" href="/assets/icon.png" />
7+
<title>Day 39/100</title>
8+
</head>
9+
<body>
10+
<main>
11+
<div class="progressBar" id="progressBar"></div>
12+
<div class="progress-text" id="progress-text">0%</div>
13+
</main>
14+
15+
<style>
16+
@font-face {
17+
font-family: "SpaceMono";
18+
src: url("/assets/SpaceMono-Bold.woff2") format("woff2");
19+
font-weight: 700;
20+
}
21+
22+
body {
23+
margin: 0;
24+
overflow: hidden;
25+
display: flex;
26+
justify-content: center;
27+
align-items: center;
28+
width: 100vw;
29+
height: 100vh;
30+
background-color: #000;
31+
}
32+
33+
main {
34+
width: 100vw;
35+
max-width: 300px;
36+
height: 100vh;
37+
display: flex;
38+
flex-direction: column;
39+
align-items: center;
40+
justify-content: center;
41+
}
42+
43+
.progressBar {
44+
width: calc(100% - 40px);
45+
height: 60px;
46+
padding: 20px;
47+
display: flex;
48+
align-items: center;
49+
gap: 5px;
50+
}
51+
52+
.progressBarItem {
53+
width: 5%;
54+
height: 2px;
55+
background-color: #fff;
56+
transition: height 0.5s ease-in-out;
57+
}
58+
59+
.progressBarItem-active {
60+
height: 100%;
61+
}
62+
63+
.progress-text {
64+
color: #fff;
65+
font-size: 24px;
66+
font-family: "SpaceMono", monospace;
67+
font-weight: 700;
68+
}
69+
</style>
70+
71+
<script>
72+
const progressBar = document.getElementById("progressBar");
73+
for (let i = 0; i < 20; i++) {
74+
const progressBarItem = document.createElement("div");
75+
progressBarItem.classList.add("progressBarItem");
76+
progressBarItem.id = `progressBarItem-${i + 1}`;
77+
progressBar.appendChild(progressBarItem);
78+
}
79+
80+
var progress = 0;
81+
let interval = setInterval(() => {
82+
progress++;
83+
document
84+
.getElementById(`progressBarItem-${progress}`)
85+
.classList.add("progressBarItem-active");
86+
document.getElementById("progress-text").textContent = `${
87+
progress * 5
88+
}%`;
89+
if (progress >= 20) {
90+
progress = 0;
91+
clearInterval(interval);
92+
}
93+
}, 400);
94+
</script>
95+
</body>
96+
</html>

0 commit comments

Comments
 (0)