forked from laoxue-btc/carbernsteini6.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
192 lines (174 loc) · 6.14 KB
/
index.html
File metadata and controls
192 lines (174 loc) · 6.14 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
<!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>
.container {
width: 100px;
height: 100px;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
animation: rotate-move 2s ease-in-out infinite;
display: none;
}
.dot {
width: 15px;
height: 15px;
border-radius: 50%;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
}
.dot-3 { background-color: #f74d75; animation: dot-3-move 2s ease infinite; }
.dot-2 { background-color: #10beae; animation: dot-2-move 2s ease infinite; }
.dot-1 { background-color: #ffe386; animation: dot-1-move 2s ease infinite; }
@keyframes dot-3-move {
20%,100% { transform: scale(1) }
45%,80% { transform: translateY(-18px) scale(.45) }
}
@keyframes dot-2-move {
20%,100% { transform: scale(1) }
45%,80% { transform: translate(-16px, 12px) scale(.45) }
}
@keyframes dot-1-move {
20%,100% { transform: scale(1) }
45%,80% { transform: translate(16px, 12px) scale(.45) }
}
@keyframes rotate-move {
55% { transform: translate(-50%, -50%) rotate(0deg) }
80%,100% { transform: translate(-50%, -50%) rotate(360deg) }
}
/* 全局水印样式 */
.watermark {
position: fixed;
pointer-events: none;
width: 100%;
height: 100%;
background-image: repeating-linear-gradient(
-45deg,
rgba(255, 0, 0, 0.1),
rgba(255, 0, 0, 0.1) 20px,
rgba(0, 0, 255, 0.1) 20px,
rgba(0, 0, 255, 0.1) 40px
);
z-index: 9999;
display: none;
}
.watermark-text {
position: absolute;
color: rgba(255, 0, 0, 0.6);
font-size: 18px;
font-weight: bold;
text-align: center;
width: 100%;
top: 50%;
transform: translateY(-50%);
text-shadow: 1px 1px 1px #fff;
}
/* iframe样式 */
.content {
height: 100%;
width: 100%;
position: fixed;
inset: -2px;
z-index: 1;
}
</style>
</head>
<body>
<!-- 三点加载动画容器 -->
<div class="container" id="loadingContainer">
<div class="dot dot-1"></div>
<div class="dot dot-2"></div>
<div class="dot dot-3"></div>
</div>
<!-- 全局水印 -->
<div class="watermark" id="watermark">
</div>
<script>
(function() {
// 白名单域名配置(预留位置方便后期添加)
const WHITELIST_CONFIG = {
domains: [
'*',
],
};
// 显示三点加载动画
function showLoadingAnimation() {
document.getElementById('loadingContainer').style.display = 'block';
}
// 验证URL域名是否在白名单
function isAllowedDomain(url) {
return true
try {
const domain = new URL(url).hostname.replace('www.', '');
return WHITELIST_CONFIG.domains.some(allowedDomain => {
return domain === allowedDomain ||
domain.endsWith('.' + allowedDomain);
});
} catch (e) {
console.error('URL解析失败:', e);
return false;
}
}
// 主处理逻辑
function processRedirect() {
showLoadingAnimation();
const urlParams = new URLSearchParams(window.location.search);
const encodedParam = urlParams.get('c');
if (!encodedParam) {
document.getElementById('watermark').style.display = 'block';
document.getElementById('loadingContainer').style.display = 'none';
return;
}
try {
const trueUrl = atob(encodedParam);
if (trueUrl.includes("http")) {
// 检查域名是否在白名单
if (!isAllowedDomain(trueUrl)) {
document.getElementById('watermark').style.display = 'block';
document.querySelector('.watermark-text').textContent = WHITELIST_CONFIG.watermarkText;
}
// 创建并加载iframe
const iframe = document.createElement('iframe');
iframe.className = 'content';
iframe.src = trueUrl;
iframe.addEventListener('load', function() {
document.getElementById('loadingContainer').style.display = 'none';
});
document.body.appendChild(iframe);
}
} catch (e) {
console.error('URL解码失败:', e);
document.getElementById('watermark').style.display = 'block';
document.getElementById('loadingContainer').style.display = 'none';
}
}
// 禁止F12开发者工具
document.addEventListener('keydown', function(e) {
if (e.key === 'F12' ||
(e.ctrlKey && e.shiftKey && e.key === 'I') ||
(e.ctrlKey && e.shiftKey && e.key === 'J') ||
(e.ctrlKey && e.key === 'U')) {
e.preventDefault();
}
});
window.addEventListener('message', function(event) {
// 验证消息类型(确保是标题同步请求)
if (event.data.type === 'SYNC_TITLE') {
// 将iframe发送的标题设置为父页面标题
document.title = event.data.title || '官方认证';
}
}, false);
processRedirect();
})();
</script>
</body>
</html>