This commit is contained in:
2024-11-24 22:57:21 +01:00
parent bbf13cf203
commit 72933a46d1
48 changed files with 752 additions and 450 deletions

View File

@@ -32,7 +32,7 @@
pagefind.init();
});
let results: PagefindDocument[] = [];
let results: PagefindDocument[] = $state([]);
async function search(e: KeyboardEvent) {
if (e.target instanceof HTMLInputElement) {
@@ -42,13 +42,17 @@
}
}
export let open = false;
interface Props {
open?: boolean;
}
let { open = $bindable(false) }: Props = $props();
</script>
<button transition:fade class="fixed top-0 left-0 w-screen h-screen backdrop-blur z-20 cursor-default" on:click={() => open = false}>
<button transition:fade class="fixed top-0 left-0 w-screen h-screen backdrop-blur z-20 cursor-default" onclick={() => open = false}>
</button>
<div transition:slide style="width: min(100%, 75em);" class="fixed top-0 left-1/2 -translate-x-1/2 h-2/3 dark:bg-zinc-900 rounded-b-2xl shadow-2xl z-30 p-4 text-white flex flex-col">
<input placeholder="Search..." on:keypress={search}>
<input placeholder="Search..." onkeypress={search}>
<div class="overflow-y-scroll flex-1 w-full mt-2 rounded-2xl">
{#each results as result}