2017-02-22 18:13:21 +00:00
|
|
|
// #docregion
|
2018-03-09 15:54:59 -08:00
|
|
|
import { animate, state, style, transition, trigger } from '@angular/animations';
|
2017-02-22 18:13:21 +00:00
|
|
|
|
|
|
|
// Component transition animations
|
2018-03-09 15:54:59 -08:00
|
|
|
export const slideInDownAnimation =
|
2017-02-22 18:13:21 +00:00
|
|
|
trigger('routeAnimation', [
|
|
|
|
state('*',
|
|
|
|
style({
|
|
|
|
opacity: 1,
|
|
|
|
transform: 'translateX(0)'
|
|
|
|
})
|
|
|
|
),
|
|
|
|
transition(':enter', [
|
|
|
|
style({
|
|
|
|
opacity: 0,
|
|
|
|
transform: 'translateX(-100%)'
|
|
|
|
}),
|
|
|
|
animate('0.2s ease-in')
|
|
|
|
]),
|
|
|
|
transition(':leave', [
|
|
|
|
animate('0.5s ease-out', style({
|
|
|
|
opacity: 0,
|
|
|
|
transform: 'translateY(100%)'
|
|
|
|
}))
|
|
|
|
])
|
|
|
|
]);
|