-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
60 lines (60 loc) · 1.62 KB
/
Copy pathindex.html
File metadata and controls
60 lines (60 loc) · 1.62 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta property="og:image" content="/img/cover.png">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script>
function redirectTimeOut(s, url) {
let el = document.getElementById('rp_i');
el.innerHTML = s+1;
if (s > 0) {
setTimeout("redirectTimeOut(" + (--s) + ", \""+url+"\");", 1000);
} else {
window.location.href = url;
}
}
function p() {
var newDiv = document.createElement("div");
newDiv.id = 'rp_p';
newDiv.innerHTML = '<div id="rp_i"></div>';
document.body.prepend(newDiv);
let subdomain = window.location.host.split('.')[1] ? window.location.host.split('.')[0] : false;
let xhr = new XMLHttpRequest();
xhr.open('GET', '/'+subdomain, false);
try {
xhr.send();
if (xhr.status != 200) {
} else {
redirectTimeOut(gri(2, 4), xhr.response);
}
} catch(err) {
}
}
function gri(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}
window.onload = p;
</script>
<style>
body > * {
display: none;
}
#rp_p {
display: -webkit-flex;
display: flex;
-webkit-flex-direction: row;
flex-direction: row;
justify-content: center;
align-items: center;
width: 100vw;
height: 100vh;
}
#rp_p #rp_i {
font-size: 20px;
}
</style>
<title>Какое-то название, может отображаться в превьюшке</title>
</head>