diff --git a/frontend/webpage/login.html b/frontend/webpage/login.html index 64fd570..73305bb 100644 --- a/frontend/webpage/login.html +++ b/frontend/webpage/login.html @@ -27,7 +27,7 @@
-
Create Account
+
Create Account >
Login

WARNING! The security of this project is questionable at best. Please refrain from using any truly sensitive data.

diff --git a/frontend/webpage/scripts/login.js b/frontend/webpage/scripts/login.js index 7096ca8..74a8b6a 100644 --- a/frontend/webpage/scripts/login.js +++ b/frontend/webpage/scripts/login.js @@ -31,11 +31,17 @@ window.addEventListener("load", (loadEvent) => { if (!frozen) { fields.username.style.display = "block"; fields.confirm.style.display = "block"; - login.style.display = "none"; header.textContent = "Create User"; + login.style.flexGrow = "0"; + login.textContent = "< Login"; + createUser.style.flexGrow = "1"; + createUser.textContent = "Create User"; createUser.removeEventListener("click", switchToCreateAction); createUser.addEventListener("click", createUserAction); + + login.removeEventListener("click", loginAction); + login.addEventListener("click", switchToLoginAction); } }; const createUserAction = (clickEvent) => { @@ -82,6 +88,23 @@ window.addEventListener("load", (loadEvent) => { }; createUser.addEventListener("click", switchToCreateAction); + const switchToLoginAction = (clickEvent) => { + if (!frozen) { + fields.username.style.display = "none"; + fields.confirm.style.display = "none"; + header.textContent = "Login"; + login.style.flexGrow = "1" + login.textContent = "Login"; + createUser.style.flexGrow = "0"; + createUser.textContent = "Create User >"; + + createUser.removeEventListener("click", createUserAction); + createUser.addEventListener("click", switchToCreateAction); + + login.removeEventListener("click", switchToLoginAction); + login.addEventListener("click", loginAction); + } + }; const loginAction = (clickEvent) => { if (!frozen) { if (fields.email.value === '') { diff --git a/frontend/webpage/styles/login.css b/frontend/webpage/styles/login.css index 707bc3a..e1d9a0c 100644 --- a/frontend/webpage/styles/login.css +++ b/frontend/webpage/styles/login.css @@ -86,8 +86,15 @@ .ap-button.login { margin: 0 calc(var(--element-spacing) / 2); + flex-basis: max-content; +} + +#create-user-button { + flex-grow: 0; +} + +#login-button { flex-grow: 1; - flex-basis: 0px; } #warning {