src/views/CardStack/CardStackStyleInterpolator.js
function forHorizontal(props) {
  const { layout, position, scene } = props;

  if (!layout.isMeasured) {
    return forInitial(props);
  }
  const interpolate = getSceneIndicesForInterpolationInputRange(props);

  if (!interpolate) return { opacity: 0 };

  const { first, last } = interpolate;
  const index = scene.index;
  const opacity = position.interpolate({
    inputRange: [first, first + 0.01, index, last - 0.01, last],
    outputRange: [0, 1, 1, 0.85, 0],
  });

  const width = layout.initWidth;
  const translateX = position.interpolate({
    inputRange: [first, index, last],
    outputRange: I18nManager.isRTL
      ? [-width, 0, width * 0.3]
      : [width, 0, width * -0.3],
  });
  const translateY = 0;

  return {
    opacity,
    transform: [{ translateX }, { translateY }],
  };
}
function forHorizontal(props) {
  const { layout, position, scene } = props;

  if (!layout.isMeasured) {
    return forInitial(props);
  }
  const interpolate = getSceneIndicesForInterpolationInputRange(props);

  if (!interpolate) return { opacity: 0 };

  const { first, last } = interpolate;
  const index = scene.index;
  const opacity = position.interpolate({
    inputRange: [first, first + 0.01, index, last - 0.01, last],
    outputRange: [0, 1, 1, 0.85, 0],
  });

  const width = layout.initWidth;
  const translateX = position.interpolate({
    inputRange: [first, index, last],
    outputRange: I18nManager.isRTL
      ? [-width, 0, width * 0.3]
      : [width, 0, width * -0.3],
  });
  const translateY = 0;

  return {
    opacity,
    transform: [{ translateX }, { translateY }],
  };
}
function forHorizontal ( props ) { const { layout , position , scene } = props ; if ( ! layout . isMeasured ) { return forInitial ( props ) ; } const interpolate = getSceneIndicesForInterpolationInputRange ( props ) ; if ( ! interpolate ) return { opacity : 0 } ; const { first , last } = interpolate ; const index = scene . index ; const opacity = position . interpolate ( { inputRange : [ first , first + 0.01 , index , last - 0.01 , last ] , outputRange : [ 0 , 1 , 1 , 0.85 , 0 ] , } ) ; const width = layout . initWidth ; const translateX = position . interpolate ( { inputRange : [ first , index , last ] , outputRange : I18nManager . isRTL ? [ - width , 0 , width * 0.3 ] : [ width , 0 , width * - 0.3 ] , } ) ; const translateY = 0 ; return { opacity , transform : [ { translateX } , { translateY } ] , } ; }
Standard iOS-style slide in from the right.
Standard iOS - style slide in from the right .