Open History to see the last commit
1<script lang="ts">
2 import { Menu, X, Home, Guitar } from 'lucide-svelte'
3
4 let isOpen = $state(false)
5</script>
6
7<header class="p-4 flex items-center bg-gray-800 text-white shadow-lg">
8 <button
9 onclick={() => (isOpen = true)}
10 class="p-2 hover:bg-gray-700 rounded-lg transition-colors"
11 aria-label="Open menu"
12 >
13 <Menu size={24} />
14 </button>
15 <h1 class="ml-4 text-xl font-semibold">
16 <a href="/">
17 <img
18 src="/tanstack-word-logo-white.svg"
19 alt="TanStack Logo"
20 class="h-10"
21 />
22 </a>
23 </h1>
24</header>
25
26<aside
27 class={`fixed top-0 left-0 h-full w-80 bg-gray-900 text-white shadow-2xl z-50 transform transition-transform duration-300 ease-in-out flex flex-col ${
28 isOpen ? 'translate-x-0' : '-translate-x-full'
29 }`}
30>
31 <div class="flex items-center justify-between p-4 border-b border-gray-700">
32 <h2 class="text-xl font-bold">Navigation</h2>
33 <button
34 onclick={() => (isOpen = false)}
35 class="p-2 hover:bg-gray-800 rounded-lg transition-colors"
36 aria-label="Close menu"
37 >
38 <X size={24} />
39 </button>
40 </div>
41
42 <nav class="flex-1 p-4 overflow-y-auto">
43 <a
44 href="/"
45 onclick={() => (isOpen = false)}
46 class="flex items-center gap-3 p-3 rounded-lg hover:bg-gray-800 transition-colors mb-2"
47 >
48 <Home size={20} />
49 <span class="font-medium">Home</span>
50 </a>
51
52 <hr class="my-2 border-gray-700" />
53
54 <a
55 href="/example/guitars"
56 onclick={() => (isOpen = false)}
57 class="flex items-center gap-3 p-3 rounded-lg hover:bg-gray-800 transition-colors mb-2"
58 >
59 <Guitar size={20} />
60 <span class="font-medium">Guitar Demo</span>
61 </a>
62 </nav>
63</aside>