parent
cfc51f04c3
commit
9acf6df1af
Before Width: | Height: | Size: 186 B |
Before Width: | Height: | Size: 172 B |
@ -1,13 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en" class="bg-primary text-words">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
||||||
<link rel="stylesheet" href="out/bundle.css">
|
|
||||||
<title>Stealing posts from Nyafuu</title>
|
|
||||||
</head>
|
|
||||||
<body class="max-w-4xl mx-auto px-4 my-8 color-text">
|
|
||||||
<script src="out/bundle.js"></script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,36 +0,0 @@
|
|||||||
<script>
|
|
||||||
import {onMount} from 'svelte';
|
|
||||||
export let themes;
|
|
||||||
|
|
||||||
let theme;
|
|
||||||
let themeSelect;
|
|
||||||
|
|
||||||
let html = document.querySelector('html');
|
|
||||||
let baseTheme = 'default';
|
|
||||||
|
|
||||||
function toggleTheme() {
|
|
||||||
html.classList.toggle(theme);
|
|
||||||
}
|
|
||||||
|
|
||||||
function handle_theme() {
|
|
||||||
toggleTheme();
|
|
||||||
theme = themeSelect.value
|
|
||||||
toggleTheme();
|
|
||||||
|
|
||||||
localStorage.setItem('theme', theme);
|
|
||||||
}
|
|
||||||
|
|
||||||
onMount(() => {
|
|
||||||
theme = localStorage.getItem('theme') || baseTheme;
|
|
||||||
html.classList.toggle(theme);
|
|
||||||
|
|
||||||
themeSelect = document.querySelector('#theme-select');
|
|
||||||
themeSelect.value = theme;
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<select id="theme-select" class="float-right bg-nav border-1 border-secondary text-nav-link w-1/5" on:change={handle_theme} >
|
|
||||||
{#each themes as theme}
|
|
||||||
<option value={theme} >{theme}</option>
|
|
||||||
{/each}
|
|
||||||
</select>
|
|
Loading…
Reference in new issue