💄 make darkmode standard theme when no javascript
Signed-off-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
parent
de636d43d6
commit
791fe66ccf
3 changed files with 34 additions and 34 deletions
|
|
@ -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 © {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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue