-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.html
More file actions
394 lines (348 loc) · 9.27 KB
/
options.html
File metadata and controls
394 lines (348 loc) · 9.27 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>ForceUserMyFont</title>
<style>
body {
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
margin: 0;
padding: 0;
background-color: #f5f5f5;
color: #333;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.page-container {
display: flex;
flex-direction: column;
align-items: center;
padding: 15px;
width: 100%;
max-width: 800px;
margin: 0 auto;
}
.card {
width: 100%;
max-width: 800px;
padding: 20px;
margin-bottom: 15px;
background-color: white;
border-radius: 8px;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
.container {
display: flex;
flex-direction: column;
gap: 12px;
}
h1, h2 {
color: #333;
margin-top: 0;
font-weight: 500;
}
h1 {
font-size: 20px;
margin-bottom: 5px;
}
h2 {
font-size: 20px;
}
p {
color: #666;
line-height: 1.5;
margin-bottom: 8px;
}
.domain-list {
display: flex;
flex-direction: column;
gap: 12px;
max-height: 200px;
overflow-y: auto;
width: 100%;
}
.domain-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 12px;
background-color: #f9f9f9;
border-radius: 4px;
transition: background-color 0.2s;
}
.domain-item:hover {
background-color: #f0f0f0;
}
.input-container {
display: flex;
gap: 40px;
width: 100%;
}
.input-container input {
flex: 1;
min-width: 0;
}
.input-container button {
flex-shrink: 0;
white-space: nowrap;
}
.input-container input, .input-container select {
padding: 8px 12px;
border-radius: 4px;
border: 1px solid #ddd;
outline: none;
transition: border-color 0.2s;
font-size: 13px;
}
.input-container input:focus, .input-container select:focus {
border-color: #4d90fe;
box-shadow: 0 0 0 2px rgba(77, 144, 254, 0.2);
}
button {
cursor: pointer;
padding: 8px 12px;
background-color: #4285f4;
color: white;
border: none;
border-radius: 4px;
font-weight: 500;
transition: background-color 0.2s;
font-size: 13px;
}
button:hover {
background-color: #3367d6;
}
.remove-domain {
background-color: #f5f5f5;
color: #666;
padding: 6px 12px;
font-size: 12px;
}
.remove-domain:hover {
background-color: #e74c3c;
color: white;
}
.empty-list {
color: #888;
font-style: italic;
text-align: center;
padding: 15px;
border: 1px dashed #ddd;
border-radius: 4px;
}
.alert {
background-color: #fff3cd;
color: #856404;
padding: 8px 12px;
border-radius: 4px;
margin-top: 8px;
font-size: 13px;
border-left: 4px solid #ffc107;
}
.font-tags {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-bottom: 10px;
width: 100%;
}
.font-tag {
display: inline-flex;
align-items: center;
background-color: #e1f5fe;
border-radius: 16px;
padding: 4px 10px;
font-size: 13px;
cursor: pointer;
transition: all 0.2s;
border: 1px solid #b3e5fc;
color: #0288d1;
position: relative;
}
.font-tag:hover {
background-color: #b3e5fc;
}
.font-tag.active {
background-color: #4fc3f7;
color: white;
}
.font-tag-remove {
margin-left: 6px;
width: 16px;
height: 16px;
border-radius: 50%;
background-color: rgba(0, 0, 0, 0.1);
color: #0288d1;
display: flex;
align-items: center;
justify-content: center;
font-size: 12px;
cursor: pointer;
transition: all 0.2s;
}
.font-tag-remove:hover {
background-color: rgba(0, 0, 0, 0.2);
} .font-input-wrapper {
position: relative;
flex-grow: 1;
}
.font-input-wrapper input {
width: 100%;
padding: 10px 12px;
border-radius: 4px;
border: 2px solid #4285f4; /* Default blue highlight border */
outline: none;
transition: all 0.2s;
font-size: 14px;
box-shadow: 0 0 5px rgba(66, 133, 244, 0.2); /* Subtle glow */
}
.font-input-wrapper input:focus {
border-color: #3367d6;
box-shadow: 0 0 8px rgba(66, 133, 244, 0.4); /* Enhanced glow on focus */
}
/* Style for the placeholder text */
.font-input-wrapper input::placeholder {
font-weight: bold;
color: #4285f4; /* Blue color for visibility */
opacity: 0.8;
}
/* Add this CSS to fix the drag-and-drop text overlap issue */
.font-input-wrapper.drag-active input::placeholder {
/* Hide placeholder when dragging */
opacity: 0;
visibility: hidden;
}
.drag-hint {
display: none;
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: rgba(52, 168, 83, 0.1);
border: 2px dashed #34a853;
border-radius: 4px;
align-items: center;
justify-content: center;
font-size: 14px;
font-weight: bold;
color: #34a853;
pointer-events: none;
z-index: 10; /* Ensure it's above the input */
}
.font-input-wrapper.drag-active .drag-hint {
display: flex;
}.reset-button {
background-color: #f44336;
} .card:nth-child(2) {
border-left: 4px solid #4285f4;
}
.reset-button:hover {
background-color: #d32f2f;
}.language-selection {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin: 8px 0;
width: 100%;
}
.lang-btn {
padding: 6px 10px;
border-radius: 4px;
background-color: #f1f3f4;
color: #333;
border: 1px solid #ddd;
cursor: pointer;
transition: all 0.2s;
}
.lang-btn:hover {
background-color: #e8eaed;
}
.lang-btn.active {
background-color: #4285f4;
color: white;
border-color: #3367d6;
}
</style>
</head>
<body>
<div class="page-container">
<!-- Replace static text with i18n IDs -->
<div class="card">
<div class="container">
<h1 id="i18n_reset_title">恢复默认</h1>
<div style="display: flex; justify-content: space-between; align-items: center;">
<p id="i18n_reset_description">将所有网站恢复为使用系统默认字体</p>
<button id="resetToSystemFont" class="reset-button">恢复到系统字体</button>
</div>
<div class="alert" id="i18n_reset_alert">
注意:恢复后,需要手动刷新已打开的网页才能生效。
</div>
</div>
</div>
<!-- Font Selection Card -->
<div class="card">
<div class="container">
<h1 id="i18n_font_title">字体指定(已安装到系统的字体)</h1>
<p id="i18n_font_description">输入您想要强制使用的字体名称</p>
<!-- Font tags container -->
<div class="font-tags" id="fontTags">
<!-- Font tags will be added here dynamically -->
</div>
<div class="input-container">
<div class="font-input-wrapper">
<input type="text" id="customFontInput" placeholder="输入您喜欢的字体名称 或 拖放字体文件至此...">
<div class="drag-hint">释放鼠标加载此字体</div>
</div>
<button id="addCustomFont">使用此字体</button>
</div>
<div class="alert" id="i18n_font_alert">
注意:更改字体后,需要手动刷新已打开的网页才能生效。
</div>
</div>
</div>
<!-- Whitelist Card -->
<div class="card">
<div class="container">
<h1 id="i18n_whitelist_title">白名单(保持原始字体)</h1>
<p id="i18n_whitelist_description">复制网站地址栏地址到下面,会自动识别进行添加</p>
<div class="input-container">
<input type="text" id="domainInput" placeholder="粘贴/输入 域名或网址...">
<button id="addDomain">添加域名</button>
</div>
<div class="domain-list" id="domainList">
<!-- Domains will be populated here -->
</div>
</div>
</div>
<!-- Language Selection Card -->
<div class="card">
<div class="container">
<h1 id="i18n_language_title">语言设置</h1>
<p id="i18n_language_description">选择您偏好的界面语言</p>
<div class="language-selection">
<button class="lang-btn" data-lang="zh">中文</button>
<button class="lang-btn" data-lang="zh-HK">繁體中文</button>
<button class="lang-btn" data-lang="en">English</button>
<button class="lang-btn" data-lang="ja">日本語</button>
<button class="lang-btn" data-lang="ko">한국어</button>
<button class="lang-btn" data-lang="vi">Tiếng Việt</button>
<button class="lang-btn" data-lang="de">Deutsch</button>
<button class="lang-btn" data-lang="fr">Français</button>
<button class="lang-btn" data-lang="ru">Русский</button>
<button class="lang-btn" data-lang="th">ไทย</button>
<button class="lang-btn" data-lang="es">Español</button>
<button class="lang-btn" data-lang="it">Italiano</button>
</div>
</div>
</div>
<script src="options.js"></script>
</body>
</html>