PluginProbe
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits / 3.1.2
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits v3.1.2
3.2.2 3.2.3 3.2.1 3.2.0 3.1.9 3.1.8 3.1.7 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.9 trunk 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.3 1.1.4 1.1.5 All 174 releases
master-addons / inc / controls / group / transitions.php

transitions.php in Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits 3.1.2, at inc/controls/group/transitions.php

140 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace MasterAddons\Inc\Controls\Group;
4
5 use Elementor\Group_Control_Base;
6 use Elementor\Controls_Manager;
7 use \Elementor\Core\Kits\Documents\Tabs\Global_Colors;
8
9 if (!defined('ABSPATH')) {
10 exit; // Exit if accessed directly.
11 }
12
13 /**
14 * Author Name: Liton Arefin
15 * Author URL: https://jeweltheme.com
16 * Custom transition group control
17 * Date: 10/12/19
18 */
19
20 class JLTMA_Transition extends Group_Control_Base
21 {
22
23 protected static $fields;
24 private static $_instance = null;
25
26 public static function instance()
27 {
28 if (is_null(self::$_instance)) {
29 self::$_instance = new self();
30 }
31 return self::$_instance;
32 }
33
34 public function __construct()
35 {
36 add_action('elementor/init', [$this, 'init'], 0);
37 }
38
39 public function init()
40 {
41 add_action('elementor/controls/controls_registered', [$this, 'register_controls']);
42 }
43
44 public function register_controls()
45 {
46 // Register control
47 \Elementor\Plugin::instance()->controls_manager->add_group_control('ma-el-transition', new self());
48 }
49
50
51 public static function get_type()
52 {
53 return 'jltma-transitions';
54 }
55
56 public static function get_easings()
57 {
58 return [
59 'linear' => esc_html__('Linear', 'master-addons' ),
60 'ease-in' => esc_html__('Ease In', 'master-addons' ),
61 'ease-out' => esc_html__('Ease Out', 'master-addons' ),
62 'ease-in-out' => esc_html__('Ease In Out', 'master-addons' )
63 ];
64 }
65
66
67
68 protected function init_fields()
69 {
70 $controls = [];
71
72 $controls['property'] = [
73 'label' => _x('Property', 'Transition Control', 'master-addons' ),
74 'type' => Controls_Manager::SELECT,
75 'default' => 'all',
76 'options' => [
77 'all' => esc_html__('All', 'master-addons' ),
78 ],
79 'selectors' => [
80 '{{SELECTOR}}' => 'transition-property: {{VALUE}}',
81 ],
82 ];
83
84 $controls['easing'] = [
85 'label' => _x('Easing', 'Transition Control', 'master-addons' ),
86 'type' => Controls_Manager::SELECT,
87 'default' => 'linear',
88 'options' => self::get_easings(),
89 'selectors' => [
90 '{{SELECTOR}}' => 'transition-timing-function: {{VALUE}}'
91 ],
92 ];
93
94 $controls['duration'] = [
95 'label' => _x('Duration', 'Transition Control', 'master-addons' ),
96 'type' => Controls_Manager::NUMBER,
97 'default' => 0.3,
98 'min' => 0.05,
99 'max' => 2,
100 'step' => 0.05,
101 'selectors' => [
102 '{{SELECTOR}}' => 'transition-duration: {{VALUE}}s;',
103 ],
104 'separator' => 'after',
105 ];
106
107 return $controls;
108 }
109
110
111 protected function prepare_fields($fields)
112 {
113
114 array_walk(
115 $fields,
116 function (&$field, $field_name) {
117
118 if (in_array($field_name, ['transition', 'popover_toggle'])) {
119 return;
120 }
121
122 $field['condition']['transition'] = 'custom';
123 }
124 );
125
126 return parent::prepare_fields($fields);
127 }
128
129
130 protected function get_default_options()
131 {
132 return [
133 'popover' => [
134 'starter_name' => 'transition',
135 'starter_title' => _x('Transition', 'Transition Control', 'master-addons' ),
136 ],
137 ];
138 }
139 }
140