Preload fonts

This commit is contained in:
2022-07-26 23:41:13 +02:00
parent 131ba697ac
commit d67eade6fb

View File

@@ -17,6 +17,16 @@
export let data: any export let data: any
export let count: any export let count: any
// Fonts to preload
const fonts = [
'G-Light',
'G-Regular',
'G-Medium',
'G-Semibold',
'J-Extralight',
'J-Light',
]
// Set global data // Set global data
setContext('global', { setContext('global', {
...data, ...data,
@@ -50,6 +60,12 @@
}) })
</script> </script>
<svelte:head>
{#each fonts as font}
<link rel="preload" href="/fonts/{font}.woff2" as="font" type="font/woff2" crossorigin="anonymous">
{/each}
</svelte:head>
<Switcher isOver={!!$page.params.location && !!$page.params.photo} /> <Switcher isOver={!!$page.params.location && !!$page.params.photo} />