Turn auth toggle into link

This commit is contained in:
2026-02-03 00:57:52 +01:00
parent 5a3763682a
commit edc8760465
3 changed files with 8 additions and 2 deletions

View File

@@ -327,7 +327,10 @@ function renderPhaseTitles() {
function setupHandlers() {
const toggleAuth = $("auth-toggle");
if (toggleAuth) {
toggleAuth.addEventListener("click", () => setAuthMode(state.authMode === "login" ? "register" : "login"));
toggleAuth.addEventListener("click", (e) => {
e.preventDefault();
setAuthMode(state.authMode === "login" ? "register" : "login");
});
}
setAuthMode(state.authMode);

View File

@@ -19,7 +19,6 @@
</div>
<div class="stack">
<h2 id="auth-title" data-i18n="auth.loginHeading">Log in</h2>
<button class="ghost" id="auth-toggle" type="button" data-i18n="auth.switchToRegister">Need an account? Register</button>
</div>
<div class="stack lang-field">
<span class="label" data-i18n="lang.label">Language</span>
@@ -58,6 +57,9 @@
</label>
<button type="submit" data-i18n="auth.registerSubmit">Create account</button>
</form>
<div class="stack">
<a class="auth-toggle-link" id="auth-toggle" href="#" data-i18n="auth.switchToRegister">Need an account? Register</a>
</div>
</section>
<section>

View File

@@ -184,6 +184,7 @@ p { margin: 0; }
.link { color: #30afea; text-decoration: none; font-weight: 700; }
.link:hover { text-decoration: underline; }
.link.compact { font-size: 14px; }
.auth-toggle-link { text-align: center; display: inline-block; }
.chip { background: #c5dff1; color: #2c1c0d; padding: 4px 8px; border-radius: 999px; font-size: 12px; }
.chip.danger-chip { background: #e0564f; border: 1px solid #c54740; color: #fffaf3; }