PluginProbe
Elementor Website Builder – more than just a page builder / 3.28.0-dev2
Elementor Website Builder – more than just a page builder v3.28.0-dev2
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / includes / controls / exit-animation.php

exit-animation.php in Elementor Website Builder – more than just a page builder 3.28.0-dev2, at includes/controls/exit-animation.php

111 lines 2.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor;
3
4 if ( ! defined( 'ABSPATH' ) ) {
5 exit; // Exit if accessed directly.
6 }
7
8 /**
9 * Elementor exit animation control.
10 *
11 * A control for creating exit animation. Displays a select box
12 * with the available exit animation effects @see Control_Exit_Animation::get_animations() .
13 *
14 * @since 2.5.0
15 */
16 class Control_Exit_Animation extends Control_Animation {
17
18 /**
19 * Get control type.
20 *
21 * Retrieve the animation control type.
22 *
23 * @since 2.5.0
24 * @access public
25 *
26 * @return string Control type.
27 */
28 public function get_type() {
29 return 'exit_animation';
30 }
31
32 /**
33 * Get animations list.
34 *
35 * Retrieve the list of all the available animations.
36 *
37 * @since 1.0.0
38 * @access public
39 * @static
40 *
41 * @return array Control type.
42 */
43 public static function get_animations() {
44 $additional_animations = [];
45
46 /**
47 * Exit animations.
48 *
49 * Filters the animations list displayed in the exit animations control.
50 *
51 * This hook can be used to register new animations in addition to the
52 * basic Elementor exit animations.
53 *
54 * @since 2.5.0
55 *
56 * @param array $additional_animations Additional animations array.
57 */
58 $additional_animations = apply_filters( 'elementor/controls/exit-animations/additional_animations', $additional_animations );
59
60 return array_merge( static::get_default_animations(), $additional_animations );
61 }
62
63 public static function get_default_animations(): array {
64 return [
65 'Fading' => [
66 'fadeIn' => 'Fade Out',
67 'fadeInDown' => 'Fade Out Up',
68 'fadeInLeft' => 'Fade Out Left',
69 'fadeInRight' => 'Fade Out Right',
70 'fadeInUp' => 'Fade Out Down',
71 ],
72 'Zooming' => [
73 'zoomIn' => 'Zoom Out',
74 'zoomInDown' => 'Zoom Out Up',
75 'zoomInLeft' => 'Zoom Out Left',
76 'zoomInRight' => 'Zoom Out Right',
77 'zoomInUp' => 'Zoom Out Down',
78 ],
79 'Sliding' => [
80 'slideInDown' => 'Slide Out Up',
81 'slideInLeft' => 'Slide Out Left',
82 'slideInRight' => 'Slide Out Right',
83 'slideInUp' => 'Slide Out Down',
84 ],
85 'Rotating' => [
86 'rotateIn' => 'Rotate Out',
87 'rotateInDownLeft' => 'Rotate Out Up Left',
88 'rotateInDownRight' => 'Rotate Out Up Right',
89 'rotateInUpRight' => 'Rotate Out Down Left',
90 'rotateInUpLeft' => 'Rotate Out Down Right',
91 ],
92 'Light Speed' => [
93 'lightSpeedIn' => 'Light Speed Out',
94 ],
95 'Specials' => [
96 'rollIn' => 'Roll Out',
97 ],
98 ];
99 }
100
101 public static function get_assets( $setting ) {
102 if ( ! $setting || 'none' === $setting ) {
103 return [];
104 }
105
106 return [
107 'styles' => [ 'e-animation-' . $setting ],
108 ];
109 }
110 }
111