Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions layouts/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@ <h1 class="text-5xl font-medium">{{ .Title }}</h1>
{{ with .Params.description }}
<p class="text-xl md:text-2xl">{{ . | markdownify }}</p>
{{ end }}
<form class="flex flex-row items-center border border-white rounded-md px-6 gap-6 w-full md:w-4/5 bg-redis-ink-900" action="/chat">
<div class="flex flex-row items-center border border-white rounded-md px-6 gap-6 w-full md:w-4/5 bg-redis-ink-900 cursor-pointer" id="search-trigger-home">
<label class="" for="search-home" id="search-label-home">
{{ partial "icons/search.html" }}
</label>
<input id="seach-home" name="q" class="appearance-none bg-transparent text-base sm:text-lg text-white placeholder-white w-full h-16 focus:outline-none"
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
placeholder="Ask our AI-powered Redis copilot a question…" maxlength="500" type="text" value="" tabindex=""/>
<!--<input type="submit" class="hover:text-redis-pen-300" value="&#x23CE;"/>-->
<input class="invisible" type="submit" class="hover:text-redis-pen-300" value=""/>
</form>
<div class="appearance-none bg-transparent text-base sm:text-lg text-white placeholder-white w-full h-16 flex items-center"
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false">
Search Redis documentation…
</div>
</div>
</div>
</header>
{{ partial "second-header.html" "disabled" }}
Expand Down
20 changes: 19 additions & 1 deletion layouts/partials/search-modal.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@
<path d="M10 10l5.09-5.09L10 10l5.09 5.09L10 10zm0 0L4.91 4.91 10 10l-5.09 5.09L10 10z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" />
</svg>
</button>
<button id="ai-copilot-toggle" type="button" style="height: calc(3rem - 2px);" class="group px-3 border border-redis-pen-800 rounded-md bg-white flex items-center gap-2" title="Switch to AI chat">
<svg width="16" height="16" viewBox="0 0 16 16" fill="none">
<!-- Larger plus in top left -->
<path class="transform origin-center transition-transform duration-300 group-hover:scale-50" d="M3 2h2v2h2v2h-2v2h-2v-2h-2v-2h2v-2z" fill="#FF4438"/>
<!-- Smaller plus in bottom right -->
<path class="transform origin-center transition-transform duration-300 group-hover:scale-150" d="M11 9h1v1h1v1h-1v1h-1v-1h-1v-1h1v-1z" fill="#FF4438"/>
</svg>
<span class="text-sm">AI</span>
</button>
<select id="search-select" style="height: calc(3rem - 2px);" class="w-2/5 pl-3 grow-0 border border-redis-pen-800 rounded-md search-filter bg-white text-left pr-8 appearance-none hidden md:block" autocomplete="off">
<option value="all" selected>All products</option>
<option value="rs">Redis Enterprise</option>
Expand Down Expand Up @@ -369,10 +378,19 @@

// Click handler function
function clickHandler(event) {
if (event.target.closest('#search-button')) {
if (event.target.closest('#search-button') || event.target.closest('#search-trigger-home')) {
startSearch()
} else if (event.target.closest('#search-cancel') || event.target.matches('#search-container')) {
stopSearch()
} else if (event.target.closest('#ai-copilot-toggle')) {
// Get the current search query
const searchQuery = searchInput.value.trim()
// Redirect to chat with the query
if (searchQuery) {
window.location.href = `/chat?q=${encodeURIComponent(searchQuery)}`
} else {
window.location.href = '/chat'
}
}
}

Expand Down