@angular/animations#AnimationTriggerMetadata TypeScript Examples

The following examples show how to use @angular/animations#AnimationTriggerMetadata. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: message-animations.ts    From alauda-ui with MIT License 6 votes vote down vote up
MessageAnimations: {
  readonly inOut: AnimationTriggerMetadata;
} = {
  inOut: trigger('inOut', [
    state(
      'flyRight, flyLeft',
      style({ opacity: 1, transform: 'translateX(0)' }),
    ),
    state('slideDown', style({ opacity: 1, transform: 'translateY(0)' })),
    transition('* => slideDown', [
      style({ opacity: 0, transform: 'translateY(-50%)' }),
      animate('100ms ease-in-out'),
    ]),
    state('slideUp', style({ opacity: 0, 'margin-top': '-50%' })),
    transition('* => slideUp', [
      style({ opacity: 1, 'margin-top': '0' }),
      animate('100ms 200ms ease-in-out'),
    ]),

    state('flyLeft', style({ opacity: 1, transform: 'translateX(0)' })),
    transition('* => flyLeft', [
      style({ opacity: 0, transform: 'translateX(5%)' }),
      animate('100ms ease-in-out'),
    ]),
    state('flyUp', style({ opacity: 0, 'margin-top': '-30%' })),
    transition('* => flyUp', [
      style({ opacity: 1, 'margin-top': '0' }),
      animate('100ms 150ms ease-in-out'),
    ]),
    state('void', style({ opacity: 0 })),
    state('true', style({ opacity: 1 })),
    state('false', style({ opacity: 0 })),
    transition('* => true', animate('150ms cubic-bezier(0.0, 0.0, 0.2, 1)')),
    transition('* => void', animate('150ms cubic-bezier(0.4, 0.0, 1, 1)')),
  ]),
}
Example #2
Source File: collapse-button.component.ts    From sba-angular with MIT License 6 votes vote down vote up
export function collapseButtonAnimations(timings: number | string): AnimationTriggerMetadata[] {
    return [
        trigger('toggleCollapsed', [
            state('0', style({transform: 'rotate(0deg)'})),
            state('1', style({transform: 'rotate(-180deg)'})),
            transition('0 <=> 1', [
                animate(timings)
            ])
        ]),
    ];
}
Example #3
Source File: collapse.component.ts    From sba-angular with MIT License 6 votes vote down vote up
export function collapseAnimations(timings: number | string): AnimationTriggerMetadata[] {
    return [
        trigger('show', [
            state('void', style({height: 0})),
            transition('void <=> 1', [
                animate(timings)
            ])
        ])
    ];
}
Example #4
Source File: notification.ts    From sba-angular with MIT License 6 votes vote down vote up
export function notificationAnimations(timings: number | string): AnimationTriggerMetadata[] {
    return [
        trigger('autoClose', [
            transition('1 => void', [
                animate(timings, style({ opacity: 0 }))
            ])
        ])
    ];
}