diff --git a/src/routes/posts/index.svelte b/src/routes/posts/index.svelte index cc1b8e3..aca80ec 100644 --- a/src/routes/posts/index.svelte +++ b/src/routes/posts/index.svelte @@ -1,5 +1,5 @@ @@ -36,14 +53,29 @@

Posts

-
- - + {#if tags} +
+ {#each tags as tag} +
toggle(tag)}> + {tag} +
+ {/each} +
+ {/if}
- {#each posts.slice(1) as post (post.title)} - + {#if !selectedTags.length || selectedTags.find(tag => posts[0].categories.includes(tag))} + + +
+ {/if} + + + {#each filteredPosts as post (post.title)} +
+ +
{/each}
@@ -53,6 +85,27 @@ max-width: 700px; padding: 0 20px; } + .tags { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; + } + .dark .tag { + background: rgb(77, 77, 77); + } + .tag { + background:rgb(173, 173, 173); + padding: 5px 10px; + border-radius: 99px; + cursor: pointer; + user-select: none; + } + .dark .tag.selected { + background: rgb(0, 108, 170); + } + .tag.selected { + background: rgb(0, 162, 255); + } h1 { margin: 0; padding: 0;