-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
mat-password-strength-info
c…
…omponent
- Loading branch information
1 parent
c60eb6a
commit cff9fda
Showing
3 changed files
with
121 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import {animate, animation, AnimationReferenceMetadata, keyframes, style} from '@angular/animations'; | ||
|
||
export function flipIn(timing: number, rotateX: number, rotateY: number): AnimationReferenceMetadata { | ||
const params = {timing: timing, delay: 0, rotateX, rotateY}; | ||
|
||
return animation( | ||
[ | ||
style({'backface-visibility': 'visible'}), | ||
animate( | ||
'{{ timing }}s {{ delay }}s ease-in', | ||
keyframes([ | ||
style({ | ||
opacity: 0, | ||
transform: | ||
'perspective(400px) rotate3d({{ rotateX }}, {{ rotateY }}, 0, 90deg)', | ||
offset: 0, | ||
}), | ||
style({ | ||
opacity: 1, | ||
transform: | ||
'perspective(400px) rotate3d({{ rotateX }}, {{ rotateY }}, 0, -20deg)', | ||
offset: 0.4, | ||
}), | ||
style({ | ||
transform: | ||
'perspective(400px) rotate3d({{ rotateX }}, {{ rotateY }}, 0, 10deg)', | ||
offset: 0.6, | ||
}), | ||
style({ | ||
transform: | ||
'perspective(400px) rotate3d({{ rotateX }}, {{ rotateY }}, 0, -5deg)', | ||
offset: 0.8, | ||
}), | ||
style({ | ||
transform: 'perspective(400px) rotate3d(0, 0, 0, 0)', | ||
offset: 1, | ||
}), | ||
]) | ||
), | ||
], | ||
{params} | ||
); | ||
} | ||
|
||
export const flipInX = flipIn(1, 1, 0); | ||
export const flipInY = flipIn(1, 0, 1); | ||
|
||
export const shake = animation( | ||
animate( | ||
'{{ timing }}s {{ delay }}s', | ||
keyframes([ | ||
style({ transform: 'translate3d(0, 0, 0)', offset: 0 }), | ||
style({ transform: 'translate3d(-10px, 0, 0)', offset: 0.1 }), | ||
style({ transform: 'translate3d(10px, 0, 0)', offset: 0.2 }), | ||
style({ transform: 'translate3d(-10px, 0, 0)', offset: 0.3 }), | ||
style({ transform: 'translate3d(10px, 0, 0)', offset: 0.4 }), | ||
style({ transform: 'translate3d(-10px, 0, 0)', offset: 0.5 }), | ||
style({ transform: 'translate3d(10px, 0, 0)', offset: 0.6 }), | ||
style({ transform: 'translate3d(-10px, 0, 0)', offset: 0.7 }), | ||
style({ transform: 'translate3d(10px, 0, 0)', offset: 0.8 }), | ||
style({ transform: 'translate3d(-10px, 0, 0)', offset: 0.9 }), | ||
style({ transform: 'translate3d(0, 0, 0)', offset: 1 }), | ||
]) | ||
), | ||
{ params: { timing: 1, delay: 0 } } | ||
); |
40 changes: 20 additions & 20 deletions
40
src/module/component/mat-password-strength-info/mat-password-strength-info.component.html
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
36 changes: 35 additions & 1 deletion
36
src/module/component/mat-password-strength-info/mat-password-strength-info.component.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