-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
261 lines (230 loc) · 10.4 KB
/
index.html
File metadata and controls
261 lines (230 loc) · 10.4 KB
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Maintenance | Darojax</title>
<style>
/* General Page Styling */
body {
margin: 0;
padding: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background: linear-gradient(to bottom right, #FF9678, #FF8895);
font-family: Roboto, sans-serif;
color: #ffffff;
text-align: center;
overflow: hidden;
text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);
position: relative;
}
h1, h2, h3, h4, h5, h6, p {
margin: 0;
}
/* Background Glow */
.glow-background {
position: absolute;
width: 700px;
height: 700px;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: radial-gradient(circle, rgba(255, 240, 180, 0.9) 10%, rgba(255, 200, 100, 0.3) 60%, rgba(0, 0, 0, 0) 100%);
border-radius: 50%;
z-index: -1;
filter: blur(80px);
animation: glowPulse 3s infinite alternate ease-in-out;
}
@keyframes glowPulse {
0% { transform: translate(-50%, -50%) scale(1); opacity: 0.9; filter: blur(80px); }
100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.6; filter: blur(120px); }
}
/* Floating Background Elements */
.background {
position: fixed;
width: 100vw;
height: 100vh;
top: 0;
left: 0;
overflow: hidden;
z-index: -2;
}
.ball {
position: absolute;
width: 15vmin;
height: 15vmin;
border-radius: 50%;
animation: move linear infinite;
opacity: 0.7;
filter: blur(25px);
box-shadow: 0 0 50px rgba(255, 240, 180, 0.6);
}
@keyframes move {
100% { transform: translate3d(0, 0, 1px) rotate(360deg); }
}
/* Ball Colors & Positions */
.ball:nth-child(odd) { background: rgba(255, 209, 181, 0.8); }
.ball:nth-child(even) { background: rgba(255, 190, 147, 0.8); }
.ball:nth-child(1) { top: 80%; left: 90%; animation-duration: 45s; transform-origin: 20vw -20vh; }
.ball:nth-child(2) { top: 20%; left: 10%; animation-duration: 55s; transform-origin: -15vw 30vh; }
.ball:nth-child(3) { top: 10%; left: 40%; animation-duration: 48s; transform-origin: -18vw 5vh; }
.ball:nth-child(4) { top: 60%; left: 85%; animation-duration: 35s; transform-origin: -14vw -15vh; }
.ball:nth-child(5) { top: 50%; left: 5%; animation-duration: 38s; transform-origin: 5vw 20vh; }
.ball:nth-child(6) { top: 30%; left: 30%; animation-duration: 40s; transform-origin: 12vw -10vh; }
.ball:nth-child(7) { top: 15%; left: 70%; animation-duration: 50s; transform-origin: -10vw 25vh; }
.ball:nth-child(8) { top: 90%; left: 50%; animation-duration: 42s; transform-origin: 8vw -15vh; }
/* Maintenance Message Container */
.container {
max-width: 600px;
padding: 30px;
background-color: rgba(199, 80, 80, 0.2);
border-radius: 12px;
box-shadow: 0px 0px 20px rgba(199, 80, 80, 0.2);
backdrop-filter: blur(10px);
position: relative;
z-index: 2;
}
h1 { font-size: 26px; margin-bottom: 15px; }
p { font-size: 18px; margin-bottom: 15px; }
.footer { margin-top: 15px; font-size: 14px; opacity: 0.8; }
.logo {
vertical-align: middle;
position: relative;
top: -4px;
}
/* Mobile Optimization */
@media (max-width: 768px) {
.glow-background, .ball {
animation: none !important;
filter: none !important;
opacity: 1 !important;
box-shadow: none !important;
}
.background { display: none; }
.glow-background {
background: radial-gradient(circle, rgba(255, 240, 180, 0.5) 20%, rgba(255, 200, 100, 0.2) 60%, rgba(0, 0, 0, 0) 100%);
width: 100vw;
height: 100vh;
top: 0;
left: 0;
transform: none;
border-radius: 0;
filter: blur(30px);
}
}
</style>
</head>
<body>
<div class="glow-background"></div>
<div class="background">
<span class="ball"></span>
<span class="ball"></span>
<span class="ball"></span>
<span class="ball"></span>
<span class="ball"></span>
<span class="ball"></span>
<span class="ball"></span>
<span class="ball"></span>
</div>
<div class="container">
<h1 id="main-message"></h1>
<h2>
Darojax <img src="plex.png" alt="Plex" width="30" class="logo"> Plex and
<img src="overseerr.png" alt="Overseerr" width="30" class="logo"> Overseerr
</h2>
<p id="status-message"></p>
<h2 id="reason-message"></h2>
<div id="downtime-container"></div>
</div>
<script src="config.js"></script>
<script>
function updatePageContent() {
const mainMessageEl = document.getElementById("main-message");
const reasonMessageEl = document.getElementById("reason-message");
const statusMessageEl = document.getElementById("status-message");
const downtimeContainerEl = document.getElementById("downtime-container");
let downtimeContent = ""; // Reset downtime section
let reasonText = maintenanceReason.trim();
let predictedDowntimeText = predictedDowntime.trim() === "" ? "" : `<h4>Predicted Downtime: ${predictedDowntime}</h4>`; // Hide if empty
// Hide reason-message if empty, otherwise add a line break after it
if (reasonText === "") {
reasonMessageEl.style.display = "none";
} else {
reasonMessageEl.style.display = "block";
reasonMessageEl.innerHTML = reasonText + "<br><br>"; // Add a line break after reason
reasonMessageEl.style.color = reasonTextColor; // Apply custom color
}
switch (maintenanceScenario) {
case "SCHEDULED_MAINTENANCE":
mainMessageEl.innerHTML = "🚧 SCHEDULED MAINTENANCE 🚧";
statusMessageEl.innerHTML = reasonText === ""
? "is temporarily offline due to an unknown issue"
: "is temporarily offline due to";
downtimeContent = `
<h1>Server Downtime: <b><span id="downtime-duration">Calculating...</span></b></h1>
${predictedDowntimeText} <!-- Only added if predictedDowntime is not empty -->
`;
break;
case "UNSCHEDULED_MAINTENANCE":
mainMessageEl.innerHTML = "🚨 UNSCHEDULED MAINTENANCE 🚨";
statusMessageEl.innerHTML = reasonText === ""
? "is temporarily offline due to an unknown issue"
: "is temporarily offline due to";
downtimeContent = `
<h1>Server Downtime: <b><span id="downtime-duration">Calculating...</span></b></h1>
${predictedDowntimeText} <!-- Only added if predictedDowntime is not empty -->
`;
break;
case "UNSCHEDULED_DOWNTIME":
mainMessageEl.innerHTML = "⚠️ UNSCHEDULED DOWNTIME ⚠️";
statusMessageEl.innerHTML = reasonText === ""
? "is offline due to an unknown issue"
: "is offline due to";
downtimeContent = `
<h1>Server Downtime: <b><span id="downtime-duration">Calculating...</span></b></h1>
${predictedDowntimeText} <!-- Only added if predictedDowntime is not empty -->
`;
break;
case "SERVER_UNREACHABLE":
default:
mainMessageEl.innerHTML = "❌ SERVER UNREACHABLE ❌";
reasonMessageEl.style.display = "none"; // Ensure it's hidden
statusMessageEl.innerHTML = "is currently unreachable.<br><br>This could be due to a server restart.<br>Try again in a couple of minutes.<br><br>Ping darojax on Discord if the issue does not resolve itself.";
downtimeContent = ""; // No downtime display
break;
}
// **Hide downtime container if there's no content**
if (downtimeContent.trim() === "") {
downtimeContainerEl.style.display = "none";
} else {
downtimeContainerEl.style.display = "block";
downtimeContainerEl.innerHTML = downtimeContent; // Update downtime section
}
}
function updateDowntimeDuration() {
const now = new Date();
const diffMs = now - manualDowntimeStart;
if (diffMs < 0) {
document.getElementById("downtime-duration").textContent = "Error: Future time detected!";
return;
}
const diffSeconds = Math.floor(diffMs / 1000) % 60;
const diffMinutes = Math.floor(diffMs / 60000) % 60;
const diffHours = Math.floor(diffMs / 3600000) % 24;
const diffDays = Math.floor(diffMs / (3600000 * 24));
let downtimeMessage = `${diffDays > 0 ? diffDays + "d " : ""}${diffHours > 0 ? diffHours + "h " : ""}${diffMinutes > 0 ? diffMinutes + "m " : ""}${diffSeconds}s`;
document.getElementById("downtime-duration").textContent = downtimeMessage;
}
// Initialize page content and update downtime every second if needed
updatePageContent();
setInterval(() => {
if (document.getElementById("downtime-duration")) {
updateDowntimeDuration();
}
}, 1000);
</script>
</body>
</html>