-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path好玩的.html
More file actions
93 lines (85 loc) · 2.96 KB
/
Copy path好玩的.html
File metadata and controls
93 lines (85 loc) · 2.96 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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>欢迎访问</title>
<style>
body {
font-family: 'Helvetica Neue', Arial, sans-serif;
text-align: center;
padding: 20px;
background-color: #f5f5f5;
}
.container {
max-width: 600px;
margin: 0 auto;
background: white;
padding: 30px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.btn {
display: inline-block;
padding: 12px 24px;
background-color: #4285f4;
color: white;
text-decoration: none;
border-radius: 5px;
font-weight: bold;
margin-top: 20px;
transition: background-color 0.3s;
}
.btn:hover {
background-color: #3367d6;
}
.countdown {
font-size: 18px;
color: #666;
margin: 20px 0;
}
</style>
</head>
<body>
<div class="container">
<h1>欢迎访问我们的网站</h1>
<p>我们将带您前往相关内容页面</p>
<div class="countdown" id="countdown">5秒后自动跳转</div>
<a href="https://geeked-cn.github.io/dweb/%E6%90%9E%E4%BA%BA%E7%9A%84.html" class="btn" id="manualBtn">立即访问</a>
<p style="margin-top: 30px; color: #999; font-size: 14px;">
如果页面没有自动跳转,请点击上面的按钮
</p>
</div>
<script>
// 倒计时功能
let seconds = 5;
const countdownEl = document.getElementById('countdown');
const timer = setInterval(() => {
seconds--;
countdownEl.textContent = `${seconds}秒后自动跳转`;
if(seconds <= 0) {
clearInterval(timer);
openTargetPage();
}
}, 1000);
// 手动跳转按钮
document.getElementById('manualBtn').addEventListener('click', function(e) {
e.preventDefault();
clearInterval(timer);
openTargetPage();
});
// 打开目标页面函数
function openTargetPage() {
// 尝试在新窗口打开
const newWindow = window.open('', '_blank');
if(newWindow) {
// 如果允许弹出窗口,直接跳转
newWindow.location.href = 'https://geeked-cn.github.io/dweb/%E6%90%9E%E4%BA%BA%E7%9A%84.html';
} else {
// 如果不允许弹出窗口,在当前窗口跳转
window.location.href = 'https://geeked-cn.github.io/dweb/%E6%90%9E%E4%BA%BA%E7%9A%84.html';
}
}
</script>
</body>
</html>