jk.nipponalba.scot website https://jk.nipponalba.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.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

18 lines
621 B

5 years ago
5 years ago
5 years ago
  1. <script>
  2. // This code is only used to remember theme selection between page loads
  3. const themeSwitch = document.querySelector('.theme-switch');
  4. themeSwitch.checked = localStorage.getItem('switchedTheme') === 'true';
  5. themeSwitch.addEventListener('change', function(e) {
  6. if (e.currentTarget.checked === true) {
  7. // Add item to localstorage
  8. localStorage.setItem('switchedTheme', 'true');
  9. } else {
  10. // Remove item if theme is switched back to normal
  11. localStorage.removeItem('switchedTheme');
  12. }
  13. });
  14. </script>
  15. </body>
  16. </html>