Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanPaul1515 committed Oct 1, 2024
1 parent 3728326 commit ea63330
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ const { title } = Astro.props;
<script>
const themeIcon = document.getElementById('theme-icon') as HTMLImageElement;
const BigTheme = document.getElementById('big-vladi') as HTMLImageElement;
const lightImage = document.getElementById('light-image');
const darkImage = document.getElementById('dark-image');
const lightImage = document.getElementById('light-image') as HTMLImageElement | null;
const darkImage = document.getElementById('dark-image') as HTMLImageElement | null;
const switchTheme = document.querySelector(
"[data-switch-theme]"
) as HTMLButtonElement;
Expand Down Expand Up @@ -66,13 +66,12 @@ const { title } = Astro.props;
themeIcon.src = '/Icono-2024-light.png';
lightImage.style.display = 'none';
darkImage.style.display = 'block';

BigTheme.src = './Icono-des-2024-light.png';
BigTheme.src = './Icono-des-2024-light.png';
} else {
document.documentElement.classList.remove("dark");
localStorage.setItem("appTheme", "light");
themeIcon.src = '/Icono-2024-dark.png';
BigTheme.src = './Icono-des-2024-dark.png';
BigTheme.src = './Icono-des-2024-dark.png';
lightImage.style.display = 'block';
darkImage.style.display = 'none';
}
Expand All @@ -81,14 +80,14 @@ const { title } = Astro.props;
doc.classList.remove("dark");
localStorage.setItem("appTheme", "light");
themeIcon.src = '/Icono-2024-light.png';
BigTheme.src = './Icono-des-2024-light.png';
BigTheme.src = './Icono-des-2024-light.png';
lightImage.style.display = 'block';
darkImage.style.display = 'none';
} else {
doc.classList.add("dark");
localStorage.setItem("appTheme", "dark");
themeIcon.src = '/Icono-2024-dark.png';
BigTheme.src = './Icono-des-2024-dark.png';
BigTheme.src = './Icono-des-2024-dark.png';
lightImage.style.display = 'none';
darkImage.style.display = 'block';
}
Expand Down

0 comments on commit ea63330

Please sign in to comment.