| @@ -2,8 +2,9 @@ import { NgModule } from '@angular/core'; | |||
| import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; | |||
| const routes: Routes = [ | |||
| { path: '', redirectTo: 'onboarding', pathMatch: 'full' }, | |||
| { path: '', redirectTo: 'login', pathMatch: 'full' }, | |||
| { path: 'onboarding', loadChildren: './onboarding/onboarding.module#OnboardingPageModule' }, | |||
| { path: 'login', loadChildren: './login/login.module#LoginPageModule' }, | |||
| ]; | |||
| @NgModule({ | |||
| @@ -0,0 +1,26 @@ | |||
| import { NgModule } from '@angular/core'; | |||
| import { CommonModule } from '@angular/common'; | |||
| import { FormsModule } from '@angular/forms'; | |||
| import { Routes, RouterModule } from '@angular/router'; | |||
| import { IonicModule } from '@ionic/angular'; | |||
| import { LoginPage } from './login.page'; | |||
| const routes: Routes = [ | |||
| { | |||
| path: '', | |||
| component: LoginPage | |||
| } | |||
| ]; | |||
| @NgModule({ | |||
| imports: [ | |||
| CommonModule, | |||
| FormsModule, | |||
| IonicModule, | |||
| RouterModule.forChild(routes) | |||
| ], | |||
| declarations: [LoginPage] | |||
| }) | |||
| export class LoginPageModule {} | |||
| @@ -0,0 +1,30 @@ | |||
| <ion-content> | |||
| <section class="login"> | |||
| <figure class="upfold"> | |||
| <img src="assets/custom/onboarding.svg"> | |||
| </figure> | |||
| <header> | |||
| Welcome Back! | |||
| </header> | |||
| <p class="description"> | |||
| Please login to your account | |||
| </p> | |||
| <div class="input-holder"> | |||
| <input type="email" placeholder="Email ID" [(ngModel)]="credentials.email"> | |||
| </div> | |||
| <div class="input-holder"> | |||
| <input *ngIf="!show_password" type="password" placeholder="Password" [(ngModel)]="credentials.password"> | |||
| <input *ngIf="show_password" type="text" placeholder="Password" [(ngModel)]="credentials.password"> | |||
| <ion-icon name="eye" *ngIf="!show_password" (click)="show_password = !show_password"></ion-icon> | |||
| <ion-icon name="eye-off" *ngIf="show_password" (click)="show_password = !show_password"></ion-icon> | |||
| </div> | |||
| <a class="forgot-link"> Forgot Password? </a> | |||
| <ion-button class="login-button" shape="round" size="block"> Sign In </ion-button> | |||
| <p class="signin-description"> Don't have account? <a (click)="signup()">Sign Up</a> </p> | |||
| </section> | |||
| </ion-content> | |||
| @@ -0,0 +1,96 @@ | |||
| .login { | |||
| background-color: var(--background-blue); | |||
| height: 100vh; | |||
| overflow-y: auto; | |||
| display: block; | |||
| } | |||
| .upfold { | |||
| display: block; | |||
| width: 100%; | |||
| padding-top: 10px; | |||
| img { | |||
| object-fit: contain; | |||
| width: 100%; | |||
| } | |||
| } | |||
| header { | |||
| font-size: 20px; | |||
| margin: 20px auto 0; | |||
| text-align: center; | |||
| } | |||
| .description { | |||
| font-size: 11px; | |||
| color: var(--brand-grey); | |||
| line-height: 1.5; | |||
| width: 70%; | |||
| margin: 10px auto 30px; | |||
| text-align: center; | |||
| } | |||
| .input-holder { | |||
| display: flex; | |||
| width: 85%; | |||
| margin: 15px auto; | |||
| background-color: white; | |||
| justify-content: space-between; | |||
| align-items: center; | |||
| box-shadow: 0px 0px 5px var(--brand-grey); | |||
| border-radius: 5px; | |||
| overflow: hidden; | |||
| ion-icon { | |||
| font-size: 20px; | |||
| margin: 0 15px; | |||
| color: var(--brand-voilet); | |||
| } | |||
| input { | |||
| flex-grow: 1; | |||
| height: 38px; | |||
| font-size: 11px; | |||
| border: 0; | |||
| padding: 0 20px; | |||
| outline: none; | |||
| letter-spacing: 1px; | |||
| } | |||
| } | |||
| .forgot-link { | |||
| font-weight: bold; | |||
| color: var(--brand-voilet); | |||
| font-size: 10px; | |||
| letter-spacing: 0.5px; | |||
| width: 85%; | |||
| margin: 20px auto; | |||
| display: block; | |||
| } | |||
| .login-button { | |||
| --background: var(--brand-voilet); | |||
| text-transform: none; | |||
| width: 85%; | |||
| margin: 0 auto 20px; | |||
| font-size: 12px; | |||
| height: 42px; | |||
| letter-spacing: 0; | |||
| font-weight: 400; | |||
| } | |||
| .signin-description { | |||
| font-size: 11px; | |||
| color: var(--brand-grey); | |||
| line-height: 1.5; | |||
| width: 70%; | |||
| text-align: center; | |||
| margin: 0 auto 20px; | |||
| a { | |||
| color: var(--brand-voilet); | |||
| font-family: 'M PLUS Rounded 1c'; | |||
| font-weight: bold; | |||
| } | |||
| } | |||
| @@ -0,0 +1,27 @@ | |||
| import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core'; | |||
| import { async, ComponentFixture, TestBed } from '@angular/core/testing'; | |||
| import { LoginPage } from './login.page'; | |||
| describe('LoginPage', () => { | |||
| let component: LoginPage; | |||
| let fixture: ComponentFixture<LoginPage>; | |||
| beforeEach(async(() => { | |||
| TestBed.configureTestingModule({ | |||
| declarations: [ LoginPage ], | |||
| schemas: [CUSTOM_ELEMENTS_SCHEMA], | |||
| }) | |||
| .compileComponents(); | |||
| })); | |||
| beforeEach(() => { | |||
| fixture = TestBed.createComponent(LoginPage); | |||
| component = fixture.componentInstance; | |||
| fixture.detectChanges(); | |||
| }); | |||
| it('should create', () => { | |||
| expect(component).toBeTruthy(); | |||
| }); | |||
| }); | |||
| @@ -0,0 +1,28 @@ | |||
| import { Component, OnInit } from '@angular/core'; | |||
| import { Router } from '@angular/router'; | |||
| @Component({ | |||
| selector: 'app-login', | |||
| templateUrl: './login.page.html', | |||
| styleUrls: ['./login.page.scss'], | |||
| }) | |||
| export class LoginPage implements OnInit { | |||
| credentials = { | |||
| email: null, | |||
| password: null | |||
| } | |||
| show_password = false; | |||
| constructor( | |||
| private router: Router | |||
| ) { } | |||
| ngOnInit() { | |||
| } | |||
| signup() { | |||
| this.router.navigate(['/onboarding']); | |||
| } | |||
| } | |||
| @@ -18,7 +18,7 @@ | |||
| Get Started | |||
| </ion-button> | |||
| <p class="signin-description"> | |||
| Already have account? <a> Sign in </a> | |||
| Already have account? <a (click)="signin()"> Sign in </a> | |||
| </p> | |||
| </ion-slide> | |||
| @@ -55,7 +55,7 @@ | |||
| <ion-button class="next-button" shape="round" (click)="nextPage()"> | |||
| Continue | |||
| </ion-button> | |||
| <p class="signin-description"> | |||
| <p class="signin-description" (click)="nextPage()"> | |||
| <a> Not Now </a> | |||
| </p> | |||
| </ion-slide> | |||
| @@ -126,7 +126,8 @@ | |||
| [(ngModel)]="credentials.password" (input)="checkPassword()"> | |||
| <input *ngIf="show_password" type="text" placeholder="Password" | |||
| [(ngModel)]="credentials.password" (input)="checkPassword()"> | |||
| <ion-icon name="eye" (click)="show_password = !show_password"></ion-icon> | |||
| <ion-icon *ngIf="!show_password" name="eye" (click)="show_password = !show_password"></ion-icon> | |||
| <ion-icon *ngIf="show_password" name="eye-off" (click)="show_password = !show_password"></ion-icon> | |||
| </div> | |||
| <ion-list lines="none"> | |||
| @@ -171,7 +172,7 @@ | |||
| <ion-button class="next-button" shape="round" (click)="nextPage()"> | |||
| Continue | |||
| </ion-button> | |||
| <p class="signin-description"> | |||
| <p class="signin-description" (click)="nextPage()"> | |||
| <a> Not Now </a> | |||
| </p> | |||
| </ion-slide> | |||
| @@ -1,4 +1,5 @@ | |||
| import { Component, OnInit } from '@angular/core'; | |||
| import { Router } from '@angular/router'; | |||
| @Component({ | |||
| selector: 'app-onboarding', | |||
| @@ -17,7 +18,9 @@ export class OnboardingPage implements OnInit { | |||
| has_upper = false; | |||
| has_special = false; | |||
| constructor() { } | |||
| constructor( | |||
| private router: Router | |||
| ) { } | |||
| ngOnInit() { | |||
| this.slideOpts = { | |||
| @@ -64,4 +67,8 @@ export class OnboardingPage implements OnInit { | |||
| document.querySelector('ion-slides').slidePrev(400); | |||
| } | |||
| signin() { | |||
| this.router.navigate(['/login']); | |||
| } | |||
| } | |||
| @@ -27,7 +27,7 @@ | |||
| @import url('https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap'); | |||
| @import url('https://fonts.googleapis.com/css?family=M+PLUS+Rounded+1c:400&display=swap'); | |||
| @import url('https://fonts.googleapis.com/css?family=M+PLUS+Rounded+1c:400,500&display=swap'); | |||
| ion-button, button, a, p, div, input { | |||
| font-family: 'Roboto', sans-serif; | |||