-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathindex.html
More file actions
485 lines (411 loc) · 18.9 KB
/
index.html
File metadata and controls
485 lines (411 loc) · 18.9 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
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>手搓VLESS节点生成器</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
}
.container {
max-width: 900px;
margin: 0 auto;
background: white;
border-radius: 12px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
padding: 30px;
text-align: center;
position: relative;
}
h1 {
color: #333;
margin-bottom: 20px;
font-size: 2rem;
text-align: center;
}
#results {
margin-top: 20px;
}
#results p {
color: #666;
text-align: center;
margin: 20px 0;
}
.copy-all-btn {
display: inline-block;
width: 50%;
padding: 12px;
margin: 20px 1%;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 8px;
font-size: 16px;
cursor: pointer;
transition: background-color 0.3s;
}
.copy-all-btn:hover {
background-color: #45a049;
}
.copy-all-btn:active {
background-color: #3e8e41;
}
.generate-btn {
background-color: #FF9800;
}
.generate-btn:hover {
background-color: #F57C00;
}
.generate-btn:active {
background-color: #E65100;
}
.copy-all-btn.copied {
background-color: #2196F3;
}
h2 {
color: #444;
margin: 20px 0;
font-size: 1.5rem;
border-bottom: 2px solid #FF9800;
padding-bottom: 10px;
}
ul {
list-style-type: none;
padding: 0;
}
li {
background: #f8f9fa;
border-radius: 8px;
padding: 15px;
margin-bottom: 15px;
border-left: 4px solid #FF9800;
transition: all 0.3s ease;
cursor: pointer;
position: relative;
}
li:hover {
transform: translateX(10px);
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}
li a {
display: block;
font-weight: 600;
color: #FF9800;
text-decoration: none;
margin-bottom: 8px;
font-size: 1.1rem;
}
li a:hover {
text-decoration: underline;
}
.link {
display: block;
font-size: 0.9rem;
color: #666;
word-break: break-all;
font-family: 'Courier New', monospace;
}
.preset-link {
color: #2196F3;
text-decoration: underline;
cursor: pointer;
transition: color 0.3s ease;
}
.preset-link:hover {
color: #1976D2;
}
.copy-tip {
position: absolute;
right: 20px;
top: 50%;
transform: translateY(-50%);
background-color: #4CAF50;
color: white;
padding: 4px 12px;
border-radius: 4px;
font-size: 0.8rem;
opacity: 0;
transition: opacity 0.3s ease;
pointer-events: none;
z-index: 10;
}
/* 响应式设计 */
@media (max-width: 768px) {
/* 页面边距 */
body {
padding: 10px;
font-size: 16px;
line-height: 1.5;
}
/* 容器调整 */
.container {
padding: 15px;
margin: 10px auto;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}
/* 按钮调整 */
.copy-all-btn {
width: 100%;
margin: 15px 0;
font-size: 18px;
padding: 15px;
}
/* 标题字体大小 */
h1 {
font-size: 1.5rem;
margin-bottom: 15px;
}
h2 {
font-size: 1.2rem;
}
/* 节点列表项调整 */
li {
padding: 12px;
margin-bottom: 12px;
}
li a {
font-size: 0.9rem;
}
/* 作者GitHub链接调整 */
.container > div:first-child {
position: relative;
top: 0;
right: 0;
margin-bottom: 15px;
text-align: center;
}
/* IP来源链接区域调整 */
div[style*="margin: 20px 0;"]:nth-last-child(2) {
margin: 20px 0;
}
/* 预设链接文本调整 */
.preset-link {
font-size: 0.85rem;
word-break: break-all;
}
/* 输入框调整 */
input[type="text"] {
padding: 12px;
font-size: 16px;
margin: 15px 0;
width: 100%;
}
/* 节点链接文本调整 */
.link {
font-size: 0.85rem;
line-height: 1.6;
}
/* 文本行高调整 */
p {
line-height: 1.5;
}
}
</style>
</head>
<body>
<div class="container">
<div style="position: absolute; top: 10px; right: 10px;">
<a href="https://github.com/gslege/CloudflareIP" target="_blank" style="color: #FF9800; text-decoration: none; font-weight: bold;">作者GitHub>></a>
</div><br/>
<h1>手搓VLESS节点生成器</h1>
<div style="margin: 20px 0;">
<label for="uuidInput" style="display: block; margin-bottom: 5px; font-weight: 600; text-align: left;">UUID:</label>
<input type="text" id="uuidInput" placeholder="04c808e2-0b59-47b0-a54b-32fc7ef1c902" style="width: 100%; padding: 8px; margin: 5px 0; border-radius: 8px; border: 1px solid #ddd;">
</div>
<div style="margin: 20px 0;">
<label for="custom3Input" style="display: block; margin-bottom: 5px; font-weight: 600; text-align: left;">反代IP</label>
<input type="text" id="custom3Input" placeholder="proxyip.cmliussss.net" style="width: 100%; padding: 8px; margin: 5px 0; border-radius: 8px; border: 1px solid #ddd;">
</div>
<div style="margin: 20px 0;">
<label for="domainInput" style="display: block; margin-bottom: 5px; font-weight: 600; text-align: left;">部署域名:</label>
<input type="text" id="domainInput" placeholder="cf.cloudip.ggff.net" style="width: 100%; padding: 8px; margin: 5px 0; border-radius: 8px; border: 1px solid #ddd;">
</div>
<div style="margin: 20px 0; text-align: left;">
<label for="ipSourceInput" style="display: block; margin-bottom: 5px; font-weight: 600; text-align: left;">IP来源网址:</label>
<input type="text" id="ipSourceInput" placeholder="https://raw.githubusercontent.com/gslege/CloudflareIP/refs/heads/main/Me.txt" style="width: 100%; padding: 8px; margin: 5px 0; border-radius: 8px; border: 1px solid #ddd; display: none;">
<select id="presetIpSelect" style="width: 100%; padding: 8px; margin: 5px 0; border-radius: 8px; border: 1px solid #ddd;">
<option value="https://raw.githubusercontent.com/gslege/CloudflareIP/refs/heads/main/Me.txt">运营商IP</option>
<option value="https://raw.githubusercontent.com/gslege/CloudflareIP/refs/heads/main/SG.txt">新加坡IP</option>
<option value="https://raw.githubusercontent.com/gslege/CloudflareIP/refs/heads/main/JP.txt">日本IP</option>
<option value="https://raw.githubusercontent.com/gslege/CloudflareIP/refs/heads/main/US.txt">美国IP</option>
<option value="https://raw.githubusercontent.com/gslege/CloudflareIP/refs/heads/main/DE.txt">德国IP</option>
<option value="https://raw.githubusercontent.com/gslege/CloudflareIP/refs/heads/main/NL.txt">荷兰IP</option>
<option value="https://raw.githubusercontent.com/gslege/CloudflareIP/refs/heads/main/country.txt">网络IP</option>
<option value="https://raw.githubusercontent.com/gslege/CloudflareIP/refs/heads/main/Cdtools.txt">优选IP</option>
<option value="https://raw.githubusercontent.com/gslege/CloudflareIP/refs/heads/main/Cfxyz.txt">测速IP</option>
<option value="https://raw.githubusercontent.com/gslege/CloudflareIP/refs/heads/main/More.txt">更多IP</option>
</select>
<div style="font-size: 12px;color: #FF9800; text-align: center;">使用方法:输入自己的UUID,部署域名,或使用默认的UUID,部署域名,再选预设IP来源后一键生成节点。</div>
<div style="text-align: center;"><button id="generateBtn" class="copy-all-btn generate-btn">一键生成节点</button></div>
<div style="font-size: 12px;color: #FF9800; text-align: center;">公益节点有流量限制,建议使用<a href="https://github.com/gslege/CloudflareIP/blob/main/CF-Worker/_worker.js" target="_blank" style="color: #888888; text-decoration: none; font-weight: bold;">_worker.js</a>自己部署!</div>
<div style="text-align: center;"><button id="copyAllBtn" class="copy-all-btn">一键复制全部</button></div>
<div style="font-size: 12px;color: #FF9800; text-align: center;">一键复制Vless节点后推荐导入<b>v2ray</b>或<b>karing</b>中使用。</div>
</div>
<div id="results"></div>
</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
// 默认UUID、域名和IP来源网址
const defaultUUID = '04c808e2-0b59-47b0-a54b-32fc7ef1c902';
const defaultDomain = 'cf.cloudip.ggff.net';
const defaultCustom3 = 'proxyip.cmliussss.net';
const defaultIpSource = 'https://raw.githubusercontent.com/gslege/CloudflareIP/refs/heads/main/Me.txt';
// 预设IP来源链接点击事件
const presetLinks = document.querySelectorAll('.preset-link');
presetLinks.forEach(link => {
link.addEventListener('click', (e) => {
e.preventDefault();
const url = link.href;
const ipSourceInput = document.getElementById('ipSourceInput');
// 填充到输入框
ipSourceInput.value = url;
// 复制到剪贴板
navigator.clipboard.writeText(url)
.then(() => {
// 提供视觉反馈
const originalColor = link.style.color;
link.style.color = '#4CAF50';
setTimeout(() => {
link.style.color = originalColor;
}, 1000);
})
.catch(err => {
console.error('复制失败:', err);
});
});
});
// 预设IP来源下拉菜单事件
const presetIpSelect = document.getElementById('presetIpSelect');
presetIpSelect.addEventListener('change', () => {
const selectedUrl = presetIpSelect.value;
const ipSourceInput = document.getElementById('ipSourceInput');
// 填充到输入框
if (selectedUrl) {
ipSourceInput.value = selectedUrl;
// 复制到剪贴板
navigator.clipboard.writeText(selectedUrl)
.then(() => {
// 提供视觉反馈
const originalColor = presetIpSelect.style.color;
presetIpSelect.style.color = '#4CAF50';
setTimeout(() => {
presetIpSelect.style.color = originalColor;
}, 1000);
})
.catch(err => {
console.error('复制失败:', err);
});
}
});
// 生成链接函数
async function generateLinks(uuid = defaultUUID, domain = defaultDomain, ipSource = defaultIpSource, custom3 = defaultCustom3) {
const resultsDiv = document.getElementById('results');
resultsDiv.innerHTML = '<p>正在获取内容并生成链接,请稍候...</p>';
try {
const url = ipSource;
const response = await fetch(url);
const content = await response.text();
// 解析每一行IP#名称
const lines = content.split('\n').filter(line => line.trim());
if (lines.length === 0) {
resultsDiv.innerHTML = '<p>未找到任何IP和名称</p>';
return;
}
// VLESS链接模板
const vlessTemplate = `vless://${uuid}@自定义1:443?encryption=none&security=tls&sni=${domain}&fp=random&insecure=0&allowInsecure=0&type=ws&host=${domain}&path=pyip%3D${custom3}#自定义2`;
// 生成VLESS链接
const links = [];
lines.forEach((line, index) => {
// 分离IP和名称
const [ip, name = `服务器${index + 1}`] = line.trim().split('#');
// 验证IP格式
const ipRegex = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/;
if (!ipRegex.test(ip)) return;
const vlessLink = vlessTemplate.replace('自定义1', ip).replace('自定义2', name).replace('自定义3', custom3);
links.push(`<li>${name}<span class="link">${vlessLink}</span><span class="copy-tip">已复制</span></li>`);
});
const linksHTML = links.join('');
resultsDiv.innerHTML = `
<ul style="list-style-type: none; padding: 0; text-align: left;">${linksHTML}</ul>
<p>共生成 ${links.length} 个链接</p>
`;
// 为每个节点添加点击复制功能
const listItems = document.querySelectorAll('#results li');
listItems.forEach(item => {
item.addEventListener('click', async () => {
const linkSpan = item.querySelector('.link');
const copyTip = item.querySelector('.copy-tip');
if (!linkSpan) return;
const linkText = linkSpan.textContent;
try {
await navigator.clipboard.writeText(linkText);
// 提供视觉反馈
const originalBg = item.style.backgroundColor;
item.style.backgroundColor = '#e8f5e9';
// 显示已复制提示
if (copyTip) {
copyTip.style.opacity = '1';
}
// 1秒后恢复原背景色和隐藏提示
setTimeout(() => {
item.style.backgroundColor = originalBg || '';
if (copyTip) {
copyTip.style.opacity = '0';
}
}, 1000);
} catch (err) {
console.error('复制失败:', err);
alert('复制失败,请重试');
}
});
});
} catch (error) {
resultsDiv.innerHTML = `<p>生成失败: ${error.message}</p>`;
}
}
// 页面加载时使用默认值生成链接
generateLinks();
// 一键生成按钮事件
document.getElementById('generateBtn').addEventListener('click', () => {
const uuid = document.getElementById('uuidInput').value || defaultUUID;
const domain = document.getElementById('domainInput').value || defaultDomain;
const ipSource = document.getElementById('ipSourceInput').value || defaultIpSource;
const custom3 = document.getElementById('custom3Input').value || defaultCustom3;
generateLinks(uuid, domain, ipSource, custom3);
});
// 一键复制全部链接功能
document.getElementById('copyAllBtn').addEventListener('click', async () => {
const links = document.querySelectorAll('.link');
if (links.length === 0) {
alert('没有可复制的链接');
return;
}
const text = Array.from(links).map(link => link.textContent).join('\n');
try {
await navigator.clipboard.writeText(text);
const btn = document.getElementById('copyAllBtn');
const originalText = btn.textContent;
btn.textContent = '已复制';
btn.classList.add('copied');
setTimeout(() => {
btn.textContent = originalText;
btn.classList.remove('copied');
}, 1500);
} catch (err) {
console.error('复制失败:', err);
alert('复制失败,请重试');
}
});
});
</script>
</body>
</html>