import { Component } from '@angular/core' ; import { IonicPage , AlertController , LoadingController , NavController , NavParams , App } from 'ionic-angular' ; import { TabsPage } from "../tabs/tabs" ; /**
 * Generated class for the LoginPage page.
 *
 * See http://ionicframework.com/docs/components/#navigation for more info
 * on Ionic pages and navigation.
 */ @ IonicPage ( ) @ Component ( { selector : 'page-login' , templateUrl : 'login.html' , } ) export class LoginPage { public loginForm : any ; constructor ( public loadingCtrl , public app , public navCtrl , public navParams ) { } login ( ) { const loading = this . loadingCtrl . create ( { duration : 500 } ) ; loading . onDidDismiss ( ( ) => { this . navCtrl . setRoot ( TabsPage ) ; } ) ; loading . present ( ) ; } goToSignup ( ) { } colors = new Array ( [ 62 , 35 , 255 ] , [ 60 , 255 , 60 ] , [ 255 , 35 , 98 ] , [ 45 , 175 , 230 ] , [ 255 , 0 , 255 ] , [ 255 , 128 , 0 ] ) ; step = 0 ; colorIndices = [ 0 , 1 , 2 , 3 ] ; gradientSpeed = 0.00005 ; gradient = '' ; updateGradient ( ) { const c00 = this . colors [ this . colorIndices [ 0 ] ] ; const c01 = this . colors [ this . colorIndices [ 1 ] ] ; const c10 = this . colors [ this . colorIndices [ 2 ] ] ; const c11 = this . colors [ this . colorIndices [ 3 ] ] ; const istep = 1 - this . step ; const r1 = Math . round ( istep * c00 [ 0 ] + this . step * c01 [ 0 ] ) ; const g1 = Math . round ( istep * c00 [ 1 ] + this . step * c01 [ 1 ] ) ; const b1 = Math . round ( istep * c00 [ 2 ] + this . step * c01 [ 2 ] ) ; const color1 = 'rgb(' + r1 + ',' + g1 + ',' + b1 + ')' ; const r2 = Math . round ( istep * c10 [ 0 ] + this . step * c11 [ 0 ] ) ; const g2 = Math . round ( istep * c10 [ 1 ] + this . step * c11 [ 1 ] ) ; const b2 = Math . round ( istep * c10 [ 2 ] + this . step * c11 [ 2 ] ) ; const color2 = 'rgb(' + r2 + ',' + g2 + ',' + b2 + ')' ; this . gradient = `-webkit-gradient(linear, left top, right bottom, from(${ color1 }), to(${ color2 }))` ; this . step += this . gradientSpeed ; if ( this . step >= 1 ) { this . step %= 1 ; this . colorIndices [ 0 ] = this . colorIndices [ 1 ] ; this . colorIndices [ 2 ] = this . colorIndices [ 3 ] ; this . colorIndices [ 1 ] = ( this . colorIndices [ 1 ] + Math . floor ( 1 + Math . random ( ) * ( this . colors . length - 1 ) ) ) % this . colors . length ; this . colorIndices [ 3 ] = ( this . colorIndices [ 3 ] + Math . floor ( 1 + Math . random ( ) * ( this . colors . length - 1 ) ) ) % this . colors . length ; } setInterval ( ( ) => { this . updateGradient ( ) ; } , 40 ) ; } }