Skip to content

Instantly share code, notes, and snippets.

@adrianfaciu
Created October 21, 2018 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrianfaciu/0a39c14da637d6e5dd5c225f7ddee4c5 to your computer and use it in GitHub Desktop.
Save adrianfaciu/0a39c14da637d6e5dd5c225f7ddee4c5 to your computer and use it in GitHub Desktop.
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