blob: 9b488bd1ea6c6b6ed7b520cdd94334e944ccf2c1 (
plain)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
<script lang="ts">
import { onMount } from "svelte";
import Header from "$lib/components/Header.svelte";
import Footer from "$lib/components/Footer.svelte";
import favicon from "$lib/assets/favicon.svg";
import "$lib/styles/global.css";
let { children } = $props();
onMount(() => {
const loadFonts = () => {
if (document.querySelector('link[data-app-fonts="true"]')) return;
const link = document.createElement("link");
link.rel = "stylesheet";
link.href =
"https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap";
link.setAttribute("data-app-fonts", "true");
document.head.appendChild(link);
};
const loadAnalytics = () => {
if (document.querySelector('script[data-goatcounter-script="true"]'))
return;
const script = document.createElement("script");
script.src = "https://stats.wsap.dev/count.js";
script.async = true;
script.defer = true;
script.setAttribute("data-goatcounter", "https://stats.wsap.dev/count");
script.setAttribute("data-goatcounter-script", "true");
document.head.appendChild(script);
};
const runDeferredLoads = () => {
loadFonts();
loadAnalytics();
};
if (document.readyState === "complete") {
window.setTimeout(runDeferredLoads, 0);
return;
}
window.addEventListener("load", runDeferredLoads, { once: true });
return () => window.removeEventListener("load", runDeferredLoads);
});
</script>
<svelte:head>
<link rel="icon" href={favicon} />
</svelte:head>
<Header title="Berke Güzel" description="Super. Bad. Code." />
<main class="container">
{@render children()}
</main>
<Footer />
|