generated from SachaWildCode/angular-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5cbe8de
commit 477d44f
Showing
5 changed files
with
170 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<main> | ||
<form [formGroup]="loginForm"> | ||
<section>img here</section> | ||
<section> | ||
<label> | ||
Email: | ||
<input type="email" formControlName="email" /> | ||
</label> | ||
<br /> | ||
<label> | ||
Mot de passe: | ||
<input type="password" formControlName="password" /> | ||
</label> | ||
<label | ||
>Se souvenir de moi | ||
<input type="checkbox" formControlName="rememberMe" /> | ||
</label> | ||
<br /> | ||
<button type="submit">Se connecter</button> | ||
</section> | ||
</form> | ||
</main> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
main { | ||
display: flex; | ||
width: 100%; | ||
align-items: center; | ||
justify-content: center; | ||
flex: 1; | ||
border-style: dashed; | ||
max-width: 980px; | ||
margin: 0 auto; | ||
padding: 1rem; | ||
|
||
form { | ||
border: 3px solid black; | ||
display: flex; | ||
padding: 1rem; | ||
min-width: 50%; | ||
background-color: #f9f9f9; | ||
border-radius: 10px; | ||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); | ||
flex: 1 1 50%; | ||
|
||
section { | ||
border-style: dashed; | ||
flex: 1 1 50%; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 1rem; | ||
margin: 0.5rem; | ||
|
||
label { | ||
display: block; | ||
margin-bottom: 0.5rem; | ||
font-weight: bold; | ||
border-style: dashed; | ||
width: 100%; | ||
|
||
input { | ||
display: block; | ||
width: 100%; | ||
padding: 0.5rem; | ||
border: 1px solid #ccc; | ||
border-radius: 5px; | ||
margin-top: 0.5rem; | ||
flex-shrink: 0; | ||
} | ||
&:last-of-type { | ||
position: relative; | ||
input[type='checkbox'] { | ||
position: absolute; | ||
right: 0; | ||
top: 0; | ||
width: 100%; | ||
height: 100%; | ||
margin: 0; | ||
} | ||
} | ||
} | ||
|
||
button { | ||
align-self: flex-end; | ||
padding: 0.5rem 1rem; | ||
border: none; | ||
border-radius: 5px; | ||
background-color: #007bff; | ||
color: white; | ||
cursor: pointer; | ||
transition: background-color 0.3s; | ||
margin-bottom: 3rem; | ||
|
||
&:hover { | ||
background-color: #0056b3; | ||
} | ||
} | ||
} | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/app/components/login-form/login-form.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { LoginFormComponent } from './login-form.component'; | ||
|
||
describe('LoginFormComponent', () => { | ||
let component: LoginFormComponent; | ||
let fixture: ComponentFixture<LoginFormComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
imports: [LoginFormComponent], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(LoginFormComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Component } from '@angular/core'; | ||
import { ReactiveFormsModule, FormBuilder, FormControl, FormGroup } from '@angular/forms'; | ||
|
||
@Component({ | ||
selector: 'app-login-form', | ||
standalone: true, | ||
imports: [ReactiveFormsModule], | ||
templateUrl: './login-form.component.html', | ||
styleUrl: './login-form.component.scss', | ||
}) | ||
export class LoginFormComponent { | ||
loginForm: FormGroup; | ||
constructor(private fb: FormBuilder) { | ||
this.loginForm = this.fb.group({ | ||
username: new FormControl(''), | ||
password: new FormControl(''), | ||
}); | ||
} | ||
} |