106 lines
3.1 KiB
HTML
106 lines
3.1 KiB
HTML
<section>
|
|
<div class="content">
|
|
<div class="headline">Log in</div>
|
|
<form
|
|
#loginForm="ngForm"
|
|
(ngSubmit)="onSubmit(loginForm)"
|
|
onsubmit="return false"
|
|
(input)="this.errorService.clearError()"
|
|
>
|
|
<input
|
|
type="mail"
|
|
id="mail"
|
|
name="mail"
|
|
#mail="ngModel"
|
|
placeholder="Email Address"
|
|
autocomplete="email"
|
|
[(ngModel)]="authData.mail"
|
|
[class.error-border]="
|
|
(!mail.valid && mail.touched) ||
|
|
(mail.touched &&
|
|
!isUserEmailValid(authData.mail.toLowerCase()) &&
|
|
authData.mail.length > 0)
|
|
"
|
|
required
|
|
/>
|
|
<div class="error-msg">
|
|
@if (!mail.valid && mail.touched) {
|
|
<p>Please enter your email</p>
|
|
} @else { @if (mail.touched && authData.mail.length > 0 &&
|
|
!isUserEmailValid(authData.mail.toLowerCase())) {
|
|
<p>This is not a valid email format</p>
|
|
}}
|
|
</div>
|
|
<div class="password-field">
|
|
<input
|
|
[type]="authService.passwordFieldType"
|
|
id="password"
|
|
name="password"
|
|
class="password-input"
|
|
#password="ngModel"
|
|
placeholder="Enter a password"
|
|
autocomplete="new-password"
|
|
[(ngModel)]="authData.password"
|
|
pattern="[^<>]*"
|
|
minlength="6"
|
|
[class.error-border]="
|
|
password.invalid && password.touched && authData.password.length < 6
|
|
"
|
|
required
|
|
/>
|
|
<img
|
|
class="passwordEye"
|
|
(click)="authService.togglePasswordVisibility()"
|
|
[src]="authService.passwordIcon"
|
|
/>
|
|
</div>
|
|
<div class="error-msg">
|
|
@if (!password.valid && password.touched && authData.password.length <
|
|
1) {
|
|
<p>Please enter your password</p>
|
|
} @else { @if (authData.password && authData.password.length < 6 &&
|
|
password.touched) {
|
|
<p>Password is too short, min 6 characters</p>
|
|
} }
|
|
</div>
|
|
<div class="checkbox">
|
|
<label class="container"
|
|
>Remember me
|
|
<input
|
|
type="checkbox"
|
|
id="checkbox"
|
|
name="checkbox"
|
|
#checkbox
|
|
[(ngModel)]="authData.checkbox"
|
|
/>
|
|
<span class="checkmark"></span>
|
|
</label>
|
|
</div>
|
|
<div class="buttons">
|
|
<app-btn-large
|
|
[value]="'Log in'"
|
|
[disabled]="
|
|
!authData.mail ||
|
|
(!isUserEmailValid(authData.mail) && authData.mail.length > 0) ||
|
|
!password.valid ||
|
|
authData.guestLogin
|
|
"
|
|
></app-btn-large>
|
|
<app-btn-large
|
|
[value]="'Guest Log in'"
|
|
[disabled]="
|
|
authData.guestLogin || (!!authData.mail && !!authData.password)
|
|
"
|
|
(click)="guestLogin()"
|
|
></app-btn-large>
|
|
</div>
|
|
</form>
|
|
<div class="footer">
|
|
<a routerLink="/forgot-password">Forgot password?</a>
|
|
<div class="footer-content">
|
|
<p>New to Videoflix?</p>
|
|
<a routerLink="/register">Sign Up now</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|