This repository has been archived by the owner on Jul 19, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
167 lines (158 loc) · 6.71 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
164
165
166
167
<!DOCTYPE html>
<html>
<head>
<title>Current map - Apex Legends</title>
<style>
body {
margin: auto;
width: auto;
height: auto;
background-color: #23272a;
font-family: "Helvetica";
color: aliceblue;
text-align: center;
line-height: 3em;
transform: translateY(30%);
}
</style>
</head>
<body onload="apexMap()">
<h1>Current map - Apex Legends</h1>
<hr width="50%"><br>
<h1><p id="map"></p></h1>
<i><p id="timer"></p></i>
<h3><p id="next"></p></h3>
<hr width="5%">
<small><p>Apex Legends : saison 8</p></small>
<script>
function apexMap() {
var cycle = (new Date().getTime() / 60000) % 2220 + 420
var map1 = "Kings Canyon"
var map2 = "Olympus"
var output
var next
if (cycle < 90) {
output = map1
residual = 90 - cycle
next = "Next map : " + map2 + " (1h30)"
} else if (cycle < 180) {
output = map2
residual = 180 - cycle
next = "Next map : " + map1 + " (1h)"
} else if (cycle < 240) {
output = map1
residual = 240 - cycle
next = "Next map : " + map2 + " (1h)"
} else if (cycle < 300) {
output = map2
residual = 300 - cycle
next = "Next map : " + map1 + " (1h)"
} else if (cycle < 360) {
output = map1
residual = 360 - cycle
next = "Next map : " + map2 + " (1h)"
} else if (cycle < 420) {
output = map2
residual = 420 - cycle
next = "Next map : " + map1 + " (2h)"
} else if (cycle < 540) {
output = map1
residual = 540 - cycle
next = "Next map : " + map2 + " (2h)"
} else if (cycle < 660) {
output = map2
residual = 660 - cycle
next = "Next map : " + map1 + " (1h30)"
} else if (cycle < 750) {
output = map1
residual = 750 - cycle
next = "Next map : " + map2 + " (1h30)"
} else if (cycle < 840) {
output = map2
residual = 840 - cycle
next = "Next map : " + map1 + " (2h)"
} else if (cycle < 960) {
output = map1
residual = 960 - cycle
next = "Next map : " + map2 + " (2h)"
} else if (cycle < 1080) {
output = map2
residual = 1080 - cycle
next = "Next map : " + map1 + " (1h30)"
} else if (cycle < 1170) {
output = map1
residual = 1170 - cycle
next = "Next map : " + map2 + " (1h30)"
} else if (cycle < 1260) {
output = map2
residual = 1260 - cycle
next = "Next map : " + map1 + " (2h)"
} else if (cycle < 1380) {
output = map1
residual = 1380 - cycle
next = "Next map : " + map2 + " (1h)"
} else if (cycle < 1500) {
output = map2
residual = 1500 - cycle
next = "Next map : " + map1 + " (1h)"
} else if (cycle < 1560) {
output = map1
residual = 1560 - cycle
next = "Next map : " + map2 + " (1h30)"
} else if (cycle < 1620) {
output = map2
residual = 1620 - cycle
next = "Next map : " + map1 + " (1h30)"
} else if (cycle < 1710) {
output = map1
residual = 1710 - cycle
next = "Next map : " + map2 + " (1h30)"
} else if (cycle < 1800) {
output = map2
residual = 1800 - cycle
next = "Next map : " + map1 + " (1h30)"
} else if (cycle < 1890) {
output = map1
residual = 1890 - cycle
next = "Next map : " + map2 + " (1h30)"
} else if (cycle < 1980) {
output = map2
residual = 1980 - cycle
next = "Next map : " + map1 + " (2h)"
} else if (cycle < 2100) {
output = map1
residual = 2100 - cycle
next = "Next map : " + map2 + " (2h)"
} else {
output = map2
residual = 2220 - cycle
next = "Next map : " + map1 + " (1h30)"
}
if (residual >= 60){
hourResi = Math.trunc(residual) / 60
minResi = residual - (Math.trunc(hourResi) * 60)
if (hourResi >= 2){
if (Math.trunc(minResi) <= 1){
var timer = Math.trunc(hourResi) + " hours " + Math.trunc(minResi) + " minute left"
} else {
var timer = Math.trunc(hourResi) + " hours " + Math.trunc(minResi) + " minutes left"
}
} else {
if (Math.trunc(minResi) <= 1){
var timer = Math.trunc(hourResi) + " hour " + Math.trunc(minResi) + " minute left"
} else {
var timer = Math.trunc(hourResi) + " hour " + Math.trunc(minResi) + " minutes left"
}
}
} else if (residual <= 1){
var timer = Math.trunc(residual) + " minute left"
} else {
var timer = Math.trunc(residual) + " minutes left"
}
document.getElementById("map").innerHTML = output
document.getElementById("timer").innerHTML = timer
document.getElementById("next").innerHTML = next
}
</script>
</body>
</html>