~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0
32 lines · 1.1 KB Raw History
<script lang="ts">
  import type { Snippet } from 'svelte';
  /**
   * A page on its own, without the site's header and footer, as an app's
   * request is approved on: one card over the host's background
   * (`backgrounds`, by colour scheme, either standing in for the other),
   * its top (`top`: whose host it is, and who is signed in), what it
   * holds, and its foot (`foot`), set apart, when there is one.
   */
  let {
    backgrounds = {},
    top,
    foot,
    children
  }: {
    backgrounds?: { light?: string; dark?: string };
    top: Snippet;
    foot?: Snippet;
    children: Snippet;
  } = $props();
  const light = $derived(backgrounds.light ? 'light' : backgrounds.dark ? 'dark' : null);
  const dark = $derived(backgrounds.dark ? 'dark' : light);
  const url = (scheme: string | null) => (scheme ? `url(/img/background-${scheme})` : null);
</script>

<main class="alone" style:--backdrop-light={url(light)} style:--backdrop-dark={url(dark)}>
  <section class="card stack alone-card">
    <div class="alone-top">{@render top()}</div>
    {@render children()}
    {#if foot}<div class="alone-foot">{@render foot()}</div>{/if}
  </section>
</main>