-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpopup.html
More file actions
435 lines (374 loc) · 10.2 KB
/
popup.html
File metadata and controls
435 lines (374 loc) · 10.2 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
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>日本の色</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
width: 380px;
font-family: 'Segoe UI', 'Noto Sans JP', system-ui, sans-serif;
background: linear-gradient(145deg, #0f0c29, #302b63, #24243e);
color: #e0e0e0;
overflow: scroll;
}
/* ── Header ───────────────────────────────────── */
.header {
background: rgba(255, 255, 255, 0.04);
backdrop-filter: blur(12px);
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
padding: 18px 20px 14px;
text-align: center;
}
.header h1 {
font-size: 20px;
font-weight: 700;
background: linear-gradient(135deg, #f39c12, #e74c3c, #9b59b6);
background-clip: text;
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
letter-spacing: 1px;
}
.header p {
font-size: 11px;
color: #8e8ea0;
margin-top: 4px;
letter-spacing: 0.3px;
}
.badge {
display: inline-block;
margin-top: 6px;
padding: 2px 8px;
font-size: 9px;
font-weight: 600;
letter-spacing: 0.8px;
text-transform: uppercase;
background: linear-gradient(135deg, #2ecc71, #27ae60);
color: #fff;
border-radius: 20px;
}
/* ── Content ──────────────────────────────────── */
.content {
padding: 16px 20px;
}
/* ── Status ───────────────────────────────────── */
.status-row {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
margin-bottom: 14px;
padding: 10px 14px;
background: rgba(255, 255, 255, 0.04);
border-radius: 10px;
border: 1px solid rgba(255, 255, 255, 0.06);
}
.status-dot {
width: 10px;
height: 10px;
border-radius: 50%;
background: #555;
transition: background 0.4s ease, box-shadow 0.4s ease;
}
.status-dot.active {
background: #2ecc71;
box-shadow: 0 0 8px rgba(46, 204, 113, 0.6);
}
.status-dot.loading {
background: #f39c12;
box-shadow: 0 0 8px rgba(243, 156, 18, 0.5);
animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0.4;
}
}
.status-text {
font-size: 13px;
font-weight: 500;
color: #aaa;
transition: color 0.3s;
}
.status-text.active {
color: #2ecc71;
}
.status-text.loading {
color: #f39c12;
}
/* ── Toggle Button ────────────────────────────── */
#toggleBtn {
display: block;
width: 100%;
padding: 13px 0;
font-size: 14px;
font-weight: 600;
letter-spacing: 0.5px;
border: none;
border-radius: 12px;
cursor: pointer;
transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
background: linear-gradient(135deg, #e74c3c, #c0392b);
color: #fff;
box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
position: relative;
overflow: hidden;
}
#toggleBtn::after {
content: '';
position: absolute;
inset: 0;
background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), transparent);
opacity: 0;
transition: opacity 0.3s;
}
#toggleBtn:hover::after {
opacity: 1;
}
#toggleBtn:active {
transform: scale(0.97);
}
#toggleBtn.active {
background: linear-gradient(135deg, #2ecc71, #27ae60);
box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
}
#toggleBtn:disabled {
opacity: 0.5;
cursor: wait;
}
/* ── Language Selector ─────────────────────────── */
.section-title {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 1.2px;
color: #666;
margin-bottom: 8px;
margin-top: 16px;
font-weight: 600;
}
.lang-selector {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-bottom: 4px;
}
.lang-chip {
display: flex;
align-items: center;
gap: 5px;
padding: 6px 12px;
border-radius: 20px;
font-size: 12px;
font-weight: 500;
cursor: pointer;
border: 1px solid rgba(255, 255, 255, 0.1);
background: rgba(255, 255, 255, 0.04);
color: #999;
transition: all 0.25s ease;
user-select: none;
}
.lang-chip:hover {
background: rgba(255, 255, 255, 0.08);
color: #ccc;
border-color: rgba(255, 255, 255, 0.2);
}
.lang-chip.selected {
background: linear-gradient(135deg, rgba(231, 76, 60, 0.2), rgba(155, 89, 182, 0.2));
color: #fff;
border-color: rgba(231, 76, 60, 0.5);
box-shadow: 0 2px 8px rgba(231, 76, 60, 0.15);
}
.lang-chip .lang-icon {
font-size: 14px;
}
.lang-chip .lang-name {
font-size: 11.5px;
}
/* ── Locale Selector ───────────────────────────── */
.locale-row {
display: flex;
align-items: center;
gap: 8px;
margin-top: 10px;
margin-bottom: 4px;
}
.locale-row label {
font-size: 11px;
color: #777;
font-weight: 500;
letter-spacing: 0.5px;
}
#localeSelect {
flex: 1;
background: rgba(255, 255, 255, 0.06);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 8px;
padding: 5px 10px;
font-size: 12px;
color: #ccc;
cursor: pointer;
outline: none;
font-family: inherit;
}
#localeSelect:focus {
border-color: rgba(231, 76, 60, 0.5);
}
#localeSelect option {
background: #1a1a2e;
color: #ccc;
}
/* ── Legend ────────────────────────────────────── */
.legend {
margin-top: 14px;
padding: 12px 14px;
background: rgba(255, 255, 255, 0.03);
border-radius: 10px;
border: 1px solid rgba(255, 255, 255, 0.06);
}
.legend-title {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 1.2px;
color: #666;
margin-bottom: 10px;
font-weight: 600;
}
.legend-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 6px 12px;
}
.legend-item {
display: flex;
align-items: center;
gap: 6px;
font-size: 11.5px;
color: #bbb;
}
.legend-swatch {
width: 10px;
height: 10px;
border-radius: 3px;
flex-shrink: 0;
}
.legend-empty {
color: #555;
font-size: 11px;
font-style: italic;
text-align: center;
padding: 8px 0;
}
.legend-controls {
display: flex;
align-items: center;
gap: 6px;
margin-right: 4px;
}
.legend-toggle {
width: 14px;
height: 14px;
cursor: pointer;
accent-color: #e74c3c;
}
.legend-color-picker {
width: 16px;
height: 16px;
padding: 0;
border: none;
cursor: pointer;
background: none;
border-radius: 4px;
}
.legend-color-picker::-webkit-color-swatch-wrapper {
padding: 0;
}
.legend-color-picker::-webkit-color-swatch {
border: 1px solid rgba(255, 255, 255, 0.2);
border-radius: 4px;
}
/* ── Tab bar for multiple legends ──────────────── */
.legend-tabs {
display: flex;
gap: 4px;
margin-bottom: 10px;
}
.legend-tab {
padding: 4px 10px;
font-size: 11px;
font-weight: 500;
border: 1px solid rgba(255, 255, 255, 0.08);
background: rgba(255, 255, 255, 0.03);
border-radius: 6px;
cursor: pointer;
color: #777;
transition: all 0.2s;
}
.legend-tab:hover {
background: rgba(255, 255, 255, 0.06);
color: #aaa;
}
.legend-tab.active {
background: rgba(231, 76, 60, 0.15);
border-color: rgba(231, 76, 60, 0.3);
color: #e74c3c;
}
/* ── Footer ───────────────────────────────────── */
.footer {
text-align: center;
padding: 10px 20px 14px;
font-size: 10px;
color: #555;
border-top: 1px solid rgba(255, 255, 255, 0.04);
}
</style>
</head>
<body>
<div class="header">
<h1>日本語カラー</h1>
<p>Multi-Language Grammar Highlighter</p>
<span class="badge">LangDB · Multi-Engine NLP</span>
</div>
<div class="content">
<div class="status-row">
<div class="status-dot" id="statusDot"></div>
<span class="status-text" id="statusText">Disabled</span>
</div>
<button id="toggleBtn">⚡ Enable Page Colors</button>
<!-- Language chips -->
<div class="section-title">Languages</div>
<div class="lang-selector" id="langSelector">
<!-- Preenchido dinamicamente -->
</div>
<!-- Locale -->
<div class="locale-row">
<label for="localeSelect">🌐 Tooltip Language:</label>
<select id="localeSelect">
<option value="en-US">English (US)</option>
<option value="pt-BR">Português (BR)</option>
<option value="ja">日本語</option>
<option value="ko">한국어</option>
<option value="zh">中文</option>
</select>
</div>
<!-- Dynamic legend -->
<div class="legend" id="legendSection">
<div class="legend-title">Color Legend</div>
<div class="legend-tabs" id="legendTabs"></div>
<div class="legend-grid" id="legendGrid">
<div class="legend-empty">Select a language</div>
</div>
</div>
</div>
<div class="footer">v4.0 · LangDB + Kuromoji NLP · Made with 💜</div>
<script src="popup.js"></script>
</body>
</html>