|
| 1 | +<script lang="ts"> |
| 2 | + import walkininSvg from '$lib/assets/splash-illustrations/walkin.svg?raw'; |
| 3 | + import OAuthButtons from '$lib/components/login/OAuthButtons.svelte'; |
| 4 | + import type { Snippet } from 'svelte'; |
| 5 | +
|
| 6 | + interface Props { |
| 7 | + title: string; |
| 8 | + subtitle?: string; |
| 9 | + oauthText?: string; |
| 10 | + bottomLinkText?: string; |
| 11 | + bottomLinkHref?: string; |
| 12 | + bottomLinkLabel?: string; |
| 13 | + children: Snippet; |
| 14 | + } |
| 15 | +
|
| 16 | + let { |
| 17 | + title, |
| 18 | + subtitle, |
| 19 | + oauthText = 'Or continue with', |
| 20 | + bottomLinkText, |
| 21 | + bottomLinkHref, |
| 22 | + bottomLinkLabel, |
| 23 | + children |
| 24 | + }: Props = $props(); |
| 25 | +</script> |
| 26 | + |
| 27 | +<div class="auth-page"> |
| 28 | + <div class="auth-form__container"> |
| 29 | + <div class="auth-form"> |
| 30 | + <h1 class="text-serif-42 m-bottom-40"> |
| 31 | + <i>{title}</i> |
| 32 | + {#if subtitle} |
| 33 | + {subtitle} |
| 34 | + {/if} |
| 35 | + </h1> |
| 36 | + |
| 37 | + {@render children()} |
| 38 | + |
| 39 | + <div class="auth-form__social"> |
| 40 | + <div class="auth-form__social-title"> |
| 41 | + <span class="text-12">{oauthText}</span> |
| 42 | + </div> |
| 43 | + |
| 44 | + <OAuthButtons /> |
| 45 | + </div> |
| 46 | + |
| 47 | + {#if bottomLinkText && bottomLinkHref && bottomLinkLabel} |
| 48 | + <div class="text-12 auth-bottom-link"> |
| 49 | + <p>{bottomLinkText} <a href={bottomLinkHref}>{bottomLinkLabel}</a></p> |
| 50 | + </div> |
| 51 | + {/if} |
| 52 | + </div> |
| 53 | + |
| 54 | + <div class="auth-form__illustration"> |
| 55 | + {@html walkininSvg} |
| 56 | + </div> |
| 57 | + </div> |
| 58 | +</div> |
| 59 | + |
| 60 | +<style lang="postcss"> |
| 61 | + .auth-page { |
| 62 | + display: flex; |
| 63 | + flex: 1; |
| 64 | + flex-direction: column; |
| 65 | + align-items: center; |
| 66 | + justify-content: center; |
| 67 | + } |
| 68 | +
|
| 69 | + .auth-form__container { |
| 70 | + display: flex; |
| 71 | + width: 100%; |
| 72 | + max-width: 1000px; |
| 73 | + overflow: hidden; |
| 74 | + border-radius: var(--radius-xl); |
| 75 | + } |
| 76 | +
|
| 77 | + .auth-form { |
| 78 | + display: flex; |
| 79 | + flex: 4; |
| 80 | + flex-direction: column; |
| 81 | + width: 100%; |
| 82 | + padding: 50px 80px 30px; |
| 83 | + background-color: var(--clr-bg-1); |
| 84 | + } |
| 85 | +
|
| 86 | + .auth-form__social { |
| 87 | + display: flex; |
| 88 | + flex-direction: column; |
| 89 | + margin-top: 24px; |
| 90 | + } |
| 91 | +
|
| 92 | + .auth-form__social-title { |
| 93 | + display: flex; |
| 94 | + justify-content: center; |
| 95 | + margin-bottom: 16px; |
| 96 | + color: var(--clr-text-2); |
| 97 | +
|
| 98 | + span { |
| 99 | + margin: 0 12px; |
| 100 | + } |
| 101 | +
|
| 102 | + &::before, |
| 103 | + &::after { |
| 104 | + flex: 1; |
| 105 | + margin: auto 0; |
| 106 | + border-bottom: 1px solid var(--clr-border-2); |
| 107 | + content: ''; |
| 108 | + } |
| 109 | + } |
| 110 | +
|
| 111 | + .auth-bottom-link { |
| 112 | + display: flex; |
| 113 | + align-items: center; |
| 114 | + justify-content: center; |
| 115 | + margin-top: 40px; |
| 116 | + gap: 4px; |
| 117 | + color: var(--clr-text-2); |
| 118 | +
|
| 119 | + a { |
| 120 | + text-decoration: underline; |
| 121 | +
|
| 122 | + &:hover { |
| 123 | + color: var(--clr-text-1); |
| 124 | + } |
| 125 | + } |
| 126 | + } |
| 127 | +
|
| 128 | + .auth-form__illustration { |
| 129 | + display: flex; |
| 130 | + flex: 4; |
| 131 | + flex-direction: column; |
| 132 | + align-items: center; |
| 133 | + justify-content: center; |
| 134 | + padding: 32px; |
| 135 | + background-color: var(--clr-illustration-bg); |
| 136 | +
|
| 137 | + :global(svg) { |
| 138 | + max-width: 400px; |
| 139 | + } |
| 140 | + } |
| 141 | +</style> |
0 commit comments