-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Expand file tree
/
Copy pathionic.leave.ts
More file actions
24 lines (19 loc) · 808 Bytes
/
ionic.leave.ts
File metadata and controls
24 lines (19 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { createAnimation } from '@utils/animation/animation';
import type { Animation } from '../../../interface';
/**
* MD Action Sheet Leave Animation
*/
export const ionicLeaveAnimation = (baseEl: HTMLElement): Animation => {
const baseAnimation = createAnimation();
const backdropAnimation = createAnimation();
const wrapperAnimation = createAnimation();
backdropAnimation.addElement(baseEl.querySelector('ion-backdrop')!).fromTo('opacity', 'var(--backdrop-opacity)', 0);
wrapperAnimation
.addElement(baseEl.querySelector('.action-sheet-wrapper')!)
.fromTo('transform', 'translateY(0%)', 'translateY(100%)');
return baseAnimation
.addElement(baseEl)
.easing('cubic-bezier(.36,.66,.04,1)')
.duration(450)
.addAnimation([backdropAnimation, wrapperAnimation]);
};