-
-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(package): added animations to the ngx-auth-firebaseui component
- Loading branch information
1 parent
6539538
commit 27b7704
Showing
11 changed files
with
376 additions
and
283 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
Oops, something went wrong.
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,36 @@ | ||
import {animate, animateChild, animation, query, stagger, state, style, transition, trigger, useAnimation} from '@angular/animations'; | ||
|
||
const customAnimation = animation( | ||
[ | ||
style({ | ||
opacity: '{{opacity}}', | ||
transform: 'scale({{scale}}) translate3d({{x}}, {{y}}, {{z}})' | ||
}), | ||
animate('{{duration}} {{delay}} cubic-bezier(0.0, 0.0, 0.2, 1)', style('*')) | ||
], | ||
{ | ||
params: { | ||
duration: '200ms', | ||
delay: '0ms', | ||
opacity: '0', | ||
scale: '1', | ||
x: '0', | ||
y: '0', | ||
z: '0' | ||
} | ||
} | ||
); | ||
|
||
export const NgxAuthFirebaseuiAnimations = [ | ||
trigger('animate', [transition('void => *', [useAnimation(customAnimation)])]), | ||
|
||
trigger('animateStagger', [ | ||
state('50', style('*')), | ||
state('100', style('*')), | ||
state('200', style('*')), | ||
|
||
transition('void => 50', query('@*', [stagger('50ms', [animateChild()])], {optional: true})), | ||
transition('void => 100', query('@*', [stagger('100ms', [animateChild()])], {optional: true})), | ||
transition('void => 200', query('@*', [stagger('200ms', [animateChild()])], {optional: true})) | ||
]), | ||
]; |
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
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 |
---|---|---|
|
@@ -5,13 +5,15 @@ | |
<mat-card> | ||
<mat-card-title>{{signInCardTitleText}}</mat-card-title> | ||
<mat-card-content> | ||
<form [formGroup]="signInFormGroup" | ||
<form [@animateStagger]="{ value: '50' }" | ||
[formGroup]="signInFormGroup" | ||
(ngSubmit)="signInFormGroup.valid && | ||
authProcess.signInWith | ||
(authProviders.EmailAndPassword, | ||
{email:signInFormGroup.value.email, password: signInFormGroup.value.password})"> | ||
<div fxLayout="column" fxLayoutAlign="center"> | ||
<mat-form-field [appearance]="appearance"> | ||
<mat-form-field [@animate]="{value:'*',params:{duration:'300ms',y:'100px'}}" | ||
[appearance]="appearance"> | ||
<mat-label>{{emailText}}</mat-label> | ||
<input matInput | ||
formControlName="email" | ||
|
@@ -25,7 +27,8 @@ | |
</mat-error> | ||
</mat-form-field> | ||
|
||
<mat-form-field [appearance]="appearance"> | ||
<mat-form-field [@animate]="{value:'*',params:{duration:'300ms',y:'100px'}}" | ||
[appearance]="appearance"> | ||
<mat-label>{{passwordText}}</mat-label> | ||
<input matInput [type]="togglePass.type" [minlength]="min" [maxlength]="max" formControlName="password" | ||
required/> | ||
|
@@ -44,7 +47,8 @@ | |
</mat-error> | ||
</mat-form-field> | ||
|
||
<button mat-raised-button | ||
<button [@animate]="{ value: '*', params: { x: '50px' } }" | ||
mat-raised-button | ||
style="margin-top: 20px" | ||
type="submit" | ||
class="space-top" | ||
|
@@ -57,6 +61,7 @@ | |
|
||
<div fxLayoutAlign="center"> | ||
<button *ngIf="resetPasswordEnabled" | ||
[@animate]="{ value: '*', params: { x: '-50px' } }" | ||
mat-button | ||
class="space-top" | ||
[color]="color" | ||
|
@@ -67,7 +72,8 @@ | |
|
||
</mat-card-content> | ||
<mat-card-footer *ngIf="authProcess.isLoading"> | ||
<mat-progress-bar mode="indeterminate"></mat-progress-bar> | ||
<mat-progress-bar [@animate]="{ value: '*', params: { z: '50px', delay: '50ms', scale: '0.2' } }" | ||
mode="indeterminate"></mat-progress-bar> | ||
</mat-card-footer> | ||
</mat-card> | ||
</mat-tab> | ||
|
@@ -79,11 +85,13 @@ | |
<div *ngIf="!authProcess.emailConfirmationSent;then register else confirm"></div> | ||
<ng-template #register> | ||
<mat-card-content fxLayout="column" fxLayoutAlign="center"> | ||
<form [formGroup]="signUpFormGroup" (ngSubmit)="signUpFormGroup.valid && | ||
<form [@animate]="{value:'*',params:{duration:'300ms',y:'100px'}}" | ||
[formGroup]="signUpFormGroup" (ngSubmit)="signUpFormGroup.valid && | ||
processLegalSignUP(authProvider.EmailAndPassword)"> | ||
<div fxLayout="column" fxLayoutAlign="center"> | ||
<!--name--> | ||
<mat-form-field [appearance]="appearance"> | ||
<mat-form-field [@animate]="{ value: '*', params: { x: '50px' } }" | ||
[appearance]="appearance"> | ||
<!--labels will work only with @angular/[email protected] --> | ||
<mat-label>{{nameText}}</mat-label> | ||
<input | ||
|
@@ -108,7 +116,8 @@ | |
</mat-form-field> | ||
|
||
<!--email--> | ||
<mat-form-field [appearance]="appearance"> | ||
<mat-form-field [@animate]="{ value: '*', params: { x: '50px' } }" | ||
[appearance]="appearance"> | ||
<mat-label>{{emailText}}</mat-label> | ||
<input matInput | ||
type="email" | ||
|
@@ -125,7 +134,8 @@ | |
|
||
<!--password--> | ||
<div fxLayout="column"> | ||
<mat-form-field [appearance]="appearance"> | ||
<mat-form-field [@animate]="{ value: '*', params: { x: '50px' } }" | ||
[appearance]="appearance"> | ||
<mat-label>{{passwordText}}</mat-label> | ||
<input | ||
matInput | ||
|
@@ -172,7 +182,8 @@ | |
|
||
</div> | ||
|
||
<button mat-raised-button | ||
<button [@animate]="{ value: '*', params: { x: '100px' } }" | ||
mat-raised-button | ||
style="margin-top: 20px" | ||
type="submit" | ||
[color]="color"> | ||
|
@@ -183,6 +194,7 @@ | |
</form> | ||
|
||
<button *ngIf="guestEnabled" | ||
[@animate]="{ value: '*', params: { x: '-100px' } }" | ||
mat-button | ||
style="margin-top: 20px" | ||
[color]="color" | ||
|
@@ -194,7 +206,8 @@ | |
</mat-card-content> | ||
|
||
<mat-card-footer *ngIf="authProcess.isLoading"> | ||
<mat-progress-bar mode="indeterminate"></mat-progress-bar> | ||
<mat-progress-bar [@animate]="{ value: '*', params: { z: '50px', delay: '50ms', scale: '0.2' } }" | ||
mode="indeterminate"></mat-progress-bar> | ||
</mat-card-footer> | ||
|
||
</ng-template> | ||
|
@@ -213,7 +226,8 @@ | |
|
||
<!--Reset password tab--> | ||
<mat-tab *ngIf="passwordResetWished" [label]="resetPasswordTabText"> | ||
<form [formGroup]="resetPasswordFormGroup" (ngSubmit)="resetPasswordFormGroup.valid && resetPassword()"> | ||
<form [@animateStagger]="{ value: '50' }" | ||
[formGroup]="resetPasswordFormGroup" (ngSubmit)="resetPasswordFormGroup.valid && resetPassword()"> | ||
|
||
<mat-card> | ||
<mat-card-header fxLayoutAlign="end"> | ||
|
@@ -227,7 +241,8 @@ | |
</mat-card-header> | ||
|
||
<mat-card-content> | ||
<mat-form-field class="full-width" [appearance]="appearance"> | ||
<mat-form-field class="full-width" [appearance]="appearance" | ||
[@animate]="{value:'*',params:{duration:'300ms',y:'100px'}}"> | ||
<mat-label> {{ resetPasswordTabText }} </mat-label> | ||
<input matInput | ||
[readonly]="passReset" | ||
|
@@ -244,18 +259,22 @@ | |
</mat-form-field> | ||
</mat-card-content> | ||
<mat-card-actions fxLayoutAlign="center"> | ||
<button mat-raised-button | ||
<button [@animate]="{ value: '*', params: { x: '50px' } }" | ||
mat-raised-button | ||
type="submit" | ||
[color]="color" | ||
[disabled]="passReset"> | ||
{{resetPasswordActionButtonText}} | ||
</button> | ||
</mat-card-actions> | ||
<mat-card-footer *ngIf="passReset" fxLayoutAlign="center"> | ||
<p>{{resetPasswordInstructionsText}}</p> | ||
<p [@animate]="{ value: '*', params: { x: '-50px' } }">{{resetPasswordInstructionsText}}</p> | ||
</mat-card-footer> | ||
<mat-card-footer> | ||
<mat-progress-bar *ngIf="authProcess.isLoading" mode="indeterminate"></mat-progress-bar> | ||
<mat-progress-bar *ngIf="authProcess.isLoading" | ||
[@animate]="{ value: '*', params: { z: '50px', delay: '50ms', scale: '0.2' } }" | ||
mode="indeterminate"> | ||
</mat-progress-bar> | ||
</mat-card-footer> | ||
</mat-card> | ||
</form> | ||
|
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
Oops, something went wrong.