Skip to content

Commit 02bc051

Browse files
committed
animate hamburger menu
1 parent 8c70324 commit 02bc051

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/islands/svelte/hamburger-button.svelte

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<script lang="ts">
2-
const { links }: { links: { href: string; title: string }[] } = $props();
3-
42
import { Popover } from "bits-ui";
3+
import { fade } from "svelte/transition";
4+
5+
const { links }: { links: { href: string; title: string }[] } = $props();
56
</script>
67

78
<Popover.Root>
@@ -29,7 +30,10 @@
2930
</Popover.Trigger>
3031

3132
<Popover.Content align="end" side="bottom" strategy="fixed">
32-
<div class="w-[100vw] bg-white transition-opacity duration-300 lg:hidden">
33+
<div
34+
transition:fade|global={{ duration: 70 }}
35+
class="w-[100vw] bg-white transition-opacity duration-300 lg:hidden"
36+
>
3337
<ul>
3438
{#each links as link}
3539
<li class="hover:bg-gray-200">

0 commit comments

Comments
 (0)