-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcountdown.html
184 lines (179 loc) · 7.52 KB
/
countdown.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
<!DOCTYPE html>
<html lang="zh-cn">
<head>
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-5803807445434654"
crossorigin="anonymous"></script>
<!-- 横向AD -->
<ins class="adsbygoogle"
style="display:block"
data-ad-client="ca-pub-5803807445434654"
data-ad-slot="1797038685"
data-ad-format="auto"
data-full-width-responsive="true"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width,height=device-height, initial-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="robots" content="noindex,follow">
<link rel="shortcut icon" href="/assets/images/favicon.png">
<title>加载中LOADING...</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/pace-js@latest/pace-theme-default.min.css" />
<style>
/* 添加必要的CSS样式 */
.center-box {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
text-align: center;
display: none; /* 隐藏整个center-box */
}
.loading-text {
margin-top: 20px;
font-size: 16px;
}
.countdown {
font-size: 24px;
color: #3085d6;
margin-top: 10px;
}
/* 添加广告卡片样式 */
.box {
position: fixed;
bottom: 20px;
right: 20px;
background: white;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0,0,0,0.1);
padding: 20px;
max-width: 300px;
}
.box__description-title {
font-size: 12px;
font-weight: bold;
margin-bottom: 10px;
}
.box__description-text {
font-size: 14px;
line-height: 1.6;
margin-bottom: 15px;
}
.box__button {
display: inline-block;
padding: 8px 20px;
background: #3085d6;
color: white;
text-decoration: none;
border-radius: 5px;
transition: background 0.3s;
}
.box__button:hover {
background: #2171c1;
}
/* 可以根据需要添加更多样式 */
</style>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="https://cdn.jsdelivr.net/npm/pace-js@latest/pace.min.js"></script>
</head>
<body>
<div class='center-box'>
<p class="loading-text">正在准备跳转,请稍候</p>
<p class="countdown">0</p>
</div>
<script type="text/javascript">
window.onload = function(){
const redirectUrl = sessionStorage.getItem('redirectUrl');
if(redirectUrl) {
let countdown = 1;
const countdownElement = document.querySelector('.countdown');
// 倒计时函数
const timer = setInterval(function() {
countdown--;
countdownElement.textContent = countdown;
if (countdown <= 0) {
clearInterval(timer);
let popupCountdown = 5;
Swal.fire({
title: "跳转确认",
html: `
<div style="margin-bottom: 10px; text-align: center;">
即将在 <b>${popupCountdown}</b> 秒后自动跳转...
</div>
<div style="background: #f8f9fa; border-radius: 10px; padding: 15px; margin: 10px 0;">
<div style="text-align: center; color: rgb(15, 76, 231); font-size: 18px; font-weight: bold; margin-bottom: 10px;">
全网最便宜机场|VPN大全
</div>
<!-- 广告图片容器 -->
<div style="text-align: center; margin: 10px 0;">
<a href="https://vpnnav.github.io/" target="_blank">
<img src="/assets/images/vpn.png" alt="广告"
style="width: 100%; max-width: 500px; height: 180px; object-fit: cover; border-radius: 8px; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.1);">
</a>
</div>
<div style="text-align: center; margin: 10px 0;">
<div style="color: #c30000; font-size: 15px; font-weight: bold; margin-bottom: 8px;">
智能分流,一键直达
</div>
<div style="font-size: 14px; line-height: 1.5; margin-bottom: 12px;">
✅国外常用流媒体加速<br/>
✅全球多个地区的节点<br/>
✅有大流量不限时套餐
</div>
<a href="https://vpnnav.github.io/"
target="_blank"
style="display: inline-block; padding: 8px 25px; background: #3085d6; color: white; text-decoration: none; border-radius: 5px; transition: background 0.3s; font-size: 15px;">
立即体验
</a>
</div>
</div>
`,
icon: "info",
showDenyButton: true,
confirmButtonColor: "#3085d6",
denyButtonColor: "#d33",
confirmButtonText: "手动跳转",
denyButtonText: "关闭页面",
width: '600px',
timer: 5000,
timerProgressBar: true,
didOpen: () => {
const popupTimer = setInterval(() => {
popupCountdown--;
Swal.getHtmlContainer().querySelector('b').textContent = popupCountdown;
if (popupCountdown <= 0) {
clearInterval(popupTimer);
window.location.href = redirectUrl;
}
}, 1000);
}
}).then((result) => {
if (result.isConfirmed) {
window.location.href = redirectUrl;
}
if (result.isDenied) {
window.opener=null;
window.close();
}
});
}
}, 1000);
} else {
Swal.fire({
icon: "error",
title: "错误",
text: "跳转地址无效,3秒后返回首页"
});
setTimeout(function(){
window.location.href = "/";
}, 5000);
}
setTimeout(function(){
window.opener=null;
window.close();
}, 50000);
}
</script>
</body>
</html>