forked from Shpigford/mutetheweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.html
360 lines (327 loc) · 11.1 KB
/
popup.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
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
<!DOCTYPE html>
<html>
<head>
<title>Mute X.com</title>
<style>
:root {
--primary-color: #111;
--primary-hover: #444;
--bg-color: #ffffff;
--text-color: #1f2937;
--border-color: #e5e7eb;
--success-bg: #dcfce7;
--success-text: #166534;
--error-bg: #fee2e2;
--error-text: #991b1b;
}
body {
width: 320px;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
background: var(--bg-color);
color: var(--text-color);
}
.header {
background: var(--primary-color);
color: white;
padding: 12px 16px;
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 12px;
flex-shrink: 0;
}
.header img {
width: 24px;
height: 24px;
}
.header h1 {
margin: 0;
font-size: 18px;
font-weight: 600;
}
.container {
padding: 0 16px 16px;
display: flex;
flex-direction: column;
gap: 12px;
}
.input-group {
display: flex;
flex-direction: column;
gap: 8px;
}
.input-group label {
font-size: 14px;
font-weight: 500;
color: var(--text-color);
}
input[type="text"] {
padding: 10px 12px;
border: 1px solid var(--border-color);
border-radius: 6px;
font-size: 14px;
font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
transition: all 0.2s;
outline: none;
}
input[type="text"]:focus {
border-color: var(--primary-color);
box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.1);
}
.toggle-group {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px;
background: #f9fafb;
border-radius: 6px;
}
.toggle-group label {
font-size: 14px;
font-weight: 500;
}
/* Modern toggle switch */
.switch {
position: relative;
display: inline-block;
width: 44px;
height: 24px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #cbd5e1;
transition: .3s;
border-radius: 24px;
}
.slider:before {
position: absolute;
content: "";
height: 18px;
width: 18px;
left: 3px;
bottom: 3px;
background-color: white;
transition: .3s;
border-radius: 50%;
}
input:checked + .slider {
background-color: var(--primary-color);
}
input:checked + .slider:before {
transform: translateX(20px);
}
.status {
margin-top: 4px;
padding: 12px;
border-radius: 6px;
font-size: 14px;
display: none;
animation: fadeIn 0.3s ease;
}
.success {
background-color: var(--success-bg);
color: var(--success-text);
}
.error {
background-color: var(--error-bg);
color: var(--error-text);
}
.stats-group {
background: #f9fafb;
border-radius: 6px;
padding: 12px;
display: flex;
flex-direction: column;
gap: 8px;
}
.stats-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.stats-header span {
font-size: 14px;
font-weight: 500;
}
.show-filtered {
background: var(--primary-color);
color: white;
border: none;
padding: 6px 12px;
border-radius: 4px;
font-size: 12px;
cursor: pointer;
transition: background-color 0.2s;
}
.show-filtered:hover {
background: var(--primary-hover);
}
.filtered-count {
font-size: 24px;
font-weight: 600;
color: var(--primary-color);
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(-4px); }
to { opacity: 1; transform: translateY(0); }
}
.filters-section {
display: flex;
flex-direction: column;
gap: 8px;
background: #f3f4f6;
padding: 12px;
border-radius: 6px;
}
.filters-section .toggle-group {
background: white;
margin: 0;
}
.clear-cache {
background: #f3f4f6;
color: #666;
border: 1px solid #ddd;
padding: 4px 8px;
border-radius: 4px;
font-size: 12px;
cursor: pointer;
margin-top: 8px;
transition: all 0.2s;
}
.clear-cache:hover {
background: #e5e7eb;
color: #333;
}
.stats-button {
margin-left: auto;
background: white;
color: var(--primary-color);
border: none;
padding: 6px 12px;
border-radius: 6px;
font-size: 14px;
font-weight: 500;
cursor: pointer;
transition: all 0.2s;
display: flex;
align-items: center;
gap: 6px;
}
.stats-button:hover {
background: rgba(255, 255, 255, 0.9);
transform: translateY(-1px);
}
</style>
</head>
<body>
<div class="header">
<img src="images/icon48.png" alt="MuteTheWeb">
<h1>MuteTheWeb</h1>
<button class="stats-button" id="viewStats">
<svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor">
<path d="M3 3v18h18v-2H5V3H3zm4 10h2v6H7v-6zm4-4h2v10h-2V9zm4-4h2v14h-2V5z" />
</svg>
View Stats
</button>
</div>
<div class="container">
<div class="input-group">
<label for="apiKey">OpenRouter API Key</label>
<input type="text" id="apiKey" placeholder="Enter your API key">
<div style="font-size: 12px; margin-top: 4px; color: #666;">
<a href="https://openrouter.ai/settings/keys" target="_blank" style="color: #666; text-decoration: underline;">Generate an OpenRouter API key here</a>
<p style="margin: 4px 0;">Note: This extension requires OpenRouter credits. Each post analysis costs approximately $0.00002.</p>
</div>
</div>
<div class="toggle-group">
<label for="enabled">Enable Filter</label>
<label class="switch">
<input type="checkbox" id="enabled" checked>
<span class="slider"></span>
</label>
</div>
<div class="filters-section">
<div class="toggle-group">
<label for="filter-cynical">Cynical Posts</label>
<label class="switch">
<input type="checkbox" id="filter-cynical" checked>
<span class="slider"></span>
</label>
</div>
<div class="toggle-group">
<label for="filter-sarcastic">Sarcastic Posts</label>
<label class="switch">
<input type="checkbox" id="filter-sarcastic">
<span class="slider"></span>
</label>
</div>
<div class="toggle-group">
<label for="filter-threatening">Threatening Posts</label>
<label class="switch">
<input type="checkbox" id="filter-threatening">
<span class="slider"></span>
</label>
</div>
<div class="toggle-group">
<label for="filter-politics">Political Posts</label>
<label class="switch">
<input type="checkbox" id="filter-politics">
<span class="slider"></span>
</label>
</div>
<div class="toggle-group">
<label for="filter-racism">Racist Content</label>
<label class="switch">
<input type="checkbox" id="filter-racism">
<span class="slider"></span>
</label>
</div>
<div class="toggle-group">
<label for="blur-mode">Blur Instead of Hide</label>
<label class="switch">
<input type="checkbox" id="blur-mode">
<span class="slider"></span>
</label>
</div>
</div>
<div class="toggle-group">
<label for="debug-mode">Debug Mode</label>
<label class="switch">
<input type="checkbox" id="debug-mode">
<span class="slider"></span>
</label>
</div>
<div class="stats-group">
<div class="stats-header">
<span>Filtered Posts</span>
<button class="show-filtered" id="showFiltered">Show Filtered</button>
</div>
<div class="filtered-count" id="filteredCount">0</div>
<div style="display: flex; gap: 8px; margin-top: 8px;">
<button class="clear-cache" id="clearCache">Clear Cache</button>
</div>
</div>
<div id="status" class="status"></div>
<div style="text-align: center; margin-top: 8px;">
<a href="https://github.com/Shpigford/mutetheweb" target="_blank" style="color: #666; font-size: 12px; text-decoration: none; display: flex; align-items: center; justify-content: center; gap: 4px;">
<svg height="14" width="14" viewBox="0 0 16 16" fill="currentColor">
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/>
</svg>
View on GitHub
</a>
</div>
</div>
<script src="popup.js"></script>
</body>
</html>