|
31 | 31 | {{ partial "utils/svg.html" "/icons/search.svg" }} |
32 | 32 | </span> |
33 | 33 | </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) { |
41 | 36 | const containerRect = document.getElementById('search-bar-container').getBoundingClientRect(); |
42 | 37 | const rect = $refs.searchBarRef.getBoundingClientRect(); |
43 | 38 | $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'; |
46 | 41 | } |
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"> |
57 | 50 | <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>` }} |
59 | 53 | {{- $emptyState | safe.HTML }} |
60 | 54 | <!-- results --> |
61 | 55 | </div> |
|
0 commit comments