Skip to content

Commit ac73f24

Browse files
qwertychouskienecolas
authored andcommitted
Modal: Significantly improve animation
`ease-in` and `ease-out` were mixed up, making the animation jarring, as it would accelerate faster towards the destination. The defined `cubic-bezier` animations now used are approximately equivalent to using `Easing.out(Easing.cubic)` for the animation in and `Easing.in(Easing.sin)` for the animation out.
1 parent fb510d0 commit ac73f24

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/react-native-web/src/exports/Modal/ModalAnimation.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import * as React from 'react';
1212
import StyleSheet from '../StyleSheet';
1313
import createElement from '../createElement';
1414

15-
const ANIMATION_DURATION = 300;
15+
const ANIMATION_DURATION = 250;
1616

1717
function getAnimationStyle(animationType, visible) {
1818
if (animationType === 'slide') {
@@ -100,12 +100,12 @@ const styles = StyleSheet.create({
100100
},
101101
animatedIn: {
102102
animationDuration: `${ANIMATION_DURATION}ms`,
103-
animationTimingFunction: 'ease-in'
103+
animationTimingFunction: 'cubic-bezier(0.215, 0.61, 0.355, 1)'
104104
},
105105
animatedOut: {
106106
pointerEvents: 'none',
107107
animationDuration: `${ANIMATION_DURATION}ms`,
108-
animationTimingFunction: 'ease-out'
108+
animationTimingFunction: 'cubic-bezier(0.47, 0, 0.745, 0.715)'
109109
},
110110
fadeIn: {
111111
opacity: 1,

0 commit comments

Comments
 (0)