🔥 Remove lightmode
Signed-off-by: SindreKjelsrud <sindre@kjelsrud.dev>
This commit is contained in:
parent
15b78a4e3e
commit
c0260b813b
8 changed files with 11 additions and 222 deletions
|
@ -7,22 +7,6 @@ type Props = CollectionEntry<'blog'>['data'];
|
|||
|
||||
const { title, description, pubDate } = Astro.props;
|
||||
---
|
||||
<script type="module" client:load>
|
||||
const jollyroger = document.getElementById('jr');
|
||||
|
||||
const updateImageForTheme = () => {
|
||||
const currentTheme = document.documentElement.classList.contains('dark') ? 'dark' : 'light';
|
||||
jollyroger.src = currentTheme === 'dark' ? '/img/jollyroger_dark.svg' : '/img/jollyroger_light.svg';
|
||||
};
|
||||
|
||||
updateImageForTheme();
|
||||
|
||||
const themeToggle = document.getElementById('themeToggle');
|
||||
if (themeToggle) {
|
||||
themeToggle.addEventListener('click', updateImageForTheme);
|
||||
}
|
||||
</script>
|
||||
|
||||
<BlogContainer>
|
||||
<main class="flex flex-col flex-1 mb-auto break-words mt-4">
|
||||
<article class="flex flex-col gap-1">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue