mirror of https://github.com/abpframework/abp.git
5 changed files with 90 additions and 69 deletions
@ -1,79 +1,74 @@ |
|||
import { animate, animation, style } from '@angular/animations'; |
|||
|
|||
export const fadeIn = animation( |
|||
[style({ opacity: '0', display: '{{ display }}' }), animate('{{ time}} {{ easing }}', style({ opacity: '1' }))], |
|||
{ params: { time: '350ms', easing: 'ease', display: 'block' } } |
|||
); |
|||
export const fadeIn = animation([style({ opacity: '0' }), animate('{{ time}} {{ easing }}', style({ opacity: '1' }))], { |
|||
params: { time: '350ms', easing: 'ease' }, |
|||
}); |
|||
|
|||
export const fadeOut = animation( |
|||
[ |
|||
style({ opacity: '1' }), |
|||
animate('{{ time}} {{ easing }}', style({ opacity: '0' })), |
|||
style({ opacity: '0', display: 'none' }) |
|||
], |
|||
{ params: { time: '350ms', easing: 'ease' } } |
|||
[style({ opacity: '1' }), animate('{{ time}} {{ easing }}', style({ opacity: '0' }))], |
|||
{ params: { time: '350ms', easing: 'ease' } }, |
|||
); |
|||
|
|||
export const fadeInDown = animation( |
|||
[ |
|||
style({ opacity: '0', display: '{{ display }}', transform: '{{ transform }} translateY(-20px)' }), |
|||
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateY(0)' })) |
|||
style({ opacity: '0', transform: '{{ transform }} translateY(-20px)' }), |
|||
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateY(0)' })), |
|||
], |
|||
{ params: { time: '350ms', easing: 'ease', display: 'block', transform: 'translate(-50%, -50%)' } } |
|||
{ params: { time: '350ms', easing: 'ease', transform: '' } }, |
|||
); |
|||
|
|||
export const fadeInUp = animation( |
|||
[ |
|||
style({ opacity: '0', display: '{{ display }}', transform: '{{ transform }} translateY(20px)' }), |
|||
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateY(0)' })) |
|||
style({ opacity: '0', transform: '{{ transform }} translateY(20px)' }), |
|||
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateY(0)' })), |
|||
], |
|||
{ params: { time: '350ms', easing: 'ease', display: 'block', transform: 'translate(-50%, -50%)' } } |
|||
{ params: { time: '350ms', easing: 'ease', transform: '' } }, |
|||
); |
|||
|
|||
export const fadeInLeft = animation( |
|||
[ |
|||
style({ opacity: '0', display: '{{ display }}', transform: '{{ transform }} translateX(20px)' }), |
|||
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateX(0)' })) |
|||
style({ opacity: '0', transform: '{{ transform }} translateX(20px)' }), |
|||
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateX(0)' })), |
|||
], |
|||
{ params: { time: '350ms', easing: 'ease', display: 'block', transform: 'translate(-50%, -50%)' } } |
|||
{ params: { time: '350ms', easing: 'ease', transform: '' } }, |
|||
); |
|||
|
|||
export const fadeInRight = animation( |
|||
[ |
|||
style({ opacity: '0', display: '{{ display }}', transform: '{{ transform }} translateX(-20px)' }), |
|||
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateX(0)' })) |
|||
style({ opacity: '0', transform: '{{ transform }} translateX(-20px)' }), |
|||
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateX(0)' })), |
|||
], |
|||
{ params: { time: '350ms', easing: 'ease', display: 'block', transform: 'translate(-50%, -50%)' } } |
|||
{ params: { time: '350ms', easing: 'ease', transform: '' } }, |
|||
); |
|||
|
|||
export const fadeOutDown = animation( |
|||
[ |
|||
style({ opacity: '1', display: '{{ display }}', transform: '{{ transform }} translateY(0)' }), |
|||
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateY(20px)' })) |
|||
style({ opacity: '1', transform: '{{ transform }} translateY(0)' }), |
|||
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateY(20px)' })), |
|||
], |
|||
{ params: { time: '350ms', easing: 'ease', display: 'block', transform: 'translate(-50%, -50%)' } } |
|||
{ params: { time: '350ms', easing: 'ease', transform: '' } }, |
|||
); |
|||
|
|||
export const fadeOutUp = animation( |
|||
[ |
|||
style({ opacity: '1', display: '{{ display }}', transform: '{{ transform }} translateY(0)' }), |
|||
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateY(-20px)' })) |
|||
style({ opacity: '1', transform: '{{ transform }} translateY(0)' }), |
|||
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateY(-20px)' })), |
|||
], |
|||
{ params: { time: '350ms', easing: 'ease', display: 'block', transform: 'translate(-50%, -50%)' } } |
|||
{ params: { time: '350ms', easing: 'ease', transform: '' } }, |
|||
); |
|||
|
|||
export const fadeOutLeft = animation( |
|||
[ |
|||
style({ opacity: '1', display: '{{ display }}', transform: '{{ transform }} translateX(0)' }), |
|||
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateX(20px)' })) |
|||
style({ opacity: '1', transform: '{{ transform }} translateX(0)' }), |
|||
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateX(20px)' })), |
|||
], |
|||
{ params: { time: '350ms', easing: 'ease', display: 'block', transform: 'translate(-50%, -50%)' } } |
|||
{ params: { time: '350ms', easing: 'ease', transform: '' } }, |
|||
); |
|||
|
|||
export const fadeOutRight = animation( |
|||
[ |
|||
style({ opacity: '1', display: '{{ display }}', transform: '{{ transform }} translateX(0)' }), |
|||
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateX(-20px)' })) |
|||
style({ opacity: '1', transform: '{{ transform }} translateX(0)' }), |
|||
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateX(-20px)' })), |
|||
], |
|||
{ params: { time: '350ms', easing: 'ease', display: 'block', transform: 'translate(-50%, -50%)' } } |
|||
{ params: { time: '350ms', easing: 'ease', transform: '' } }, |
|||
); |
|||
|
|||
@ -1,14 +1,12 @@ |
|||
import { trigger, state, style, transition, useAnimation } from '@angular/animations'; |
|||
import { fadeInDown, fadeOut, fadeIn } from '../../animations'; |
|||
import { transition, trigger, useAnimation } from '@angular/animations'; |
|||
import { fadeIn, fadeInDown, fadeOut } from '../../animations/fade.animations'; |
|||
|
|||
export const backdropAnimation = trigger('backdrop', [ |
|||
state('void', style({ opacity: '0' })), |
|||
state('*', style({ opacity: '1' })), |
|||
transition('void => *', useAnimation(fadeIn)), |
|||
transition('* => void', useAnimation(fadeOut)) |
|||
transition(':enter', useAnimation(fadeIn)), |
|||
transition(':leave', useAnimation(fadeOut)), |
|||
]); |
|||
|
|||
export const dialogAnimation = trigger('dialog', [ |
|||
transition('void => *', useAnimation(fadeInDown)), |
|||
transition('* => void', useAnimation(fadeOut)) |
|||
transition(':enter', useAnimation(fadeInDown)), |
|||
transition(':leave', useAnimation(fadeOut)), |
|||
]); |
|||
|
|||
@ -1,21 +1,29 @@ |
|||
<div class="modal {{ modalClass }}" tabindex="-1" role="dialog" *ngIf="visible"> |
|||
<div class="modal-backdrop" [@backdrop]="visible" (click)="close()"></div> |
|||
<div id="abp-modal-dialog" class="modal-dialog modal-{{ size }}" role="document" [@dialog]="visible" #abpModalContent> |
|||
<div id="abp-modal-content" class="modal-content"> |
|||
<div id="abp-modal-header" class="modal-header"> |
|||
<ng-container *ngTemplateOutlet="abpHeader"></ng-container> |
|||
|
|||
<button id="abp-modal-close-button" type="button" class="close" aria-label="Close" (click)="close()"> |
|||
<span aria-hidden="true">×</span> |
|||
</button> |
|||
</div> |
|||
<div id="abp-modal-body" class="modal-body"> |
|||
<ng-container *ngTemplateOutlet="abpBody"></ng-container> |
|||
</div> |
|||
<div id="abp-modal-footer" class="modal-footer"> |
|||
<ng-container *ngTemplateOutlet="abpFooter"></ng-container> |
|||
<ng-container *ngIf="visible"> |
|||
<div class="modal show {{ modalClass }}" tabindex="-1" role="dialog"> |
|||
<div class="modal-backdrop" [@backdrop]="isModalOpen" (click)="close()"></div> |
|||
<div |
|||
id="abp-modal-dialog" |
|||
class="modal-dialog modal-{{ size }}" |
|||
role="document" |
|||
[@dialog]="isModalOpen" |
|||
#abpModalContent |
|||
> |
|||
<div id="abp-modal-content" class="modal-content"> |
|||
<div id="abp-modal-header" class="modal-header"> |
|||
<ng-container *ngTemplateOutlet="abpHeader"></ng-container> |
|||
|
|||
<button id="abp-modal-close-button" type="button" class="close" aria-label="Close" (click)="close()"> |
|||
<span aria-hidden="true">×</span> |
|||
</button> |
|||
</div> |
|||
<div id="abp-modal-body" class="modal-body"> |
|||
<ng-container *ngTemplateOutlet="abpBody"></ng-container> |
|||
</div> |
|||
<div id="abp-modal-footer" class="modal-footer"> |
|||
<ng-container *ngTemplateOutlet="abpFooter"></ng-container> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
<ng-content></ng-content> |
|||
</div> |
|||
<ng-content></ng-content> |
|||
</div> |
|||
</ng-container> |
|||
|
|||
Loading…
Reference in new issue