All files / src/components panelsanimation.js

0% Statements 0/14
0% Branches 0/2
0% Functions 0/5
0% Lines 0/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38                                                                           
/**
 * Welcome page panels animations
 */
import LOG from './lslog';
 
export default function panelsAnimation(){
    setTimeout(() => {
        LOG.log('Triggering panel animation');
        /**
         * Panel shown one by one
         */
        $('.panel').each(function(i){
            $(this).delay((i++) * 200).animate({opacity: 1, top: '0px'}, 200);
        });
 
        /**
         * Rotate last survey/question
         */
        function rotateLast(){
        const $rotateShown = $('.rotateShown');
        const $rotateHidden = $('.rotateHidden');
        $rotateShown.hide('slide', { direction: 'left', easing: 'easeInOutQuint'}, 500, function(){
            $rotateHidden.show('slide', { direction: 'right', easing: 'easeInOutQuint' }, 1000);
        });
 
        $rotateShown.removeClass('rotateShown').addClass('rotateHidden');
        $rotateHidden.removeClass('rotateHidden').addClass('rotateShown');
        window.setTimeout( rotateLast, 5000 );
 
        }
 
        if ( $( "#last_question" ).length ) {
            $('.rotateHidden').hide();
            window.setTimeout( rotateLast, 2000 );
        }
    }, 350);
};