-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
512 lines (448 loc) · 18.1 KB
/
Copy pathindex.html
File metadata and controls
512 lines (448 loc) · 18.1 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
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
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>GitHub 文件加速器</title>
<meta name="description" content="极速 GitHub 文件链接加速服务 by Relogys">
<meta name="robots" content="index, follow">
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes"/>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;700&display=swap" rel="stylesheet">
<style>
:root {
--bg-color: #0A0A0A;
--text-color: #EAEAEA;
--primary-accent: #007AFF;
--primary-accent-rgb: 0, 122, 255; /* RGB 版本的主强调色,用于辉光 */
--secondary-accent: #333333;
--line-color: #222222;
--font-main: 'Inter', 'Noto Sans SC', sans-serif;
--modal-bg-color: #181818;
--modal-border-color: var(--secondary-accent);
}
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
font-size: 16px;
scroll-behavior: smooth;
}
body {
font-family: var(--font-main);
background-color: var(--bg-color);
color: var(--text-color);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
overflow: hidden;
opacity: 0;
animation: fadeInBody 0.5s 0.5s ease-out forwards;
}
@keyframes fadeInBody {
to { opacity: 1; }
}
/* --- Preloader --- */
#preloader {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: var(--bg-color);
z-index: 9999;
display: flex;
justify-content: center;
align-items: center;
transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}
#preloader.loaded {
opacity: 0;
visibility: hidden;
pointer-events: none;
}
.preloader-bar {
width: 0%;
height: 2px;
background-color: var(--primary-accent);
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
animation: preloadAnimation 1s ease-out forwards;
}
@keyframes preloadAnimation {
0% { width: 0%; }
80% { width: 80%; }
100% { width: 100%; }
}
/* --- Lines Decorativas --- */
.decorative-lines {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 1;
}
.line {
position: absolute;
background-color: var(--line-color);
opacity: 0;
animation: drawLine 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.line.top { top: 20px; left: 20px; right: 20px; height: 1px; transform-origin: left; transform: scaleX(0); animation-delay: 0.7s; }
.line.bottom { bottom: 20px; left: 20px; right: 20px; height: 1px; transform-origin: right; transform: scaleX(0); animation-delay: 0.7s; }
.line.left { top: 20px; bottom: 20px; left: 20px; width: 1px; transform-origin: top; transform: scaleY(0); animation-delay: 0.9s; }
.line.right { top: 20px; bottom: 20px; right: 20px; width: 1px; transform-origin: bottom; transform: scaleY(0); animation-delay: 0.9s; }
@keyframes drawLine {
to { opacity: 1; transform: scaleX(1) scaleY(1); }
}
/* --- Contenedor Principal --- */
.accelerator-container {
padding: 2rem 2rem;
text-align: center;
max-width: 600px;
width: 100%;
position: relative;
z-index: 2;
opacity: 0;
transform: translateY(20px);
animation: contentFadeInUp 0.8s 1.2s ease-out forwards;
}
@keyframes contentFadeInUp {
to {
opacity: 1;
transform: translateY(0);
}
}
/* --- 主标题 H1 --- */
h1 {
font-size: clamp(2rem, 6vw, 3rem);
font-weight: 700;
margin-bottom: 1em; /* 初始状态:主标题和下方(此时为输入框)的间距 */
letter-spacing: -0.5px;
color: var(--text-color);
position: relative;
cursor: default;
display: inline-block;
transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0s,
margin-bottom 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0s;
transform: translateY(0);
}
h1::before { /* 辉光效果 */
content: '';
position: absolute;
left: var(--glow-x, 50%);
top: var(--glow-y, 50%);
width: 150px;
height: 150px;
background: radial-gradient(circle,
rgba(var(--primary-accent-rgb), 0.3) 0%,
transparent 60%
);
transform: translate(-50%, -50%);
opacity: var(--glow-opacity, 0);
transition: opacity 0.3s ease-out;
pointer-events: none;
z-index: -1;
}
.content-wrapper.input-focused h1 {
/* 激活状态:向上推动的距离。这个值需要根据副标题实际高度和其margin-top仔细调整 */
/* 估算:若副标题内容高约3.2rem, margin-top 0.5rem => 总共约3.7rem。 */
/* 初始标题margin-bottom为1em。激活后标题自身margin-bottom为0.5em。 */
/* 需要推开的距离大约是 (3.7rem + 0.5em(激活后标题mb)) - 1em(初始标题mb) = 3.2rem */
/* 这只是一个起点,具体数值需要测试和微调 */
transform: translateY(-2.8rem);
margin-bottom: 0.5em; /* 激活状态:主标题和下方(此时为副标题)的间距 */
}
/* --- 副标题 --- */
.subtitle {
font-size: clamp(0.9rem, 2.5vw, 1.05rem);
font-weight: 300;
color: var(--text-color);
line-height: 1.6;
text-align: center;
opacity: 0;
transform: translateY(10px);
max-height: 0;
margin-top: 0;
margin-bottom: 0;
overflow: hidden;
transition: opacity 0.4s ease-out 0.1s, /* opacity和transform稍延迟 */
transform 0.4s cubic-bezier(0.23, 1, 0.32, 1) 0.1s,
max-height 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0s, /* max-height和margin立即开始 */
margin-top 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0s,
margin-bottom 0.5s cubic-bezier(0.23, 1, 0.32, 1) 0s;
}
.content-wrapper.input-focused .subtitle {
opacity: 0.8;
transform: translateY(0);
max-height: 5em; /* 确保能容纳约两行文本 */
margin-top: -3.5em; /* 激活状态:副标题和上方(此时为主标题)的间距 */
margin-bottom: 1.5em; /* 激活状态:副标题和下方(此时为输入框)的间距 */
}
#githubUrl {
width: 100%;
padding: 1rem 1.25rem;
background-color: rgba(255, 255, 255, 0.05);
border: 1px solid var(--secondary-accent);
border-radius: 6px;
font-size: 1rem;
color: var(--text-color);
font-family: var(--font-main);
transition: border-color 0.3s ease, background-color 0.3s ease;
}
#githubUrl::placeholder {
color: rgba(255, 255, 255, 0.4);
font-weight: 300;
}
#githubUrl:focus {
outline: none;
border-color: var(--primary-accent);
background-color: rgba(var(--primary-accent-rgb), 0.08);
}
.button-accelerate {
background-color: transparent;
color: var(--primary-accent);
padding: 0.9rem 2rem;
border: 1px solid var(--primary-accent);
border-radius: 6px;
font-size: 1rem;
font-weight: 500;
font-family: var(--font-main);
cursor: pointer;
transition: background-color 0.3s ease, color 0.3s ease, transform 0.2s ease;
position: relative;
overflow: hidden;
margin-top: 1.5em; /* 按钮与上方(输入框)的间距 */
}
.button-accelerate:hover {
background-color: var(--primary-accent);
color: var(--bg-color);
transform: translateY(-2px);
}
.button-accelerate:active {
transform: translateY(0px);
}
.ripple {
position: absolute;
border-radius: 50%;
background-color: rgba(255, 255, 255, 0.3);
transform: scale(0);
animation: ripple-animation 0.6s linear;
pointer-events: none;
}
@keyframes ripple-animation {
to {
transform: scale(4);
opacity: 0;
}
}
/* --- 页面内模态框 (Modal) 样式 --- */
.modal-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.6);
z-index: 1000;
opacity: 0;
visibility: hidden;
transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.active {
opacity: 1;
visibility: visible;
}
.modal {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%) scale(0.95);
background-color: var(--modal-bg-color);
padding: 2rem 2.5rem;
border-radius: 8px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
z-index: 1001;
width: 90%;
max-width: 400px;
text-align: center;
opacity: 0;
visibility: hidden;
transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
border: 1px solid var(--modal-border-color);
}
.modal.active {
opacity: 1;
visibility: visible;
transform: translate(-50%, -50%) scale(1);
}
.modal-title {
font-size: 1.25rem;
font-weight: 500;
color: var(--text-color);
margin-bottom: 0.8em;
}
.modal-message {
font-size: 0.95rem;
color: var(--text-color);
opacity: 0.8;
margin-bottom: 1.8em;
line-height: 1.6;
}
.modal-button {
background-color: var(--primary-accent);
color: var(--bg-color);
padding: 0.7rem 1.8rem;
border: none;
border-radius: 6px;
font-size: 0.9rem;
font-weight: 500;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.2s ease;
}
.modal-button:hover {
background-color: #005cbf;
transform: translateY(-1px);
}
/* Adaptabilidad */
@media (max-width: 768px) {
.line.top, .line.bottom, .line.left, .line.right {
top: 15px; bottom: 15px; left: 15px; right: 15px;
}
.modal { padding: 1.5rem 2rem; }
.accelerator-container { padding: 1.5rem 1rem; }
h1 { margin-bottom: 0.8em; } /* 小屏幕上初始间距可以稍微调整 */
.content-wrapper.input-focused h1 { transform: translateY(-2.6rem); } /* 小屏幕上推动距离也可能需要微调 */
}
</style>
</head>
<body>
<div id="preloader">
<span class="preloader-bar"></span>
</div>
<div class="decorative-lines">
<span class="line top"></span>
<span class="line right"></span>
<span class="line left"></span>
<span class="line bottom"></span>
</div>
<div class="content-wrapper" id="contentWrapper">
<main class="accelerator-container">
<h1 id="mainTitle">GitHub 加速</h1>
<p class="subtitle" id="mainSubtitle">粘贴您的 GitHub 文件链接,体验如丝般顺滑的加速下载。<br>由 Relogys 精心为您呈现。</p>
<input type="text" id="githubUrl" placeholder="例如: https://github.com/user/repo/blob/main/file.zip">
<button class="button-accelerate" id="accelerateButton">立即加速</button>
</main>
</div>
<div class="modal-overlay" id="pageModalOverlay"></div>
<div class="modal" id="pageModal">
<h2 class="modal-title" id="modalTitle">操作提示</h2> <!-- 默认弹窗标题 -->
<p class="modal-message" id="modalMessage">请输入一个有效的 GitHub 文件链接!</p> <!-- 默认弹窗消息 -->
<button class="modal-button" id="modalCloseButton">确定</button>
</div>
<script>
// --- Preloader ---
window.addEventListener('load', () => {
const preloader = document.getElementById('preloader');
setTimeout(() => {
preloader.classList.add('loaded');
document.body.style.overflow = 'auto';
}, 500);
});
// --- 页面内模态框 (Modal) 逻辑 ---
const modalOverlay = document.getElementById('pageModalOverlay');
const pageModal = document.getElementById('pageModal');
const modalTitleElement = document.getElementById('modalTitle');
const modalMessageElement = document.getElementById('modalMessage');
const modalCloseButton = document.getElementById('modalCloseButton');
function showPageModal(title, message) {
modalTitleElement.textContent = title;
modalMessageElement.textContent = message;
modalOverlay.classList.add('active');
pageModal.classList.add('active');
}
function hidePageModal() {
modalOverlay.classList.remove('active');
pageModal.classList.remove('active');
}
modalCloseButton.addEventListener('click', hidePageModal);
modalOverlay.addEventListener('click', hidePageModal);
// --- 标题辉光效果 和 副标题动画 ---
const mainTitle = document.getElementById('mainTitle');
const githubUrlInput = document.getElementById('githubUrl');
const contentWrapper = document.getElementById('contentWrapper');
mainTitle.addEventListener('mousemove', (e) => {
const rect = mainTitle.getBoundingClientRect();
const x = e.clientX - rect.left;
const y = e.clientY - rect.top;
mainTitle.style.setProperty('--glow-x', `${x}px`);
mainTitle.style.setProperty('--glow-y', `${y}px`);
});
mainTitle.addEventListener('mouseenter', () => {
mainTitle.style.setProperty('--glow-opacity', '1');
});
mainTitle.addEventListener('mouseleave', () => {
mainTitle.style.setProperty('--glow-opacity', '0');
});
githubUrlInput.addEventListener('focus', () => {
contentWrapper.classList.add('input-focused');
});
// 如果希望失去焦点时恢复布局(副标题消失,主标题归位)
// 取消下面的注释即可
// githubUrlInput.addEventListener('blur', () => {
// contentWrapper.classList.remove('input-focused');
// });
// --- GitHub 加速器核心逻辑 ---
// !!! 重要: 这里的 PREFIX 必须和你的 Cloudflare Worker 脚本中的 PREFIX 常量完全一致 !!!
const PREFIX = '/gh/'; // 例如 '/gh/' 或 '/'
const accelerateButton = document.getElementById('accelerateButton');
function navigateToProxy() {
const githubUrl = githubUrlInput.value.trim();
if (githubUrl) {
window.location.href = window.location.origin + PREFIX + githubUrl;
} else {
showPageModal("操作提示", "请输入一个有效的 GitHub 文件链接!");
githubUrlInput.focus();
}
}
accelerateButton.addEventListener('click', function(event) {
createRipple(event);
navigateToProxy();
});
githubUrlInput.addEventListener('keypress', function(event) {
if (event.key === 'Enter') {
event.preventDefault();
accelerateButton.click();
}
});
function createRipple(event) {
const button = event.currentTarget;
const existingRipple = button.querySelector(".ripple");
if (existingRipple) {
existingRipple.remove();
}
const circle = document.createElement("span");
const diameter = Math.max(button.clientWidth, button.clientHeight);
const radius = diameter / 2;
circle.style.width = circle.style.height = `${diameter}px`;
const rect = button.getBoundingClientRect();
circle.style.left = `${event.clientX - rect.left - radius}px`;
circle.style.top = `${event.clientY - rect.top - radius}px`;
circle.classList.add("ripple");
button.appendChild(circle);
circle.addEventListener('animationend', () => {
circle.remove();
});
}
</script>
</body>
</html>