import { AnimationTriggerMetadata, trigger, state, transition, style, animate } from '@angular/animations';

export const slideAnimationTime = 150;
export const toastAnimations: {
  readonly slideToast: AnimationTriggerMetadata;
} = {
  slideToast: trigger('slideAnimation', [
    state('default', style({ transform: 'translateY(0%)' })),
    transition('void => *', [style({ transform: 'translateY(-100%)' }), animate(`${slideAnimationTime}ms ease-in`)]),
    transition('default => closing', animate(`${slideAnimationTime}ms ease-in`, style({ transform: 'translateY(-100%)' }))),
  ]),
};

export type ToastAnimationState = 'default' | 'closing';
