Bootstrap 5 Login and Registration Form with Slider
A login and registration card with a sliding brand panel that swaps between the two forms, floating-label inputs and social sign-in buttons. On phones it collapses to one form with a text switch link.
<section class="wdw-stage">
<div class="container" style="max-width:940px">
<div class="wdw-card au" id="auth" data-mode="login">
<div class="au-overlay wdw-aurora d-none d-md-flex" aria-hidden="false">
<div class="au-copy au-copy-login">
<h2 class="h2 fw-bold mb-2">Hello, friend!</h2>
<p class="opacity-75 mb-4">Enter your details and start your journey with us.</p>
<button type="button" class="btn btn-outline-light rounded-pill px-4" data-au="register">Sign up</button>
</div>
<div class="au-copy au-copy-register">
<h2 class="h2 fw-bold mb-2">Welcome back!</h2>
<p class="opacity-75 mb-4">Already have an account? Sign in to keep connected.</p>
<button type="button" class="btn btn-outline-light rounded-pill px-4" data-au="login">Sign in</button>
</div>
</div>
<div class="au-panel au-login p-4 p-md-5" id="au-login">
<h1 class="h3 wdw-heading mb-1">Sign in</h1>
<p class="wdw-muted small mb-4">Welcome back. Use a provider or your email.</p>
<div class="d-flex gap-2 mb-3">
<button type="button" class="btn btn-outline-secondary rounded-pill flex-fill"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"/></svg>GitHub</button>
<button type="button" class="btn btn-outline-secondary rounded-pill flex-fill"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 12h5.5M17 12a5 5 0 1 1-1.5-3.6"/></svg>Google</button>
</div>
<div class="au-or text-center small wdw-muted mb-3"><span>or with email</span></div>
<form class="d-grid gap-3" data-au-form novalidate>
<div class="form-floating"><input type="email" class="form-control" id="au-l-email" placeholder="Email" autocomplete="email" required><label for="au-l-email">Email</label></div>
<div class="form-floating"><input type="password" class="form-control" id="au-l-pass" placeholder="Password" autocomplete="current-password" required><label for="au-l-pass">Password</label></div>
<div class="text-end"><a href="#" class="small fw-semibold text-decoration-none">Forgot password?</a></div>
<button type="submit" class="btn btn-primary rounded-pill">Sign in</button>
<div class="small text-success-emphasis text-center" role="status" data-au-msg></div>
</form>
<p class="d-md-none text-center small wdw-muted mt-4 mb-0">No account? <button type="button" class="btn btn-link p-0 align-baseline fw-semibold text-decoration-none" data-au="register">Sign up</button></p>
</div>
<div class="au-panel au-register p-4 p-md-5" id="au-register">
<h1 class="h3 wdw-heading mb-1">Create account</h1>
<p class="wdw-muted small mb-4">It takes less than a minute.</p>
<div class="d-flex gap-2 mb-3">
<button type="button" class="btn btn-outline-secondary rounded-pill flex-fill"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"/></svg>GitHub</button>
<button type="button" class="btn btn-outline-secondary rounded-pill flex-fill"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M12 12h5.5M17 12a5 5 0 1 1-1.5-3.6"/></svg>Google</button>
</div>
<div class="au-or text-center small wdw-muted mb-3"><span>or with email</span></div>
<form class="d-grid gap-3" data-au-form novalidate>
<div class="form-floating"><input type="text" class="form-control" id="au-r-name" placeholder="Name" autocomplete="name" required><label for="au-r-name">Name</label></div>
<div class="form-floating"><input type="email" class="form-control" id="au-r-email" placeholder="Email" autocomplete="email" required><label for="au-r-email">Email</label></div>
<div class="form-floating"><input type="password" class="form-control" id="au-r-pass" placeholder="Password" autocomplete="new-password" required><label for="au-r-pass">Password</label></div>
<button type="submit" class="btn btn-primary rounded-pill">Create account</button>
<div class="small text-success-emphasis text-center" role="status" data-au-msg></div>
</form>
<p class="d-md-none text-center small wdw-muted mt-4 mb-0">Have an account? <button type="button" class="btn btn-link p-0 align-baseline fw-semibold text-decoration-none" data-au="login">Sign in</button></p>
</div>
</div>
</div>
</section>
/* Web Designer Wall library style — shared base for every Bootstrap 5 snippet.
Indigo accent, Plus Jakarta Sans, soft cards, pill buttons. Works in light and dark. */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");
:root,
[data-bs-theme="light"] {
--wdw-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
--bs-body-font-family: var(--wdw-font);
--bs-primary: #4f46e5;
--bs-primary-rgb: 79, 70, 229;
--bs-primary-text-emphasis: #3730a3;
--bs-primary-bg-subtle: #eef2ff;
--bs-primary-border-subtle: #c7d2fe;
--bs-link-color: #4f46e5;
--bs-link-color-rgb: 79, 70, 229;
--bs-link-hover-color: #4338ca;
--bs-link-hover-color-rgb: 67, 56, 202;
--bs-focus-ring-color: rgba(79, 70, 229, 0.25);
--bs-border-radius: 0.75rem;
--bs-border-radius-lg: 1rem;
--bs-border-radius-xl: 1.25rem;
--wdw-radius-card: 1.25rem;
--wdw-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 16px 40px -16px rgba(16, 24, 40, 0.22);
--wdw-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06), 0 4px 12px -4px rgba(16, 24, 40, 0.12);
--wdw-stage: #f5f6fb;
}
[data-bs-theme="dark"] {
--bs-primary: #818cf8;
--bs-primary-rgb: 129, 140, 248;
--bs-primary-text-emphasis: #c7d2fe;
--bs-primary-bg-subtle: rgba(129, 140, 248, 0.14);
--bs-primary-border-subtle: rgba(129, 140, 248, 0.35);
--bs-link-color: #a5b4fc;
--bs-link-color-rgb: 165, 180, 252;
--bs-link-hover-color: #c7d2fe;
--bs-link-hover-color-rgb: 199, 210, 254;
--bs-focus-ring-color: rgba(129, 140, 248, 0.35);
--wdw-shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 16px 40px -16px rgba(0, 0, 0, 0.7);
--wdw-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 12px -4px rgba(0, 0, 0, 0.5);
--wdw-stage: #0f1117;
}
body { font-family: var(--wdw-font); -webkit-font-smoothing: antialiased; }
/* Bootstrap compiles its blue into these components; point them at the accent. */
.btn-primary {
--bs-btn-bg: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: #4338ca; --bs-btn-hover-border-color: #4338ca;
--bs-btn-active-bg: #3730a3; --bs-btn-active-border-color: #3730a3;
--bs-btn-disabled-bg: var(--bs-primary); --bs-btn-disabled-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
[data-bs-theme="dark"] .btn-primary { --bs-btn-color: #0f1117; --bs-btn-hover-bg: #a5b4fc; --bs-btn-hover-border-color: #a5b4fc; --bs-btn-hover-color: #0f1117; --bs-btn-active-color: #0f1117; }
.btn-outline-primary {
--bs-btn-color: var(--bs-primary); --bs-btn-border-color: var(--bs-primary);
--bs-btn-hover-bg: var(--bs-primary); --bs-btn-hover-border-color: var(--bs-primary);
--bs-btn-active-bg: var(--bs-primary); --bs-btn-active-border-color: var(--bs-primary);
--bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
}
.btn { --bs-btn-font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; }
.btn-sm { min-height: 36px; }
.form-control, .form-select { min-height: 44px; border-radius: .75rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: rgba(var(--bs-primary-rgb), .6); box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.form-check-input:checked { background-color: var(--bs-primary); border-color: var(--bs-primary); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--bs-primary); }
.nav { --bs-nav-link-color: var(--bs-secondary-color); --bs-nav-link-hover-color: var(--bs-emphasis-color); }
.pagination { --bs-pagination-active-bg: var(--bs-primary); --bs-pagination-active-border-color: var(--bs-primary); --bs-pagination-color: var(--bs-body-color); --bs-pagination-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.progress, .progress-stacked { --bs-progress-bar-bg: var(--bs-primary); }
.list-group { --bs-list-group-active-bg: var(--bs-primary); --bs-list-group-active-border-color: var(--bs-primary); }
.dropdown-menu { --bs-dropdown-link-active-bg: var(--bs-primary); border-radius: .875rem; box-shadow: var(--wdw-shadow-sm); }
.accordion { --bs-accordion-active-bg: var(--bs-primary-bg-subtle); --bs-accordion-active-color: var(--bs-primary-text-emphasis); --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem var(--bs-focus-ring-color); }
.badge { font-weight: 600; }
/* Library building blocks — use these instead of re-inventing them per snippet. */
.wdw-stage { min-height: 100vh; display: flex; align-items: center; background: var(--wdw-stage); padding-block: 3rem; }
.wdw-card { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: var(--wdw-radius-card); box-shadow: var(--wdw-shadow); }
.wdw-card-sm { background: var(--bs-body-bg); border: 1px solid var(--bs-border-color-translucent); border-radius: 1rem; box-shadow: var(--wdw-shadow-sm); }
.wdw-aurora { position: relative; color: #fff; background: radial-gradient(60% 55% at 100% 0, #818cf8 0, transparent 70%), radial-gradient(65% 60% at 0 100%, #ec4899 0, transparent 65%), #1e1b4b; }
.wdw-eyebrow { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--bs-primary); }
.wdw-heading { font-weight: 800; letter-spacing: -.02em; color: var(--bs-emphasis-color); }
.wdw-muted { color: var(--bs-secondary-color); }
.wdw-icon { width: 2.75rem; height: 2.75rem; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: .875rem; background: var(--bs-primary-bg-subtle); color: var(--bs-primary); }
/* Component */
.au { position: relative; overflow: hidden; min-height: 600px; }
.au-panel { background: var(--bs-body-bg); }
.au-register { display: none; }
.au[data-mode="register"] .au-login { display: none; }
.au[data-mode="register"] .au-register { display: block; }
.au-or { position: relative; }
.au-or::before { content: ""; position: absolute; inset: 50% 0 auto; border-top: 1px solid var(--bs-border-color); }
.au-or span { position: relative; background: var(--bs-body-bg); padding: 0 .75rem; }
@media (min-width: 768px) {
.au-panel { position: absolute; top: 0; bottom: 0; width: 50%; display: flex; flex-direction: column; justify-content: center; transition: opacity .35s ease, visibility .35s; }
.au-login { left: 0; }
.au-register { right: 0; display: flex; opacity: 0; visibility: hidden; }
.au[data-mode="register"] .au-login { display: flex; opacity: 0; visibility: hidden; }
.au[data-mode="register"] .au-register { display: flex; opacity: 1; visibility: visible; }
.au-overlay { position: absolute; z-index: 2; top: 0; bottom: 0; right: 0; width: 50%; align-items: center; justify-content: center; text-align: center; padding: 2.5rem; transition: transform .6s cubic-bezier(.65, 0, .35, 1); overflow: hidden; }
.au[data-mode="register"] .au-overlay { transform: translateX(-100%); }
.au-copy { position: absolute; inset: 0; padding: 2.5rem; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: opacity .3s ease; }
.au-copy-register { opacity: 0; pointer-events: none; }
.au[data-mode="register"] .au-copy-login { opacity: 0; pointer-events: none; }
.au[data-mode="register"] .au-copy-register { opacity: 1; pointer-events: auto; }
}
@media (prefers-reduced-motion: reduce) { .au-overlay, .au-panel, .au-copy { transition: none; } }
.au .btn-outline-secondary { --bs-btn-color: var(--bs-body-color); --bs-btn-border-color: var(--bs-border-color); --bs-btn-hover-color: var(--bs-emphasis-color); --bs-btn-hover-bg: var(--bs-tertiary-bg); --bs-btn-hover-border-color: var(--bs-border-color); --bs-btn-active-color: var(--bs-emphasis-color); --bs-btn-active-bg: var(--bs-secondary-bg); --bs-btn-active-border-color: var(--bs-border-color); }
function initAuthSlider() {
var box = document.getElementById('auth');
if (!box) return;
box.querySelectorAll('[data-au]').forEach(function (btn) {
btn.addEventListener('click', function () {
var mode = btn.dataset.au;
box.dataset.mode = mode;
var field = box.querySelector('#au-' + mode + ' input');
if (field) setTimeout(function () { field.focus({ preventScroll: true }); }, 350);
});
});
box.querySelectorAll('[data-au-form]').forEach(function (form) {
form.addEventListener('submit', function (e) {
e.preventDefault();
var msg = form.querySelector('[data-au-msg]');
var ok = form.checkValidity();
form.classList.add('was-validated');
if (msg) msg.textContent = ok ? 'Looks good. This demo has no backend.' : 'Please fill in every field.';
if (msg) msg.classList.toggle('text-danger', !ok);
});
});
}
initAuthSlider();
<section class="auth-stage">
<div class="auth" id="auth" data-mode="signin">
<!-- Sign in -->
<div class="auth-panel auth-signin" id="panel-signin">
<h1 class="fs-3xl fw-bold mb-3">Sign in</h1>
<p class="fg-secondary mb-7">Welcome back. Pick up where you left off.</p>
<div class="auth-social" role="group" aria-label="Sign in with">
<button type="button" class="btn-outline theme-secondary btn-icon" aria-label="Continue with Google">
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M21.35 11.1H12v2.98h5.35c-.23 1.4-1.64 4.1-5.35 4.1-3.22 0-5.85-2.67-5.85-5.96S8.78 6.26 12 6.26c1.83 0 3.06.78 3.76 1.45l2.56-2.47C16.68 3.7 14.56 2.7 12 2.7a9.3 9.3 0 1 0 0 18.6c5.37 0 8.93-3.77 8.93-9.09 0-.61-.07-1.08-.16-1.55z"/></svg>
</button>
<button type="button" class="btn-outline theme-secondary btn-icon" aria-label="Continue with Facebook">
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M13.5 21v-8h2.7l.4-3.2h-3.1V7.8c0-.9.3-1.5 1.6-1.5h1.7V3.4c-.3 0-1.3-.1-2.4-.1-2.4 0-4 1.5-4 4.1v2.4H7.7V13h2.7v8z"/></svg>
</button>
<button type="button" class="btn-outline theme-secondary btn-icon" aria-label="Continue with GitHub">
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2a10 10 0 0 0-3.16 19.49c.5.09.68-.22.68-.48v-1.7c-2.78.6-3.37-1.34-3.37-1.34-.45-1.16-1.11-1.47-1.11-1.47-.91-.62.07-.61.07-.61 1 .07 1.53 1.03 1.53 1.03.9 1.52 2.34 1.08 2.91.83.09-.65.35-1.08.63-1.33-2.22-.25-4.55-1.11-4.55-4.94 0-1.09.39-1.98 1.03-2.68-.1-.25-.45-1.27.1-2.65 0 0 .84-.27 2.75 1.02a9.5 9.5 0 0 1 5 0c1.91-1.29 2.75-1.02 2.75-1.02.55 1.38.2 2.4.1 2.65.64.7 1.03 1.59 1.03 2.68 0 3.84-2.34 4.69-4.57 4.93.36.31.68.92.68 1.85v2.74c0 .27.18.58.69.48A10 10 0 0 0 12 2z"/></svg>
</button>
</div>
<p class="auth-or"><span>or use your email</span></p>
<form class="auth-form" data-bs-validate novalidate>
<div>
<label class="form-label" for="si-email">Email</label>
<input class="form-control" id="si-email" type="email" placeholder="[email protected]" autocomplete="email" required>
</div>
<div>
<div class="d-flex justify-content-between">
<label class="form-label" for="si-pass">Password</label>
<a class="fs-sm" href="#">Forgot password?</a>
</div>
<input class="form-control" id="si-pass" type="password" placeholder="Your password" autocomplete="current-password" required>
</div>
<button type="submit" class="btn-solid theme-primary btn-lg">Sign in</button>
</form>
<p class="auth-switch fg-secondary fs-sm">New here? <button type="button" class="btn-link" data-auth-go="signup">Create an account</button></p>
</div>
<!-- Register -->
<div class="auth-panel auth-signup" id="panel-signup">
<h1 class="fs-3xl fw-bold mb-3">Create account</h1>
<p class="fg-secondary mb-7">Free for 14 days. No credit card needed.</p>
<div class="auth-social" role="group" aria-label="Sign up with">
<button type="button" class="btn-outline theme-secondary btn-icon" aria-label="Sign up with Google">
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M21.35 11.1H12v2.98h5.35c-.23 1.4-1.64 4.1-5.35 4.1-3.22 0-5.85-2.67-5.85-5.96S8.78 6.26 12 6.26c1.83 0 3.06.78 3.76 1.45l2.56-2.47C16.68 3.7 14.56 2.7 12 2.7a9.3 9.3 0 1 0 0 18.6c5.37 0 8.93-3.77 8.93-9.09 0-.61-.07-1.08-.16-1.55z"/></svg>
</button>
<button type="button" class="btn-outline theme-secondary btn-icon" aria-label="Sign up with Facebook">
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M13.5 21v-8h2.7l.4-3.2h-3.1V7.8c0-.9.3-1.5 1.6-1.5h1.7V3.4c-.3 0-1.3-.1-2.4-.1-2.4 0-4 1.5-4 4.1v2.4H7.7V13h2.7v8z"/></svg>
</button>
<button type="button" class="btn-outline theme-secondary btn-icon" aria-label="Sign up with GitHub">
<svg width="18" height="18" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M12 2a10 10 0 0 0-3.16 19.49c.5.09.68-.22.68-.48v-1.7c-2.78.6-3.37-1.34-3.37-1.34-.45-1.16-1.11-1.47-1.11-1.47-.91-.62.07-.61.07-.61 1 .07 1.53 1.03 1.53 1.03.9 1.52 2.34 1.08 2.91.83.09-.65.35-1.08.63-1.33-2.22-.25-4.55-1.11-4.55-4.94 0-1.09.39-1.98 1.03-2.68-.1-.25-.45-1.27.1-2.65 0 0 .84-.27 2.75 1.02a9.5 9.5 0 0 1 5 0c1.91-1.29 2.75-1.02 2.75-1.02.55 1.38.2 2.4.1 2.65.64.7 1.03 1.59 1.03 2.68 0 3.84-2.34 4.69-4.57 4.93.36.31.68.92.68 1.85v2.74c0 .27.18.58.69.48A10 10 0 0 0 12 2z"/></svg>
</button>
</div>
<p class="auth-or"><span>or sign up with email</span></p>
<form class="auth-form" data-bs-validate novalidate>
<div>
<label class="form-label" for="su-name">Full name</label>
<input class="form-control" id="su-name" type="text" placeholder="Alex Morgan" autocomplete="name" required>
</div>
<div>
<label class="form-label" for="su-email">Email</label>
<input class="form-control" id="su-email" type="email" placeholder="[email protected]" autocomplete="email" required>
</div>
<div>
<label class="form-label" for="su-pass">Password</label>
<input class="form-control" id="su-pass" type="password" placeholder="At least 8 characters" autocomplete="new-password" minlength="8" required>
</div>
<button type="submit" class="btn-solid theme-primary btn-lg">Create account</button>
</form>
<p class="auth-switch fg-secondary fs-sm">Already registered? <button type="button" class="btn-link" data-auth-go="signin">Sign in</button></p>
</div>
<!-- Sliding cover -->
<div class="auth-cover" aria-live="polite">
<div class="auth-cover-copy auth-cover-signup">
<h2 class="fs-3xl fw-bold mb-3">Hello, friend!</h2>
<p class="mb-7">Enter your details and start a journey with us.</p>
<button type="button" class="auth-cover-btn" data-auth-go="signup">Sign up</button>
</div>
<div class="auth-cover-copy auth-cover-signin">
<h2 class="fs-3xl fw-bold mb-3">Welcome back!</h2>
<p class="mb-7">Already have an account? Sign in to stay connected.</p>
<button type="button" class="auth-cover-btn" data-auth-go="signin">Sign in</button>
</div>
</div>
</div>
</section>
.auth-stage { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; background: var(--bs-bg-2); }
.auth { position: relative; width: 100%; max-width: 62.5rem; min-height: 34rem; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden;
background: var(--bs-bg-body); border: 1px solid var(--bs-border-color); border-radius: 1.25rem; box-shadow: 0 24px 60px -24px rgb(0 0 0 / .25); }
.auth-panel { padding: 3rem 3.5rem; display: flex; flex-direction: column; justify-content: center; text-align: center; }
.auth-signin { grid-column: 1; grid-row: 1; }
.auth-signup { grid-column: 2; grid-row: 1; }
.auth-social { display: flex; justify-content: center; gap: .75rem; }
.auth-or { display: flex; align-items: center; gap: .75rem; margin-block: 1.25rem; color: var(--bs-fg-3); font-size: .8125rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--bs-border-color); }
.auth-form { display: flex; flex-direction: column; gap: 1rem; text-align: start; }
.auth-form .btn-solid { margin-top: .5rem; }
.auth-switch { display: none; margin-top: 1.25rem; margin-bottom: 0; }
.auth-cover { position: absolute; top: 0; bottom: 0; left: 0; width: 50%; z-index: 2; display: grid; place-items: center; padding: 2.5rem;
text-align: center; color: #fff; background: linear-gradient(160deg, oklch(58% .2 258), oklch(42% .17 266));
transition: transform .6s cubic-bezier(.65, 0, .35, 1); }
.auth[data-mode="signin"] .auth-cover { transform: translateX(100%); }
.auth[data-mode="signup"] .auth-cover { transform: translateX(0); }
.auth-cover-copy { grid-area: 1 / 1; max-width: 18rem; transition: opacity .3s; }
.auth[data-mode="signin"] .auth-cover-signin, .auth[data-mode="signup"] .auth-cover-signup { opacity: 0; visibility: hidden; }
.auth-cover-btn { background: transparent; color: #fff; border: 1.5px solid rgb(255 255 255 / .85); border-radius: 999px; padding: .75rem 2.5rem;
font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: .8125rem; cursor: pointer; }
.auth-cover-btn:hover { background: #fff; color: oklch(40% .17 266); }
.auth-cover-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@media (width < 768px) {
.auth { grid-template-columns: 1fr; min-height: 0; }
.auth-cover { display: none; }
.auth-panel { grid-column: 1; padding: 2rem 1.5rem; }
.auth[data-mode="signin"] .auth-signup, .auth[data-mode="signup"] .auth-signin { display: none; }
.auth-switch { display: block; }
}
@media (prefers-reduced-motion: reduce) { .auth-cover, .auth-cover-copy { transition: none; } }
function initAuthSlider() {
const auth = document.getElementById('auth');
if (!auth) return;
const panels = { signin: document.getElementById('panel-signin'), signup: document.getElementById('panel-signup') };
const setMode = (mode) => {
auth.dataset.mode = mode;
panels.signin.inert = mode !== 'signin' && window.matchMedia('(width >= 768px)').matches;
panels.signup.inert = mode !== 'signup' && window.matchMedia('(width >= 768px)').matches;
};
auth.querySelectorAll('[data-auth-go]').forEach((btn) => {
btn.addEventListener('click', () => {
setMode(btn.dataset.authGo);
panels[btn.dataset.authGo].querySelector('input')?.focus({ preventScroll: true });
});
});
setMode('signin');
}
initAuthSlider();
Built on Bootstrap 6.0.0-alpha.1 (ES modules, no jQuery). Load Bootstrap through an import map and run the JavaScript as type="module" — the downloaded file is already set up that way. Alpha releases can still change class names.
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.