-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
163 lines (149 loc) · 5.06 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Programming Hours</title>
<link
rel="stylesheet"
href="https://www.w3schools.com/w3css/4/w3.css"
/>
<link
rel="icon"
href="icon.png"
type="image/png"/>
</head>
<body>
<div class="main">
<div class="displayer">
<h4>Hours Programming has received the Robot</h4>
<p>
Throughout the history of Talon540, the programming subgroup
never receives the robot. This website tracks how long the
programming subgroup has recived the robot during the build
season.
</p>
<div class="hours-container">
<div class="hour-count">
<h4 id="hours-counts">
Programming has Received: 0 Hours
</h4>
</div>
<div class="progress-bar-container">
<div class="w3-light-grey">
<div
id="progress-bar"
class="w3-container w3-center"
style="width: 0%"
></div>
</div>
<br />
</div>
</div>
<div>
<hr/>
<img src="askingForBot.png" alt="programming meme"/>
</div>
<div>
<hr />
<h3>Additional Information:</h3>
<div class="stats">
<div class="stats-item">
<p>Weeks Till First Comp:</p>
<p id="time-left-weeks"></p>
</div>
<div class="stats-item">
<p>Days Till First Comp:</p>
<p id="time-left-days"></p>
</div>
<div class="stats-item">
<p>Hours Till First Comp:</p>
<p id="time-left-hours"></p>
</div>
<div class="stats-item">
<p>Minutes Till First Comp:</p>
<p id="time-left-minutes"></p>
</div>
<div class="stats-item">
<p>Seconds Till First Comp:</p>
<p id="time-left-seconds"></p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
<style>
body {
margin: 0;
padding: 0;
font-family: Arial, Helvetica, sans-serif;
text-align: center !important;
background-color: #1d1f20;
color: white !important;
}
.main {
width: 100%;
height: 100%;
display: flex;
justify-content: center;
padding: 10px;
}
.displayer {
height: 800px;
width: 500px;
}
.hours-container {
padding-top: 12px;
}
#progress-bar {
display: flex;
justify-content: center;
background-color: red;
color: white;
}
.stats {
display: flex;
flex-direction: column;
}
.stats-item {
display: flex;
justify-content: space-between;
}
</style>
<noscript>
Your browser doesnt support Javscript, enable that, are you old?
</noscript>
<script>
const hoursRecived = 0.25;
const hoursElem = document.getElementById("hours-counts");
hoursElem.innerText = `Programming has recived: ${hoursRecived} Hours`;
const progressBar = document.getElementById("progress-bar");
const progress = `${Math.round((hoursRecived / 20) * 100)}%`;
progressBar.innerHTML = progress;
progressBar.style.width = progress;
// Month is 0 indexed
const firstCompDate = new Date(2023, 2, 3);
const updateTimes = () => {
const delta = firstCompDate.getTime() - new Date().getTime();
document.getElementById("time-left-weeks").innerText = `${(
delta / 6.048e8
).toFixed(2)} Weeks`;
document.getElementById("time-left-days").innerText = `${(
delta / 8.64e7
).toFixed(2)} Days`;
document.getElementById("time-left-hours").innerText = `${(
delta / 3.6e6
).toFixed(2)} Hours`;
document.getElementById("time-left-minutes").innerText = `${(
delta / 60000
).toFixed(0)} Minutes`;
document.getElementById("time-left-seconds").innerText = `${(
delta / 1000
).toFixed(0)} Seconds`;
setInterval(updateTimes, 1000);
};
updateTimes();
</script>