/
githubmirror
/
ionic
Обзор
Документация
Войти
/
githubmirror
/
ionic
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
core/src/components/modal/animations/md.leave.ts
38 строк
1 KB
Shane
fix(sheet): move sheet footers instead of cloning while dragging (#30433)
03 июн 2025, 18:47
Не верифицирован
03 июн 2025, 18:47
4cbbbb0
Код
Авторство
О чём код?
import { createAnimation } from '@utils/animation/animation'; import { getElementRoot } from '@utils/helpers'; import type { Animation } from '../../../interface'; import type { ModalAnimationOptions } from '../modal-interface'; import { createSheetLeaveAnimation } from './sheet'; const createLeaveAnimation = () => { const backdropAnimation = createAnimation().fromTo('opacity', 'var(--backdrop-opacity)', 0); const wrapperAnimation = createAnimation().keyframes([ { offset: 0, opacity: 0.99, transform: `translateY(0px)` }, { offset: 1, opacity: 0, transform: 'translateY(40px)' }, ]); return { backdropAnimation, wrapperAnimation }; }; /** * Md Modal Leave Animation */ export const mdLeaveAnimation = (baseEl: HTMLElement, opts: ModalAnimationOptions): Animation => { const { currentBreakpoint } = opts; const root = getElementRoot(baseEl); const { wrapperAnimation, backdropAnimation } = currentBreakpoint !== undefined ? createSheetLeaveAnimation(opts) : createLeaveAnimation(); backdropAnimation.addElement(root.querySelector('ion-backdrop')!); wrapperAnimation.addElement(root.querySelector('.modal-wrapper')!); const baseAnimation = createAnimation() .easing('cubic-bezier(0.47,0,0.745,0.715)') .duration(200) .addAnimation([backdropAnimation, wrapperAnimation]); return baseAnimation; };