I've used typescript for 30 minutes and I already love it

This commit is contained in:
Eclypsed
2024-01-21 23:51:15 -05:00
parent ae8f030afb
commit 266a805ac0
12 changed files with 1411 additions and 10 deletions

31
src/routes/+layout.svelte Normal file
View File

@@ -0,0 +1,31 @@
<script lang="ts">
import '../app.css'
import '@fortawesome/fontawesome-free/css/all.min.css'
import AlertBox from '$lib/components/util/alertBox.svelte'
import { newestAlert, backgroundImage, pageWidth } from '$lib/stores'
import { fade } from 'svelte/transition'
let alertBox: AlertBox
$: if ($newestAlert !== null && alertBox) alertBox.addAlert(...$newestAlert)
</script>
<svelte:window bind:innerWidth={$pageWidth} />
<div class="no-scrollbar relative font-notoSans text-white">
<div class="fixed isolate -z-10 h-full w-screen bg-black">
<div id="background-gradient" class="absolute z-10 h-1/2 w-full bg-cover" />
{#key $backgroundImage}
<img id="background-image" src={$backgroundImage} alt="" class="absolute h-1/2 w-full object-cover blur-lg" transition:fade={{ duration: 1000 }} />
{/key}
</div>
<slot />
<AlertBox bind:this={alertBox} />
</div>
<style>
#background-gradient {
background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), black);
}
#background-image {
mask-image: linear-gradient(to bottom, black, rgba(0, 0, 0, 0.3));
}
</style>