diff --git a/frontend/src/app/app.routes.ts b/frontend/src/app/app.routes.ts index b74af87..208750f 100644 --- a/frontend/src/app/app.routes.ts +++ b/frontend/src/app/app.routes.ts @@ -1,4 +1,8 @@ import { Routes } from '@angular/router'; import { HomeComponent } from './components/home/home.component'; +import { RegisterComponent } from './components/auth/register/register.component'; -export const routes: Routes = [{ path: '', component: HomeComponent }]; +export const routes: Routes = [ + { path: '', component: HomeComponent }, + { path: 'register', component: HomeComponent }, +]; diff --git a/frontend/src/app/components/auth/auth.component.html b/frontend/src/app/components/auth/auth.component.html index 61fbc66..562c0f5 100644 --- a/frontend/src/app/components/auth/auth.component.html +++ b/frontend/src/app/components/auth/auth.component.html @@ -1,3 +1,30 @@
- +
+

Movies, TV shows, and more

+

Watch whenever you want wherever you want

+

Enter your email to create or restart your subscription.

+
+
+ + +
diff --git a/frontend/src/app/components/auth/auth.component.scss b/frontend/src/app/components/auth/auth.component.scss index f885271..31e3ca7 100644 --- a/frontend/src/app/components/auth/auth.component.scss +++ b/frontend/src/app/components/auth/auth.component.scss @@ -13,4 +13,55 @@ section { width: 100vw; height: 100vh; text-align: center; + background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), + url(./../../../assets/img/backgrounds/home.png); + background-size: cover; + background-position: center; + background-repeat: no-repeat; +} + +.headline { + p:nth-child(1) { + font-size: 48px; + font-weight: 700; + padding: 12px; + } + p:nth-child(2) { + font-size: 24px; + font-weight: 500; + padding: 12px; + } + p:nth-child(3) { + font-size: 18px; + font-weight: 400; + padding: 12px; + } +} + +.register-form { + display: flex; + align-items: center; + justify-content: space-between; + width: 500px; + padding: 24px; + input { + width: 70%; + padding: 12px 18px; + margin: 8px 0; + box-sizing: border-box; + background: transparent; + border: 2px solid $white; + border-radius: 24px; + font-size: 18px; + font-weight: 400; + transition: background-color 250ms ease-in-out, color 250ms ease-in-out, + border-color 250ms ease-in-out; + &::placeholder { + color: rgba($white, 0.6); + } + &:focus { + outline: none; + background-color: rgba($white, 0.1); + } + } } diff --git a/frontend/src/app/components/auth/auth.component.ts b/frontend/src/app/components/auth/auth.component.ts index b57955d..9153ea3 100644 --- a/frontend/src/app/components/auth/auth.component.ts +++ b/frontend/src/app/components/auth/auth.component.ts @@ -1,11 +1,28 @@ import { Component } from '@angular/core'; -import { RegisterComponent } from './register/register.component'; +import { FormsModule, NgForm } from '@angular/forms'; +import { BtnLargeComponent } from '../../shared/components/btn-large/btn-large.component'; @Component({ selector: 'app-auth', standalone: true, - imports: [RegisterComponent], + imports: [BtnLargeComponent, FormsModule], templateUrl: './auth.component.html', styleUrl: './auth.component.scss', }) -export class AuthComponent {} +export class AuthComponent { + authData = { + mail: '', + }; + + isUserEmailValid(emailValue: string) { + const emailRegex = /^[\w.%+-]+@[\w.-]+\.[a-zA-Z]{2,}$/; + return emailRegex.test(emailValue); + } + + onSubmit(ngForm: NgForm) { + if (ngForm.submitted && ngForm.form.valid) { + console.log(this.authData.mail); + this.authData.mail = ''; + } + } +} diff --git a/frontend/src/app/components/auth/register/register.component.html b/frontend/src/app/components/auth/register/register.component.html index 55cb218..0e2f8bc 100644 --- a/frontend/src/app/components/auth/register/register.component.html +++ b/frontend/src/app/components/auth/register/register.component.html @@ -1,27 +1,49 @@
-
-

Movies, TV shows, and more

-

Watch whenever you want wherever you want

-

Enter your email to create or restart your subscription.

+
+
Sign Up
+
+ + + + +
-
- - -
diff --git a/frontend/src/app/components/auth/register/register.component.scss b/frontend/src/app/components/auth/register/register.component.scss index d855426..8288390 100644 --- a/frontend/src/app/components/auth/register/register.component.scss +++ b/frontend/src/app/components/auth/register/register.component.scss @@ -13,46 +13,51 @@ section { width: 100vw; height: 100vh; text-align: center; + background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), + url(./../../../../assets/img/backgrounds/register.png); + background-size: cover; + background-position: center; + background-repeat: no-repeat; } -.headline { - p:nth-child(1) { +.content { + width: 520px; + height: 492px; + padding: 43px 56px; + border-radius: 48px; + background-color: $white; + .headline { font-size: 48px; font-weight: 700; - padding: 12px; + color: $blue; + margin-bottom: 24px; } - p:nth-child(2) { - font-size: 24px; - font-weight: 500; - padding: 12px; - } - p:nth-child(3) { - font-size: 18px; - font-weight: 400; - padding: 12px; + app-btn-large { + margin-top: 36px; } } .register-form { display: flex; + flex-direction: column; align-items: center; justify-content: space-between; - width: 500px; - padding: 24px; + gap: 32px; input { - width: 70%; - padding: 12px; + width: 90%; + padding: 12px 18px; margin: 8px 0; box-sizing: border-box; background: transparent; - border: 2px solid $white; - border-radius: 24px; + color: $blue; + border: 1px solid $blue; + border-radius: 12px; font-size: 18px; font-weight: 400; transition: background-color 250ms ease-in-out, color 250ms ease-in-out, border-color 250ms ease-in-out; &::placeholder { - color: rgba($white, 0.6); + color: rgba($blue, 0.6); } &:focus { outline: none; diff --git a/frontend/src/app/components/auth/register/register.component.ts b/frontend/src/app/components/auth/register/register.component.ts index 06e65df..5a24598 100644 --- a/frontend/src/app/components/auth/register/register.component.ts +++ b/frontend/src/app/components/auth/register/register.component.ts @@ -12,11 +12,19 @@ import { FormsModule, NgForm } from '@angular/forms'; export class RegisterComponent { authData = { mail: '', + password: '', + passwordConfirm: '', }; + isUserEmailValid(emailValue: string) { + const emailRegex = /^[\w.%+-]+@[\w.-]+\.[a-zA-Z]{2,}$/; + return emailRegex.test(emailValue); + } + onSubmit(ngForm: NgForm) { if (ngForm.submitted && ngForm.form.valid) { - console.log('pass'); + console.log(this.authData.mail); + this.authData.mail = ''; } } } diff --git a/frontend/src/app/components/home/footer/footer.component.scss b/frontend/src/app/components/home/footer/footer.component.scss index 559ce76..a673429 100644 --- a/frontend/src/app/components/home/footer/footer.component.scss +++ b/frontend/src/app/components/home/footer/footer.component.scss @@ -10,6 +10,7 @@ footer { right: 0; height: 88px; padding: 12px; + z-index: 1; p { padding: 0 36px; font-size: 18px; diff --git a/frontend/src/app/components/home/header/header.component.scss b/frontend/src/app/components/home/header/header.component.scss index ec14620..9379cbf 100644 --- a/frontend/src/app/components/home/header/header.component.scss +++ b/frontend/src/app/components/home/header/header.component.scss @@ -10,6 +10,7 @@ header { right: 0; height: 88px; padding: 10px 96px; + z-index: 1; } .logo { diff --git a/frontend/src/app/components/home/home.component.html b/frontend/src/app/components/home/home.component.html index a2784e7..e27d48b 100644 --- a/frontend/src/app/components/home/home.component.html +++ b/frontend/src/app/components/home/home.component.html @@ -1,5 +1,9 @@
+ @if (currentRoute === '') { + } @if (currentRoute === 'register') { + + }
diff --git a/frontend/src/app/components/home/home.component.scss b/frontend/src/app/components/home/home.component.scss index 391a7d8..962e72e 100644 --- a/frontend/src/app/components/home/home.component.scss +++ b/frontend/src/app/components/home/home.component.scss @@ -3,10 +3,10 @@ section { height: 100vh; } -.bg-home { - background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), - url(./../../../assets/img/backgrounds/home.png); - background-size: cover; - background-position: center; - background-repeat: no-repeat; -} +// .bg-home { +// background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), +// url(./../../../assets/img/backgrounds/home.png); +// background-size: cover; +// background-position: center; +// background-repeat: no-repeat; +// } diff --git a/frontend/src/app/components/home/home.component.ts b/frontend/src/app/components/home/home.component.ts index f3dfbb9..1b6912f 100644 --- a/frontend/src/app/components/home/home.component.ts +++ b/frontend/src/app/components/home/home.component.ts @@ -1,13 +1,26 @@ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { HeaderComponent } from './header/header.component'; import { FooterComponent } from './footer/footer.component'; import { AuthComponent } from '../auth/auth.component'; +import { Router, NavigationEnd, ActivatedRoute } from '@angular/router'; +import { filter } from 'rxjs/operators'; +import { RegisterComponent } from '../auth/register/register.component'; @Component({ selector: 'app-home', standalone: true, - imports: [HeaderComponent, FooterComponent, AuthComponent], + imports: [HeaderComponent, FooterComponent, AuthComponent, RegisterComponent], templateUrl: './home.component.html', styleUrl: './home.component.scss', }) -export class HomeComponent {} +export class HomeComponent implements OnInit { + currentRoute: any; + + constructor(private route: ActivatedRoute) {} + + ngOnInit(): void { + this.route.url.subscribe((url) => { + this.currentRoute = url[0]?.path || ''; + }); + } +} diff --git a/frontend/src/assets/img/backgrounds/register.png b/frontend/src/assets/img/backgrounds/register.png new file mode 100644 index 0000000..ac3e4a5 Binary files /dev/null and b/frontend/src/assets/img/backgrounds/register.png differ