style: format code for better readability and consistency
This commit is contained in:
parent
1569922fda
commit
9c12ccd716
2 changed files with 20 additions and 14 deletions
|
@ -2,7 +2,7 @@ import { Injectable } from '@angular/core';
|
|||
import gsap from 'gsap';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class ModalAnimationService {
|
||||
private readonly defaultDuration = 0.3;
|
||||
|
@ -10,17 +10,17 @@ export class ModalAnimationService {
|
|||
|
||||
openModal(modalElement: HTMLElement, overlayElement: HTMLElement) {
|
||||
gsap.set(overlayElement, { opacity: 0, display: 'block' });
|
||||
gsap.set(modalElement, {
|
||||
opacity: 0,
|
||||
gsap.set(modalElement, {
|
||||
opacity: 0,
|
||||
scale: 0.95,
|
||||
y: 20,
|
||||
display: 'block'
|
||||
display: 'block',
|
||||
});
|
||||
|
||||
gsap.to(overlayElement, {
|
||||
opacity: 1,
|
||||
duration: this.defaultDuration,
|
||||
ease: this.defaultEase
|
||||
ease: this.defaultEase,
|
||||
});
|
||||
|
||||
gsap.to(modalElement, {
|
||||
|
@ -28,7 +28,7 @@ export class ModalAnimationService {
|
|||
scale: 1,
|
||||
y: 0,
|
||||
duration: this.defaultDuration,
|
||||
ease: this.defaultEase
|
||||
ease: this.defaultEase,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -40,14 +40,14 @@ export class ModalAnimationService {
|
|||
onComplete: () => {
|
||||
gsap.set([overlayElement, modalElement], { display: 'none' });
|
||||
onComplete?.();
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
gsap.to(modalElement, {
|
||||
scale: 0.95,
|
||||
y: 20,
|
||||
duration: this.defaultDuration,
|
||||
ease: this.defaultEase
|
||||
ease: this.defaultEase,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue