Created
October 21, 2018 14:56
-
-
Save adrianfaciu/0a39c14da637d6e5dd5c225f7ddee4c5 to your computer and use it in GitHub Desktop.
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
import { | |
AnimationTriggerMetadata, | |
trigger, | |
state, | |
transition, | |
style, | |
animate, | |
} from '@angular/animations'; | |
export const toastAnimations: { | |
readonly fadeToast: AnimationTriggerMetadata; | |
} = { | |
fadeToast: trigger('fadeAnimation', [ | |
state('in', style({ opacity: 1 })), | |
transition('void => *', [style({ opacity: 0 }), animate('{{ fadeIn }}ms')]), | |
transition( | |
'default => closing', | |
animate('{{ fadeOut }}ms', style({ opacity: 0 })), | |
), | |
]), | |
}; | |
export type ToastAnimationState = 'default' | 'closing'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment