function themeButton() {
  slider.addEventListener("change", function (e) {
    if (this.checked) {
      theme.theme = "dark";
      localStorage.setItem("checked", true);
    } else {
      theme.theme = "light";
      localStorage.setItem("checked", false);
    }
    localStorage.setItem("theme", theme.theme);
  });
}
// function to change theme and save it to local storage
function to change theme and save it to local storage
function to change theme and save it to local storage
function themeButton() {
  slider.addEventListener("change", function (e) {
    if (this.checked) {
      theme.theme = "dark";
      localStorage.setItem("checked", true);
    } else {
      theme.theme = "light";
      localStorage.setItem("checked", false);
    }
    localStorage.setItem("theme", theme.theme);
  });
}
function themeButton ( ) { slider . addEventListener ( "change" , function ( e ) { if ( this . checked ) { theme . theme = "dark" ; localStorage . setItem ( "checked" , true ) ; } else { theme . theme = "light" ; localStorage . setItem ( "checked" , false ) ; } localStorage . setItem ( "theme" , theme . theme ) ; } ) ; }
function to change theme and save it to local storage
function to change theme and save it to local storage