-
Notifications
You must be signed in to change notification settings - Fork 219
/
index.html
277 lines (253 loc) · 8.77 KB
/
index.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
<html>
<head>
<link rel="icon" href="https://avatars.githubusercontent.com/u/88201352" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="description" content="List for blocking ads in the Chinese region">
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, user-scalable=no"
/>
<title>AdRules</title>
<script
src="https://cdnjs.cloudflare.com/ajax/libs/remarkable/2.0.1/remarkable.min.js"
integrity="sha512-skYYbQHAuOTpeJTthhUH3flZohep8blA+qjZOY0VqmfXMDiYcWxu29F5UbxU4LxaIpGkRBk+3Qf8qaXfd9jngg=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
></script>
<style>
select ~ article[id] {
display: block;
opacity: 0;
transition: opacity 0.45s ease-in-out;
}
select ~ article[id].show {
opacity: 1;
}
select ~ article[id].hide {
display: none;
}
</style>
<meta name="viewport" content="width=device-width; initial-scale=1.0; minimum-scale=1.0; maximum-scale=1.0">
<style>
.container {
width: 80%;
margin: 10% auto 0;
background-color: rgba(255,255,255,0.7);
padding: 2% 5%;
border-radius: 10px
}
ul {
padding-left: 20px;
}
ul li {
line-height: 2.3
}
a {
color: #20a53a
}
select {
font-size: 16px;
} .styled-select {
border: 1px solid #ccc;
border-radius: 4px;
padding: 6px 10px;
font-size: 16px;
color: #333;
}
.copy-button {
margin-top: 10px;
cursor: pointer;
padding: 10px;
border-radius: 5px;
background-color: #4CAF50; /* Green */
border: none;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
}
.add-button {
margin-top: 10px;
cursor: pointer;
padding: 10px;
border-radius: 5px;
background-color: #4CAF50; /* Green */
border: none;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
}
</style>
</head>
<body>
<div class="container" align="center">
<header>
<article><pre>
## **AdRules**
### *List for blocking ads in the Chinese region*
</pre></article>
<img src="https://img.shields.io/github/stars/Cats-Team/AdRules?style=flat-square&color=yellow">
<img alt="GitHub last commit" src="https://img.shields.io/github/last-commit/cats-team/adrules/main?style=flat-square&color=red">
<img src="https://img.shields.io/github/license/Cats-Team/AdRules?style=flat-square"><br>
<br>
</header>
<main>
<select class="styled-select">
<option value="empty" hidden selected>Choose Your Tool:</option>
<optgroup label="Browser & App">
<option value="adge">Browser Extension</option>
<option value="adgai">AdGuard for Android/iOS</option>
<option value="adgwm">AdGuard for Windows/Mac</option>
</optgroup>
<optgroup label="DNS & Proxy">
<option value="adgh">AdGuard Home</option>
<option value="sd">SmartDNS</option>
<option value="qx">Quantumult X</option>
<option value="cla">Clash</option>
<option value="mosdns">mosdns</option>
<option value="loon">Loon</option>
<option value="surge">Surge</option>
<option value="singbox">Singbox</option>
</optgroup>
</select>
<article id="adgai" class="hide"><pre>
### AdGuard for Android / iOS
<a href="./adblock.txt">AdRules AdBlock List</a><br>
<button class="copy-button">Copy Link</button>
<button class="add-button">Add Your Tool</button>
</pre></article>
<article id="adgwm" class="hide"><pre>
### AdGuard for Windows / Mac
<a href="./adblock_plus.txt">AdRules AdBlock List Plus </a><br>
<button class="copy-button">Copy Link</button>
<button class="add-button">Add Your Tool</button>
</pre></article>
<article id="adge" class="hide"><pre>
### AdGuard Browser extension / uBlock Origin
<a href="./adblock.txt">AdRules AdBlock List</a><br>
<button class="copy-button">Copy Link</button>
<button class="add-button">Add Your Tool</button>
</pre></article>
<article id="adgh" class="hide"><pre>
### AdGuard Home
<a href="./dns.txt">AdRules DNS List </a>
<button class="copy-button">Copy Link</button>
</pre></article>
<article id="sd" class="hide"><pre>
### SmartDNS
<a href="./smart-dns.conf">AdRules SmartDNS List </a>
<button class="copy-button">Copy Link</button>
</pre></article>
<article id="qx" class="hide"><pre>
### Quantumult X
<a href="./qx.conf">AdRules Quantumult X List </a>
<button class="copy-button">Copy Link</button>
</pre></article>
<article id="cla" class="hide"><pre>
### Clash / Mihomo
<a href="./adrules_domainset.txt">AdRules Clash Domainset List </a>
<button class="copy-button">Copy Link</button>
</pre></article>
<article id="mosdns" class="hide"><pre>
### mosdns
<a href="./mosdns_adrules.txt">AdRules MosDNS List </a>
<button class="copy-button">Copy Link</button>
</pre></article>
<article id="loon" class="hide"><pre>
### Loon
<a href="./adrules.list">AdRules Ruleset List </a>
<button class="copy-button">Copy Link</button>
</pre></article>
<article id="surge" class="hide"><pre>
### Surge
<a href="./adrules-surge.conf">AdRules Surge List </a>
<button class="copy-button">Copy Link</button>
</pre></article>
<article id="singbox" class="hide"><pre>
### Singbox
<a href="./adrules-singbox.srs">AdRules Singbox List </a>
<button class="copy-button">Copy Link</button>
</pre></article>
</main>
<footer>
<article><pre>
( ̄︶ ̄)↗
❔Have any questions? Please go to [Chat](https://github.com/Cats-Team/AdRules#chat)
📃Want to see the upstream rules? [Source](https://github.com/Cats-Team/AdRules/blob/script/Source.md)
🌟Get more or give a star? [GitHub Homepage](https://github.com/Cats-Team/AdRules)</pre></article>
</footer>
<script>
const md = new remarkable.Remarkable({
html: true,
});
document.querySelectorAll("article").forEach((art) => {
art.innerHTML = md.render(art.querySelector("pre").innerHTML);
});
document.querySelector("select").addEventListener("change", (e) => {
document.querySelectorAll("select ~ article[id].show").forEach((art) => {
art.classList.remove("show");
});
setTimeout(() => {
if (e.target.value !== "empty") {
document.querySelectorAll("select ~ article[id]").forEach((art) => {
if (art.id===e.target.value) {
art.classList.remove("hide");
} else {
art.classList.add("hide");
}
});
} else {
document.querySelectorAll("select ~ article[id]").forEach((art) => {
art.classList.add("hide");
});
}
}, 500);
setTimeout(() => {
document.querySelectorAll("select ~ article[id]").forEach((art) => {
if (art.id===e.target.value) {
art.classList.add("show")
}
});
}, 900);
});
</script>
<script>
const copyButtons = document.querySelectorAll(".copy-button");
copyButtons.forEach(button => {
button.addEventListener('click', () => {
let href = button.parentElement.querySelector('a').getAttribute('href');
href = href.replace('./', '/');
navigator.clipboard.writeText(window.location.origin + href).then(() => {
button.innerText = "Copied";
}).catch(err => {
console.error('Could not copy text: ', err);
});
});
});
const addButtons = document.querySelectorAll(".add-button");
addButtons.forEach((button) => {
button.addEventListener("click", () => {
let href = button.parentElement
.querySelector("a")
.getAttribute("href");
href = href.replace("./", "/");
const fullUrl =
"abp:subscribe?location=" +
encodeURIComponent(window.location.origin + href);
const hideA = document.createElement("a");
hideA.style.cssText = "position:absolute;top:-100%";
hideA.href = fullUrl;
document.body.appendChild(hideA);
hideA.click();
hideA.remove();
});
});
document.querySelector("select").value = "empty";
</script>
</body>
<br>
</html>