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

export const fadeInAnimation = trigger('fadeIn', [
  state('true', style({ opacity: 1, transform: 'translateY(0)' })),
  transition(':enter', [style({ opacity: 0, transform: 'translateY(-50px)' }), animate('200ms ease-in')]),
  transition(':leave', animate(200, style({ opacity: 0 }))),
]);

export function fadeInWithDelay(delayInSec: number) {
  return trigger('fadeInWithDelay', [
    state('true', style({ opacity: 1, transform: 'translateY(0)' })),
    transition(':enter', [style({ opacity: 0, transform: 'translateY(-50px)' }), animate(`200ms ${delayInSec}s ease-in`)]),
    transition(':leave', animate(200, style({ opacity: 0 }))),
  ]);
}
