-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathvpn.html
296 lines (249 loc) · 9.31 KB
/
vpn.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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="./tailwindcss.js"></script>
<link rel="icon" type="image/x-icon" href="images/default.png" />
<title>完全免费翻墙软件 推墙运动 墙倒众人推 大翻墙运动 拆墙运动 普及翻墙 </title>
<meta charset="UTF-8" />
<meta
name="description"
content="推墙运动 墙倒众人推 大翻墙运动 拆除互联网防火墙 拆墙运动 声援乔鑫鑫 杨泽伟 编程随想 阮晓寰 "
/>
<meta
name="keywords"
content="推墙运动 墙倒众人推 大翻墙运动 完全免费翻墙软件 梯子 机场 拆墙机场 回国机场 回国梯子 代理 Vmess Shadowsocks Trojan v2ray v2board Shadowrocket GFW 突破防火墙 VPN 防火墙 拆墙运动 拆墙 推墙 fanqiang 科学上网 自由上网 免费科学上网 免费翻墙 油管youtube 电脑、手机、iOS、安卓、windows、Mac、Linux 推特"
/>
<script>
fetch('header.html')
.then((response) => response.text())
.then((text) => {
document.getElementById('header').innerHTML = text;
const mobileHeader = document.getElementById('mobile-header');
const closeMenu = document.getElementById('close-menu');
const openMenu = document.getElementById('open-menu');
mobileHeader.classList.add('hidden');
closeMenu.onclick = () => {
mobileHeader.classList.add('hidden');
};
openMenu.onclick = () => {
mobileHeader.classList.remove('hidden');
};
});
fetch('footer.html')
.then((response) => response.text())
.then((text) => (document.getElementById('footer').innerHTML = text));
</script>
</head>
<body>
<div id="header"></div>
<main>
<div class="mx-auto w-full flex items-center justify-center">
<fieldset class="mt-20">
<legend class="sr-only"></legend>
<div class="grid grid-cols-3 gap-3 sm:grid-cols-5" id="os-group">
<!-- Memory Options will be added here using JavaScript -->
</div>
</fieldset>
</div>
<h1
class="mx-auto w-full flex items-center justify-center my-10 text-2xl font-bold leading-10 tracking-tight text-gray-900"
>
翻墙软件
</h1>
<ul
role="list"
class="grid grid-cols-1 gap-6 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"
id="vpn-list"
></ul>
<h1
class="mx-auto w-full flex items-center justify-center my-10 text-2xl font-bold leading-10 tracking-tight text-gray-900"
>
无审查软件
</h1>
<ul
role="list"
class="grid grid-cols-1 gap-6 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4"
id="e2e-list"
></ul>
<!-- FAQs -->
</main>
<!-- <div id="footer"></div> -->
<!-- Footer -->
<div id="footer"></div>
<script type="module">
const osTypes = [
{
id: 'android',
name: '安卓手机',
icon: 'images/android.svg',
},
{
id: 'windows',
name: '微软电脑',
icon: 'images/windows.svg',
},
{
id: 'ios',
name: '苹果手机',
icon: 'images/ios.svg',
},
{
id: 'mac',
name: '苹果电脑',
icon: 'images/mac.svg',
},
{
id: 'linux',
name: 'Linux电脑',
icon: 'images/linux.svg',
},
];
async function getVPN() {
const response = await fetch('/vpn-data');
const vpn = await response.json();
return vpn;
}
async function getE2E() {
const response = await fetch('/ee-data');
const e2e = await response.json();
return e2e;
}
function classNames(...classes) {
return classes.filter(Boolean).join(' ');
}
function addLiElement(activeVPN, vpnGroup) {
activeVPN.map((item) => {
const vpnLiElement = document.createElement('li');
vpnLiElement.className =
'col-span-1 flex flex-col divide-y divide-gray-200 rounded-lg bg-white text-center shadow';
vpnLiElement.innerHTML = `<div class="flex flex-1 flex-col p-8">
<img
class="mx-auto h-32 w-32 flex-shrink-0 rounded-full"
src="${item.image}"
alt=""
/>
<h3 class="mt-6 text-sm font-medium text-gray-900">${item.name}</h3>
<dl class="mt-1 flex flex-grow flex-col justify-between">
<dd class="text-sm text-gray-500">${item.comment}</dd>
<dd class='mt-3'>
<a
href='${item.web}'
class='inline-flex items-center rounded-full bg-green-50 px-2 py-1 text-xs font-medium text-green-700 ring-1 ring-inset ring-green-600/20'
>
${item.web ? '官网' : ''}
</a>
</dd>
</dl>
</div>
<div>
<div class="-mt-px flex divide-x divide-gray-200">
<div class="flex w-0 flex-1">
<a
href="${item.link1}"
class="relative -mr-px inline-flex w-0 flex-1 items-center justify-center gap-x-3 rounded-bl-lg border border-transparent py-4 text-sm font-semibold text-gray-900"
>
免墙HTTP下载
</a>
</div>
<div class="-ml-px flex w-0 flex-1">
<a
href="${item.link2}"
class="relative inline-flex w-0 flex-1 items-center justify-center gap-x-3 rounded-br-lg border border-transparent py-4 text-sm font-semibold text-gray-900"
>
Github HTTPS下载
</a>
</div>
</div>
</div>`;
vpnGroup.appendChild(vpnLiElement);
});
}
const radioGroup = document.getElementById('os-group');
const vpnGroup = document.getElementById('vpn-list');
const e2eGroup = document.getElementById('e2e-list');
let vpn;
let e2e;
let activeVPN;
let activeE2E;
try {
e2e = await getE2E();
} catch (err) {
console.log('load e2e json error', err);
}
try {
vpn = await getVPN();
} catch (err) {
console.log('load vpn json error', err);
}
if (vpn) {
activeVPN = vpn
?.filter((item) => item.os == 'android')
?.sort((a, b) => b.star - a.star);
addLiElement(activeVPN, vpnGroup);
}
if (e2e) {
activeE2E = e2e
?.filter((item) => item.os == 'android')
?.sort((a, b) => b.star - a.star);
addLiElement(activeE2E, e2eGroup);
}
osTypes.forEach((option, i) => {
const osGroupElement = document.createElement('div');
osGroupElement.className = classNames(
'cursor-pointer focus:outline-none',
'flex items-center justify-center rounded-md py-3 px-3 text-sm font-semibold uppercase sm:flex-1'
);
osGroupElement.className +=
i == 0
? ' selected bg-indigo-600 text-white hover:bg-indigo-500'
: ' ring-1 ring-inset ring-gray-300 bg-white text-gray-900 hover:bg-gray-50';
osGroupElement.innerHTML = `
<p>
<img src='${option.icon}' />
<span>${option.name}</span>
</p>
`;
osGroupElement.id = option.id;
osGroupElement.onclick = () => {
const selectedOption = radioGroup.querySelector('.selected');
if (selectedOption) {
selectedOption.classList.remove('selected');
selectedOption.classList.remove('bg-indigo-600');
selectedOption.classList.remove('text-white');
selectedOption.classList.remove('hover:bg-indigo-500');
selectedOption.classList.add('bg-white');
selectedOption.classList.add('text-gray-900');
selectedOption.classList.add('hover:bg-gray-50');
selectedOption.classList.add('ring-1');
selectedOption.classList.add('ring-inset');
selectedOption.classList.add('ring-gray-300');
}
const activeVPN = vpn
.filter((item) => item.os == osGroupElement.id)
.sort((a, b) => b.star - a.star);
const activeE2E = e2e
.filter((item) => item.os == osGroupElement.id)
.sort((a, b) => b.star - a.star);
while (vpnGroup.firstChild) {
vpnGroup.removeChild(vpnGroup.firstChild);
}
while (e2eGroup.firstChild) {
e2eGroup.removeChild(e2eGroup.firstChild);
}
addLiElement(activeVPN, vpnGroup);
addLiElement(activeE2E, e2eGroup);
osGroupElement.classList.add('selected');
osGroupElement.classList.add('bg-indigo-600');
osGroupElement.classList.add('text-white');
osGroupElement.classList.add('hover:bg-indigo-500');
osGroupElement.classList.remove('bg-white');
osGroupElement.classList.remove('text-gray-900');
osGroupElement.classList.remove('hover:bg-gray-50');
};
radioGroup.appendChild(osGroupElement);
});
</script>
</body>
</html>