Loggest thine Stuff
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
846 B

  1. <script lang="ts" context="module">
  2. import type { Load } from "@sveltejs/kit/types/internal";
  3. export const load: Load = async({ fetch, session, url }) => {
  4. if (session.user == null && !url.pathname.startsWith("/login")) {
  5. return { status: 302, redirect: "/login" };
  6. }
  7. return { props: {} };
  8. }
  9. </script>
  10. <script lang="ts">
  11. import { page } from "$app/stores";
  12. import Background from "$lib/components/layout/Background.svelte"
  13. import TimeContext from "$lib/components/contexts/TimeContext.svelte";
  14. import ModalContext from "$lib/components/contexts/ModalContext.svelte";
  15. let opacity = 0.175;
  16. $: opacity = $page.url.pathname === "/" ? 0.3 : 0.2;
  17. </script>
  18. <ModalContext>
  19. <TimeContext>
  20. <Background initialOrientation="landscape" opacity={opacity} />
  21. <slot></slot>
  22. </TimeContext>
  23. </ModalContext>