fuse-angular/src/app/core/animations.ts

70 lines
2.0 KiB
TypeScript
Raw Normal View History

import { trigger, state, transition, animate, style } from '@angular/animations';
export class Animations
{
public static slideInOut = trigger('slideInOut', [
2017-08-02 16:51:02 +00:00
state('0', style({
height : '0px',
display: 'none'
})),
state('1', style({
height : '*',
display: 'block'
})),
transition('1 => 0', animate('300ms ease-out')),
transition('0 => 1', animate('300ms ease-in'))
]);
2017-08-02 16:51:02 +00:00
public static slideInLeft = 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'
})),
transition('void => *', animate('300ms')),
transition('* => void', animate('300ms'))
]);
2017-08-02 16:51:02 +00:00
public static slideInRight = 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'))
]);
public static slideInTop = trigger('slideInTop', [
state('void', style({
transform: 'translateY(-100%)',
display : 'none'
})),
state('*', style({
transform: 'translateY(0)',
display : 'flex'
})),
transition('void => *', animate('300ms')),
transition('* => void', animate('300ms'))
]);
public static slideInBottom = trigger('slideInBottom', [
state('void', style({
transform: 'translateY(100%)',
display : 'none'
})),
state('*', style({
transform: 'translateY(0)',
display : 'flex'
})),
transition('void => *', animate('300ms')),
transition('* => void', animate('300ms'))
]);
}