-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.html
More file actions
395 lines (338 loc) · 10.1 KB
/
Copy pathpopup.html
File metadata and controls
395 lines (338 loc) · 10.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Substack Filter Settings</title>
<style>
body {
width: 400px;
min-height: 300px;
padding: 16px;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
font-size: 14px;
margin: 0;
position: relative;
}
h1 {
font-size: 18px;
margin: 0 0 16px 0;
padding-right: 60px;
color: #333;
}
.section {
margin-bottom: 20px;
padding-bottom: 16px;
border-bottom: 1px solid #e9ecef;
}
.section:last-child {
border-bottom: none;
}
label {
display: block;
font-weight: 500;
margin-bottom: 8px;
color: #495057;
}
textarea {
width: 100%;
min-height: 80px;
padding: 8px;
border: 1px solid #ced4da;
border-radius: 4px;
font-size: 13px;
font-family: monospace;
resize: vertical;
box-sizing: border-box;
}
input[type="number"] {
width: 80px;
padding: 6px 8px;
border: 1px solid #ced4da;
border-radius: 4px;
font-size: 13px;
}
.checkbox-group {
display: flex;
align-items: center;
gap: 8px;
}
.checkbox-group input[type="checkbox"] {
width: 18px;
height: 18px;
cursor: pointer;
}
button {
padding: 8px 16px;
background: #007bff;
color: white;
border: none;
border-radius: 4px;
cursor: pointer;
font-size: 13px;
font-weight: 500;
transition: background 0.2s;
}
button:hover {
background: #0056b3;
}
.button-group {
display: flex;
gap: 8px;
}
.stats {
background: #f8f9fa;
padding: 12px;
border-radius: 4px;
font-size: 13px;
color: #495057;
}
.stats-row {
display: flex;
justify-content: space-between;
margin-bottom: 4px;
}
.stats-row:last-child {
margin-bottom: 0;
}
.help-text {
font-size: 12px;
color: #6c757d;
margin-top: 4px;
}
.status {
padding: 8px 12px;
margin-top: 12px;
border-radius: 4px;
font-size: 13px;
display: none;
}
.status.success {
background: #d4edda;
color: #155724;
border: 1px solid #c3e6cb;
}
.status.error {
background: #f8d7da;
color: #721c24;
border: 1px solid #f5c6cb;
}
/* Dark mode toggle button */
.dark-mode-toggle {
position: absolute;
top: 16px;
right: 16px;
padding: 6px 12px;
background: #e9ecef;
color: #333;
border: 1px solid #ced4da;
border-radius: 4px;
cursor: pointer;
font-size: 18px;
font-weight: 500;
transition: all 0.2s;
z-index: 1000;
line-height: 1;
}
.dark-mode-toggle:hover {
background: #dee2e6;
}
.dark-mode-toggle:active {
transform: scale(0.95);
}
/* Dark mode styles - applied via class OR media query */
@media (prefers-color-scheme: dark) {
body:not(.light-mode) {
background: #1a1a1a;
color: #e9ecef;
}
body:not(.light-mode) h1 {
color: #f8f9fa;
}
body:not(.light-mode) label {
color: #ced4da;
}
body:not(.light-mode) .section {
border-bottom-color: #333;
}
body:not(.light-mode) textarea,
body:not(.light-mode) input[type="number"],
body:not(.light-mode) select {
background: #2d2d2d;
color: #e9ecef;
border-color: #444;
}
body:not(.light-mode) .stats {
background: #2d2d2d;
color: #e9ecef;
}
body:not(.light-mode) .help-text {
color: #999;
}
body:not(.light-mode) button {
opacity: 0.95;
}
body:not(.light-mode) button:hover {
opacity: 1;
}
body:not(.light-mode) .dark-mode-toggle {
background: #2d2d2d;
color: #e9ecef;
border-color: #444;
}
body:not(.light-mode) .dark-mode-toggle:hover {
background: #3d3d3d;
}
}
/* Manual dark mode override */
body.dark-mode {
background: #1a1a1a;
color: #e9ecef;
}
body.dark-mode h1 {
color: #f8f9fa;
}
body.dark-mode label {
color: #ced4da;
}
body.dark-mode .section {
border-bottom-color: #333;
}
body.dark-mode textarea,
body.dark-mode input[type="number"],
body.dark-mode select {
background: #2d2d2d;
color: #e9ecef;
border-color: #444;
}
body.dark-mode .stats {
background: #2d2d2d;
color: #e9ecef;
}
body.dark-mode .help-text {
color: #999;
}
body.dark-mode button {
opacity: 0.95;
}
body.dark-mode button:hover {
opacity: 1;
}
body.dark-mode .dark-mode-toggle {
background: #2d2d2d;
color: #e9ecef;
border-color: #444;
}
body.dark-mode .dark-mode-toggle:hover {
background: #3d3d3d;
}
</style>
</head>
<body>
<button class="dark-mode-toggle" id="darkModeToggle" title="Toggle dark mode">🌙</button>
<h1>🔍 Substack Notification Filter</h1>
<div class="section">
<div class="checkbox-group">
<input type="checkbox" id="enabled" checked>
<label for="enabled" style="margin: 0;">Enable filtering</label>
</div>
</div>
<div class="section">
<label for="filterLevel">Filter Level Preset</label>
<select id="filterLevel" style="width: 100%; padding: 6px 8px; border: 1px solid #ced4da; border-radius: 4px; font-size: 13px;">
<option value="custom">Custom</option>
<option value="mild">Mild (keywords only)</option>
<option value="moderate">Moderate (keywords + min 5 likes)</option>
<option value="strict">Strict (keywords + min 10 likes + followed only)</option>
</select>
<div class="help-text">Quick presets for common filtering levels</div>
</div>
<div class="section">
<label for="keywords">Blocked Keywords/Slurs</label>
<div class="checkbox-group" style="margin-bottom: 8px;">
<input type="checkbox" id="useCommonSlurs">
<label for="useCommonSlurs" style="margin: 0;">Use common slur blocklist</label>
</div>
<textarea id="keywords" placeholder="Enter one keyword per line example badword slur"></textarea>
<div class="help-text">One keyword per line. Case-insensitive matching. Blocklist is added automatically when enabled above.</div>
</div>
<div class="section">
<label for="minLikes">Minimum Likes Threshold</label>
<input type="number" id="minLikes" min="0" value="0">
<div class="help-text">Filter notifications with fewer likes than this (0 = disabled)</div>
</div>
<div class="section">
<label>Filter by Notification Type</label>
<div class="checkbox-group" style="margin-bottom: 4px;">
<input type="checkbox" id="filterReplies">
<label for="filterReplies" style="margin: 0;">Filter Replies</label>
</div>
<div class="checkbox-group" style="margin-bottom: 4px;">
<input type="checkbox" id="filterLikes">
<label for="filterLikes" style="margin: 0;">Filter Likes</label>
</div>
<div class="checkbox-group" style="margin-bottom: 4px;">
<input type="checkbox" id="filterRestacks">
<label for="filterRestacks" style="margin: 0;">Filter Restacks</label>
</div>
<div class="help-text">Hide specific types of notifications</div>
</div>
<div class="section">
<div class="checkbox-group">
<input type="checkbox" id="requireFollowed">
<label for="requireFollowed" style="margin: 0;">Only show from people I follow</label>
</div>
<div class="help-text">Manually manage your followed users list below</div>
</div>
<div class="section">
<label for="followedUsers">Followed Users</label>
<textarea id="followedUsers" placeholder="Enter one username per line username1 username2 username3"></textarea>
<div class="help-text">Usernames from notifications (without @ symbol). One per line.</div>
</div>
<div class="section">
<label for="whitelistedUsers">Whitelisted Users (Never Filter)</label>
<textarea id="whitelistedUsers" placeholder="Enter one username per line username1 username2"></textarea>
<div class="help-text">These users will NEVER be filtered, even if they match other criteria.</div>
</div>
<div class="section">
<label>Statistics</label>
<div class="stats">
<div class="stats-row">
<span>Total notifications:</span>
<strong id="stat-total">0</strong>
</div>
<div class="stats-row">
<span>Filtered:</span>
<strong id="stat-filtered" style="color: #dc3545;">0</strong>
</div>
<div class="stats-row">
<span>Visible:</span>
<strong id="stat-visible" style="color: #28a745;">0</strong>
</div>
</div>
</div>
<div class="button-group">
<button id="save">Save Settings</button>
<button id="quickDisable" style="background: #ffc107; color: #000;">Quick Disable (1 hour)</button>
</div>
<div class="button-group" style="margin-top: 8px;">
<button id="export" style="background: #28a745;">Export</button>
<button id="import" style="background: #17a2b8;">Import</button>
<button id="reset" style="background: #6c757d;">Reset</button>
<input type="file" id="importFile" accept=".json" style="display: none;">
</div>
<div id="status" class="status"></div>
<div class="section" style="text-align: center; border-top: 2px solid #e9ecef; padding-top: 16px;">
<p style="font-size: 12px; color: #6c757d; margin-bottom: 8px;">
Enjoy using Substack Filter? ❤️
</p>
<a href="https://patreon.com/mythraps" target="_blank" style="display: inline-block; padding: 8px 16px; background: #FF424D; color: #fff; text-decoration: none; border-radius: 4px; font-size: 13px; font-weight: 500; transition: background 0.2s;">
Support on Patreon
</a>
<p style="font-size: 11px; color: #999; margin-top: 8px;">
100% optional • Supports development
</p>
</div>
<script src="popup.js"></script>
</body>
</html>