swimlane/ngx-ui

View on GitHub
projects/swimlane/ngx-ui/src/lib/animations/slide-left.animation.ts

Summary

Maintainability
A
2 hrs
Test Coverage
import { style, animate, transition } from '@angular/animations';

export function slideLeftAnimation(ms = 500) {
  return [
    transition(':enter', [
      style({
        opacity: 0,
        transform: 'translateX(-100%)'
      }),
      animate(
        ms,
        style({
          transform: 'translateX(0)',
          opacity: 1
        })
      )
    ]),
    transition(':leave', [
      animate(
        ms,
        style({
          transform: 'translateX(-100%)',
          opacity: 0
        })
      )
    ])
  ];
}