mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
refactor(): minor updates for next stencil version (#20787)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { getIonMode } from '../../../global/ionic-global';
|
||||
import { Animation, MenuI } from '../../../interface';
|
||||
import { createAnimation } from '../../animation/animation';
|
||||
|
||||
@@ -30,7 +31,8 @@ export const menuOverlayAnimation = (menu: MenuI): Animation => {
|
||||
.addElement(menu.menuInnerEl!)
|
||||
.fromTo('transform', `translateX(${closedX})`, `translateX(${openedX})`);
|
||||
|
||||
const isIos = menu.mode === 'ios';
|
||||
const mode = getIonMode(menu);
|
||||
const isIos = mode === 'ios';
|
||||
const opacity = isIos ? 0.2 : 0.25;
|
||||
|
||||
backdropAnimation
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { getIonMode } from '../../../global/ionic-global';
|
||||
import { Animation, MenuI } from '../../../interface';
|
||||
import { createAnimation } from '../../animation/animation';
|
||||
|
||||
@@ -12,6 +13,7 @@ export const menuPushAnimation = (menu: MenuI): Animation => {
|
||||
let contentOpenedX: string;
|
||||
let menuClosedX: string;
|
||||
|
||||
const mode = getIonMode(menu);
|
||||
const width = menu.width;
|
||||
|
||||
if (menu.isEndSide) {
|
||||
@@ -35,5 +37,5 @@ export const menuPushAnimation = (menu: MenuI): Animation => {
|
||||
.addElement(menu.backdropEl!)
|
||||
.fromTo('opacity', 0.01, 0.32);
|
||||
|
||||
return baseAnimation(menu.mode === 'ios').addAnimation([menuAnimation, contentAnimation, backdropAnimation]);
|
||||
return baseAnimation(mode === 'ios').addAnimation([menuAnimation, contentAnimation, backdropAnimation]);
|
||||
};
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { getIonMode } from '../../../global/ionic-global';
|
||||
import { Animation, MenuI } from '../../../interface';
|
||||
import { createAnimation } from '../../animation/animation';
|
||||
|
||||
@@ -9,11 +10,11 @@ import { baseAnimation } from './base';
|
||||
* The menu itself, which is under the content, does not move.
|
||||
*/
|
||||
export const menuRevealAnimation = (menu: MenuI): Animation => {
|
||||
const mode = getIonMode(menu);
|
||||
const openedX = (menu.width * (menu.isEndSide ? -1 : 1)) + 'px';
|
||||
|
||||
const contentOpen = createAnimation()
|
||||
.addElement(menu.contentEl!) // REVIEW
|
||||
.fromTo('transform', 'translateX(0px)', `translateX(${openedX})`);
|
||||
|
||||
return baseAnimation(menu.mode === 'ios').addAnimation(contentOpen);
|
||||
return baseAnimation(mode === 'ios').addAnimation(contentOpen);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user