-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpopup.html
More file actions
327 lines (296 loc) · 11.7 KB
/
popup.html
File metadata and controls
327 lines (296 loc) · 11.7 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
background: transparent;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
width: 100%;
height: 100%;
overflow: visible;
}
#widget {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
/* --- Orb container --- */
#orb-wrap {
position: relative;
width: 60px;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
}
/* --- Ping rings (expand outward and fade) --- */
.ping {
position: absolute;
inset: 0;
border-radius: 50%;
border: 2px solid transparent;
pointer-events: none;
opacity: 0;
}
.ping-1, .ping-2, .ping-3 {
border-color: rgba(140, 130, 220, 0.3);
}
/* --- State: idle (default) --- no rings, no animation */
/* --- State: connecting --- single ring spinning */
#orb-wrap.connecting .ping-1 {
border-color: rgba(120, 100, 255, 0.5);
border-top-color: transparent;
border-right-color: transparent;
opacity: 1;
animation: spin 1s linear infinite;
inset: -8px;
}
/* --- State: connected --- 3 concentric ping rings pulsing outward */
#orb-wrap.connected .ping-1 {
border-color: rgba(74, 222, 128, 0.4);
animation: ping 2.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}
#orb-wrap.connected .ping-2 {
border-color: rgba(74, 222, 128, 0.3);
animation: ping 2.5s cubic-bezier(0, 0, 0.2, 1) infinite 0.5s;
}
#orb-wrap.connected .ping-3 {
border-color: rgba(74, 222, 128, 0.2);
animation: ping 2.5s cubic-bezier(0, 0, 0.2, 1) infinite 1s;
}
/* --- State: AI speaking --- fast, intense ping rings */
#orb-wrap.ai-speaking .ping-1 {
border-color: rgba(99, 102, 241, 0.5);
animation: ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}
#orb-wrap.ai-speaking .ping-2 {
border-color: rgba(99, 102, 241, 0.35);
animation: ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite 0.3s;
}
#orb-wrap.ai-speaking .ping-3 {
border-color: rgba(99, 102, 241, 0.2);
animation: ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite 0.6s;
}
/* --- State: user speaking --- slow, subtle single ping */
#orb-wrap.user-speaking .ping-1 {
border-color: rgba(52, 211, 153, 0.35);
animation: ping 3s cubic-bezier(0, 0, 0.2, 1) infinite;
}
/* --- The orb button --- */
#orb {
position: relative;
z-index: 1;
width: 54px;
height: 54px;
border-radius: 50%;
border: none;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.15s ease;
}
#orb:hover { transform: scale(1.05); }
/* Idle: dark muted orb */
#orb {
background: linear-gradient(145deg, #e8e6f0, #d4d2e0);
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
color: #6b6990;
}
/* Connecting: purple tint */
#orb-wrap.connecting #orb {
background: linear-gradient(145deg, #d8d4f0, #c4bfe8);
box-shadow: 0 2px 14px rgba(120, 100, 255, 0.2);
color: #7c6cf0;
cursor: wait;
}
/* Connected: green tint */
#orb-wrap.connected #orb {
background: linear-gradient(145deg, #d0f0e0, #b8e8d0);
box-shadow: 0 2px 14px rgba(74, 222, 128, 0.25);
color: #22a860;
}
/* AI Speaking: indigo/purple, vibrant */
#orb-wrap.ai-speaking #orb {
background: linear-gradient(145deg, #4f46e5, #6366f1);
box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
color: #fff;
}
/* User Speaking: dark green */
#orb-wrap.user-speaking #orb {
background: linear-gradient(145deg, #065f46, #047857);
box-shadow: 0 4px 20px rgba(5, 150, 105, 0.35);
color: #a7f3d0;
}
/* --- Icons (swap via CSS visibility) --- */
.orb-icon {
display: none;
width: 24px;
height: 24px;
}
.orb-icon svg { width: 100%; height: 100%; }
/* Show correct icon per state */
#orb-wrap .icon-idle { display: flex; }
#orb-wrap.connecting .icon-idle { display: none; }
#orb-wrap.connecting .icon-wifi { display: flex; }
#orb-wrap.connected .icon-idle { display: none; }
#orb-wrap.connected .icon-sound { display: flex; }
#orb-wrap.ai-speaking .icon-idle { display: none; }
#orb-wrap.ai-speaking .icon-speaker { display: flex; }
#orb-wrap.user-speaking .icon-idle { display: none; }
#orb-wrap.user-speaking .icon-mic { display: flex; }
/* --- Sound bars (inside AI speaking icon) --- */
.wave-bars {
display: flex;
align-items: center;
justify-content: center;
gap: 2px;
height: 20px;
}
.wave-bars .bar {
width: 3px;
border-radius: 1.5px;
background: currentColor;
transition: height 0.1s ease;
}
/* Static bar heights */
.wave-bars .bar:nth-child(1) { height: 6px; }
.wave-bars .bar:nth-child(2) { height: 10px; }
.wave-bars .bar:nth-child(3) { height: 16px; }
.wave-bars .bar:nth-child(4) { height: 10px; }
.wave-bars .bar:nth-child(5) { height: 6px; }
/* AI speaking: fast wave */
#orb-wrap.ai-speaking .bar { animation: wave 0.7s ease-in-out infinite; }
#orb-wrap.ai-speaking .bar:nth-child(1) { animation-delay: 0s; }
#orb-wrap.ai-speaking .bar:nth-child(2) { animation-delay: 0.08s; }
#orb-wrap.ai-speaking .bar:nth-child(3) { animation-delay: 0.16s; }
#orb-wrap.ai-speaking .bar:nth-child(4) { animation-delay: 0.24s; }
#orb-wrap.ai-speaking .bar:nth-child(5) { animation-delay: 0.32s; }
/* User speaking: slow wave */
#orb-wrap.user-speaking .bar { animation: wave-slow 1.4s ease-in-out infinite; }
#orb-wrap.user-speaking .bar:nth-child(1) { animation-delay: 0s; }
#orb-wrap.user-speaking .bar:nth-child(2) { animation-delay: 0.12s; }
#orb-wrap.user-speaking .bar:nth-child(3) { animation-delay: 0.24s; }
#orb-wrap.user-speaking .bar:nth-child(4) { animation-delay: 0.36s; }
#orb-wrap.user-speaking .bar:nth-child(5) { animation-delay: 0.48s; }
/* --- Animations --- */
@keyframes ping {
0% { transform: scale(1); opacity: 0.8; }
100% { transform: scale(2.2); opacity: 0; }
}
@keyframes spin {
to { transform: rotate(360deg); }
}
@keyframes wave {
0%, 100% { height: 4px; }
50% { height: 20px; }
}
@keyframes wave-slow {
0%, 100% { height: 5px; }
50% { height: 13px; }
}
/* --- Toast --- */
#toast {
position: fixed;
bottom: 80px;
right: 0;
transform: translateX(calc(100% + 8px));
max-width: 260px;
padding: 10px 14px;
background: rgba(30, 20, 50, 0.95);
backdrop-filter: blur(12px);
color: #f0f0f5;
font-size: 12px;
line-height: 1.45;
border-radius: 10px;
border: 1px solid rgba(255, 255, 255, 0.08);
box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
opacity: 0;
transition: transform 0.3s ease, opacity 0.3s ease;
pointer-events: none;
}
#toast.visible {
transform: translateX(0);
opacity: 1;
}
#toast.error {
border-color: rgba(239, 68, 68, 0.3);
}
#toast .toast-title {
font-weight: 600;
font-size: 11px;
text-transform: uppercase;
letter-spacing: 0.5px;
color: #ef4444;
margin-bottom: 4px;
}
</style>
</head>
<body>
<div id="widget">
<div id="orb-wrap">
<!-- Ping rings -->
<span class="ping ping-1"></span>
<span class="ping ping-2"></span>
<span class="ping ping-3"></span>
<button id="orb" title="Talk to AI assistant">
<!-- Idle: wifi-off / slash icon -->
<div class="orb-icon icon-idle">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="1" y1="1" x2="23" y2="23"/>
<path d="M16.72 11.06A10.94 10.94 0 0 1 19 12.55"/>
<path d="M5 12.55a10.94 10.94 0 0 1 5.17-2.39"/>
<path d="M10.71 5.05A16 16 0 0 1 22.56 9"/>
<path d="M1.42 9a15.91 15.91 0 0 1 4.7-2.88"/>
<path d="M8.53 16.11a6 6 0 0 1 6.95 0"/>
<line x1="12" y1="20" x2="12.01" y2="20"/>
</svg>
</div>
<!-- Connecting: wifi icon -->
<div class="orb-icon icon-wifi">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M5 12.55a11 11 0 0 1 14.08 0"/>
<path d="M1.42 9a16 16 0 0 1 21.16 0"/>
<path d="M8.53 16.11a6 6 0 0 1 6.95 0"/>
<line x1="12" y1="20" x2="12.01" y2="20"/>
</svg>
</div>
<!-- Connected: sound waves icon -->
<div class="orb-icon icon-sound">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">
<path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>
<path d="M19.07 4.93a10 10 0 0 1 0 14.14"/>
<circle cx="8" cy="12" r="2" fill="currentColor" stroke="none"/>
</svg>
</div>
<!-- AI Speaking: animated bars -->
<div class="orb-icon icon-speaker">
<div class="wave-bars">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
</div>
</div>
<!-- User Speaking: microphone icon + bars -->
<div class="orb-icon icon-mic">
<div class="wave-bars">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
</div>
</div>
</button>
</div>
</div>
<div id="toast"></div>
<script src="popup.js"></script>
</body>
</html>