forked from andyburke/autonomous.contact
feature: remember if someone has logged in and default to a login screen
fix: some includes needed updating feature: some more overrides
This commit is contained in:
parent
ebf0e4428e
commit
7b3494cc32
12 changed files with 90 additions and 55 deletions
|
|
@ -14,7 +14,19 @@
|
|||
background: var(--bg);
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
transition: all 0.33s;
|
||||
transition: all 0.33s ease;
|
||||
animation: slideIn 0.4s ease;
|
||||
}
|
||||
|
||||
@keyframes slideIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: scale(1.2);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: scale(1.0);
|
||||
}
|
||||
}
|
||||
|
||||
#login-tab .tab-content {
|
||||
|
|
@ -49,52 +61,17 @@
|
|||
}
|
||||
</style>
|
||||
|
||||
<!-- #include "./files/settings/signup_pitch.md" or "./signup_pitch.default.md" -->
|
||||
<!-- #include "./files/settings/signup_pitch.html" or "./files/settings/signup_pitch.md" or "./signup_pitch.default.md" -->
|
||||
|
||||
<div class="limiter">
|
||||
<div class="tabs">
|
||||
<div id="login-tab" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="signup-login-tabs"
|
||||
id="login-tab-input"
|
||||
class="tab-switch"
|
||||
checked="checked"
|
||||
/>
|
||||
<label for="login-tab-input" class="tab-label">
|
||||
<div class="label">Log In</div>
|
||||
</label>
|
||||
<div class="tab-content">
|
||||
<form data-smart="true" data-method="POST" id="login-form" action="/api/auth">
|
||||
<script>
|
||||
{
|
||||
const form = document.currentScript.closest("form");
|
||||
form.on_reply = (response) => {
|
||||
const user = response.user;
|
||||
APP.login( user );
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<div>
|
||||
<input id="login-username" type="text" name="username" required />
|
||||
<label class="placeholder" for="login-username">username</label>
|
||||
</div>
|
||||
<div>
|
||||
<input id="login-password" type="password" name="password" required />
|
||||
<label class="placeholder" for="login-password">password</label>
|
||||
</div>
|
||||
<div>
|
||||
<button id="login-submit" type="submit" class="primary">Log In</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="signup-tab" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="signup-login-tabs"
|
||||
id="signup-tab-input"
|
||||
class="tab-switch"
|
||||
checked="checked"
|
||||
/>
|
||||
<label for="signup-tab-input" class="tab-label">
|
||||
<div class="label">Sign Up</div>
|
||||
|
|
@ -136,6 +113,7 @@
|
|||
id="signup-invite-code"
|
||||
type="text"
|
||||
name="invite_code"
|
||||
required
|
||||
/>
|
||||
<label class="placeholder" for="signup-invite-code">invite code</label>
|
||||
</div>
|
||||
|
|
@ -143,6 +121,53 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div id="login-tab" class="tab">
|
||||
<input
|
||||
type="radio"
|
||||
name="signup-login-tabs"
|
||||
id="login-tab-input"
|
||||
class="tab-switch"
|
||||
/>
|
||||
<label for="login-tab-input" class="tab-label">
|
||||
<div class="label">Log In</div>
|
||||
</label>
|
||||
<div class="tab-content">
|
||||
<form data-smart="true" data-method="POST" id="login-form" action="/api/auth">
|
||||
<script>
|
||||
{
|
||||
const form = document.currentScript.closest("form");
|
||||
form.on_reply = (response) => {
|
||||
const user = response.user;
|
||||
APP.login( user );
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<div>
|
||||
<input id="login-username" type="text" name="username" required />
|
||||
<label class="placeholder" for="login-username">username</label>
|
||||
</div>
|
||||
<div>
|
||||
<input id="login-password" type="password" name="password" required />
|
||||
<label class="placeholder" for="login-password">password</label>
|
||||
</div>
|
||||
<div>
|
||||
<button id="login-submit" type="submit" class="primary">Log In</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener( 'DOMContentLoaded', () => {
|
||||
const authed_before = (document.cookie.match(
|
||||
/^(?:.*;)?\s*authed_before\s*=\s*([^;]+)(?:.*)?$/,
|
||||
) || [, null])[1];
|
||||
|
||||
if ( authed_before ) {
|
||||
document.getElementById("login-tab-input").checked = true;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue