Animation.php (1664B)
1 <?php 2 namespace Welbim\Helper\Elementor\Settings; 3 4 use Elementor\Utils; 5 6 class Animation { 7 8 9 public static function welbim_get_animation_name() { 10 $animations = array( 11 'none' => 'No Animation', 12 'sliceDown' => 'sliceDown', 13 'sliceDownLeft' => 'sliceDownLeft', 14 'sliceUp' => 'sliceUp', 15 'sliceUpLeft' => 'sliceUpLeft', 16 'sliceUpDown' => 'sliceUpDown', 17 'sliceUpDownLeft' => 'sliceUpDownLeft', 18 'fold' => 'fold', 19 'fade' => 'fade', 20 'random' => 'random', 21 'slideInRight' => 'slideInRight', 22 'slideInLeft' => 'slideInLeft', 23 'boxRandom' => 'boxRandom', 24 'boxRain' => 'boxRain', 25 'boxRainReverse' => 'boxRainReverse', 26 'boxRainGrow' => 'boxRainGrow', 27 'boxRainGrowReverse' => 'boxRainGrowReverse', 28 ); 29 30 return $animations; 31 } 32 33 public static function welbim_get_wow_animation_control( $obj, $animationClass = 'fadeInLeft', $animationDelay = '0s' ) { 34 $obj->add_control( 35 'animation_class', 36 array( 37 'label' => __( 'Animation Class', 'welbim-core' ), 38 'separator' => 'before', 39 'type' => \Elementor\Controls_Manager::ANIMATION, 40 'default' => $animationClass, 41 'options' => welbim_get_animation_name(), 42 ) 43 ); 44 $obj->add_control( 45 'addon_animation_delay_time', 46 array( 47 'label' => __( 'Delay Time', 'welbim-core' ), 48 'separator' => 'before', 49 'type' => \Elementor\Controls_Manager::TEXT, 50 'default' => $animationDelay, 51 'placeholder' => esc_html__( 'Animation delay value ex:200s.', 'welbim-core' ), 52 ) 53 ); 54 } 55 }