aboutsummaryrefslogtreecommitdiff
path: root/src/routes/+error.svelte
blob: f822d52140e85c0af8afebc184fdf1f55b7f8d6a (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
<script lang="ts">
  import { page } from '$app/stores';
  import { closest } from '$lib/Error/path';
  import Popup from '$lib/Layout/Popup.svelte';

  $: suggestion = closest($page.url.pathname.replace('/', ''), [
    'birthdays',
    'completed',
    'schedule',
    'hololive',
    'settings',
    'tools',
    'updates',
    'user',
    'wrapped'
  ]);
</script>

<Popup>
  <p style="text-align: center;">
    <a href={$page.url.pathname}>{$page.url.pathname}</a> not found
  </p>

  <blockquote style="margin: 0 0 0 1.5rem;">
    Did you mean "<a
      href={suggestion}
      style={suggestion === '...' ? 'pointer-events: none; color: inherit;' : ''}
      >{suggestion.charAt(0).toUpperCase() + suggestion.slice(1)}</a
    >"?
  </blockquote>
</Popup>