File size: 589 Bytes
e8a6c67
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<script lang="ts">
  import type { Citation } from '$lib/types/claim';
  import { citations } from '$lib/stores/citations.svelte';

  interface Props { c: Citation; }
  let { c }: Props = $props();

  function activate(e: MouseEvent) {
    e.preventDefault();
    citations.active = c.id;
    const el = document.getElementById(`cite-${c.id}`);
    el?.scrollIntoView({ block: 'center', behavior: 'smooth' });
  }
</script>

<a
  href="#cite-{c.id}"
  class="inline-cite"
  data-cite={c.id}
  onclick={activate}
  aria-label="Citation {c.n}: {c.source}, {c.title}"
><sup>[{c.n}]</sup></a>