Skip to content

Commit b743696

Browse files
committed
search dropdown
1 parent 59ef277 commit b743696

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

hugo_stats.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,12 @@
172172
"bg-blue-500",
173173
"bg-gradient-to-br",
174174
"bg-gradient-to-r",
175+
"bg-gray-0",
175176
"bg-gray-100",
177+
"bg-gray-100t",
176178
"bg-gray-400",
177179
"bg-gray-50",
180+
"bg-gray-50/2",
178181
"bg-gray-700",
179182
"bg-green-400",
180183
"bg-green-500",
@@ -188,11 +191,13 @@
188191
"block",
189192
"border",
190193
"border-0",
194+
"border-1",
191195
"border-b",
192196
"border-b-4",
193197
"border-blue",
194198
"border-blue-300",
195199
"border-divider-light",
200+
"border-gray-100",
196201
"border-gray-200",
197202
"border-gray-400",
198203
"border-green-400",
@@ -240,7 +245,10 @@
240245
"dark:border-b-blue-600",
241246
"dark:border-divider-dark",
242247
"dark:border-gray-400",
248+
"dark:border-gray-600",
243249
"dark:border-gray-700",
250+
"dark:border-gray-800",
251+
"dark:border-gray-900",
244252
"dark:border-green-400",
245253
"dark:border-l-magenta-dark",
246254
"dark:fill-blue-300",
@@ -293,7 +301,9 @@
293301
"focus:outline-none",
294302
"focus:ring-3-blue-light",
295303
"font-bold",
304+
"font-light",
296305
"font-medium",
306+
"font-mediux",
297307
"font-normal",
298308
"font-semibold",
299309
"footnote-backref",
@@ -551,8 +561,11 @@
551561
"text-gray-300",
552562
"text-gray-400",
553563
"text-gray-500",
564+
"text-gray-600",
554565
"text-gray-700",
555566
"text-gray-800",
567+
"text-gray-950",
568+
"text-gray-9700",
556569
"text-left",
557570
"text-lg",
558571
"text-magenta-light",

layouts/partials/search-bar.html

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -31,31 +31,25 @@
3131
{{ partial "utils/svg.html" "/icons/search.svg" }}
3232
</span>
3333
</div>
34-
<div
35-
id="search-bar-dropdown"
36-
x-show="open"
37-
x-cloak
38-
x-ref="dropdown"
39-
x-init="$nextTick(() => {
40-
if (open) {
34+
<div id="search-bar-dropdown" x-show="open" x-cloak x-ref="dropdown" x-init="$nextTick(() => {
35+
if (open) {
4136
const containerRect = document.getElementById('search-bar-container').getBoundingClientRect();
4237
const rect = $refs.searchBarRef.getBoundingClientRect();
4338
$el.style.top = (rect.bottom + window.scrollY + 9) + 'px';
44-
$el.style.left = (containerRect.right - Math.max(rect.width, 400)) + 'px';
45-
$el.style.width = Math.max(rect.width, 400) + 'px';
39+
$el.style.left = (containerRect.right - 500) + 'px';
40+
$el.style.width = '500px';
4641
}
47-
})"
48-
x-effect="if (open) {
49-
const containerRect = document.getElementById('search-bar-container').getBoundingClientRect();
50-
const rect = $refs.searchBarRef.getBoundingClientRect();
51-
$el.style.top = (rect.bottom + window.scrollY + 9) + 'px';
52-
$el.style.left = (containerRect.right - Math.max(rect.width, 400)) + 'px';
53-
$el.style.width = Math.max(rect.width, 400) + 'px';
54-
}"
55-
class="bg-background-light dark:bg-background-dark fixed z-[999] max-w-xl rounded-sm px-6 py-4 shadow-lg"
56-
>
42+
})" x-effect="if (open) {
43+
const containerRect = document.getElementById('search-bar-container').getBoundingClientRect();
44+
const rect = $refs.searchBarRef.getBoundingClientRect();
45+
$el.style.top = (rect.bottom + window.scrollY + 9) + 'px';
46+
$el.style.left = (containerRect.right - 500) + 'px';
47+
$el.style.width = '500px';
48+
}"
49+
class="font-medium text-gray-400 dark:text-gray-200 bg-gray-50 dark:bg-gray-900 rounded-sm mt-1 border-1 border-gray-100 dark:border-gray-700 fixed z-[999] max-w-xl p-6 shadow-md">
5750
<div id="search-bar-results">
58-
{{- $emptyState := `<div class="p-2 text-gray-500 dark:text-gray-400">Start typing to search or try <button onclick="askAI('search-bar-input')" class="link">Ask AI</button></div>` }}
51+
{{- $emptyState := `<div>Start typing to search or try <button onclick="askAI('search-bar-input')" class="link">Ask
52+
AI</button>.</div>` }}
5953
{{- $emptyState | safe.HTML }}
6054
<!-- results -->
6155
</div>

0 commit comments

Comments
 (0)