@@ -6,11 +6,11 @@ import { SwipeToCloseDefaults } from '../gestures/swipe-to-close';
66import type { ModalAnimationOptions } from '../modal-interface' ;
77
88/**
9- * Transition animation from mobile view to portrait view
10- * This handles the case where a card modal is open in mobile view
11- * and the user switches to portrait view
9+ * Transition animation from portrait view to landscape view
10+ * This handles the case where a card modal is open in portrait view
11+ * and the user switches to landscape view
1212 */
13- export const mobileToPortraitTransition = (
13+ export const portraitToLandscapeTransition = (
1414 baseEl : HTMLElement ,
1515 opts : ModalAnimationOptions ,
1616 duration = 300
@@ -19,36 +19,36 @@ export const mobileToPortraitTransition = (
1919
2020 if ( ! presentingEl ) {
2121 // No transition needed for non-card modals
22- return createAnimation ( 'mobile -to-portrait -transition' ) ;
22+ return createAnimation ( 'portrait -to-landscape -transition' ) ;
2323 }
2424
2525 const hasCardModal =
2626 presentingEl . tagName === 'ION-MODAL' && ( presentingEl as HTMLIonModalElement ) . presentingElement !== undefined ;
2727 const presentingElRoot = getElementRoot ( presentingEl ) ;
2828 const bodyEl = document . body ;
2929
30- const baseAnimation = createAnimation ( 'mobile -to-portrait -transition' )
30+ const baseAnimation = createAnimation ( 'portrait -to-landscape -transition' )
3131 . addElement ( baseEl )
3232 . easing ( 'cubic-bezier(0.32,0.72,0,1)' )
3333 . duration ( duration ) ;
3434
3535 const presentingAnimation = createAnimation ( ) ;
3636
3737 if ( ! hasCardModal ) {
38- // Non-card modal: transition from mobile state to portrait state
39- // Mobile : presentingEl has transform and body has black background
40- // Portrait : no transform, no body background, modal wrapper opacity changes
38+ // Non-card modal: transition from portrait state to landscape state
39+ // Portrait : presentingEl has transform and body has black background
40+ // Landscape : no transform, no body background, modal wrapper opacity changes
4141
4242 const root = getElementRoot ( baseEl ) ;
4343 const wrapperAnimation = createAnimation ( )
4444 . addElement ( root . querySelectorAll ( '.modal-wrapper, .modal-shadow' ) ! )
45- . fromTo ( 'opacity' , '1' , '1' ) ; // Keep wrapper visible in portrait
45+ . fromTo ( 'opacity' , '1' , '1' ) ; // Keep wrapper visible in landscape
4646
4747 const backdropAnimation = createAnimation ( )
4848 . addElement ( root . querySelector ( 'ion-backdrop' ) ! )
4949 . fromTo ( 'opacity' , 'var(--backdrop-opacity)' , 'var(--backdrop-opacity)' ) ; // Keep backdrop visible
5050
51- // Animate presentingEl from mobile state back to normal
51+ // Animate presentingEl from portrait state back to normal
5252 const transformOffset = ! CSS . supports ( 'width' , 'max(0px, 1px)' ) ? '30px' : 'max(30px, var(--ion-safe-area-top))' ;
5353 const toPresentingScale = SwipeToCloseDefaults . MIN_PRESENTING_SCALE ;
5454 const fromTransform = `translateY(${ transformOffset } ) scale(${ toPresentingScale } )` ;
@@ -62,7 +62,7 @@ export const mobileToPortraitTransition = (
6262
6363 baseAnimation . addAnimation ( [ presentingAnimation , wrapperAnimation , backdropAnimation ] ) ;
6464 } else {
65- // Card modal: transition from mobile card state to portrait card state
65+ // Card modal: transition from portrait card state to landscape card state
6666 const toPresentingScale = SwipeToCloseDefaults . MIN_PRESENTING_SCALE ;
6767 const transformOffset = ! CSS . supports ( 'width' , 'max(0px, 1px)' ) ? '30px' : 'max(30px, var(--ion-safe-area-top))' ;
6868 const fromTransform = `translateY(${ transformOffset } ) scale(${ toPresentingScale } )` ;
@@ -75,7 +75,7 @@ export const mobileToPortraitTransition = (
7575
7676 const shadowAnimation = createAnimation ( )
7777 . addElement ( presentingElRoot . querySelector ( '.modal-shadow' ) ! )
78- . fromTo ( 'opacity' , '0' , '0' ) // Shadow stays hidden in portrait for card modals
78+ . fromTo ( 'opacity' , '0' , '0' ) // Shadow stays hidden in landscape for card modals
7979 . fromTo ( 'transform' , fromTransform , toTransform ) ;
8080
8181 baseAnimation . addAnimation ( [ presentingAnimation , shadowAnimation ] ) ;
@@ -85,11 +85,11 @@ export const mobileToPortraitTransition = (
8585} ;
8686
8787/**
88- * Transition animation from portrait view to mobile view
89- * This handles the case where a card modal is open in portrait view
90- * and the user switches to mobile view
88+ * Transition animation from landscape view to portrait view
89+ * This handles the case where a card modal is open in landscape view
90+ * and the user switches to portrait view
9191 */
92- export const portraitToMobileTransition = (
92+ export const landscapeToPortraitTransition = (
9393 baseEl : HTMLElement ,
9494 opts : ModalAnimationOptions ,
9595 duration = 300
@@ -98,23 +98,23 @@ export const portraitToMobileTransition = (
9898
9999 if ( ! presentingEl ) {
100100 // No transition needed for non-card modals
101- return createAnimation ( 'portrait -to-mobile -transition' ) ;
101+ return createAnimation ( 'landscape -to-portrait -transition' ) ;
102102 }
103103
104104 const hasCardModal =
105105 presentingEl . tagName === 'ION-MODAL' && ( presentingEl as HTMLIonModalElement ) . presentingElement !== undefined ;
106106 const presentingElRoot = getElementRoot ( presentingEl ) ;
107107 const bodyEl = document . body ;
108108
109- const baseAnimation = createAnimation ( 'portrait -to-mobile -transition' )
109+ const baseAnimation = createAnimation ( 'landscape -to-portrait -transition' )
110110 . addElement ( baseEl )
111111 . easing ( 'cubic-bezier(0.32,0.72,0,1)' )
112112 . duration ( duration ) ;
113113
114114 const presentingAnimation = createAnimation ( ) ;
115115
116116 if ( ! hasCardModal ) {
117- // Non-card modal: transition from portrait state to mobile state
117+ // Non-card modal: transition from landscape state to portrait state
118118 const root = getElementRoot ( baseEl ) ;
119119 const wrapperAnimation = createAnimation ( )
120120 . addElement ( root . querySelectorAll ( '.modal-wrapper, .modal-shadow' ) ! )
@@ -124,7 +124,7 @@ export const portraitToMobileTransition = (
124124 . addElement ( root . querySelector ( 'ion-backdrop' ) ! )
125125 . fromTo ( 'opacity' , 'var(--backdrop-opacity)' , 'var(--backdrop-opacity)' ) ; // Keep backdrop visible
126126
127- // Animate presentingEl from normal state to mobile state
127+ // Animate presentingEl from normal state to portrait state
128128 const transformOffset = ! CSS . supports ( 'width' , 'max(0px, 1px)' ) ? '30px' : 'max(30px, var(--ion-safe-area-top))' ;
129129 const toPresentingScale = SwipeToCloseDefaults . MIN_PRESENTING_SCALE ;
130130 const toTransform = `translateY(${ transformOffset } ) scale(${ toPresentingScale } )` ;
@@ -138,7 +138,7 @@ export const portraitToMobileTransition = (
138138
139139 baseAnimation . addAnimation ( [ presentingAnimation , wrapperAnimation , backdropAnimation ] ) ;
140140 } else {
141- // Card modal: transition from portrait card state to mobile card state
141+ // Card modal: transition from landscape card state to portrait card state
142142 const toPresentingScale = SwipeToCloseDefaults . MIN_PRESENTING_SCALE ;
143143 const transformOffset = ! CSS . supports ( 'width' , 'max(0px, 1px)' ) ? '30px' : 'max(30px, var(--ion-safe-area-top))' ;
144144 const fromTransform = `translateY(-10px) scale(${ toPresentingScale } )` ;
0 commit comments