Skip to content

Instantly share code, notes, and snippets.

@gsans
Last active March 7, 2020 14:03
Show Gist options
  • Save gsans/6b8421f9055369965426dc11818fa29e to your computer and use it in GitHub Desktop.
Save gsans/6b8421f9055369965426dc11818fa29e to your computer and use it in GitHub Desktop.
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 }),
])
])
])
@stevermeister
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment