source for sakino.kelbie.scot
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

19 lines
636 B

</section>
<script>
// This code is only used to remember theme selection between page loads
const themeSwitch = document.querySelector('.theme-switch');
themeSwitch.checked = localStorage.getItem('switchedTheme') === 'true';
themeSwitch.addEventListener('change', function(e) {
if (e.currentTarget.checked === true) {
// Add item to localstorage
localStorage.setItem('switchedTheme', 'true');
} else {
// Remove item if theme is switched back to normal
localStorage.removeItem('switchedTheme');
}
});
</script>
</body>
</html>