Skip to content

Commit

Permalink
Update script.js
Browse files Browse the repository at this point in the history
  • Loading branch information
FaDiiiLeo committed May 22, 2022
1 parent 38b8175 commit 00e6c01
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scripts/script.js
Expand Up @@ -5,15 +5,15 @@ let themeValue = 1;
function lastSelectedTheme(){
themeValue = localStorage.getItem('selectedTheme');
if(themeValue === '1'){
themeStyleSheet.href = '/styles/themes/theme-1.css';
themeStyleSheet.href = 'styles/themes/theme-1.css';
themeSelector.value = localStorage.getItem('toggleValue');
}
else if(themeValue === '2'){
themeStyleSheet.href = '/styles/themes/theme-2.css';
themeStyleSheet.href = 'styles/themes/theme-2.css';
themeSelector.value = localStorage.getItem('toggleValue');
}
else if(themeValue === '3'){
themeStyleSheet.href = '/styles/themes/theme-3.css';
themeStyleSheet.href = 'styles/themes/theme-3.css';
themeSelector.value = localStorage.getItem('toggleValue');
}
}
Expand All @@ -23,13 +23,13 @@ function selectTheme(){
themeSelector.addEventListener('input',function(){
themeValue = themeSelector.value;
if(themeValue === '1'){
themeStyleSheet.href = '/styles/themes/theme-1.css';
themeStyleSheet.href = 'styles/themes/theme-1.css';
}
else if(themeValue === '2'){
themeStyleSheet.href = '/styles/themes/theme-2.css';
themeStyleSheet.href = 'styles/themes/theme-2.css';
}
else if(themeValue === '3'){
themeStyleSheet.href = '/styles/themes/theme-3.css';
themeStyleSheet.href = 'styles/themes/theme-3.css';
}
if (typeof(Storage) !== 'undefined') {
localStorage.setItem('selectedTheme', themeValue);
Expand All @@ -40,4 +40,4 @@ function selectTheme(){
})
}

selectTheme();
selectTheme();

1 comment on commit 00e6c01

@FaDiiiLeo
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed '/' from the href in js file

Please sign in to comment.