Skip to content

Commit

Permalink
closes #36
Browse files Browse the repository at this point in the history
  • Loading branch information
willpinha committed Jan 10, 2024
1 parent f4d9f1c commit f540e0d
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 5 deletions.
24 changes: 24 additions & 0 deletions src/components/AllTags.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<script lang="ts">
import TagExamples from "./TagExamples.svelte";
import { getTags } from "../utils/collection";
const tags: string[] = getTags();
</script>

<div class="flex flex-col gap-8">
<div class="flex items-center gap-2">
<a href="/" class="btn btn-ghost px-3">
<span class="hidden">Get back</span>

<i class="fa-solid fa-arrow-left-long text-2xl"></i>
</a>

<h1 class="text-3xl font-bold text-primary">All tags</h1>
</div>

<div class="flex flex-col gap-20">
{#each tags as tag}
<TagExamples {tag} withArrow={false} smallTitle />
{/each}
</div>
</div>
1 change: 1 addition & 0 deletions src/components/Filter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
🌸 You can find
<span class="badge badge-accent badge-outline badge-sm">{numExamples}</span> UI examples in
<span class="badge badge-accent badge-outline badge-sm">{tags.length}</span> tags!
<a href="/all" class="link link-accent">See all here</a>
</div>

<label for="filter" class="flex relative items-center">
Expand Down
14 changes: 9 additions & 5 deletions src/components/TagExamples.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,23 @@
import Preview from "../components/Preview.svelte";
export let tag: string;
export let withArrow: boolean = true;
export let smallTitle: boolean = false;
const examples = collection[tag];
</script>

<div class="flex flex-col gap-8">
<div class="flex items-center gap-2">
<a href="/" class="btn btn-ghost px-3">
<span class="hidden">Get back</span>
{#if withArrow}
<a href="/" class="btn btn-ghost px-3">
<span class="hidden">Get back</span>

<i class="fa-solid fa-arrow-left-long text-2xl"></i>
</a>
<i class="fa-solid fa-arrow-left-long text-2xl"></i>
</a>
{/if}

<h1 class="text-3xl font-bold text-primary">#{tag}</h1>
<h1 class="text-3xl font-bold text-primary" class:text-xl={smallTitle}>#{tag}</h1>
</div>

<ul class="timeline timeline-snap-icon timeline-compact timeline-vertical">
Expand Down
14 changes: 14 additions & 0 deletions src/pages/all.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
import Page from "../layout/Page.astro";
import Navbar from "../components/Navbar.svelte";
import Content from "../layout/Content.astro";
import AllTags from "../components/AllTags.svelte";
---

<Page title="All">
<Navbar />

<Content>
<AllTags />
</Content>
</Page>

0 comments on commit f540e0d

Please sign in to comment.