-
-
Save benjanderson/d29ca44abf8f70a6613ae4a1d1c2b74e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {trigger, animate, style, group, animateChild, query, stagger, transition} from '@angular/animations'; | |
export const routerTransition = trigger('routerTransition', [ | |
transition('* <=> *', [ | |
/* order */ | |
/* 1 */ query(':enter, :leave', style({ position: 'fixed', width:'100%' }) | |
, { optional: true }), | |
/* 2 */ group([ // block executes in parallel | |
query(':enter', [ | |
style({ transform: 'translateX(100%)' }), | |
animate('0.5s ease-in-out', style({ transform: 'translateX(0%)' })) | |
], { optional: true }), | |
query(':leave', [ | |
style({ transform: 'translateX(0%)' }), | |
animate('0.5s ease-in-out', style({ transform: 'translateX(-100%)' })) | |
], { optional: true }), | |
]) | |
]) | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment