forked from starGleam6/available-domains-detection
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
executable file
·222 lines (195 loc) · 5.35 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
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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>xxx网站前置页 - 检测线路</title>
<link rel="stylesheet" href="./reset.min.css" />
<style>
body {
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-image: url(https://source.unsplash.com/random/1920x1080/?scenery);
background-color: #000;
color: #fff;
}
body:before {
content: '';
position: fixed;
top: 0;
left: 0;
background-image: linear-gradient(#000, transparent);
width: 100%;
height: 100%;
z-index: -1;
}
h1 {
margin-bottom: 0.5rem;
font-size: 3rem;
font-weight: bold;
line-height: 1.33333;
}
.text {
font-size: 1.5rem;
line-height: 1.33333;
}
.lds-ellipsis {
display: inline-block;
position: relative;
width: 40px;
height: 10px;
}
.lds-ellipsis div {
position: absolute;
top: 2px;
width: 3px;
height: 3px;
border-radius: 50%;
background: #fff;
animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
.lds-ellipsis div:nth-child(1) {
left: 6px;
animation: lds-ellipsis1 0.6s infinite;
}
.lds-ellipsis div:nth-child(2) {
left: 6px;
animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(3) {
left: 17px;
animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(4) {
left: 28px;
animation: lds-ellipsis3 0.6s infinite;
}
@keyframes lds-ellipsis1 {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
}
}
@keyframes lds-ellipsis2 {
0% {
transform: translate(0, 0);
}
100% {
transform: translate(10px, 0);
}
}
@keyframes lds-ellipsis3 {
0% {
transform: scale(1);
}
100% {
transform: scale(0);
}
}
@media (max-width: 768px) {
html {
font-size: 12px;
}
}
</style>
</head>
<body>
<div>
<h1>线路检测页</h1>
<div class="text" id="info">
线路测试中
<div class="lds-ellipsis">
<div></div>
<div></div>
<div></div>
<div></div>
</div>
将自动跳转可用域名<br />请耐心等候
</div>
</div>
<script>
// 获取当前页面的 URL
var url = window.location.href;
// 解析 URL,并获取查询参数
var urlParams = new URL(url);
var queryParams = {};
var path = ''; // 初始化 path 为空字符串
var timer;
// 遍历所有查询参数并放入对象中
urlParams.searchParams.forEach(function (value, key) {
if (key === "path") {
// 如果查询参数名是 "path",将其赋值给一个变量
path = value;
} else {
// 否则,将其他查询参数放入对象中
queryParams[key] = value;
}
});
function joinUrlAndPath(url, path) {
// 移除 URL 和路径末尾的斜杠
url = url.replace(/\/+$/, ''); // 移除 URL 末尾的斜杠
path = path.replace(/^\/+/, ''); // 移除路径开头的斜杠
// 使用 "/" 将 URL 和路径连接在一起
var joinedUrl = url + '/' + path;
return joinedUrl;
}
fetch("./data.json?t=" + Date.now())
.then((res) => res.json())
.then((data) => {
checkDomain(data); // 立即执行一次
timer && clearInterval(timer);
// retry every 3 seconds
timer = setInterval(() => {
checkDomain(data)
}, 3000);
setTimeout(() => {
// 超时 60 秒禁止循环,弹出提示联系站长
clearInterval(timer);
timer = null;
const text = "无法跳转可用站点,请点击右下角信息图标联系客服";
alert(text);
document.getElementById('info').innerText = text;
}, 60000)
});
function checkDomain(hosts) {
for (var i = 0; i < hosts.length; i++) {
let checkUrl;
let jumpUrl;
if (typeof hosts[i] === 'object' && hosts[i] !== null) {
checkUrl = hosts[i].checkUrl;
jumpUrl = hosts[i].jumpUrl;
} else {
checkUrl = hosts[i];
jumpUrl = hosts[i];
}
fetch(checkUrl).then((res) => {
if (res.ok && res.status === 200) {
window.location.href = joinUrlAndPath(jumpUrl, path) + location.search;
}
});
}
}
</script>
<script type="text/javascript">
window.$crisp = [];
window.CRISP_WEBSITE_ID = ""; // 填写 Crisp ID
(function () {
d = document;
s = d.createElement("script");
s.src = "https://client.crisp.chat/l.js";
s.async = 1;
d.getElementsByTagName("head")[0].appendChild(s);
})();
</script>
</body>
</html>