Cleanup router animation code

This commit is contained in:
Cameron Cordes
2019-09-29 13:04:16 -04:00
parent 12cc5b072f
commit 8feddb493c

View File

@@ -5,34 +5,30 @@ import { Angulartics2Piwik } from 'angulartics2/piwik';
export const routerTransition = trigger('routerTransition', [ export const routerTransition = trigger('routerTransition', [
transition('* <=> *', [ transition('* <=> *', [
// Initial state of new route
query(':enter', query(':enter',
style({ style({
position: 'fixed', position: 'fixed',
width: '100%', width: '100%',
// transform: 'translateX(-100%)' height: '100%',
opacity: 0 opacity: 0
}), }),
{optional: true}), {optional: true}),
// move page off screen right on leave
query(':leave', query(':leave',
animate('300ms ease-in-out', animate('300ms ease-in-out',
style({ style({
position: 'fixed', position: 'fixed',
width: '100%', width: '100%',
// transform: 'translateX(100%)' height: '100%',
opacity: 0 opacity: 0
}) })
), ),
{optional: true}), {optional: true}),
// move page in screen from left to right
query(':enter', query(':enter',
animate('300ms ease-in-out', animate('300ms ease-in-out',
style({ style({
opacity: 1, opacity: 1,
// transform: 'translateX(0%)'
}) })
), ),
{optional: true}), {optional: true}),