-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
popup.html
342 lines (302 loc) · 8.26 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>wAI</title>
<link
href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@400;500;600&display=swap"
rel="stylesheet"
/>
<style>
:root {
--bg-color: #000000;
--text-color: #ffffff;
--input-bg: #1a1a1a;
--button-bg: #333333;
--button-hover: #444444;
--border-color: #2a2a2a;
--accent-color: #ffffff;
--scrollbar-bg: #1a1a1a;
--scrollbar-thumb: #333333;
--toggle-off-bg: #444444;
--toggle-on-bg: #ffffff;
--toggle-off-slider: #1a1a1a;
--toggle-on-slider: #000000;
}
body {
font-family: "Roboto Mono", monospace;
background-color: var(--bg-color);
color: var(--text-color);
margin: 0;
padding: 15px;
width: 300px;
height: 450px;
display: flex;
flex-direction: column;
overflow: hidden;
box-sizing: border-box;
}
h1 {
font-size: 24px;
font-weight: 600;
margin-bottom: 15px;
text-align: center;
}
.container {
flex: 1;
display: flex;
flex-direction: column;
gap: 15px;
overflow-y: auto;
overflow-x: hidden;
}
.input-group {
display: flex;
flex-direction: column;
gap: 6px;
}
label {
font-size: 12px;
font-weight: 500;
}
input,
select {
width: 100%;
padding: 8px;
background-color: var(--input-bg);
border: 1px solid var(--border-color);
color: var(--text-color);
font-family: "Roboto Mono", monospace;
font-size: 12px;
outline: none;
box-sizing: border-box;
}
input:focus,
select:focus {
border-color: var(--accent-color);
}
button {
background-color: var(--button-bg);
color: var(--text-color);
border: none;
padding: 8px 12px;
cursor: pointer;
font-family: "Roboto Mono", monospace;
font-size: 12px;
font-weight: 500;
transition: background-color 0.3s ease;
width: 100%;
box-sizing: border-box;
}
button:hover {
background-color: var(--button-hover);
}
#dashboard,
#onboarding {
display: none;
}
.button-group {
display: flex;
gap: 10px;
justify-content: space-between;
}
.button-group button {
flex: 1;
}
.models-list {
flex: 1;
overflow-y: auto;
border: 1px solid var(--border-color);
padding: 8px;
margin-top: 8px;
}
.model-item {
padding: 6px;
cursor: pointer;
}
.model-item:hover {
background-color: var(--input-bg);
}
.step-indicator {
display: flex;
justify-content: center;
gap: 6px;
margin-bottom: 15px;
}
.step-dot {
width: 6px;
height: 6px;
background-color: var(--border-color);
}
.step-dot.active {
background-color: var(--accent-color);
}
.toggle-switch {
position: relative;
display: inline-block;
width: 40px;
height: 20px;
}
.toggle-switch input {
opacity: 0;
width: 0;
height: 0;
}
.toggle-slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: var(--toggle-off-bg);
transition: 0.4s;
}
.toggle-slider:before {
position: absolute;
content: "";
height: 16px;
width: 16px;
left: 2px;
bottom: 2px;
background-color: var(--toggle-off-slider);
transition: 0.4s;
}
input:checked + .toggle-slider {
background-color: var(--toggle-on-bg);
}
input:checked + .toggle-slider:before {
transform: translateX(20px);
background-color: var(--toggle-on-slider);
}
.settings-row {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.settings-row span {
font-size: 12px;
}
.modal {
display: none;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
}
.modal-content {
background-color: var(--bg-color);
margin: 15% auto;
padding: 20px;
border: 1px solid var(--border-color);
width: 80%;
}
.close {
color: var(--text-color);
float: right;
font-size: 28px;
font-weight: bold;
cursor: pointer;
}
.close:hover,
.close:focus {
color: var(--accent-color);
text-decoration: none;
cursor: pointer;
}
/* Custom scrollbar styles */
.models-list::-webkit-scrollbar {
width: 10px;
}
.models-list::-webkit-scrollbar-track {
background: var(--scrollbar-bg);
}
.models-list::-webkit-scrollbar-thumb {
background: var(--scrollbar-thumb);
border: 2px solid var(--scrollbar-bg);
}
.models-list::-webkit-scrollbar-thumb:hover {
background: var(--button-hover);
}
button:disabled {
background-color: #222222;
color: #666666;
cursor: not-allowed;
}
button:disabled:hover {
background-color: #222222;
}
</style>
</head>
<body>
<h1>wAI</h1>
<div id="onboarding" class="container">
<div class="step-indicator">
<div class="step-dot active"></div>
<div class="step-dot"></div>
<div class="step-dot"></div>
</div>
<div id="step1" class="input-group">
<label for="provider">Select Provider</label>
<select id="provider">
<option value="">Select Provider</option>
<option value="openai">OpenAI</option>
<option value="anthropic">Anthropic (Claude)</option>
<option value="custom">Custom Endpoint</option>
</select>
</div>
<div id="step2" class="input-group" style="display: none">
<label for="apiKey">API Key</label>
<input type="password" id="apiKey" placeholder="Enter API Key" />
</div>
<div id="step3" class="input-group" style="display: none">
<label for="customEndpoint">Custom Endpoint URL</label>
<input type="text" id="customEndpoint" placeholder="Enter Custom Endpoint URL" />
</div>
<button id="nextStep" disabled>Next</button>
</div>
<div id="dashboard" class="container">
<div class="input-group">
<label for="selectedModel">Selected Model</label>
<input type="text" id="selectedModel" readonly />
</div>
<button id="fetchModels">Fetch Available Models</button>
<div id="modelsList" class="models-list"></div>
<div class="settings-row">
<span>Dark Mode</span>
<label class="toggle-switch">
<input type="checkbox" id="darkModeToggle" checked />
<span class="toggle-slider"></span>
</label>
</div>
<div class="settings-row">
<span>Auto-fetch Models</span>
<label class="toggle-switch">
<input type="checkbox" id="autoFetchToggle" />
<span class="toggle-slider"></span>
</label>
</div>
<div class="button-group">
<button id="updateApiKey">Update API Key</button>
<button id="reset">Reset All</button>
</div>
</div>
<div id="updateApiKeyModal" class="modal">
<div class="modal-content">
<span class="close">×</span>
<h2>Update API Key</h2>
<div class="input-group">
<label for="newApiKey">New API Key</label>
<input type="password" id="newApiKey" placeholder="Enter new API Key" />
</div>
<button id="confirmUpdateApiKey" disabled>Update</button>
</div>
</div>
<script src="popup.js"></script>
</body>
</html>