blob: 2899bfcd52bdf3a1af2c39798568f084e4f0a41d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
<script lang="ts">
import { page } from '$app/stores';
</script>
<nav class="navbar">
<a href="/" class:active={$page.url.pathname === '/'}>List</a>
<a href="/catalog" class:active={$page.url.pathname === '/catalog'}>Catalog</a
>
<a href="/categories" class:active={$page.url.pathname === '/categories'}
>Categories</a
>
</nav>
<style>
.navbar {
display: flex;
gap: 0.25rem;
margin-bottom: 1.5rem;
border-bottom: 1px solid #ddd;
padding-bottom: 0.5rem;
}
.navbar a {
padding: 0.5rem 1rem;
border-radius: 0.5rem;
color: #333;
text-decoration: none;
font-size: 0.875rem;
transition: background 0.15s;
}
.navbar a:hover {
background: #f5f5f5;
}
.navbar a.active {
background: #333;
color: #fff;
}
</style>
|