@supernal/tts-widget 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +502 -0
- package/README.md +340 -0
- package/dist/loader.d.ts +78 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +96 -0
- package/dist/loader.js.map +7 -0
- package/dist/react/TTSInitializer.d.ts +64 -0
- package/dist/react/TTSInitializer.d.ts.map +1 -0
- package/dist/react/TTSInitializer.js +132 -0
- package/dist/react/TTSInitializer.js.map +1 -0
- package/dist/react/index.d.ts +8 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +17 -0
- package/dist/react/index.js.map +1 -0
- package/dist/widget.css +839 -0
- package/dist/widget.d.ts +176 -0
- package/dist/widget.d.ts.map +1 -0
- package/dist/widget.js +96 -0
- package/dist/widget.js.map +7 -0
- package/package.json +84 -0
- package/src/react/TTSInitializer.tsx +163 -0
- package/src/react/index.ts +11 -0
package/dist/widget.css
ADDED
|
@@ -0,0 +1,839 @@
|
|
|
1
|
+
/* Supernal TTS Widget Styles */
|
|
2
|
+
.supernal-tts-widget {
|
|
3
|
+
position: relative;
|
|
4
|
+
display: inline-block;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/* Button Container - groups button and branding */
|
|
8
|
+
.supernal-tts-button-container {
|
|
9
|
+
display: inline-flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
gap: 6px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.supernal-tts-play {
|
|
15
|
+
display: inline-flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
gap: 6px;
|
|
18
|
+
padding: 10px 16px;
|
|
19
|
+
background: rgba(14, 165, 233, 0.7); /* Light blue with transparency */
|
|
20
|
+
color: white;
|
|
21
|
+
border: none;
|
|
22
|
+
border-radius: 24px; /* More circular/pill shape */
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
transition: all 0.2s ease;
|
|
27
|
+
margin: 4px 0;
|
|
28
|
+
position: relative;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/* Icon states - hide loading icon by default */
|
|
32
|
+
.supernal-tts-play-icon {
|
|
33
|
+
display: block;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.supernal-tts-loading-icon {
|
|
37
|
+
display: none;
|
|
38
|
+
position: absolute;
|
|
39
|
+
left: 50%;
|
|
40
|
+
top: 50%;
|
|
41
|
+
transform: translate(-50%, -50%);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Show loading spinner when loading */
|
|
45
|
+
.supernal-tts-play.supernal-tts-loading .supernal-tts-play-icon {
|
|
46
|
+
display: none;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.supernal-tts-play.supernal-tts-loading .supernal-tts-loading-icon {
|
|
50
|
+
display: block;
|
|
51
|
+
animation: spin 1s linear infinite;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/* Spinner animation */
|
|
55
|
+
@keyframes spin {
|
|
56
|
+
from {
|
|
57
|
+
transform: translate(-50%, -50%) rotate(0deg);
|
|
58
|
+
}
|
|
59
|
+
to {
|
|
60
|
+
transform: translate(-50%, -50%) rotate(360deg);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/* Compact play button (icon only) */
|
|
65
|
+
.supernal-tts-play-compact {
|
|
66
|
+
width: 40px;
|
|
67
|
+
height: 40px;
|
|
68
|
+
padding: 0;
|
|
69
|
+
border-radius: 50%;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
justify-content: center;
|
|
73
|
+
flex-shrink: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.supernal-tts-play-compact .supernal-tts-icon {
|
|
77
|
+
margin: 0;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.supernal-tts-play:hover:not(:disabled) {
|
|
81
|
+
background: rgba(14, 165, 233, 1); /* Full opacity on hover */
|
|
82
|
+
transform: translateY(-1px);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.supernal-tts-play:active {
|
|
86
|
+
transform: translateY(0);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.supernal-tts-play:disabled {
|
|
90
|
+
opacity: 0.7;
|
|
91
|
+
cursor: not-allowed;
|
|
92
|
+
transform: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.supernal-tts-play.supernal-tts-loading {
|
|
96
|
+
background: #f59e0b;
|
|
97
|
+
cursor: wait;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.supernal-tts-play.supernal-tts-playing {
|
|
101
|
+
background: #f97316; /* Orange from logo */
|
|
102
|
+
animation: pulse 1.5s ease-in-out infinite;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.supernal-tts-play.supernal-tts-error {
|
|
106
|
+
background: #ef4444;
|
|
107
|
+
cursor: default;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.supernal-tts-play svg {
|
|
111
|
+
flex-shrink: 0;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.supernal-tts-text {
|
|
115
|
+
white-space: nowrap;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.supernal-tts-error-tooltip {
|
|
119
|
+
position: absolute;
|
|
120
|
+
top: 100%;
|
|
121
|
+
left: 50%;
|
|
122
|
+
transform: translateX(-50%);
|
|
123
|
+
background: #1f2937;
|
|
124
|
+
color: white;
|
|
125
|
+
padding: 8px 12px;
|
|
126
|
+
border-radius: 4px;
|
|
127
|
+
font-size: 12px;
|
|
128
|
+
white-space: nowrap;
|
|
129
|
+
z-index: 1000;
|
|
130
|
+
margin-top: 4px;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.supernal-tts-error-tooltip::before {
|
|
134
|
+
content: '';
|
|
135
|
+
position: absolute;
|
|
136
|
+
top: -4px;
|
|
137
|
+
left: 50%;
|
|
138
|
+
transform: translateX(-50%);
|
|
139
|
+
border-left: 4px solid transparent;
|
|
140
|
+
border-right: 4px solid transparent;
|
|
141
|
+
border-bottom: 4px solid #1f2937;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Branding Badge - Compact logo */
|
|
145
|
+
.supernal-badge {
|
|
146
|
+
display: inline-flex;
|
|
147
|
+
align-items: center;
|
|
148
|
+
justify-content: center;
|
|
149
|
+
width: 24px;
|
|
150
|
+
height: 24px;
|
|
151
|
+
background: transparent;
|
|
152
|
+
border-radius: 0; /* No border radius to prevent clipping the SVG */
|
|
153
|
+
text-decoration: none;
|
|
154
|
+
transition: all 0.2s ease;
|
|
155
|
+
position: relative;
|
|
156
|
+
cursor: pointer;
|
|
157
|
+
padding: 0;
|
|
158
|
+
/* Hover-only: hidden by default */
|
|
159
|
+
opacity: 0 !important;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/* Show logo on widget hover or when badge itself is hovered/focused */
|
|
163
|
+
.supernal-tts-widget:hover .supernal-badge,
|
|
164
|
+
.supernal-tts-button-container:hover .supernal-badge,
|
|
165
|
+
.supernal-tts-widget:focus-within .supernal-badge,
|
|
166
|
+
.supernal-badge:hover,
|
|
167
|
+
.supernal-badge:focus {
|
|
168
|
+
opacity: 1 !important;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.supernal-badge:hover {
|
|
172
|
+
transform: scale(1.1);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.supernal-logo-img {
|
|
176
|
+
width: 24px;
|
|
177
|
+
height: 24px;
|
|
178
|
+
object-fit: contain;
|
|
179
|
+
display: block;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/* Compact Widget Layout */
|
|
183
|
+
.supernal-tts-compact-widget {
|
|
184
|
+
display: flex;
|
|
185
|
+
flex-direction: column;
|
|
186
|
+
gap: 8px;
|
|
187
|
+
padding: 8px;
|
|
188
|
+
background: var(--supernal-tts-bg, #f8f9fa);
|
|
189
|
+
border-radius: 8px;
|
|
190
|
+
border: 1px solid var(--supernal-tts-border, #e0e0e0);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.supernal-tts-top-row {
|
|
194
|
+
display: flex;
|
|
195
|
+
align-items: center;
|
|
196
|
+
gap: 8px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.supernal-tts-voice-select {
|
|
200
|
+
flex: 1;
|
|
201
|
+
padding: 8px 12px;
|
|
202
|
+
border: 1px solid var(--supernal-tts-border, #e0e0e0);
|
|
203
|
+
border-radius: 6px;
|
|
204
|
+
background: white;
|
|
205
|
+
font-size: 14px;
|
|
206
|
+
cursor: pointer;
|
|
207
|
+
transition: border-color 0.2s;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.supernal-tts-voice-select:hover {
|
|
211
|
+
border-color: #3b82f6;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.supernal-tts-voice-select:focus {
|
|
215
|
+
outline: none;
|
|
216
|
+
border-color: #3b82f6;
|
|
217
|
+
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.supernal-tts-speed-control {
|
|
221
|
+
display: flex;
|
|
222
|
+
flex-direction: column;
|
|
223
|
+
gap: 4px;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.supernal-tts-speed-control label {
|
|
227
|
+
font-size: 12px;
|
|
228
|
+
color: var(--supernal-tts-text, #666);
|
|
229
|
+
display: flex;
|
|
230
|
+
justify-content: space-between;
|
|
231
|
+
align-items: center;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.supernal-tts-speed-value {
|
|
235
|
+
font-weight: 600;
|
|
236
|
+
color: var(--supernal-tts-primary, #3b82f6);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.supernal-tts-speed-slider {
|
|
240
|
+
width: 100%;
|
|
241
|
+
height: 6px;
|
|
242
|
+
border-radius: 3px;
|
|
243
|
+
background: #e0e0e0;
|
|
244
|
+
outline: none;
|
|
245
|
+
-webkit-appearance: none;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.supernal-tts-speed-slider::-webkit-slider-thumb {
|
|
249
|
+
-webkit-appearance: none;
|
|
250
|
+
appearance: none;
|
|
251
|
+
width: 16px;
|
|
252
|
+
height: 16px;
|
|
253
|
+
border-radius: 50%;
|
|
254
|
+
background: #3b82f6;
|
|
255
|
+
cursor: pointer;
|
|
256
|
+
transition: all 0.2s;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.supernal-tts-speed-slider::-webkit-slider-thumb:hover {
|
|
260
|
+
background: #2563eb;
|
|
261
|
+
transform: scale(1.1);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.supernal-tts-speed-slider::-moz-range-thumb {
|
|
265
|
+
width: 16px;
|
|
266
|
+
height: 16px;
|
|
267
|
+
border-radius: 50%;
|
|
268
|
+
background: #3b82f6;
|
|
269
|
+
cursor: pointer;
|
|
270
|
+
border: none;
|
|
271
|
+
transition: all 0.2s;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.supernal-tts-speed-slider::-moz-range-thumb:hover {
|
|
275
|
+
background: #2563eb;
|
|
276
|
+
transform: scale(1.1);
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/* Advanced Widget Layout */
|
|
280
|
+
.supernal-tts-advanced-widget {
|
|
281
|
+
display: flex;
|
|
282
|
+
flex-direction: column;
|
|
283
|
+
gap: 12px;
|
|
284
|
+
padding: 12px;
|
|
285
|
+
background: var(--supernal-tts-bg, #f8f9fa);
|
|
286
|
+
border-radius: 8px;
|
|
287
|
+
border: 1px solid var(--supernal-tts-border, #e0e0e0);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.supernal-tts-button-group {
|
|
291
|
+
display: flex;
|
|
292
|
+
gap: 8px;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.supernal-tts-progress {
|
|
296
|
+
display: flex;
|
|
297
|
+
flex-direction: column;
|
|
298
|
+
gap: 4px;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.supernal-tts-progress-slider {
|
|
302
|
+
width: 100%;
|
|
303
|
+
height: 6px;
|
|
304
|
+
border-radius: 3px;
|
|
305
|
+
background: #e0e0e0;
|
|
306
|
+
outline: none;
|
|
307
|
+
-webkit-appearance: none;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.supernal-tts-progress-slider::-webkit-slider-thumb {
|
|
311
|
+
-webkit-appearance: none;
|
|
312
|
+
appearance: none;
|
|
313
|
+
width: 16px;
|
|
314
|
+
height: 16px;
|
|
315
|
+
border-radius: 50%;
|
|
316
|
+
background: #10b981;
|
|
317
|
+
cursor: pointer;
|
|
318
|
+
transition: all 0.2s;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.supernal-tts-progress-slider::-moz-range-thumb {
|
|
322
|
+
width: 16px;
|
|
323
|
+
height: 16px;
|
|
324
|
+
border-radius: 50%;
|
|
325
|
+
background: #10b981;
|
|
326
|
+
cursor: pointer;
|
|
327
|
+
border: none;
|
|
328
|
+
transition: all 0.2s;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.supernal-tts-time {
|
|
332
|
+
font-size: 12px;
|
|
333
|
+
color: var(--supernal-tts-text, #666);
|
|
334
|
+
text-align: center;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/* Remove tooltip CSS - using native title attribute instead */
|
|
338
|
+
/* Native title attribute provides single, consistent tooltip without duplication */
|
|
339
|
+
|
|
340
|
+
/* Dev Mode Cache Clear Button */
|
|
341
|
+
.supernal-tts-dev-button {
|
|
342
|
+
position: fixed;
|
|
343
|
+
bottom: 20px;
|
|
344
|
+
right: 20px;
|
|
345
|
+
z-index: 10000;
|
|
346
|
+
background: #dc3545;
|
|
347
|
+
color: white;
|
|
348
|
+
border: none;
|
|
349
|
+
padding: 10px 15px;
|
|
350
|
+
border-radius: 5px;
|
|
351
|
+
font-size: 14px;
|
|
352
|
+
cursor: pointer;
|
|
353
|
+
box-shadow: 0 2px 8px rgba(0,0,0,0.3);
|
|
354
|
+
font-family: system-ui, -apple-system, sans-serif;
|
|
355
|
+
transition: all 0.2s ease;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.supernal-tts-dev-button:hover {
|
|
359
|
+
transform: scale(1.05);
|
|
360
|
+
box-shadow: 0 4px 12px rgba(0,0,0,0.4);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/* Animation for playing state */
|
|
364
|
+
@keyframes pulse {
|
|
365
|
+
0%, 100% {
|
|
366
|
+
opacity: 1;
|
|
367
|
+
}
|
|
368
|
+
50% {
|
|
369
|
+
opacity: 0.8;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/* Dark mode support */
|
|
374
|
+
@media (prefers-color-scheme: dark) {
|
|
375
|
+
.supernal-tts-play {
|
|
376
|
+
background: rgba(14, 165, 233, 0.7); /* Light blue with transparency */
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
.supernal-tts-play:hover:not(:disabled) {
|
|
380
|
+
background: rgba(14, 165, 233, 1); /* Full opacity on hover */
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.supernal-tts-play.supernal-tts-loading {
|
|
384
|
+
background: #d97706;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.supernal-tts-play.supernal-tts-playing {
|
|
388
|
+
background: #ea580c; /* Darker orange for dark mode */
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.supernal-tts-play.supernal-tts-error {
|
|
392
|
+
background: #dc2626;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/* Responsive design */
|
|
397
|
+
@media (max-width: 768px) {
|
|
398
|
+
.supernal-tts-play {
|
|
399
|
+
padding: 6px 10px;
|
|
400
|
+
font-size: 13px;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.supernal-badge {
|
|
404
|
+
width: 36px;
|
|
405
|
+
height: 36px;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
.supernal-tts-voice-toggle,
|
|
409
|
+
.supernal-tts-speed-toggle,
|
|
410
|
+
.supernal-tts-play-compact {
|
|
411
|
+
width: 36px;
|
|
412
|
+
height: 36px;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
/* ================================================================
|
|
417
|
+
MODULAR WIDGET STYLES (New UX with conditional features)
|
|
418
|
+
================================================================ */
|
|
419
|
+
|
|
420
|
+
/* Widget wraps content - position controls at top-left */
|
|
421
|
+
.supernal-tts-widget {
|
|
422
|
+
position: relative;
|
|
423
|
+
display: block;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/* Modular Widget Container - position at top-left */
|
|
427
|
+
.supernal-tts-modular-widget {
|
|
428
|
+
position: absolute;
|
|
429
|
+
top: 8px;
|
|
430
|
+
left: 0;
|
|
431
|
+
display: flex;
|
|
432
|
+
flex-direction: column;
|
|
433
|
+
gap: 8px;
|
|
434
|
+
z-index: 10;
|
|
435
|
+
background: transparent; /* Transparent background */
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/* Controls Row - horizontal layout for play button, voice, speed */
|
|
439
|
+
.supernal-tts-controls-row {
|
|
440
|
+
display: inline-flex;
|
|
441
|
+
align-items: center;
|
|
442
|
+
gap: 8px;
|
|
443
|
+
flex-wrap: nowrap;
|
|
444
|
+
background: transparent; /* Transparent background */
|
|
445
|
+
position: relative; /* Enable z-index positioning */
|
|
446
|
+
z-index: 10; /* Place above progress bar */
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
/* Add padding to widget content to make room for controls */
|
|
450
|
+
.supernal-tts-widget-modular {
|
|
451
|
+
padding-top: 60px; /* Base space for controls */
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
/* Additional padding when progress bar is enabled */
|
|
455
|
+
.supernal-tts-widget-modular.has-progress {
|
|
456
|
+
padding-top: 90px; /* Extra space for progress bar */
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
/* Hide additional controls by default, show on hover */
|
|
460
|
+
.supernal-tts-voice-control,
|
|
461
|
+
.supernal-tts-speed-control {
|
|
462
|
+
opacity: 0;
|
|
463
|
+
visibility: hidden;
|
|
464
|
+
transition: opacity 0.2s ease, visibility 0.2s ease;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
.supernal-tts-widget:hover .supernal-tts-voice-control,
|
|
468
|
+
.supernal-tts-widget:hover .supernal-tts-speed-control,
|
|
469
|
+
.supernal-tts-widget:focus-within .supernal-tts-voice-control,
|
|
470
|
+
.supernal-tts-widget:focus-within .supernal-tts-speed-control {
|
|
471
|
+
opacity: 1;
|
|
472
|
+
visibility: visible;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
/* Mobile/Touch: Always show controls (no hover) */
|
|
476
|
+
@media (hover: none) and (pointer: coarse) {
|
|
477
|
+
.supernal-tts-voice-control,
|
|
478
|
+
.supernal-tts-speed-control {
|
|
479
|
+
opacity: 1;
|
|
480
|
+
visibility: visible;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/* Voice Control - Person Icon */
|
|
485
|
+
.supernal-tts-voice-control {
|
|
486
|
+
position: relative;
|
|
487
|
+
display: inline-flex;
|
|
488
|
+
align-items: center; /* Ensure vertical alignment */
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
.supernal-tts-voice-toggle {
|
|
492
|
+
display: flex;
|
|
493
|
+
align-items: center;
|
|
494
|
+
justify-content: center;
|
|
495
|
+
width: 40px;
|
|
496
|
+
height: 40px;
|
|
497
|
+
padding: 0;
|
|
498
|
+
background: rgba(14, 165, 233, 0.15); /* Light cyan background */
|
|
499
|
+
border: none;
|
|
500
|
+
border-radius: 50%; /* Circular shape */
|
|
501
|
+
cursor: pointer;
|
|
502
|
+
transition: all 0.2s ease;
|
|
503
|
+
flex-shrink: 0;
|
|
504
|
+
color: #0ea5e9; /* Cyan icon color */
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
.supernal-tts-voice-toggle:hover {
|
|
508
|
+
background: rgba(14, 165, 233, 0.25); /* Slightly darker cyan on hover */
|
|
509
|
+
color: #0284c7;
|
|
510
|
+
transform: scale(1.05);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.supernal-tts-voice-toggle:focus {
|
|
514
|
+
outline: none;
|
|
515
|
+
background: rgba(14, 165, 233, 0.25);
|
|
516
|
+
color: #0284c7;
|
|
517
|
+
box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
.supernal-tts-voice-icon {
|
|
521
|
+
transition: transform 0.2s ease;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
.supernal-tts-voice-toggle[aria-expanded="true"] .supernal-tts-voice-icon {
|
|
525
|
+
transform: scale(1.1);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/* Voice Dropdown Menu */
|
|
529
|
+
.supernal-tts-voice-dropdown {
|
|
530
|
+
position: absolute;
|
|
531
|
+
top: calc(100% + 4px);
|
|
532
|
+
left: 0;
|
|
533
|
+
min-width: 140px;
|
|
534
|
+
background: white;
|
|
535
|
+
border: 1px solid var(--supernal-tts-border, #e0e0e0);
|
|
536
|
+
border-radius: 6px;
|
|
537
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
538
|
+
z-index: 1000;
|
|
539
|
+
overflow: hidden;
|
|
540
|
+
transition: opacity 0.2s ease, transform 0.2s ease;
|
|
541
|
+
transform-origin: top left;
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
.supernal-tts-voice-dropdown.hidden {
|
|
545
|
+
display: none;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
.supernal-tts-voice-option {
|
|
549
|
+
width: 100%;
|
|
550
|
+
padding: 10px 12px;
|
|
551
|
+
background: none;
|
|
552
|
+
border: none;
|
|
553
|
+
text-align: left;
|
|
554
|
+
font-size: 14px;
|
|
555
|
+
cursor: pointer;
|
|
556
|
+
transition: background 0.2s ease;
|
|
557
|
+
color: var(--supernal-tts-text, #1f2937);
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
.supernal-tts-voice-option:hover {
|
|
561
|
+
background: #f3f4f6;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
.supernal-tts-voice-option.active {
|
|
565
|
+
background: #eff6ff;
|
|
566
|
+
color: #3b82f6;
|
|
567
|
+
font-weight: 600;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
.supernal-tts-voice-option:focus {
|
|
571
|
+
outline: none;
|
|
572
|
+
background: #f3f4f6;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/* Speed Control - Hover Dropdown */
|
|
576
|
+
.supernal-tts-speed-control {
|
|
577
|
+
position: relative;
|
|
578
|
+
display: inline-flex;
|
|
579
|
+
align-items: center; /* Ensure vertical alignment */
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.supernal-tts-speed-toggle {
|
|
583
|
+
display: flex;
|
|
584
|
+
align-items: center;
|
|
585
|
+
justify-content: center;
|
|
586
|
+
width: 40px;
|
|
587
|
+
height: 40px;
|
|
588
|
+
padding: 0;
|
|
589
|
+
background: rgba(6, 182, 212, 0.15); /* Light teal background */
|
|
590
|
+
border: none;
|
|
591
|
+
border-radius: 50%; /* Circular shape */
|
|
592
|
+
cursor: pointer;
|
|
593
|
+
transition: all 0.2s ease;
|
|
594
|
+
flex-shrink: 0;
|
|
595
|
+
color: #06b6d4; /* Teal icon color */
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
.supernal-tts-speed-toggle:hover {
|
|
599
|
+
background: rgba(6, 182, 212, 0.25); /* Slightly darker teal on hover */
|
|
600
|
+
color: #0891b2;
|
|
601
|
+
transform: scale(1.05);
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
.supernal-tts-speed-icon {
|
|
605
|
+
color: inherit;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
/* Speed Dropdown Menu (shown on hover) */
|
|
609
|
+
.supernal-tts-speed-dropdown {
|
|
610
|
+
position: absolute;
|
|
611
|
+
top: calc(100% + 4px);
|
|
612
|
+
left: 0;
|
|
613
|
+
min-width: 80px;
|
|
614
|
+
background: white;
|
|
615
|
+
border: 1px solid var(--supernal-tts-border, #e0e0e0);
|
|
616
|
+
border-radius: 6px;
|
|
617
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
618
|
+
z-index: 1000;
|
|
619
|
+
overflow: hidden;
|
|
620
|
+
transition: opacity 0.2s ease;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
.supernal-tts-speed-dropdown.hidden {
|
|
624
|
+
display: none;
|
|
625
|
+
opacity: 0;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
.supernal-tts-speed-control:hover .supernal-tts-speed-dropdown.hidden {
|
|
629
|
+
display: block;
|
|
630
|
+
opacity: 1;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
.supernal-tts-speed-option {
|
|
634
|
+
width: 100%;
|
|
635
|
+
padding: 8px 12px;
|
|
636
|
+
background: none;
|
|
637
|
+
border: none;
|
|
638
|
+
text-align: center;
|
|
639
|
+
font-size: 13px;
|
|
640
|
+
cursor: pointer;
|
|
641
|
+
transition: background 0.2s ease;
|
|
642
|
+
color: var(--supernal-tts-text, #1f2937);
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
.supernal-tts-speed-option:hover {
|
|
646
|
+
background: #fef3c7;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
.supernal-tts-speed-option.active {
|
|
650
|
+
background: #fef3c7;
|
|
651
|
+
color: #d97706;
|
|
652
|
+
font-weight: 600;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/* Progress Bar Container */
|
|
656
|
+
.supernal-tts-progress-container {
|
|
657
|
+
display: flex;
|
|
658
|
+
flex-direction: column;
|
|
659
|
+
gap: 4px;
|
|
660
|
+
width: 100%;
|
|
661
|
+
min-width: 200px;
|
|
662
|
+
max-width: 400px;
|
|
663
|
+
background: transparent; /* Ensure no white background */
|
|
664
|
+
padding: 0; /* Remove any padding that might create background */
|
|
665
|
+
margin-top: 4px; /* Add slight spacing from controls row */
|
|
666
|
+
position: relative; /* Enable z-index positioning */
|
|
667
|
+
z-index: 1; /* Place below controls */
|
|
668
|
+
/* Hide by default */
|
|
669
|
+
opacity: 0;
|
|
670
|
+
visibility: hidden;
|
|
671
|
+
max-height: 0;
|
|
672
|
+
overflow: hidden;
|
|
673
|
+
transition: opacity 0.2s ease, visibility 0.2s ease, max-height 0.2s ease;
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/* Show on hover or when playing */
|
|
677
|
+
.supernal-tts-widget:hover .supernal-tts-progress-container,
|
|
678
|
+
.supernal-tts-progress-container.playing {
|
|
679
|
+
opacity: 1;
|
|
680
|
+
visibility: visible;
|
|
681
|
+
max-height: 50px; /* Enough for progress bar + time */
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
/* Mobile/Touch: Show progress when playing */
|
|
685
|
+
@media (hover: none) and (pointer: coarse) {
|
|
686
|
+
.supernal-tts-progress-container.playing {
|
|
687
|
+
opacity: 1;
|
|
688
|
+
visibility: visible;
|
|
689
|
+
max-height: 50px;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
/* Progress Slider */
|
|
694
|
+
.supernal-tts-progress-container .supernal-tts-progress-slider {
|
|
695
|
+
width: 100%;
|
|
696
|
+
height: 4px;
|
|
697
|
+
border-radius: 2px;
|
|
698
|
+
background: #e0e0e0; /* Simple background, progress shown via thumb position */
|
|
699
|
+
outline: none;
|
|
700
|
+
cursor: pointer;
|
|
701
|
+
-webkit-appearance: none;
|
|
702
|
+
appearance: none;
|
|
703
|
+
margin: 0; /* Remove default margins */
|
|
704
|
+
padding: 0; /* Remove default padding */
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
.supernal-tts-progress-container .supernal-tts-progress-slider::-webkit-slider-thumb {
|
|
708
|
+
-webkit-appearance: none;
|
|
709
|
+
appearance: none;
|
|
710
|
+
width: 12px;
|
|
711
|
+
height: 12px;
|
|
712
|
+
border-radius: 50%;
|
|
713
|
+
background: #3b82f6;
|
|
714
|
+
cursor: pointer;
|
|
715
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
716
|
+
transition: all 0.2s ease;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
.supernal-tts-progress-container .supernal-tts-progress-slider::-webkit-slider-thumb:hover {
|
|
720
|
+
background: #2563eb;
|
|
721
|
+
transform: scale(1.2);
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
.supernal-tts-progress-container .supernal-tts-progress-slider::-moz-range-thumb {
|
|
725
|
+
width: 12px;
|
|
726
|
+
height: 12px;
|
|
727
|
+
border-radius: 50%;
|
|
728
|
+
background: #3b82f6;
|
|
729
|
+
cursor: pointer;
|
|
730
|
+
border: none;
|
|
731
|
+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
|
|
732
|
+
transition: all 0.2s ease;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
.supernal-tts-progress-container .supernal-tts-progress-slider::-moz-range-thumb:hover {
|
|
736
|
+
background: #2563eb;
|
|
737
|
+
transform: scale(1.2);
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
/* Time Display */
|
|
741
|
+
.supernal-tts-time-display {
|
|
742
|
+
font-size: 11px;
|
|
743
|
+
color: var(--supernal-tts-text, #6b7280);
|
|
744
|
+
text-align: right;
|
|
745
|
+
font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Mono', 'Droid Sans Mono', 'Source Code Pro', monospace;
|
|
746
|
+
background: transparent; /* Ensure no background */
|
|
747
|
+
padding: 0; /* Remove padding */
|
|
748
|
+
margin: 0; /* Remove margin */
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
.supernal-tts-time-display .current {
|
|
752
|
+
font-weight: 600;
|
|
753
|
+
color: #3b82f6;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
/* Dark mode support for modular widget */
|
|
757
|
+
@media (prefers-color-scheme: dark) {
|
|
758
|
+
.supernal-tts-voice-toggle {
|
|
759
|
+
background: rgba(14, 165, 233, 0.2);
|
|
760
|
+
color: #38bdf8;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
.supernal-tts-speed-toggle {
|
|
764
|
+
background: rgba(6, 182, 212, 0.2);
|
|
765
|
+
color: #22d3ee;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
.supernal-tts-voice-toggle:hover {
|
|
769
|
+
background: rgba(14, 165, 233, 0.3);
|
|
770
|
+
color: #7dd3fc;
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
.supernal-tts-speed-toggle:hover {
|
|
774
|
+
background: rgba(6, 182, 212, 0.3);
|
|
775
|
+
color: #5eead4;
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
.supernal-tts-voice-dropdown,
|
|
779
|
+
.supernal-tts-speed-dropdown {
|
|
780
|
+
background: #1f2937;
|
|
781
|
+
border-color: #374151;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
.supernal-tts-voice-option,
|
|
785
|
+
.supernal-tts-speed-option {
|
|
786
|
+
color: #f3f4f6;
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
.supernal-tts-voice-option:hover {
|
|
790
|
+
background: #374151;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
.supernal-tts-speed-option:hover {
|
|
794
|
+
background: #374151;
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
.supernal-tts-voice-option.active {
|
|
798
|
+
background: rgba(14, 165, 233, 0.2);
|
|
799
|
+
color: #7dd3fc;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
.supernal-tts-speed-option.active {
|
|
803
|
+
background: rgba(6, 182, 212, 0.2);
|
|
804
|
+
color: #5eead4;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
/* Mobile responsiveness for modular widget */
|
|
809
|
+
@media (max-width: 768px) {
|
|
810
|
+
.supernal-tts-controls-row {
|
|
811
|
+
flex-wrap: wrap;
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
.supernal-tts-progress-container {
|
|
815
|
+
min-width: 100%;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
.supernal-tts-voice-dropdown {
|
|
819
|
+
left: auto;
|
|
820
|
+
right: 0;
|
|
821
|
+
}
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
/* Progressive loading indicator */
|
|
825
|
+
.supernal-tts-progress-container.loading .current {
|
|
826
|
+
color: #f59e0b;
|
|
827
|
+
font-weight: 500;
|
|
828
|
+
animation: pulse 1.5s ease-in-out infinite;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
@keyframes pulse {
|
|
832
|
+
0%, 100% {
|
|
833
|
+
opacity: 1;
|
|
834
|
+
}
|
|
835
|
+
50% {
|
|
836
|
+
opacity: 0.5;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
|