Bootstrap 5 Login and Sign Up Form with Sliding Panel
A login and sign-up card with a sliding gradient panel that swaps between the two forms; on phones it collapses to a single form with a text switch.
<section class="auth-section wdw-stage">
<div class="container">
<div class="auth card border-0 shadow-sm auth-shadow rounded-4 overflow-hidden mx-auto" id="authCard" data-mode="login">
<div class="auth-panel auth-login">
<div class="auth-strip wdw-aurora d-md-none" aria-hidden="true"><span class="auth-strip-mark">A</span><span class="fw-semibold">Acme Studio</span></div>
<form class="auth-form" novalidate onsubmit="return false">
<h1 class="h3 fw-bold text-body-emphasis mb-2">Welcome back</h1>
<p class="text-body-secondary mb-4">Log in to pick up where you left off.</p>
<button type="button" class="btn btn-social w-100 d-flex align-items-center justify-content-center gap-2 mb-3 py-2 rounded-3"><svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true"><path fill="#4285F4" d="M23 12.3c0-.8-.1-1.5-.2-2.2H12v4.2h6.2a5.3 5.3 0 0 1-2.3 3.5v2.9h3.7c2.2-2 3.4-5 3.4-8.4z"/><path fill="#34A853" d="M12 23.5c3.1 0 5.7-1 7.6-2.8l-3.7-2.9c-1 .7-2.3 1.1-3.9 1.1-3 0-5.5-2-6.4-4.7H1.8v3A11.5 11.5 0 0 0 12 23.5z"/><path fill="#FBBC05" d="M5.6 14.2a6.9 6.9 0 0 1 0-4.4v-3H1.8a11.5 11.5 0 0 0 0 10.4z"/><path fill="#EA4335" d="M12 5.4c1.7 0 3.2.6 4.4 1.7l3.3-3.3A11.5 11.5 0 0 0 1.8 6.8l3.8 3c.9-2.7 3.4-4.4 6.4-4.4z"/></svg> Continue with Google</button>
<div class="auth-or text-body-secondary small mb-3"><span>or with email</span></div>
<div class="form-floating mb-3"><input type="email" class="form-control rounded-3" id="loginEmail" placeholder="Email" autocomplete="email"><label for="loginEmail">Email address</label></div>
<div class="form-floating mb-2"><input type="password" class="form-control rounded-3" id="loginPass" placeholder="Password" autocomplete="current-password"><label for="loginPass">Password</label></div>
<div class="text-end mb-3"><a href="#" class="small fw-medium text-decoration-none link-forgot">Forgot password?</a></div>
<button type="submit" class="btn btn-primary btn-lg w-100 rounded-pill">Log in</button>
<p class="d-md-none text-center text-body-secondary small mt-4 mb-0">New here? <button type="button" class="btn btn-link p-0 align-baseline small" data-auth-go="signup">Create an account</button></p>
</form>
</div>
<div class="auth-panel auth-signup">
<div class="auth-strip wdw-aurora d-md-none" aria-hidden="true"><span class="auth-strip-mark">A</span><span class="fw-semibold">Acme Studio</span></div>
<form class="auth-form" novalidate onsubmit="return false">
<h2 class="h3 fw-bold text-body-emphasis mb-2">Create account</h2>
<p class="text-body-secondary mb-4">Free for 14 days. No card required.</p>
<button type="button" class="btn btn-social w-100 d-flex align-items-center justify-content-center gap-2 mb-3 py-2 rounded-3"><svg width="18" height="18" viewBox="0 0 24 24" aria-hidden="true"><path fill="#4285F4" d="M23 12.3c0-.8-.1-1.5-.2-2.2H12v4.2h6.2a5.3 5.3 0 0 1-2.3 3.5v2.9h3.7c2.2-2 3.4-5 3.4-8.4z"/><path fill="#34A853" d="M12 23.5c3.1 0 5.7-1 7.6-2.8l-3.7-2.9c-1 .7-2.3 1.1-3.9 1.1-3 0-5.5-2-6.4-4.7H1.8v3A11.5 11.5 0 0 0 12 23.5z"/><path fill="#FBBC05" d="M5.6 14.2a6.9 6.9 0 0 1 0-4.4v-3H1.8a11.5 11.5 0 0 0 0 10.4z"/><path fill="#EA4335" d="M12 5.4c1.7 0 3.2.6 4.4 1.7l3.3-3.3A11.5 11.5 0 0 0 1.8 6.8l3.8 3c.9-2.7 3.4-4.4 6.4-4.4z"/></svg> Sign up with Google</button>
<div class="auth-or text-body-secondary small mb-3"><span>or with email</span></div>
<div class="form-floating mb-3"><input type="text" class="form-control rounded-3" id="signName" placeholder="Name" autocomplete="name"><label for="signName">Full name</label></div>
<div class="form-floating mb-3"><input type="email" class="form-control rounded-3" id="signEmail" placeholder="Email" autocomplete="email"><label for="signEmail">Email address</label></div>
<div class="form-floating mb-4"><input type="password" class="form-control rounded-3" id="signPass" placeholder="Password" autocomplete="new-password"><label for="signPass">Password</label></div>
<button type="submit" class="btn btn-primary btn-lg w-100 rounded-pill">Sign up</button>
<p class="d-md-none text-center text-body-secondary small mt-4 mb-0">Have an account? <button type="button" class="btn btn-link p-0 align-baseline small" data-auth-go="login">Log in</button></p>
</form>
</div>
<div class="auth-overlay wdw-aurora d-none d-md-flex" aria-hidden="false"><span class="auth-orb auth-orb-1" aria-hidden="true"></span><span class="auth-orb auth-orb-2" aria-hidden="true"></span>
<div class="auth-ov auth-ov-login text-center text-white">
<h2 class="h2 fw-bold mb-2">New here?</h2>
<p class="mb-3 opacity-75">Create an account and start building in minutes.</p>
<ul class="auth-feats list-unstyled text-start mb-4"><li><svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8.5l3.2 3L13 4.5"/></svg><span>Unlimited projects and teammates</span></li><li><svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8.5l3.2 3L13 4.5"/></svg><span>Live previews on every change</span></li><li><svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 8.5l3.2 3L13 4.5"/></svg><span>Cancel any time, no card needed</span></li></ul>
<button type="button" class="btn btn-light btn-lg rounded-pill px-5 fw-semibold" data-auth-go="signup">Sign up</button>
</div>
<div class="auth-ov auth-ov-signup text-center text-white">
<h2 class="h2 fw-bold mb-2">Already a member?</h2>
<p class="mb-3 opacity-75">Log in to see your projects and team.</p>
<figure class="auth-quote text-start mb-4"><blockquote class="mb-2 small">"We shipped our redesign in a week. The workflow just gets out of the way."</blockquote><figcaption class="small opacity-75">Maya R., Design Lead</figcaption></figure>
<button type="button" class="btn btn-light btn-lg rounded-pill px-5 fw-semibold" data-auth-go="login">Log in</button>
</div>
</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 */
.auth { position: relative; max-width: 880px; min-height: 560px; }
.auth-panel { position: absolute; top: 0; bottom: 0; width: 50%; display: flex; align-items: center; justify-content: center; padding: 2rem; transition: transform .6s cubic-bezier(.65,.05,.25,1), opacity .4s; background: var(--bs-body-bg); }
.auth-form { width: 100%; max-width: 340px; }
.auth-login { left: 0; z-index: 2; }
.auth-signup { left: 0; opacity: 0; z-index: 1; pointer-events: none; }
.auth[data-mode="signup"] .auth-login { transform: translateX(100%); opacity: 0; pointer-events: none; }
.auth[data-mode="signup"] .auth-signup { transform: translateX(100%); opacity: 1; z-index: 5; pointer-events: auto; }
.auth-overlay { position: absolute; top: 0; left: 50%; width: 50%; height: 100%; z-index: 10; overflow: hidden; transition: transform .6s cubic-bezier(.65,.05,.25,1); align-items: center; justify-content: center; }
.auth-ov { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2.5rem; transition: opacity .4s, transform .6s; }
.auth-ov-signup { opacity: 0; transform: translateX(-20%); pointer-events: none; }
.auth[data-mode="signup"] .auth-overlay { transform: translateX(-100%); }
.auth[data-mode="signup"] .auth-ov-login { opacity: 0; transform: translateX(20%); pointer-events: none; }
.auth[data-mode="signup"] .auth-ov-signup { opacity: 1; transform: none; pointer-events: auto; }
.btn-social { background: var(--bs-secondary-bg); color: var(--bs-emphasis-color); border: 1px solid var(--bs-border-color); font-weight: 500; }
.btn-social:hover, .btn-social:focus-visible { background: var(--bs-tertiary-bg); color: var(--bs-emphasis-color); border-color: var(--bs-secondary-color); }
.link-forgot { color: var(--bs-primary-text-emphasis); }
.link-forgot:hover { text-decoration: underline !important; }
.auth-ov { z-index: 1; color: #fff; }
.auth-orb { position: absolute; pointer-events: none; border-radius: 50%; background: rgba(255,255,255,.12); }
.auth-orb-1 { width: 320px; height: 320px; top: -110px; right: -110px; }
.auth-orb-2 { width: 220px; height: 220px; bottom: -80px; left: -70px; background: rgba(255,255,255,.09); }
.auth-feats li { display: flex; align-items: center; gap: .6rem; padding: .35rem 0; font-size: .9rem; }
.auth-feats svg { flex: none; padding: 3px; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.2); }
.auth-quote { background: rgba(255,255,255,.14); border-radius: 1rem; padding: 1rem 1.1rem; margin-inline: 0; }
.auth-strip { display: none; }
.auth-or { display: flex; align-items: center; gap: .75rem; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--bs-border-color); }
@media (max-width: 767.98px) {
.auth-panel { flex-direction: column; justify-content: flex-start; padding: 0 !important; }
.auth-strip { display: flex; align-items: center; gap: .6rem; width: 100%; padding: 1rem 1.5rem; color: #fff; }
.auth-strip-mark { width: 2rem; height: 2rem; border-radius: .6rem; background: rgba(255,255,255,.22); display: grid; place-items: center; font-weight: 700; }
.auth-panel .auth-form { padding: 1.75rem 1.5rem 2rem; max-width: none; }
.auth { min-height: 0; }
.auth-panel { position: static; width: 100%; padding: 2rem 1.5rem; transform: none !important; }
.auth[data-mode="login"] .auth-signup, .auth[data-mode="signup"] .auth-login { display: none; }
.auth-signup, .auth-login { opacity: 1 !important; pointer-events: auto !important; }
}
@media (prefers-reduced-motion: reduce) { .auth-panel, .auth-overlay, .auth-ov { transition: none; } }
(function () {
function initAuthSlider() {
var card = document.getElementById('authCard');
if (!card) return;
card.querySelectorAll('[data-auth-go]').forEach(function (btn) {
btn.addEventListener('click', function () {
card.dataset.mode = btn.dataset.authGo;
var first = card.querySelector(btn.dataset.authGo === 'signup' ? '#signName' : '#loginEmail');
if (first) setTimeout(function () { first.focus({ preventScroll: true }); }, 650);
});
});
}
initAuthSlider();
})();
Built on Bootstrap 5.3.8 with plain JavaScript — no jQuery. Supports light and dark mode via data-bs-theme.