From 730a177b952f2e9a89f954a11a3578ace8b8a783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6ninger?= <44400490+p-hoeni@users.noreply.github.com> Date: Mon, 21 Oct 2024 00:29:37 +0200 Subject: [PATCH] [#6] create first login page design --- .../app/identity/login/login.component.css | 0 .../app/identity/login/login.component.html | 83 ++++++++++++++++++- .../app/identity/login/login.component.scss | 83 +++++++++++++++++++ .../src/app/identity/login/login.component.ts | 44 ++++++++-- 4 files changed, 202 insertions(+), 8 deletions(-) delete mode 100644 CLIENT/CLIENT.FileSharing/src/app/identity/login/login.component.css create mode 100644 CLIENT/CLIENT.FileSharing/src/app/identity/login/login.component.scss diff --git a/CLIENT/CLIENT.FileSharing/src/app/identity/login/login.component.css b/CLIENT/CLIENT.FileSharing/src/app/identity/login/login.component.css deleted file mode 100644 index e69de29..0000000 diff --git a/CLIENT/CLIENT.FileSharing/src/app/identity/login/login.component.html b/CLIENT/CLIENT.FileSharing/src/app/identity/login/login.component.html index cbdfa13..a93a1bd 100644 --- a/CLIENT/CLIENT.FileSharing/src/app/identity/login/login.component.html +++ b/CLIENT/CLIENT.FileSharing/src/app/identity/login/login.component.html @@ -1,3 +1,80 @@ -

- login works! -

+
+ +
+ lock + Login +
+ +
+ + Username + + @if (usernameInput.invalid && usernameInput.touched) { + Username is required. + } + + + Password + + @if (passwordInput.invalid && passwordInput.touched) { + Password is required. + } + +
+ Keep me signed in + + Language + + @for (language of languages; track language) { + {{ language.label }} + } + + +
+ @if (loginErrorMessage) { + {{ + loginErrorMessage + }} + } +
+ + +
+
+
+
+ No account yet? + +
diff --git a/CLIENT/CLIENT.FileSharing/src/app/identity/login/login.component.scss b/CLIENT/CLIENT.FileSharing/src/app/identity/login/login.component.scss new file mode 100644 index 0000000..f810814 --- /dev/null +++ b/CLIENT/CLIENT.FileSharing/src/app/identity/login/login.component.scss @@ -0,0 +1,83 @@ +$panel-width: 390px; + +:host { + height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + background: #f6f6f6; +} + +.panel { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + padding: 44px 56px 48px; + border-radius: 4px; + box-shadow: 0 2px 4px #727685; + width: $panel-width; + margin: 32px 16px 8px; + + .header { + display: flex; + align-items: center; + justify-content: space-between; + + .title { + margin-left: 8px; + font-size: 24px; + line-height: 24px; + } + } + + form { + display: flex; + flex-direction: column; + width: 100%; + margin-top: 44px; + } + + #password-field { + margin-top: 4px; + } + + .selections-container { + display: flex; + justify-content: space-between; + align-items: center; + margin-top: 16px; + + .selection { + width: 50%; + } + + .keep-signed-in { + padding-bottom: 20px; + } + } + + .error-message { + text-align: center; + margin-top: 4px; + } + + .buttons { + display: flex; + justify-content: space-between; + margin-top: 24px; + + #login-button { + padding-inline: 48px; + } + } +} + +#register-section { + width: $panel-width; + display: flex; + align-items: center; + justify-content: center; + gap: 8px; +} diff --git a/CLIENT/CLIENT.FileSharing/src/app/identity/login/login.component.ts b/CLIENT/CLIENT.FileSharing/src/app/identity/login/login.component.ts index 5701fa2..a2d7c95 100644 --- a/CLIENT/CLIENT.FileSharing/src/app/identity/login/login.component.ts +++ b/CLIENT/CLIENT.FileSharing/src/app/identity/login/login.component.ts @@ -1,15 +1,49 @@ import { Component, OnInit } from '@angular/core'; +import { FormsModule, NgForm, ReactiveFormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatIconModule } from '@angular/material/icon'; +import { MatInputModule } from '@angular/material/input'; +import { MatSelectModule } from '@angular/material/select'; @Component({ - selector: 'app-login', + selector: 'fs-login', templateUrl: './login.component.html', - styleUrls: ['./login.component.css'] + styleUrl: './login.component.scss', + standalone: true, + imports: [ + MatIconModule, + MatFormFieldModule, + MatSelectModule, + FormsModule, + ReactiveFormsModule, + MatInputModule, + MatButtonModule, + MatCheckboxModule, + ], }) export class LoginComponent implements OnInit { + public loginErrorMessage?: string; + public showLanguageSelection = true; - constructor() { } + public languages = [ + { value: 'en', label: 'English' }, + { value: 'de', label: 'Deutsch' }, + { value: 'fr', label: 'Français' }, + ]; + public selectedLanguage = 'en'; - ngOnInit() { - } + protected username?: string; + protected password?: string; + public keepSignedIn: boolean = false; + + constructor() {} + ngOnInit() {} + + onSubmit(form: NgForm, event: Event) { + event.preventDefault(); + console.log('Form submitted', form.value); + } }