+
-
+
-

{appName}

+

{appName}

-
-
+
+
{#if showTwoFactor} -
-

Zwei-Faktor-Authentifizierung

-

+

+

+ Zwei-Faktor-Authentifizierung +

+

{useBackupCode ? 'Gib einen Backup-Code ein' : 'Gib den Code aus deiner Authenticator-App ein'} @@ -457,7 +475,10 @@

{#if error} -
{#if appSlider} -
+
{@render appSlider()}
{/if} {#if version} -

+

v{version}{#if buildTime} · {new Date(buildTime).toLocaleDateString('de-DE', { day: '2-digit', @@ -831,574 +920,6 @@ height: 100%; } - .page-container { - display: flex; - flex-direction: column; - min-height: 100vh; - min-height: 100dvh; - width: 100%; - max-width: 100vw; - overflow-x: hidden; - margin: 0; - padding: 0; - /* Dark mode default */ - background-color: var(--dark-bg, #121212); - } - - .page-container.light { - background-color: var(--light-bg, #f5f5f5); - } - - .theme-toggle { - position: absolute; - top: 1rem; - left: 1rem; - z-index: 50; - display: flex; - align-items: center; - justify-content: center; - width: 2.5rem; - height: 2.5rem; - border-radius: 0.5rem; - border: 1px solid rgba(255, 255, 255, 0.2); - background: rgba(255, 255, 255, 0.1); - color: rgba(255, 255, 255, 0.7); - cursor: pointer; - transition: all 0.2s ease; - } - - .light .theme-toggle { - border-color: rgba(0, 0, 0, 0.2); - background: rgba(0, 0, 0, 0.05); - color: rgba(0, 0, 0, 0.7); - } - - .theme-toggle:hover { - background: rgba(255, 255, 255, 0.2); - color: #fff; - } - - .light .theme-toggle:hover { - background: rgba(0, 0, 0, 0.1); - color: #000; - } - - .header-controls { - position: absolute; - top: 1rem; - right: 1rem; - z-index: 50; - opacity: 0.6; - display: flex; - gap: 0.75rem; - } - - .main-content { - flex: 1; - display: flex; - flex-direction: column; - } - - .logo-section { - display: flex; - flex-direction: column; - align-items: center; - padding: 3rem 1rem 1.5rem; - } - - .logo-button { - width: 100px; - height: 100px; - border-radius: 50%; - border: 3px solid; - display: flex; - align-items: center; - justify-content: center; - margin-bottom: 0.75rem; - cursor: pointer; - transition: transform 0.2s; - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); - /* Dark mode default */ - background-color: #000; - } - - .light .logo-button { - background-color: #fff; - } - - .logo-button:hover { - transform: scale(1.05); - } - - .logo-button:active { - transform: scale(0.95); - } - - .app-name { - font-size: 1.5rem; - font-weight: 600; - color: #fff; - } - - .light .app-name { - color: #000; - } - - .form-section { - flex: 1; - display: flex; - justify-content: center; - padding: 1rem 1rem 2rem; - } - - .form-card { - width: 100%; - max-width: 400px; - border-radius: 1rem; - padding: 1.5rem; - border: 1px solid; - backdrop-filter: blur(10px); - /* Dark mode default */ - background-color: rgba(255, 255, 255, 0.08); - border-color: rgba(255, 255, 255, 0.1); - } - - .light .form-card { - background-color: rgba(255, 255, 255, 0.7); - border-color: rgba(0, 0, 0, 0.1); - } - - .form-header { - text-align: center; - margin-bottom: 1.5rem; - } - - .form-title { - font-size: 1.25rem; - font-weight: 600; - color: rgba(255, 255, 255, 0.9); - } - - .form-subtitle { - font-size: 0.875rem; - margin-top: 0.5rem; - color: rgba(255, 255, 255, 0.6); - } - - .light .form-title { - color: rgba(0, 0, 0, 0.9); - } - - .light .form-subtitle { - color: rgba(0, 0, 0, 0.6); - } - - .verified-banner { - display: flex; - align-items: center; - gap: 0.5rem; - padding: 0.75rem; - margin-bottom: 1rem; - border-radius: 0.75rem; - background: rgba(34, 197, 94, 0.15); - border: 1px solid rgba(34, 197, 94, 0.3); - color: #22c55e; - font-size: 0.875rem; - position: relative; - } - - .verified-banner-close { - position: absolute; - right: 0.5rem; - top: 50%; - transform: translateY(-50%); - background: none; - border: none; - color: #22c55e; - font-size: 1.25rem; - cursor: pointer; - padding: 0.25rem; - line-height: 1; - opacity: 0.7; - } - - .verified-banner-close:hover { - opacity: 1; - } - - .error-message { - display: flex; - align-items: flex-start; - gap: 0.5rem; - padding: 0.75rem; - margin-bottom: 1rem; - border-radius: 0.75rem; - background: rgba(239, 68, 68, 0.15); - border: 1px solid rgba(239, 68, 68, 0.3); - color: #ef4444; - font-size: 0.875rem; - } - - .error-content { - display: flex; - flex-direction: column; - gap: 0.25rem; - } - - .retry-countdown { - font-weight: 600; - margin-top: 0.25rem; - } - - .lockout-banner { - display: flex; - gap: 0.75rem; - padding: 1rem; - margin-bottom: 1rem; - border-radius: 0.75rem; - background: rgba(245, 158, 11, 0.15); - border: 1px solid rgba(245, 158, 11, 0.3); - color: #f59e0b; - } - - .lockout-icon { - flex-shrink: 0; - margin-top: 0.125rem; - } - - .lockout-content { - display: flex; - flex-direction: column; - gap: 0.25rem; - } - - .lockout-title { - font-weight: 600; - font-size: 0.9rem; - } - - .lockout-text { - font-size: 0.8rem; - opacity: 0.9; - } - - .lockout-reset-link { - background: none; - border: none; - cursor: pointer; - font-weight: 500; - font-size: 0.8rem; - padding: 0; - text-align: left; - text-decoration: underline; - margin-top: 0.25rem; - } - - .resend-link { - background: none; - border: none; - cursor: pointer; - font-weight: 500; - font-size: 0.875rem; - padding: 0; - text-align: left; - text-decoration: underline; - } - - .resend-link:hover { - opacity: 0.8; - } - - .resend-link:disabled { - opacity: 0.5; - cursor: not-allowed; - } - - .input-group { - margin-bottom: 0.75rem; - } - - .input-wrapper { - position: relative; - } - - .input-field { - width: 100%; - height: 3.5rem; - padding: 0 1rem; - border: 1px solid; - border-radius: 0.75rem; - font-size: 1rem; - transition: - border-color 0.2s, - box-shadow 0.2s; - /* Dark mode default */ - background-color: rgba(0, 0, 0, 0.2); - border-color: rgba(255, 255, 255, 0.2); - color: #fff; - } - - .input-field.input-error { - border-color: #ef4444; - } - - .light .input-field { - background-color: rgba(255, 255, 255, 0.8); - border-color: rgba(0, 0, 0, 0.1); - color: #000; - } - - .light .input-field.input-error { - border-color: #ef4444; - } - - .input-field:focus { - outline: none; - box-shadow: 0 0 0 2px var(--ring-color, currentColor); - } - - .input-field.has-icon { - padding-right: 3rem; - } - - .password-toggle { - position: absolute; - right: 0; - top: 0; - height: 100%; - width: 3rem; - display: flex; - align-items: center; - justify-content: center; - background: none; - border: none; - cursor: pointer; - transition: opacity 0.2s; - color: rgba(255, 255, 255, 0.5); - } - - .light .password-toggle { - color: rgba(0, 0, 0, 0.4); - } - - .password-toggle:hover { - opacity: 0.8; - } - - .options-row { - display: flex; - justify-content: space-between; - align-items: center; - margin-bottom: 1rem; - font-size: 0.875rem; - } - - .remember-label { - display: flex; - align-items: center; - gap: 0.5rem; - cursor: pointer; - color: rgba(255, 255, 255, 0.7); - } - - .light .remember-label { - color: rgba(0, 0, 0, 0.7); - } - - .remember-label input[type='checkbox'] { - width: 1.125rem; - height: 1.125rem; - cursor: pointer; - background-color: transparent; - border: 1.5px solid rgba(255, 255, 255, 0.4); - border-radius: 0.25rem; - appearance: none; - -webkit-appearance: none; - display: grid; - place-content: center; - } - - .remember-label input[type='checkbox']::before { - content: ''; - width: 0.65rem; - height: 0.65rem; - transform: scale(0); - transition: transform 0.1s ease-in-out; - box-shadow: inset 1rem 1rem var(--primary-color, #fff); - clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); - } - - .remember-label input[type='checkbox']:checked { - border-color: var(--primary-color, #fff); - } - - .remember-label input[type='checkbox']:checked::before { - transform: scale(1); - } - - .light .remember-label input[type='checkbox'] { - border-color: rgba(0, 0, 0, 0.3); - } - - .forgot-link { - background: none; - border: none; - cursor: pointer; - font-weight: 500; - padding: 0.25rem; - } - - .forgot-link:hover { - opacity: 0.7; - } - - .submit-button { - width: 100%; - height: 3.5rem; - border: 2px solid; - border-radius: 0.75rem; - font-weight: 500; - display: flex; - align-items: center; - justify-content: center; - gap: 0.5rem; - cursor: pointer; - transition: opacity 0.2s; - color: #fff; - } - - .light .submit-button { - color: #000; - } - - .submit-button:hover:not(:disabled) { - opacity: 0.85; - } - - .submit-button:disabled { - opacity: 0.5; - cursor: not-allowed; - } - - .passkey-button { - width: 100%; - height: 3.5rem; - border: 2px solid; - border-radius: 0.75rem; - font-weight: 500; - display: flex; - align-items: center; - justify-content: center; - gap: 0.5rem; - cursor: pointer; - transition: opacity 0.2s; - color: rgba(255, 255, 255, 0.9); - background: transparent; - margin-bottom: 0; - } - - .light .passkey-button { - color: rgba(0, 0, 0, 0.9); - } - - .passkey-button:hover:not(:disabled) { - opacity: 0.85; - } - - .passkey-button:disabled { - opacity: 0.5; - cursor: not-allowed; - } - - .divider { - display: flex; - align-items: center; - gap: 1rem; - margin: 1.25rem 0; - } - - .divider::before, - .divider::after { - content: ''; - flex: 1; - height: 1px; - background: currentColor; - opacity: 0.2; - } - - .divider span { - font-size: 0.75rem; - color: rgba(255, 255, 255, 0.5); - } - - .light .divider span { - color: rgba(0, 0, 0, 0.5); - } - - .magic-link-button { - width: 100%; - background: none; - border: none; - cursor: pointer; - font-weight: 500; - font-size: 0.875rem; - padding: 0.75rem; - text-align: center; - transition: opacity 0.2s; - } - - .magic-link-button:hover:not(:disabled) { - opacity: 0.7; - } - - .magic-link-button:disabled { - opacity: 0.4; - cursor: not-allowed; - } - - .register-link { - text-align: center; - font-size: 0.875rem; - margin-top: 1rem; - color: rgba(255, 255, 255, 0.6); - } - - .light .register-link { - color: rgba(0, 0, 0, 0.6); - } - - .register-link button { - background: none; - border: none; - cursor: pointer; - font-weight: 500; - padding: 0.25rem; - } - - .register-link button:hover { - opacity: 0.7; - } - - .app-slider-section { - width: 100%; - padding: 0 0 1rem; - } - - .version-label { - position: fixed; - bottom: 0.5rem; - right: 0.75rem; - font-size: 10px; - color: rgba(156, 163, 175, 0.6); - user-select: none; - pointer-events: none; - margin: 0; - } - - .light .version-label { - color: rgba(156, 163, 175, 0.6); - } - /* Entrance Animations */ @keyframes fadeInUp { from { @@ -1431,15 +952,15 @@ } } - .logo-section { + .anim-fade-in-scale { animation: fadeInScale 0.5s ease-out both; } - .form-card { + .anim-fade-in-up { animation: fadeInUp 0.5s ease-out 0.15s both; } - .app-slider-section { + .anim-fade-in { animation: fadeIn 0.5s ease-out 0.3s both; } @@ -1494,39 +1015,60 @@ animation: success-pulse 0.6s ease-in-out; } - /* Accessibility */ - .sr-only { - position: absolute; - width: 1px; + /* Divider pseudo-elements */ + .divider::before, + .divider::after { + content: ''; + flex: 1; height: 1px; - padding: 0; - margin: -1px; - overflow: hidden; - clip: rect(0, 0, 0, 0); - white-space: nowrap; - border: 0; + background: currentColor; + opacity: 0.2; } - .skip-link { - position: absolute; - top: -40px; - left: 0; - background: #000; - color: #fff; - padding: 0.5rem 1rem; - z-index: 100; - font-weight: 500; + /* Custom checkbox styling */ + .remember-label input[type='checkbox'] { + width: 1.125rem; + height: 1.125rem; + cursor: pointer; + background-color: transparent; + border: 1.5px solid currentColor; + border-radius: 0.25rem; + appearance: none; + -webkit-appearance: none; + display: grid; + place-content: center; + opacity: 0.5; } - .skip-link:focus { - top: 0; + .remember-label input[type='checkbox']::before { + content: ''; + width: 0.65rem; + height: 0.65rem; + transform: scale(0); + transition: transform 0.1s ease-in-out; + box-shadow: inset 1rem 1rem var(--primary-color, #fff); + clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); + } + + .remember-label input[type='checkbox']:checked { + border-color: var(--primary-color, #fff); + opacity: 1; + } + + .remember-label input[type='checkbox']:checked::before { + transform: scale(1); + } + + /* Focus ring color via CSS variable */ + input:focus { + --tw-ring-color: var(--ring-color, currentColor); } /* Reduced motion */ @media (prefers-reduced-motion: reduce) { - .logo-section, - .form-card, - .app-slider-section, + .anim-fade-in-scale, + .anim-fade-in-up, + .anim-fade-in, .shake, .spinner, .success-pulse { @@ -1536,25 +1078,4 @@ transition-duration: 0.01ms !important; } } - - /* Mobile adjustments */ - @media (max-width: 480px) { - .logo-section { - padding-top: 2rem; - } - - .logo-button { - width: 80px; - height: 80px; - } - - .logo-button :global(svg) { - width: 40px; - height: 40px; - } - - .form-card { - padding: 1.25rem; - } - } diff --git a/packages/shared-auth-ui/src/pages/RegisterPage.svelte b/packages/shared-auth-ui/src/pages/RegisterPage.svelte index 41fb8e6d8..d5e670fae 100644 --- a/packages/shared-auth-ui/src/pages/RegisterPage.svelte +++ b/packages/shared-auth-ui/src/pages/RegisterPage.svelte @@ -156,31 +156,6 @@ } } - // Password validation - let passwordRequirements = $derived.by(() => { - if (!password) { - return { - length: false, - lowercase: false, - uppercase: false, - digit: false, - special: false, - }; - } - - return { - length: password.length >= 8, - lowercase: /[a-z]/.test(password), - uppercase: /[A-Z]/.test(password), - digit: /[0-9]/.test(password), - special: /[^a-zA-Z0-9]/.test(password), - }; - }); - - function getPageBackground() { - return isDark ? darkBackground : lightBackground; - } - async function handleRegister() { loading = true; error = null; @@ -266,23 +241,22 @@ Create Account - {appName} + +

- + {#if headerControls} -
+
{@render headerControls()}
{/if} - -
-
- -
-

- {appName} -

-
- - -
-
- -

+ +
+
- {t.title} -

+ +
+

{appName}

+
- - {#if error} -
-

{error}

+ +
+
+ +
+

+ {t.title} +

- {/if} - - {#if verificationEmailSent} -
-

- {t.verificationEmailSent} -

-
- {/if} + + {#if error} + + {/if} - - {#if success && needsVerification} -
+ {#if verificationEmailSent} +
+ {t.verificationEmailSent} +
+ {/if} + + + {#if success && needsVerification} +
+
+
+ + + +
+
+

+ {t.checkYourEmail || 'Check your email'} +

+

+ {t.accountCreated} +

+
+
+ + {#if onResendVerification} +
+

+ Didn't receive the email? +

+ +
+ {/if} +
+ {/if} + + +
{ + e.preventDefault(); + handleRegister(); + }} > -
-
- - - -
-
-

- {t.checkYourEmail || 'Check your email'} -

-

- {t.accountCreated} -

-
+ +
+
- {#if onResendVerification} -
-

- Didn't receive the email? -

+ +
+
+
- {/if} -
- {/if} - - - { - e.preventDefault(); - handleRegister(); - }} - class="space-y-4" - > -
- -
- -
-
- -
-
- + -
-
- - + +
+
+ + +
+ + +

+ {t.passwordRequirements} +

+ + + + + + +
+
- - -

- {t.passwordRequirements} -

- - - - - -
-
-
+