function changeScreen(state) {
    if (state == "showForm") {
      // Show form and hide buttons
      changeView(
        [
          "email",
          "email-label",
          "password",
          "password-label",
          "close",
          "account-link"
        ],
        "show"
      );
      document.getElementById("signup-button").classList.add("submitButton");
      document.getElementById("login-button").classList.add("submitButton");
    } else {
      // otherwise, hide form and show buttons
      changeView([
        "email",
        "email-label",
        "password",
        "password-label",
        "close",
        "account-link",
        "reset"
      ]);
      changeView(["signup-button", "login-button"], "show");
      showLoginForm = false;
      showSignupForm = false;
      changeText("login-button", "Log In");
      changeText("error", "");
      document.getElementById("signup-button").classList.remove("submitButton");
      document.getElementById("login-button").classList.remove("submitButton");
    }
  }
// Switch to login or signup screen
Switch to login or signup screen
Switch to login or signup screen
function changeScreen(state) {
    if (state == "showForm") {
      changeView(
        [
          "email",
          "email-label",
          "password",
          "password-label",
          "close",
          "account-link"
        ],
        "show"
      );
      document.getElementById("signup-button").classList.add("submitButton");
      document.getElementById("login-button").classList.add("submitButton");
    } else {
      changeView([
        "email",
        "email-label",
        "password",
        "password-label",
        "close",
        "account-link",
        "reset"
      ]);
      changeView(["signup-button", "login-button"], "show");
      showLoginForm = false;
      showSignupForm = false;
      changeText("login-button", "Log In");
      changeText("error", "");
      document.getElementById("signup-button").classList.remove("submitButton");
      document.getElementById("login-button").classList.remove("submitButton");
    }
  }
function changeScreen ( state ) { if ( state == "showForm" ) { changeView ( [ "email" , "email-label" , "password" , "password-label" , "close" , "account-link" ] , "show" ) ; document . getElementById ( "signup-button" ) . classList . add ( "submitButton" ) ; document . getElementById ( "login-button" ) . classList . add ( "submitButton" ) ; } else { changeView ( [ "email" , "email-label" , "password" , "password-label" , "close" , "account-link" , "reset" ] ) ; changeView ( [ "signup-button" , "login-button" ] , "show" ) ; showLoginForm = false ; showSignupForm = false ; changeText ( "login-button" , "Log In" ) ; changeText ( "error" , "" ) ; document . getElementById ( "signup-button" ) . classList . remove ( "submitButton" ) ; document . getElementById ( "login-button" ) . classList . remove ( "submitButton" ) ; } }
Switch to login or signup screen
Switch to login or signup screen
// Show form and hide buttons // otherwise, hide form and show buttons