💄 make darkmode standard theme when no javascript

Signed-off-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
Sindre Kjelsrud 2024-02-22 15:22:10 +01:00
parent de636d43d6
commit 791fe66ccf
Signed by: sidski
GPG key ID: D2BBDF3EDE6BA9A6
3 changed files with 34 additions and 34 deletions

View file

@ -8,9 +8,9 @@ const today = new Date();
const updateImageForTheme = () => {
const currentTheme = document.documentElement.classList.contains('dark') ? 'dark' : 'light';
githubImage.src = currentTheme === 'dark' ? '/socials/github_dark.svg' : '/socials/github_light.svg';
spotifyImage.src = currentTheme === 'dark' ? '/socials/spotify_dark.svg' : '/socials/spotify_light.svg';
webringImage.src = currentTheme === 'dark' ? '/socials/webring_dark.svg' : '/socials/webring_light.svg';
githubImage.src = currentTheme === 'dark' ? '/socials/github_light.svg' : '/socials/github_dark.svg';
spotifyImage.src = currentTheme === 'dark' ? '/socials/spotify_light.svg' : '/socials/spotify_dark.svg';
webringImage.src = currentTheme === 'dark' ? '/socials/webring_light.svg' : '/socials/webring_dark.svg';
};
updateImageForTheme();
@ -25,13 +25,13 @@ const today = new Date();
<div>Sindre Kjelsrud &copy; {today.getFullYear()}</div>
<div class="flex gap-1">
<a href="https://github.com/SindreKjelsrud" aria-label="Link to my GitHub">
<img id="githubImage" height="30" width="30" src="/socials/github_light.svg" alt="GitHub"/>
<img id="githubImage" height="30" width="30" src="/socials/github_dark.svg" alt="GitHub"/>
</a>
<a href="https://open.spotify.com/user/kjelsrud!" aria-label="Link to my Spotify">
<img id="spotifyImage" height="30" width="30" src="/socials/spotify_light.svg" alt="Spotify"/>
<img id="spotifyImage" height="30" width="30" src="/socials/spotify_dark.svg" alt="Spotify"/>
</a>
<a href="https://webring.xxiivv.com/#sid" target="_blank" rel="noopener">
<img id="webringImage" height="30" width="30" src="/socials/webring_light.svg" alt="XXIIVV webring"/>
<img id="webringImage" height="30" width="30" src="/socials/webring_dark.svg" alt="XXIIVV webring"/>
</a>
</div>
</footer>