2017-09-21 12:05:18 +00:00
|
|
|
import { sequence, trigger, animate, style, group, query, transition, animateChild, state, animation, useAnimation, stagger } from '@angular/animations';
|
2017-07-10 02:59:30 +00:00
|
|
|
|
2017-09-21 12:05:18 +00:00
|
|
|
const customAnimation = animation([
|
|
|
|
style({
|
|
|
|
opacity : '{{opacity}}',
|
|
|
|
transform: 'scale({{scale}}) translate3d({{x}}, {{y}}, {{z}})'
|
|
|
|
}),
|
|
|
|
animate('{{duration}} {{delay}} cubic-bezier(0.0, 0.0, 0.2, 1)', style('*'))
|
|
|
|
], {
|
|
|
|
params: {
|
|
|
|
duration: '200ms',
|
|
|
|
delay : '0ms',
|
|
|
|
opacity : '0',
|
|
|
|
scale : '1',
|
|
|
|
x : '0',
|
|
|
|
y : '0',
|
|
|
|
z : '0'
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
export const fuseAnimations = [
|
|
|
|
|
|
|
|
trigger('animate', [transition('void => *', [useAnimation(customAnimation)])]),
|
|
|
|
|
|
|
|
trigger('animateStagger', [
|
|
|
|
state('50', style('*')),
|
|
|
|
state('100', style('*')),
|
|
|
|
state('200', style('*')),
|
|
|
|
|
|
|
|
transition('void => 50',
|
|
|
|
query('@*',
|
|
|
|
[
|
|
|
|
stagger('50ms', [
|
|
|
|
animateChild()
|
|
|
|
])
|
2017-10-25 07:15:19 +00:00
|
|
|
], {optional: true})),
|
2017-09-21 12:05:18 +00:00
|
|
|
transition('void => 100',
|
|
|
|
query('@*',
|
|
|
|
[
|
|
|
|
stagger('100ms', [
|
|
|
|
animateChild()
|
|
|
|
])
|
2017-10-25 07:15:19 +00:00
|
|
|
], {optional: true})),
|
2017-09-21 12:05:18 +00:00
|
|
|
transition('void => 200',
|
|
|
|
query('@*',
|
|
|
|
[
|
|
|
|
stagger('200ms', [
|
|
|
|
animateChild()
|
|
|
|
])
|
2017-10-25 07:15:19 +00:00
|
|
|
], {optional: true}))
|
2017-09-21 12:05:18 +00:00
|
|
|
]),
|
|
|
|
|
|
|
|
trigger('fadeInOut', [
|
2017-09-11 09:30:01 +00:00
|
|
|
state('0', style({
|
|
|
|
display: 'none',
|
|
|
|
opacity: 0
|
|
|
|
})),
|
|
|
|
state('1', style({
|
|
|
|
display: 'block',
|
|
|
|
opacity: 1
|
|
|
|
})),
|
|
|
|
transition('1 => 0', animate('300ms ease-out')),
|
|
|
|
transition('0 => 1', animate('300ms ease-in'))
|
2017-09-21 12:05:18 +00:00
|
|
|
]),
|
2017-09-11 09:30:01 +00:00
|
|
|
|
2017-09-21 12:05:18 +00:00
|
|
|
trigger('slideInOut', [
|
2017-08-02 16:51:02 +00:00
|
|
|
state('0', style({
|
|
|
|
height : '0px',
|
|
|
|
display: 'none'
|
|
|
|
})),
|
|
|
|
state('1', style({
|
|
|
|
height : '*',
|
|
|
|
display: 'block'
|
|
|
|
})),
|
2017-07-10 02:59:30 +00:00
|
|
|
transition('1 => 0', animate('300ms ease-out')),
|
|
|
|
transition('0 => 1', animate('300ms ease-in'))
|
2017-09-21 12:05:18 +00:00
|
|
|
]),
|
2017-08-02 16:51:02 +00:00
|
|
|
|
2017-09-21 12:05:18 +00:00
|
|
|
trigger('slideInLeft', [
|
2017-08-02 16:51:02 +00:00
|
|
|
state('void', style({
|
|
|
|
transform: 'translateX(-100%)',
|
|
|
|
display : 'none'
|
|
|
|
})),
|
|
|
|
state('*', style({
|
|
|
|
transform: 'translateX(0)',
|
|
|
|
display : 'flex'
|
|
|
|
})),
|
2017-07-23 07:32:13 +00:00
|
|
|
transition('void => *', animate('300ms')),
|
|
|
|
transition('* => void', animate('300ms'))
|
2017-09-21 12:05:18 +00:00
|
|
|
]),
|
2017-08-02 16:51:02 +00:00
|
|
|
|
2017-09-21 12:05:18 +00:00
|
|
|
trigger('slideInRight', [
|
2017-08-02 16:51:02 +00:00
|
|
|
state('void', style({
|
|
|
|
transform: 'translateX(100%)',
|
|
|
|
display : 'none'
|
|
|
|
})),
|
|
|
|
state('*', style({
|
|
|
|
transform: 'translateX(0)',
|
|
|
|
display : 'flex'
|
|
|
|
})),
|
|
|
|
transition('void => *', animate('300ms')),
|
|
|
|
transition('* => void', animate('300ms'))
|
2017-09-21 12:05:18 +00:00
|
|
|
]),
|
2017-08-02 16:51:02 +00:00
|
|
|
|
2017-09-21 12:05:18 +00:00
|
|
|
trigger('slideInTop', [
|
2017-08-02 16:51:02 +00:00
|
|
|
state('void', style({
|
|
|
|
transform: 'translateY(-100%)',
|
|
|
|
display : 'none'
|
|
|
|
})),
|
|
|
|
state('*', style({
|
|
|
|
transform: 'translateY(0)',
|
|
|
|
display : 'flex'
|
|
|
|
})),
|
|
|
|
transition('void => *', animate('300ms')),
|
|
|
|
transition('* => void', animate('300ms'))
|
2017-09-21 12:05:18 +00:00
|
|
|
]),
|
2017-08-02 16:51:02 +00:00
|
|
|
|
2017-09-21 12:05:18 +00:00
|
|
|
trigger('slideInBottom', [
|
2017-08-19 13:20:09 +00:00
|
|
|
state('void',
|
|
|
|
style({
|
|
|
|
transform: 'translateY(100%)',
|
|
|
|
display : 'none'
|
|
|
|
})),
|
2017-08-02 16:51:02 +00:00
|
|
|
state('*', style({
|
|
|
|
transform: 'translateY(0)',
|
|
|
|
display : 'flex'
|
|
|
|
})),
|
2017-07-23 07:32:13 +00:00
|
|
|
transition('void => *', animate('300ms')),
|
|
|
|
transition('* => void', animate('300ms'))
|
2017-09-21 12:05:18 +00:00
|
|
|
]),
|
2017-08-19 13:20:09 +00:00
|
|
|
|
2017-11-02 07:47:28 +00:00
|
|
|
trigger('expandCollapse', [
|
|
|
|
state('void', style({
|
|
|
|
height: '0px'
|
|
|
|
})),
|
|
|
|
state('*', style({
|
|
|
|
height: '*'
|
|
|
|
})),
|
|
|
|
transition('void => *', animate('300ms ease-out')),
|
|
|
|
transition('* => void', animate('300ms ease-in'))
|
|
|
|
]),
|
|
|
|
|
2017-09-21 12:05:18 +00:00
|
|
|
trigger('routerTransitionLeft', [
|
2017-08-19 13:20:09 +00:00
|
|
|
|
|
|
|
transition('* => *', [
|
2017-08-23 14:28:15 +00:00
|
|
|
query('fuse-content > :enter, fuse-content > :leave', [
|
|
|
|
style({
|
|
|
|
position: 'absolute',
|
|
|
|
top : 0,
|
|
|
|
bottom : 0,
|
|
|
|
left : 0,
|
|
|
|
right : 0
|
|
|
|
})
|
2017-08-24 08:13:12 +00:00
|
|
|
], {optional: true}),
|
2017-08-23 14:28:15 +00:00
|
|
|
query('fuse-content > :enter', [
|
|
|
|
style({
|
|
|
|
transform: 'translateX(100%)',
|
|
|
|
opacity : 0
|
|
|
|
})
|
2017-08-24 08:13:12 +00:00
|
|
|
], {optional: true}),
|
2017-08-19 13:20:09 +00:00
|
|
|
sequence([
|
|
|
|
group([
|
2017-08-23 14:28:15 +00:00
|
|
|
query('fuse-content > :leave', [
|
|
|
|
style({
|
|
|
|
transform: 'translateX(0)',
|
|
|
|
opacity : 1
|
|
|
|
}),
|
2017-09-21 12:05:18 +00:00
|
|
|
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
2017-08-23 14:28:15 +00:00
|
|
|
style({
|
|
|
|
transform: 'translateX(-100%)',
|
|
|
|
opacity : 0
|
|
|
|
}))
|
2017-08-24 08:13:12 +00:00
|
|
|
], {optional: true}),
|
2017-08-23 14:28:15 +00:00
|
|
|
query('fuse-content > :enter', [
|
|
|
|
style({transform: 'translateX(100%)'}),
|
2017-09-21 12:05:18 +00:00
|
|
|
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
2017-08-23 14:28:15 +00:00
|
|
|
style({
|
|
|
|
transform: 'translateX(0%)',
|
|
|
|
opacity : 1
|
|
|
|
}))
|
2017-08-24 08:13:12 +00:00
|
|
|
], {optional: true})
|
2017-08-23 14:28:15 +00:00
|
|
|
]),
|
2017-08-24 08:13:12 +00:00
|
|
|
query('fuse-content > :leave', animateChild(), {optional: true}),
|
|
|
|
query('fuse-content > :enter', animateChild(), {optional: true})
|
2017-08-23 14:28:15 +00:00
|
|
|
])
|
|
|
|
])
|
2017-09-21 12:05:18 +00:00
|
|
|
]),
|
2017-08-23 14:28:15 +00:00
|
|
|
|
2017-09-21 12:05:18 +00:00
|
|
|
trigger('routerTransitionRight', [
|
2017-08-23 14:28:15 +00:00
|
|
|
|
|
|
|
transition('* => *', [
|
|
|
|
query('fuse-content > :enter, fuse-content > :leave', [
|
|
|
|
style({
|
|
|
|
position: 'absolute',
|
|
|
|
top : 0,
|
|
|
|
bottom : 0,
|
|
|
|
left : 0,
|
|
|
|
right : 0
|
|
|
|
})
|
2017-08-24 08:13:12 +00:00
|
|
|
], {optional: true}),
|
2017-08-23 14:28:15 +00:00
|
|
|
query('fuse-content > :enter', [
|
|
|
|
style({
|
|
|
|
transform: 'translateX(-100%)',
|
|
|
|
opacity : 0
|
|
|
|
})
|
2017-08-24 08:13:12 +00:00
|
|
|
], {optional: true}),
|
2017-08-23 14:28:15 +00:00
|
|
|
sequence([
|
|
|
|
group([
|
|
|
|
query('fuse-content > :leave', [
|
|
|
|
style({
|
|
|
|
transform: 'translateX(0)',
|
|
|
|
opacity : 1
|
|
|
|
}),
|
2017-09-21 12:05:18 +00:00
|
|
|
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
2017-08-23 14:28:15 +00:00
|
|
|
style({
|
|
|
|
transform: 'translateX(100%)',
|
|
|
|
opacity : 0
|
|
|
|
}))
|
2017-08-24 08:13:12 +00:00
|
|
|
], {optional: true}),
|
2017-08-23 14:28:15 +00:00
|
|
|
query('fuse-content > :enter', [
|
|
|
|
style({transform: 'translateX(-100%)'}),
|
2017-09-21 12:05:18 +00:00
|
|
|
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
2017-08-23 14:28:15 +00:00
|
|
|
style({
|
|
|
|
transform: 'translateX(0%)',
|
|
|
|
opacity : 1
|
|
|
|
}))
|
2017-08-24 08:13:12 +00:00
|
|
|
], {optional: true})
|
2017-08-23 14:28:15 +00:00
|
|
|
]),
|
2017-08-24 08:13:12 +00:00
|
|
|
query('fuse-content > :leave', animateChild(), {optional: true}),
|
|
|
|
query('fuse-content > :enter', animateChild(), {optional: true})
|
2017-08-23 14:28:15 +00:00
|
|
|
])
|
|
|
|
])
|
2017-09-21 12:05:18 +00:00
|
|
|
]),
|
2017-08-23 14:28:15 +00:00
|
|
|
|
2017-09-21 12:05:18 +00:00
|
|
|
trigger('routerTransitionUp', [
|
2017-08-23 14:28:15 +00:00
|
|
|
|
|
|
|
transition('* => *', [
|
|
|
|
query('fuse-content > :enter, fuse-content > :leave', [
|
|
|
|
style({
|
|
|
|
position: 'absolute',
|
|
|
|
top : 0,
|
|
|
|
bottom : 0,
|
|
|
|
left : 0,
|
|
|
|
right : 0
|
|
|
|
})
|
2017-08-24 08:13:12 +00:00
|
|
|
], {optional: true}),
|
2017-08-23 14:28:15 +00:00
|
|
|
query('fuse-content > :enter', [
|
|
|
|
style({
|
|
|
|
transform: 'translateY(100%)',
|
|
|
|
opacity : 0
|
|
|
|
})
|
2017-08-24 08:13:12 +00:00
|
|
|
], {optional: true}),
|
2017-09-21 12:05:18 +00:00
|
|
|
group([
|
|
|
|
query('fuse-content > :leave', [
|
|
|
|
style({
|
|
|
|
transform: 'translateY(0)',
|
|
|
|
opacity : 1
|
|
|
|
}),
|
|
|
|
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
2017-08-19 13:20:09 +00:00
|
|
|
style({
|
2017-09-21 12:05:18 +00:00
|
|
|
transform: 'translateY(-100%)',
|
|
|
|
opacity : 0
|
|
|
|
}))
|
|
|
|
], {optional: true}),
|
|
|
|
query('fuse-content > :enter', [
|
|
|
|
style({transform: 'translateY(100%)'}),
|
|
|
|
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
|
|
|
style({
|
|
|
|
transform: 'translateY(0%)',
|
2017-08-19 13:20:09 +00:00
|
|
|
opacity : 1
|
2017-09-21 12:05:18 +00:00
|
|
|
}))
|
|
|
|
], {optional: true})
|
|
|
|
]),
|
|
|
|
query('fuse-content > :leave', animateChild(), {optional: true}),
|
|
|
|
query('fuse-content > :enter', animateChild(), {optional: true})
|
2017-08-23 14:28:15 +00:00
|
|
|
])
|
2017-09-21 12:05:18 +00:00
|
|
|
]),
|
2017-08-23 14:28:15 +00:00
|
|
|
|
2017-09-21 12:05:18 +00:00
|
|
|
trigger('routerTransitionDown', [
|
2017-08-23 14:28:15 +00:00
|
|
|
|
|
|
|
transition('* => *', [
|
|
|
|
query('fuse-content > :enter, fuse-content > :leave', [
|
|
|
|
style({
|
|
|
|
position: 'absolute',
|
|
|
|
top : 0,
|
|
|
|
bottom : 0,
|
|
|
|
left : 0,
|
|
|
|
right : 0
|
|
|
|
})
|
2017-08-24 08:13:12 +00:00
|
|
|
], {optional: true}),
|
2017-08-23 14:28:15 +00:00
|
|
|
query('fuse-content > :enter', [
|
|
|
|
style({
|
|
|
|
transform: 'translateY(-100%)',
|
|
|
|
opacity : 0
|
|
|
|
})
|
2017-08-24 08:13:12 +00:00
|
|
|
], {optional: true}),
|
2017-08-23 14:28:15 +00:00
|
|
|
sequence([
|
|
|
|
group([
|
|
|
|
query('fuse-content > :leave', [
|
|
|
|
style({
|
|
|
|
transform: 'translateY(0)',
|
|
|
|
opacity : 1
|
|
|
|
}),
|
2017-09-21 12:05:18 +00:00
|
|
|
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
2017-08-23 14:28:15 +00:00
|
|
|
style({
|
|
|
|
transform: 'translateY(100%)',
|
|
|
|
opacity : 0
|
|
|
|
}))
|
2017-08-24 08:13:12 +00:00
|
|
|
], {optional: true}),
|
2017-08-23 14:28:15 +00:00
|
|
|
query('fuse-content > :enter', [
|
|
|
|
style({transform: 'translateY(-100%)'}),
|
2017-09-21 12:05:18 +00:00
|
|
|
animate('600ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
2017-08-23 14:28:15 +00:00
|
|
|
style({
|
|
|
|
transform: 'translateY(0%)',
|
|
|
|
opacity : 1
|
|
|
|
}))
|
2017-08-24 08:13:12 +00:00
|
|
|
], {optional: true})
|
2017-08-23 14:28:15 +00:00
|
|
|
]),
|
2017-08-24 08:13:12 +00:00
|
|
|
query('fuse-content > :leave', animateChild(), {optional: true}),
|
|
|
|
query('fuse-content > :enter', animateChild(), {optional: true})
|
2017-08-19 13:20:09 +00:00
|
|
|
])
|
|
|
|
])
|
2017-09-21 12:05:18 +00:00
|
|
|
]),
|
2017-08-23 14:28:15 +00:00
|
|
|
|
2017-09-21 12:05:18 +00:00
|
|
|
trigger('routerTransitionFade', [
|
2017-08-23 14:28:15 +00:00
|
|
|
|
2017-09-20 14:38:14 +00:00
|
|
|
transition('* => *', group([
|
2017-08-23 14:28:15 +00:00
|
|
|
|
|
|
|
query('fuse-content > :enter, fuse-content > :leave ', [
|
|
|
|
style({
|
|
|
|
position: 'absolute',
|
|
|
|
top : 0,
|
|
|
|
bottom : 0,
|
|
|
|
left : 0,
|
|
|
|
right : 0
|
|
|
|
})
|
2017-08-24 08:13:12 +00:00
|
|
|
], {optional: true}),
|
2017-09-21 12:05:18 +00:00
|
|
|
|
2017-08-23 14:28:15 +00:00
|
|
|
query('fuse-content > :enter', [
|
|
|
|
style({
|
|
|
|
opacity: 0
|
|
|
|
})
|
2017-08-24 08:13:12 +00:00
|
|
|
], {optional: true}),
|
2017-09-20 14:38:14 +00:00
|
|
|
query('fuse-content > :leave', [
|
|
|
|
style({
|
|
|
|
opacity: 1
|
|
|
|
}),
|
2017-09-21 12:05:18 +00:00
|
|
|
animate('300ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
2017-08-23 14:28:15 +00:00
|
|
|
style({
|
|
|
|
opacity: 0
|
2017-09-20 14:38:14 +00:00
|
|
|
}))
|
|
|
|
], {optional: true}),
|
|
|
|
query('fuse-content > :enter', [
|
|
|
|
style({
|
|
|
|
opacity: 0
|
|
|
|
}),
|
2017-09-21 12:05:18 +00:00
|
|
|
animate('300ms cubic-bezier(0.0, 0.0, 0.2, 1)',
|
2017-09-20 14:38:14 +00:00
|
|
|
style({
|
|
|
|
opacity: 1
|
|
|
|
}))
|
|
|
|
], {optional: true}),
|
2017-08-24 08:13:12 +00:00
|
|
|
query('fuse-content > :enter', animateChild(), {optional: true}),
|
|
|
|
query('fuse-content > :leave', animateChild(), {optional: true})
|
2017-09-20 14:38:14 +00:00
|
|
|
]))
|
2017-09-21 12:05:18 +00:00
|
|
|
])
|
|
|
|
];
|