src/utils/animations.js
// Based on prop 'inactiveSlideShift'
Based on prop 'inactiveSlideShift'
Based on prop ' inactiveSlideShift '
function shiftAnimatedStyles (index, animatedValue, carouselProps) {
    let animatedOpacity = {};
    let animatedScale = {};
    let animatedTranslate = {};
    if (carouselProps.inactiveSlideOpacity < 1) {
        animatedOpacity = {
            opacity: animatedValue.interpolate({
                inputRange: [0, 1],
                outputRange: [carouselProps.inactiveSlideOpacity, 1]
            })
        };
    }
    if (carouselProps.inactiveSlideScale < 1) {
        animatedScale = {
            scale: animatedValue.interpolate({
                inputRange: [0, 1],
                outputRange: [carouselProps.inactiveSlideScale, 1]
            })
        };
    }
    if (carouselProps.inactiveSlideShift !== 0) {
        const translateProp = carouselProps.vertical ? 'translateX' : 'translateY';
        animatedTranslate = {
            [translateProp]: animatedValue.interpolate({
                inputRange: [0, 1],
                outputRange: [carouselProps.inactiveSlideShift, 0]
            })
        };
    }
    return {
        ...animatedOpacity,
        transform: [
            { ...animatedScale },
            { ...animatedTranslate }
        ]
    };
}
function shiftAnimatedStyles ( index , animatedValue , carouselProps ) { let animatedOpacity = { } ; let animatedScale = { } ; let animatedTranslate = { } ; if ( carouselProps . inactiveSlideOpacity < 1 ) { animatedOpacity = { opacity : animatedValue . interpolate ( { inputRange : [ 0 , 1 ] , outputRange : [ carouselProps . inactiveSlideOpacity , 1 ] } ) } ; } if ( carouselProps . inactiveSlideScale < 1 ) { animatedScale = { scale : animatedValue . interpolate ( { inputRange : [ 0 , 1 ] , outputRange : [ carouselProps . inactiveSlideScale , 1 ] } ) } ; } if ( carouselProps . inactiveSlideShift !== 0 ) { const translateProp = carouselProps . vertical ? 'translateX' : 'translateY' ; animatedTranslate = { [ translateProp ] : animatedValue . interpolate ( { inputRange : [ 0 , 1 ] , outputRange : [ carouselProps . inactiveSlideShift , 0 ] } ) } ; } return { ... animatedOpacity , transform : [ { ... animatedScale } , { ... animatedTranslate } ] } ; }
Based on prop 'inactiveSlideShift'
Based on prop ' inactiveSlideShift '