blob: eba2e91bdb4e35b4db9671e81ca1623c9938560d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
<script lang="ts">
import PhSunBold from "virtual:icons/ph/sun-bold";
import PhMoonStarsBold from "virtual:icons/ph/moon-stars-bold";
import { t } from "$lib/translations";
import { theme } from "$lib/store";
let dark = () => {
$theme = $theme === "dark" ? "light" : "dark";
document.cookie = `theme=${$theme}; path=/; max-age=21000000`;
};
</script>
<button class="flex justify-center items-center hover:opacity-80 gap-2 font-bold whitespace-nowrap" onclick={dark}>
{#if $theme === "dark"}
<PhSunBold width="32" />
{:else}
<PhMoonStarsBold width="32" />
{/if}
{$t(`nav.${$theme === "dark" ? "light" : "dark"}`)}
</button>
|