-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
497 lines (489 loc) · 19.3 KB
/
index.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
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
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>GitHub Stars Semantic Search</title>
<style>
/* Base styles */
body {
margin: 0;
padding: 0;
min-height: 100vh;
background-color: #f8fafc;
}
#app {
max-width: 64rem;
margin: 0 auto;
padding: 1rem;
}
/* Section visibility */
.section-container > section {
display: none;
}
/* Only auth section visible by default */
#auth-section {
display: block;
}
/* Hidden sections */
.hidden {
display: none !important;
}
/* Critical icons styles to prevent flashing */
.text-secondary-400 {
color: rgb(148 163 184);
}
.text-primary-500 {
color: rgb(14 165 233);
}
.text-secondary-500 {
color: rgb(100 116 139);
}
.text-secondary-700 {
color: rgb(51 65 85);
}
.h-4 {
height: 1rem;
}
.w-4 {
width: 1rem;
}
.h-6 {
height: 1.5rem;
}
.w-6 {
width: 1.5rem;
}
.shrink-0 {
flex-shrink: 0;
}
/* Prevent layout shift */
[data-loading] {
visibility: hidden;
}
</style>
<script type="module" src="/src/main.ts"></script>
<script
defer
src="https://satisfied-tortoise.pikapod.net/script.js"
data-website-id="2983c79c-de19-45e8-bb50-18d5ccbf3184"
></script>
</head>
<body class="bg-secondary-50 min-h-screen" data-loading>
<div
id="app"
class="max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 py-4 sm:py-6 lg:py-8"
>
<header class="text-center mb-8 sm:mb-12">
<h1 class="text-3xl sm:text-4xl font-bold text-secondary-900 mb-2">
GitHub Stars Semantic Search
</h1>
<p class="text-sm sm:text-base text-secondary-600">
Search through your starred repositories using natural language
</p>
</header>
<main class="section-container space-y-6 sm:space-y-8">
<section
id="auth-section"
class="bg-white rounded-xl shadow-sm border border-secondary-200 p-4 sm:p-6"
>
<h2 class="text-xl sm:text-2xl font-semibold text-secondary-900 mb-4">
Authentication
</h2>
<div class="space-y-4">
<div class="flex flex-col">
<label
for="github-token"
class="text-sm font-medium text-secondary-700 mb-1"
>
GitHub Personal Access Token
</label>
<div class="relative">
<div
class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"
>
<svg
class="h-4 w-4 text-secondary-400"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="currentColor"
>
<path
fill-rule="evenodd"
d="M18 8a6 6 0 01-7.743 5.743L10 14l-1 1-1 1H6v2H2v-4l4.257-4.257A6 6 0 1118 8zm-6-4a1 1 0 100 2 2 2 0 012 2 1 1 0 102 0 4 4 0 00-4-4z"
clip-rule="evenodd"
/>
</svg>
</div>
<input
type="password"
id="github-token"
placeholder="Enter your GitHub token"
class="w-full pl-10 pr-4 py-2 border border-secondary-300 rounded-lg shadow-sm focus:ring-2 focus:ring-primary-500 focus:border-primary-500 text-sm transition-colors"
/>
<div class="absolute inset-y-0 right-0 pr-3 flex items-center">
<a
href="https://github.com/settings/tokens"
target="_blank"
class="text-primary-500 hover:text-primary-600 transition-colors"
>
<svg
class="h-4 w-4 shrink-0"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
</a>
</div>
</div>
<div
id="github-token-error"
class="text-sm text-red-600 mt-1"
></div>
<p class="mt-1 text-sm text-secondary-500">
Need a token?
<a
href="https://github.com/settings/tokens"
target="_blank"
class="text-primary-500 hover:text-primary-600 hover:underline transition-colors"
>
Generate one here
</a>
. Make sure to include the
<span class="font-mono bg-secondary-100 px-1.5 py-0.5 rounded"
>read:user</span
>
scope.
</p>
</div>
<div class="flex flex-col mt-4">
<label
for="openai-key"
class="text-sm font-medium text-secondary-700 mb-1"
>
OpenAI API Key
</label>
<div class="relative">
<div
class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"
>
<svg
class="h-4 w-4 text-secondary-400"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="currentColor"
>
<path
fill-rule="evenodd"
d="M18 8a6 6 0 01-7.743 5.743L10 14l-1 1-1 1H6v2H2v-4l4.257-4.257A6 6 0 1118 8zm-6-4a1 1 0 100 2 2 2 0 012 2 1 1 0 102 0 4 4 0 00-4-4z"
clip-rule="evenodd"
/>
</svg>
</div>
<input
type="password"
id="openai-key"
placeholder="Enter your OpenAI API key"
class="w-full pl-10 pr-4 py-2 border border-secondary-300 rounded-lg shadow-sm focus:ring-2 focus:ring-primary-500 focus:border-primary-500 text-sm transition-colors"
/>
<div class="absolute inset-y-0 right-0 pr-3 flex items-center">
<a
href="https://platform.openai.com/api-keys"
target="_blank"
class="text-primary-500 hover:text-primary-600 transition-colors"
>
<svg
class="h-4 w-4 shrink-0"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"
/>
</svg>
</a>
</div>
</div>
<div
id="openai-key-error"
class="text-sm text-red-600 mt-1"
></div>
<p class="mt-1 text-sm text-secondary-500">
Need an API key?
<a
href="https://platform.openai.com/api-keys"
target="_blank"
class="text-primary-500 hover:text-primary-600 hover:underline transition-colors"
>
Get one here
</a>
</p>
</div>
<div class="flex flex-col mt-4">
<label
for="auth-per-page"
class="text-sm font-medium text-secondary-700 mb-1"
>
Repositories Per Page
</label>
<div class="relative">
<input
type="number"
id="auth-per-page"
min="1"
max="100"
placeholder="Enter number (1-100)"
class="w-full px-3 py-2 border border-secondary-300 rounded-lg shadow-sm focus:ring-2 focus:ring-primary-500 focus:border-primary-500 text-sm transition-colors"
/>
</div>
<div id="per-page-error" class="text-sm text-red-600 mt-1"></div>
<p class="mt-1 text-sm text-amber-600">
<strong>Important:</strong> This setting cannot be changed after
initial setup due to GitHub pagination (1-100) requirements.
</p>
</div>
<button
id="auth-button"
class="w-full sm:w-auto px-6 py-2 mt-6 bg-primary-500 text-white rounded-lg hover:bg-primary-600 transition-colors font-medium flex items-center justify-center gap-2 shadow-sm"
>
<svg
class="h-4 w-4 shrink-0"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1"
/>
</svg>
Authenticate
</button>
</div>
</section>
<section
id="indexing-section"
class="hidden bg-white rounded-xl shadow-sm border border-secondary-200 p-4 sm:p-6"
>
<h2 class="text-xl sm:text-2xl font-semibold text-secondary-900 mb-4">
Indexing Progress
</h2>
<div class="space-y-2">
<div
class="w-full bg-secondary-100 rounded-full h-2.5 overflow-hidden"
>
<div
id="indexing-progress"
class="bg-primary-500 h-2.5 rounded-full transition-all duration-300"
style="width: 0%"
></div>
</div>
<div class="space-y-1">
<p
id="progress-text"
class="text-sm font-medium text-secondary-600 text-center"
>
0% - Initializing...
</p>
</div>
</div>
</section>
<section
id="search-section"
class="hidden bg-white rounded-xl shadow-sm border border-secondary-200 p-4 sm:p-6"
>
<h2 class="text-xl sm:text-2xl font-semibold text-secondary-900 mb-4">
Search Your Starred Repositories
</h2>
<div class="space-y-4">
<div class="flex flex-col sm:flex-row gap-2">
<div class="relative flex-1">
<div
class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none"
>
<svg
class="h-4 w-4 text-secondary-400"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
fill="currentColor"
>
<path
fill-rule="evenodd"
d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z"
clip-rule="evenodd"
/>
</svg>
</div>
<input
type="text"
id="search-input"
placeholder="Search repositories (e.g., 'React libraries with good documentation')"
class="w-full pl-10 pr-4 py-2 border border-secondary-300 rounded-lg shadow-sm focus:ring-2 focus:ring-primary-500 focus:border-primary-500 text-sm transition-colors"
/>
</div>
<div class="flex gap-2 sm:flex-shrink-0">
<button
id="search-button"
class="flex-1 sm:flex-none px-4 py-2 bg-primary-500 text-white rounded-lg hover:bg-primary-600 transition-colors whitespace-nowrap font-medium shadow-sm"
>
Search
</button>
<button
id="reindex-button"
class="flex-1 sm:flex-none px-4 py-2 bg-secondary-100 text-secondary-700 rounded-lg hover:bg-secondary-200 transition-colors whitespace-nowrap font-medium"
>
Reindex
</button>
<button
id="config-button"
class="w-10 sm:w-auto px-2 sm:px-4 py-2 bg-secondary-100 text-secondary-700 rounded-lg hover:bg-secondary-200 transition-colors flex items-center justify-center"
title="Configure batch settings"
>
<svg
class="w-4 h-4 shrink-0"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"
></path>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"
></path>
</svg>
</button>
</div>
</div>
<div id="search-results" class="mt-4 sm:mt-6 space-y-4"></div>
</div>
</section>
</main>
<!-- Configuration Modal - Moved outside main -->
<div
id="config-modal"
class="hidden fixed inset-0 bg-secondary-900/50 backdrop-blur-sm flex items-center justify-center z-50"
>
<div
id="config-modal-content"
class="bg-white rounded-xl p-6 max-w-md w-full mx-4 shadow-lg border border-secondary-200"
>
<div class="flex justify-between items-center mb-4">
<h3 class="text-xl font-semibold text-secondary-900">
Configuration
</h3>
<button
id="close-config-modal"
class="text-secondary-500 hover:text-secondary-700 transition-colors"
>
<svg
class="w-6 h-6"
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M6 18L18 6M6 6l12 12"
></path>
</svg>
</button>
</div>
<div class="space-y-4">
<div>
<label
for="batch-size"
class="block text-sm font-medium text-secondary-700 mb-1"
>
Batch Size
</label>
<input
type="number"
id="batch-size"
min="1"
max="50"
class="w-full px-3 py-2 border border-secondary-300 rounded-lg shadow-sm focus:ring-2 focus:ring-primary-500 focus:border-primary-500 text-sm transition-colors"
/>
<p class="mt-1 text-sm text-secondary-500">
Number of repositories to process in parallel (1-50)
</p>
</div>
<div>
<label
for="max-retries"
class="block text-sm font-medium text-secondary-700 mb-1"
>
Max Retries
</label>
<input
type="number"
id="max-retries"
min="1"
max="10"
class="w-full px-3 py-2 border border-secondary-300 rounded-lg shadow-sm focus:ring-2 focus:ring-primary-500 focus:border-primary-500 text-sm transition-colors"
/>
<p class="mt-1 text-sm text-secondary-500">
Maximum number of retry attempts (1-10)
</p>
</div>
<div class="flex justify-end mt-6">
<button
id="save-config"
class="px-4 py-2 bg-primary-500 text-white rounded-lg hover:bg-primary-600 transition-colors font-medium shadow-sm"
>
Save Changes
</button>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer class="mt-8 sm:mt-12 pb-4 sm:pb-6 text-center">
<div
class="flex items-center justify-center gap-2 text-sm text-secondary-600"
>
<span>Open Source Project</span>
<a
href="https://github.com/LuisReinoso/github-stars-semantic-search"
target="_blank"
rel="noopener noreferrer"
class="inline-flex items-center gap-1.5 text-primary-500 hover:text-primary-600 hover:underline transition-colors"
>
<svg class="w-4 h-4" fill="currentColor" viewBox="0 0 24 24">
<path
fill-rule="evenodd"
d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z"
clip-rule="evenodd"
/>
</svg>
<span>View on GitHub</span>
</a>
</div>
</footer>
</div>
</body>
</html>