clove/pkviewer
web/src/routes/badges/+page.svelte
<!-- web/src/routes/badges/+page.svelte -->
<script lang="ts">
import BadgeSample from "$lib/components/BadgeSample.svelte";
import Meta from "$lib/components/Meta.svelte";
import SiteDisclosure from "$lib/components/SiteDisclosure.svelte";
// Half the anti-forgery story: every badge links here, a path nobody else controls
let { data } = $props();
</script>
<Meta
title="Badges · pkviewer"
description="What the badges on a pkviewer page mean."
path="/badges"
/>
<main class="page stack">
<header class="stack-tight">
<h1>Badges</h1>
<p class="prose">
A badge is given by pkviewer, not set by the system it appears on. It
shows only after the system has accepted it, and it can be handed back
at any time.
</p>
</header>
{#if !data.result.ok}
<p class="prose muted">
The badge list could not be loaded right now. Please try again shortly.
</p>
{:else}
<ul class="badge-glossary">
{#each data.result.value.badges as badge (badge.id)}
<li>
<BadgeSample {badge} />
<p class="muted">{badge.description}</p>
</li>
{/each}
</ul>
{/if}
<section class="prose stack-tight">
<h2>Why they cannot be faked</h2>
<p>
Anything a system can write about itself — its name, its description,
the label on a link — is ordinary text and is styled as ordinary text.
A badge is not part of a page's appearance settings, so a system
cannot restyle one, hide one, or make anything else look like one.
</p>
<p>
If something looks like a badge but does not link here, it is not one.
</p>
</section>
<SiteDisclosure />
</main>