PluginProbe ʕ •ᴥ•ʔ
Premium Addons for Elementor – Powerful Elementor Templates & Widgets / 4.10.15
Premium Addons for Elementor – Powerful Elementor Templates & Widgets v4.10.15
4.11.79 4.11.78 4.11.77 4.11.76 4.11.75 3.20.5 4.11.69 3.20.6 4.11.7 3.20.7 4.11.70 3.20.8 4.11.71 3.20.9 4.11.72 3.21.1 4.11.73 3.21.2 4.11.74 3.21.3 4.11.8 3.21.4 4.11.9 3.21.5 4.2.0 3.21.6 4.2.1 3.3.0 4.2.2 3.3.1 4.2.3 3.3.2 4.2.4 3.3.3 4.2.5 3.3.4 4.2.6 3.3.5 4.2.7 3.3.6 4.2.8 3.3.7 4.2.9 3.3.8 4.3.0 3.3.9 4.3.1 3.4.0 4.3.2 3.4.1 4.3.3 3.4.2 4.3.4 3.4.3 4.3.5 3.4.4 4.3.6 3.4.5 4.3.7 3.4.6 4.3.8 3.4.7 4.3.9 3.4.8 4.4.0 3.4.9 4.4.1 3.5.0 4.4.2 3.5.1 4.4.3 3.5.2 4.4.4 3.5.3 4.4.5 3.5.4 4.4.6 3.5.5 4.4.7 3.5.6 4.4.8 3.5.7 4.4.9 3.5.8 4.5.0 3.5.9 4.5.1 3.6.0 4.5.2 3.6.1 4.5.3 3.6.2 4.5.4 3.6.3 4.5.5 3.6.4 4.5.6 3.6.5 4.5.7 3.6.6 4.5.8 3.6.7 4.5.9 3.6.8 4.6.0 3.6.9 4.6.1 3.7.0 4.7.0 3.7.1 4.7.1 3.7.2 4.7.2 3.7.3 4.7.3 3.7.4 4.7.4 3.7.5 4.7.5 3.7.6 4.7.6 3.7.7 4.7.7 3.7.8 4.7.8 3.7.9 4.7.9 3.8.0 4.8.0 3.8.1 4.8.1 3.8.2 4.8.10 3.8.3 4.8.11 3.8.4 4.8.2 3.8.5 4.8.3 3.8.6 4.8.4 3.8.7 4.8.5 3.8.8 4.8.6 3.8.9 4.8.7 3.9.0 4.8.8 3.9.1 4.8.9 3.9.2 4.9.0 3.9.3 4.9.0-beta1 3.9.4 4.9.0-beta2 3.9.5 4.9.1 3.9.6 4.9.10 3.9.7 4.9.11 3.9.8 4.9.12 3.9.9 4.9.13 4.0.1 4.9.14 4.0.3 4.9.15 4.0.4 4.9.16 4.0.5 4.9.17 4.0.6 4.9.18 4.0.7 4.9.19 4.0.8 4.9.2 4.0.9 4.9.20 4.1.0 4.9.21 4.1.1 4.9.22 4.1.2 4.9.23 4.1.3 4.9.24 trunk 4.1.4 4.9.25 1.0 4.1.5 4.9.26 1.01 4.1.6 4.9.27 1.02 4.1.7 4.9.28 1.03 4.1.8 4.9.29 1.04 4.1.9 4.9.3 1.05 4.10.0 4.9.30 1.06 4.10.1 4.9.31 1.07 4.10.10 4.9.32 1.08 4.10.11 4.9.33 1.09 4.10.12 4.9.34 2.0 4.10.13 4.9.35 2.0.1 4.10.14 4.9.36 2.0.2 4.10.15 4.9.37 2.0.3 4.10.16 4.9.38 2.0.4 4.10.17 4.9.39 2.0.5 4.10.18 4.9.4 2.0.6 4.10.19 4.9.40 2.0.7 4.10.2 4.9.41 2.0.8 4.10.20 4.9.42 2.0.9 4.10.21 4.9.43 2.1.0 4.10.22 4.9.45 2.1.1 4.10.23 4.9.46 2.1.2 4.10.24 4.9.47 2.1.3 4.10.25 4.9.48 2.1.4 4.10.26 4.9.49 2.1.5 4.10.27 4.9.5 2.1.5-beta1 4.10.28 4.9.50 2.1.6 4.10.29 4.9.51 2.1.7 4.10.3 4.9.52 2.1.8 4.10.30 4.9.53 2.1.9 4.10.31 4.9.54 2.2.0 4.10.32 4.9.55 2.2.1 4.10.33 4.9.56 2.2.2 4.10.34 4.9.57 2.2.3 4.10.35 4.9.6 2.2.4 4.10.36 4.9.7 2.2.5 4.10.37 4.9.8 2.2.6 4.10.38 4.9.9 2.2.7 4.10.39 2.2.8 4.10.4 2.2.9 4.10.40 2.3.0 4.10.41 2.3.1 4.10.42 2.3.2 4.10.43 2.3.3 4.10.44 2.3.4 4.10.45 2.3.5 4.10.46 2.3.6 4.10.47 2.3.7 4.10.48 2.3.8 4.10.49 2.3.9 4.10.5 2.4.0 4.10.50 2.4.1 4.10.51 2.5.0 4.10.52 2.5.1 4.10.53 2.5.2 4.10.54 2.5.3 4.10.55 2.5.4 4.10.56 2.5.5 4.10.57 2.5.6 4.10.58 2.5.7 4.10.59 2.5.8 4.10.6 2.5.9 4.10.60 2.6.0 4.10.61 2.6.1 4.10.62 2.6.2 4.10.63 2.6.3 4.10.64 2.6.4 4.10.65 2.6.5 4.10.66 2.6.6 4.10.67 2.6.7 4.10.68 2.6.8 4.10.69 2.6.9 4.10.7 2.7.0 4.10.70 2.7.1 4.10.71 2.7.2 4.10.72 2.7.3 4.10.73 2.7.4 4.10.74 2.7.5 4.10.75 2.7.6 4.10.76 2.7.7 4.10.77 2.7.8 4.10.78 2.7.9 4.10.79 2.8.0 4.10.8 2.8.1 4.10.80 2.8.2 4.10.81 2.8.3 4.10.82 2.8.4 4.10.83 2.8.5 4.10.84 2.8.6 4.10.85 2.8.7 4.10.86 2.8.8 4.10.87 2.8.9 4.10.88 2.9.0 4.10.89 2.9.1 4.10.9 2.9.2 4.10.90 2.9.3 4.11.0 2.9.4 4.11.1 2.9.5 4.11.10 2.9.6 4.11.11 2.9.7 4.11.12 2.9.8 4.11.13 2.9.9 4.11.14 3.0.0 4.11.15 3.0.1 4.11.16 3.0.2 4.11.17 3.0.3 4.11.18 3.0.4 4.11.19 3.0.5 4.11.2 3.0.6 4.11.20 3.0.7 4.11.21 3.0.8 4.11.22 3.0.9 4.11.23 3.1.0 4.11.24 3.1.1 4.11.25 3.1.2 4.11.26 3.1.3 4.11.27 3.1.4 4.11.28 3.1.5 4.11.29 3.1.6 4.11.3 3.1.7 4.11.30 3.1.8 4.11.31 3.1.9 4.11.32 3.10.0 4.11.33 3.10.1 4.11.34 3.10.2 4.11.35 3.10.3 4.11.36 3.10.4 4.11.37 3.10.5 4.11.38 3.10.6 4.11.39 3.10.7 4.11.4 3.10.8 4.11.40 3.10.9 4.11.41 3.11.0 4.11.42 3.11.1 4.11.43 3.11.2 4.11.44 3.11.3 4.11.45 3.11.4 4.11.46 3.11.5 4.11.47 3.11.6 4.11.48 3.11.7 4.11.49 3.11.8 4.11.5 3.11.9 4.11.50 3.12.0 4.11.51 3.12.1 4.11.52 3.12.2 4.11.53 3.12.3 4.11.54 3.2.0 4.11.55 3.2.1 4.11.56 3.2.2 4.11.57 3.2.3 4.11.58 3.2.4 4.11.59 3.2.5 4.11.6 3.2.6 4.11.60 3.2.7 4.11.61 3.2.8 4.11.62 3.2.9 4.11.63 3.20.0 4.11.64 3.20.1 4.11.65 3.20.2 4.11.66 3.20.3 4.11.67 3.20.4 4.11.68
premium-addons-for-elementor / widgets / premium-title.php
premium-addons-for-elementor / widgets Last commit date
dep 2 years ago premium-banner.php 2 years ago premium-blog.php 2 years ago premium-button.php 2 years ago premium-carousel.php 2 years ago premium-contactform.php 2 years ago premium-countdown.php 2 years ago premium-counter.php 2 years ago premium-dual-header.php 2 years ago premium-fancytext.php 2 years ago premium-grid.php 2 years ago premium-icon-list.php 2 years ago premium-image-button.php 2 years ago premium-image-scroll.php 2 years ago premium-image-separator.php 2 years ago premium-lottie.php 2 years ago premium-maps.php 2 years ago premium-media-wheel.php 2 years ago premium-modalbox.php 2 years ago premium-nav-menu.php 2 years ago premium-notifications.php 2 years ago premium-person.php 2 years ago premium-pinterest-feed.php 2 years ago premium-post-ticker.php 2 years ago premium-pricing-table.php 2 years ago premium-progressbar.php 2 years ago premium-svg-drawer.php 2 years ago premium-tcloud.php 2 years ago premium-testimonials.php 2 years ago premium-tiktok-feed.php 2 years ago premium-title.php 2 years ago premium-videobox.php 2 years ago premium-vscroll.php 2 years ago premium-weather.php 2 years ago premium-world-clock.php 2 years ago
premium-title.php
2374 lines
1 <?php
2 /**
3 * Premium Title.
4 */
5
6 namespace PremiumAddons\Widgets;
7
8 // Elementor Classes.
9 use Elementor\Widget_Base;
10 use Elementor\Utils;
11 use Elementor\Icons_Manager;
12 use Elementor\Controls_Manager;
13 use Elementor\Control_Media;
14 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
15 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
16 use Elementor\Group_Control_Border;
17 use Elementor\Group_Control_Typography;
18 use Elementor\Group_Control_Text_Shadow;
19 use Elementor\Group_Control_Background;
20
21 // PremiumAddons Classes.
22 use PremiumAddons\Admin\Includes\Admin_Helper;
23 use PremiumAddons\Includes\Helper_Functions;
24 use PremiumAddons\Includes\Premium_Template_Tags;
25
26 if ( ! defined( 'ABSPATH' ) ) {
27 exit; // If this file is called directly, abort.
28 }
29
30 /**
31 * Class Premium_Title
32 */
33 class Premium_Title extends Widget_Base {
34
35 /**
36 * Template Instance
37 *
38 * @var template_instance
39 */
40 protected $template_instance;
41
42 /**
43 * Check Icon Draw Option.
44 *
45 * @since 4.9.26
46 * @access public
47 */
48 public function check_icon_draw() {
49 $is_enabled = Admin_Helper::check_svg_draw( 'premium-title' );
50 return $is_enabled;
51 }
52
53 /**
54 * Get Elementor Helper Instance.
55 *
56 * @since 1.0.0
57 * @access public
58 */
59 public function getTemplateInstance() {
60 return $this->template_instance = Premium_Template_Tags::getInstance();
61 }
62
63 /**
64 * Retrieve Widget Name.
65 *
66 * @since 1.0.0
67 * @access public
68 */
69 public function get_name() {
70 return 'premium-addon-title';
71 }
72
73 /**
74 * Retrieve Widget Title.
75 *
76 * @since 1.0.0
77 * @access public
78 */
79 public function get_title() {
80 return __( 'Heading', 'premium-addons-for-elementor' );
81 }
82
83 /**
84 * Retrieve Widget Icon.
85 *
86 * @since 1.0.0
87 * @access public
88 *
89 * @return string widget icon.
90 */
91 public function get_icon() {
92 return 'pa-title';
93 }
94
95 /**
96 * Retrieve Widget Dependent CSS.
97 *
98 * @since 1.0.0
99 * @access public
100 *
101 * @return array CSS style handles.
102 */
103 public function get_style_depends() {
104 return array(
105 'premium-addons',
106 );
107 }
108
109 /**
110 * Retrieve Widget Dependent JS.
111 *
112 * @since 1.0.0
113 * @access public
114 *
115 * @return array JS script handles.
116 */
117 public function get_script_depends() {
118
119 $draw_scripts = $this->check_icon_draw() ? array(
120 'pa-fontawesome-all',
121 'pa-tweenmax',
122 'pa-motionpath',
123 ) : array();
124
125 return array_merge(
126 $draw_scripts,
127 array(
128 'premium-addons',
129 'elementor-waypoints',
130 'lottie-js',
131 )
132 );
133
134 }
135
136 /**
137 * Retrieve Widget Categories.
138 *
139 * @since 1.5.1
140 * @access public
141 *
142 * @return array Widget categories.
143 */
144 public function get_categories() {
145 return array( 'premium-elements' );
146 }
147
148 /**
149 * Retrieve Widget Dependent CSS.
150 *
151 * @since 1.0.0
152 * @access public
153 *
154 * @return array CSS style handles.
155 */
156 public function get_keywords() {
157 return array( 'pa', 'premium', 'title', 'text', 'headline' );
158 }
159
160 /**
161 * Retrieve Widget Support URL.
162 *
163 * @access public
164 *
165 * @return string support URL.
166 */
167 public function get_custom_help_url() {
168 return 'https://premiumaddons.com/support/';
169 }
170
171 /**
172 * Register Title controls.
173 *
174 * @since 1.0.0
175 * @access protected
176 */
177 protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
178
179 $draw_icon = $this->check_icon_draw();
180
181 $this->start_controls_section(
182 'premium_title_content',
183 array(
184 'label' => __( 'Title', 'premium-addons-for-elementor' ),
185 )
186 );
187
188 $this->add_control(
189 'premium_title_text',
190 array(
191 'label' => __( 'Title', 'premium-addons-for-elementor' ),
192 'type' => Controls_Manager::TEXT,
193 'default' => __( 'Premium Title', 'premium-addons-for-elementor' ),
194 'label_block' => true,
195 'dynamic' => array( 'active' => true ),
196 )
197 );
198
199 $this->add_control(
200 'premium_title_style',
201 array(
202 'label' => __( 'Style', 'premium-addons-for-elementor' ),
203 'type' => Controls_Manager::SELECT,
204 'default' => 'style1',
205 'options' => array(
206 'style1' => __( 'Style 1', 'premium-addons-for-elementor' ),
207 'style2' => __( 'Style 2', 'premium-addons-for-elementor' ),
208 'style3' => __( 'Style 3', 'premium-addons-for-elementor' ),
209 'style4' => __( 'Style 4', 'premium-addons-for-elementor' ),
210 'style5' => __( 'Style 5', 'premium-addons-for-elementor' ),
211 'style6' => __( 'Style 6', 'premium-addons-for-elementor' ),
212 'style7' => __( 'Style 7', 'premium-addons-for-elementor' ),
213 'style8' => __( 'Style 8', 'premium-addons-for-elementor' ),
214 'style9' => __( 'Style 9', 'premium-addons-for-elementor' ),
215 ),
216 'label_block' => true,
217 )
218 );
219
220 $this->add_control(
221 'premium_title_icon_switcher',
222 array(
223 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
224 'type' => Controls_Manager::SWITCHER,
225 )
226 );
227
228 $this->add_control(
229 'icon_type',
230 array(
231 'label' => __( 'Icon Type', 'premium-addons-for-elementor' ),
232 'type' => Controls_Manager::SELECT,
233 'options' => array(
234 'icon' => __( 'Icon', 'premium-addons-for-elementor' ),
235 'image' => __( 'Image', 'premium-addons-for-elementor' ),
236 'animation' => __( 'Lottie Animation', 'premium-addons-for-elementor' ),
237 'svg' => __( 'SVG Code', 'premium-addons-for-elementor' ),
238 ),
239 'default' => 'icon',
240 'condition' => array(
241 'premium_title_icon_switcher' => 'yes',
242 ),
243 )
244 );
245
246 $common_conditions = array(
247 'premium_title_icon_switcher' => 'yes',
248 );
249
250 $this->add_control(
251 'premium_title_icon_updated',
252 array(
253 'label' => __( 'Font Awesome Icon', 'premium-addons-for-elementor' ),
254 'type' => Controls_Manager::ICONS,
255 'fa4compatibility' => 'premium_title_icon',
256 'default' => array(
257 'value' => 'fas fa-bars',
258 'library' => 'fa-solid',
259 ),
260 'label_block' => true,
261 'condition' => array_merge(
262 $common_conditions,
263 array(
264 'icon_type' => 'icon',
265 )
266 ),
267 )
268 );
269
270 $this->add_control(
271 'image_upload',
272 array(
273 'label' => __( 'Upload Image', 'premium-addons-for-elementor' ),
274 'type' => Controls_Manager::MEDIA,
275 'default' => array(
276 'url' => Utils::get_placeholder_image_src(),
277 ),
278 'condition' => array_merge(
279 $common_conditions,
280 array(
281 'icon_type' => 'image',
282 )
283 ),
284 )
285 );
286
287 $this->add_control(
288 'custom_svg',
289 array(
290 'label' => __( 'SVG Code', 'premium-addons-for-elementor' ),
291 'type' => Controls_Manager::TEXTAREA,
292 'description' => 'You can use these sites to create SVGs: <a href="https://danmarshall.github.io/google-font-to-svg-path/" target="_blank">Google Fonts</a> and <a href="https://boxy-svg.com/" target="_blank">Boxy SVG</a>',
293 'condition' => array_merge(
294 $common_conditions,
295 array(
296 'icon_type' => 'svg',
297 )
298 ),
299 )
300 );
301
302 $this->add_control(
303 'lottie_url',
304 array(
305 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ),
306 'type' => Controls_Manager::TEXT,
307 'dynamic' => array( 'active' => true ),
308 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>',
309 'label_block' => true,
310 'condition' => array_merge(
311 $common_conditions,
312 array(
313 'icon_type' => 'animation',
314 )
315 ),
316 )
317 );
318
319 $animation_conds = array(
320 'terms' => array(
321 array(
322 'name' => 'premium_title_icon_switcher',
323 'value' => 'yes',
324 ),
325 array(
326 'relation' => 'or',
327 'terms' => array(
328 array(
329 'name' => 'icon_type',
330 'value' => 'animation',
331 ),
332 array(
333 'terms' => array(
334 array(
335 'relation' => 'or',
336 'terms' => array(
337 array(
338 'name' => 'icon_type',
339 'value' => 'icon',
340 ),
341 array(
342 'name' => 'icon_type',
343 'value' => 'svg',
344 ),
345 ),
346 ),
347 array(
348 'name' => 'draw_svg',
349 'value' => 'yes',
350 ),
351 ),
352 ),
353 ),
354 ),
355 ),
356 );
357
358 $this->add_control(
359 'draw_svg',
360 array(
361 'label' => __( 'Draw Icon', 'premium-addons-for-elementor' ),
362 'type' => Controls_Manager::SWITCHER,
363 'classes' => $draw_icon ? '' : 'editor-pa-control-disabled',
364 'condition' => array_merge(
365 $common_conditions,
366 array(
367 'icon_type' => array( 'icon', 'svg' ),
368 'premium_title_icon_updated[library]!' => 'svg',
369 )
370 ),
371 )
372 );
373
374 if ( $draw_icon ) {
375
376 $this->add_control(
377 'path_width',
378 array(
379 'label' => __( 'Path Thickness', 'premium-addons-for-elementor' ),
380 'type' => Controls_Manager::SLIDER,
381 'range' => array(
382 'px' => array(
383 'min' => 0,
384 'max' => 50,
385 'step' => 0.1,
386 ),
387 ),
388 'condition' => array_merge(
389 $common_conditions,
390 array(
391 'icon_type' => array( 'icon', 'svg' ),
392 )
393 ),
394 'selectors' => array(
395 '{{WRAPPER}} .premium-title-header svg *' => 'stroke-width: {{SIZE}}',
396 ),
397 )
398 );
399
400 $this->add_control(
401 'svg_sync',
402 array(
403 'label' => __( 'Draw All Paths Together', 'premium-addons-for-elementor' ),
404 'type' => Controls_Manager::SWITCHER,
405 'condition' => array_merge(
406 $common_conditions,
407 array(
408 'icon_type' => array( 'icon', 'svg' ),
409 'draw_svg' => 'yes',
410 )
411 ),
412 )
413 );
414
415 $this->add_control(
416 'frames',
417 array(
418 'label' => __( 'Speed', 'premium-addons-for-elementor' ),
419 'type' => Controls_Manager::NUMBER,
420 'description' => __( 'Larger value means longer animation duration.', 'premium-addons-for-elementor' ),
421 'default' => 5,
422 'min' => 1,
423 'max' => 100,
424 'condition' => array_merge(
425 $common_conditions,
426 array(
427 'icon_type' => array( 'icon', 'svg' ),
428 'draw_svg' => 'yes',
429 )
430 ),
431 )
432 );
433
434 } else {
435
436 Helper_Functions::get_draw_svg_notice(
437 $this,
438 'heading',
439 array_merge(
440 $common_conditions,
441 array(
442 'icon_type' => array( 'icon', 'svg' ),
443 'premium_title_icon_updated[library]!' => 'svg',
444 )
445 )
446 );
447
448 }
449
450 $this->add_control(
451 'lottie_loop',
452 array(
453 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
454 'type' => Controls_Manager::SWITCHER,
455 'return_value' => 'true',
456 'default' => 'true',
457 'conditions' => $animation_conds,
458 )
459 );
460
461 $this->add_control(
462 'lottie_reverse',
463 array(
464 'label' => __( 'Reverse', 'premium-addons-for-elementor' ),
465 'type' => Controls_Manager::SWITCHER,
466 'return_value' => 'true',
467 'conditions' => $animation_conds,
468 )
469 );
470
471 if ( $draw_icon ) {
472 $this->add_control(
473 'start_point',
474 array(
475 'label' => __( 'Start Point (%)', 'premium-addons-for-elementor' ),
476 'type' => Controls_Manager::SLIDER,
477 'description' => __( 'Set the point that the SVG should start from.', 'premium-addons-for-elementor' ),
478 'default' => array(
479 'unit' => '%',
480 'size' => 0,
481 ),
482 'condition' => array_merge(
483 $common_conditions,
484 array(
485 'icon_type' => array( 'icon', 'svg' ),
486 'draw_svg' => 'yes',
487 'lottie_reverse!' => 'true',
488 )
489 ),
490 )
491 );
492
493 $this->add_control(
494 'end_point',
495 array(
496 'label' => __( 'End Point (%)', 'premium-addons-for-elementor' ),
497 'type' => Controls_Manager::SLIDER,
498 'description' => __( 'Set the point that the SVG should end at.', 'premium-addons-for-elementor' ),
499 'default' => array(
500 'unit' => '%',
501 'size' => 0,
502 ),
503 'condition' => array_merge(
504 $common_conditions,
505 array(
506 'icon_type' => array( 'icon', 'svg' ),
507 'draw_svg' => 'yes',
508 'lottie_reverse' => 'true',
509 )
510 ),
511
512 )
513 );
514
515 $this->add_control(
516 'svg_hover',
517 array(
518 'label' => __( 'Only Play on Hover', 'premium-addons-for-elementor' ),
519 'type' => Controls_Manager::SWITCHER,
520 'return_value' => 'true',
521 'condition' => array_merge(
522 $common_conditions,
523 array(
524 'icon_type' => array( 'icon', 'svg' ),
525 'draw_svg' => 'yes',
526 )
527 ),
528 )
529 );
530
531 $this->add_control(
532 'svg_yoyo',
533 array(
534 'label' => __( 'Yoyo Effect', 'premium-addons-for-elementor' ),
535 'type' => Controls_Manager::SWITCHER,
536 'condition' => array_merge(
537 $common_conditions,
538 array(
539 'icon_type' => array( 'icon', 'svg' ),
540 'draw_svg' => 'yes',
541 'lottie_loop' => 'true',
542 )
543 ),
544 )
545 );
546 }
547
548 $this->add_responsive_control(
549 'icon_position',
550 array(
551 'label' => __( 'Icon Position', 'premium-addons-for-elementor' ),
552 'type' => Controls_Manager::SELECT,
553 'options' => array(
554 'row' => __( 'Before', 'premium-addons-for-elementor' ),
555 'row-reverse' => __( 'After', 'premium-addons-for-elementor' ),
556 'column' => __( 'Top', 'premium-addons-for-elementor' ),
557 'column-reverse' => __( 'Bottom', 'premium-addons-for-elementor' ),
558 ),
559 'default' => 'row',
560 'toggle' => false,
561 'render_type' => 'template',
562 'prefix_class' => 'premium-title-icon-',
563 'selectors' => array(
564 '{{WRAPPER}} .premium-title-header:not(.premium-title-style7), {{WRAPPER}} .premium-title-style7-inner' => 'flex-direction: {{VALUE}}',
565 ),
566 'condition' => array(
567 'premium_title_icon_switcher' => 'yes',
568 ),
569 )
570 );
571
572 $this->add_responsive_control(
573 'top_icon_align',
574 array(
575 'label' => __( 'Icon Alignment', 'premium-addons-for-elementor' ),
576 'type' => Controls_Manager::CHOOSE,
577 'options' => array(
578 'flex-start' => array(
579 'title' => __( 'Left', 'premium-addons-for-elementor' ),
580 'icon' => 'eicon-text-align-left',
581 ),
582 'center' => array(
583 'title' => __( 'Center', 'premium-addons-for-elementor' ),
584 'icon' => 'eicon-text-align-center',
585 ),
586 'flex-end' => array(
587 'title' => __( 'Right', 'premium-addons-for-elementor' ),
588 'icon' => 'eicon-text-align-right',
589 ),
590 ),
591 'default' => 'center',
592 'toggle' => false,
593 'selectors' => array(
594 '{{WRAPPER}}.premium-title-icon-column .premium-title-header:not(.premium-title-style7)' => 'align-items: {{VALUE}}',
595 '{{WRAPPER}}.premium-title-icon-column .premium-title-style7 .premium-title-icon' => 'align-self: {{VALUE}}',
596 ),
597 'condition' => array(
598 'premium_title_icon_switcher' => 'yes',
599 'icon_position' => 'column',
600 'premium_title_style!' => array( 'style3', 'style4' ),
601 ),
602 )
603 );
604
605 $this->add_control(
606 'premium_title_tag',
607 array(
608 'label' => __( 'HTML Tag', 'premium-addons-for-elementor' ),
609 'type' => Controls_Manager::SELECT,
610 'default' => 'h2',
611 'options' => array(
612 'h1' => 'H1',
613 'h2' => 'H2',
614 'h3' => 'H3',
615 'h4' => 'H4',
616 'h5' => 'H5',
617 'h6' => 'H6',
618 'div' => 'div',
619 'span' => 'span',
620 ),
621 'separator' => 'before',
622 )
623 );
624
625 $inline_flex = array( 'style1', 'style2', 'style5', 'style6', 'style7', 'style8', 'style9' );
626
627 $this->add_responsive_control(
628 'premium_title_align',
629 array(
630 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
631 'type' => Controls_Manager::CHOOSE,
632 'options' => array(
633 'left' => array(
634 'title' => __( 'Left', 'premium-addons-for-elementor' ),
635 'icon' => 'eicon-text-align-left',
636 ),
637 'center' => array(
638 'title' => __( 'Center', 'premium-addons-for-elementor' ),
639 'icon' => 'eicon-text-align-center',
640 ),
641 'right' => array(
642 'title' => __( 'Right', 'premium-addons-for-elementor' ),
643 'icon' => 'eicon-text-align-right',
644 ),
645 ),
646 'default' => 'left',
647 'toggle' => false,
648 'selectors' => array(
649 '{{WRAPPER}} .premium-title-container' => 'text-align: {{VALUE}};',
650 ),
651 'condition' => array(
652 'premium_title_style' => $inline_flex,
653 ),
654 )
655 );
656
657 $this->add_control(
658 'premium_title_align_flex',
659 array(
660 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
661 'type' => Controls_Manager::CHOOSE,
662 'prefix_class' => 'premium-title-',
663 'options' => array(
664 'flex-start' => array(
665 'title' => __( 'Left', 'premium-addons-for-elementor' ),
666 'icon' => 'eicon-text-align-left',
667 ),
668 'center' => array(
669 'title' => __( 'Center', 'premium-addons-for-elementor' ),
670 'icon' => 'eicon-text-align-center',
671 ),
672 'flex-end' => array(
673 'title' => __( 'Right', 'premium-addons-for-elementor' ),
674 'icon' => 'eicon-text-align-right',
675 ),
676 ),
677 'default' => 'flex-start',
678 'selectors' => array(
679 '{{WRAPPER}}:not(.premium-title-icon-column) .premium-title-header' => 'justify-content: {{VALUE}}',
680 '{{WRAPPER}}.premium-title-icon-column .premium-title-header' => 'align-items: {{VALUE}}',
681 ),
682 'toggle' => false,
683 'condition' => array(
684 'premium_title_style' => array( 'style3', 'style4' ),
685 ),
686 )
687 );
688
689 $this->add_control(
690 'alignment_notice',
691 array(
692 'raw' => __( 'Please note that left/right alignment is reversed when Icon Position is set to After.', 'premium-addons-for-elementor' ),
693 'type' => Controls_Manager::RAW_HTML,
694 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
695 'condition' => array(
696 'premium_title_icon_switcher' => 'yes',
697 'icon_position' => 'row-reverse',
698 'premium_title_style' => array( 'style3', 'style4' ),
699 ),
700 )
701 );
702
703 $this->add_control(
704 'premium_title_stripe_pos',
705 array(
706 'label' => __( 'Stripe Position', 'premium-addons-for-elementor' ),
707 'type' => Controls_Manager::SELECT,
708 'options' => array(
709 'top' => __( 'Top', 'premium-addons-for-elementor' ),
710 'bottom' => __( 'Bottom', 'premium-addons-for-elementor' ),
711 ),
712 'selectors_dictionary' => array(
713 'top' => 'initial',
714 'bottom' => '2',
715 ),
716 'default' => 'top',
717 'label_block' => true,
718 'separator' => 'before',
719 'condition' => array(
720 'premium_title_style' => 'style7',
721 ),
722 'selectors' => array(
723 '{{WRAPPER}} .premium-title-style7-stripe-wrap' => 'order: {{VALUE}}',
724 ),
725 )
726 );
727
728 $this->add_responsive_control(
729 'premium_title_style7_strip_width',
730 array(
731 'label' => __( 'Stripe Width (PX)', 'premium-addons-for-elementor' ),
732 'type' => Controls_Manager::SLIDER,
733 'size_units' => array( 'px', '%', 'em' ),
734 'default' => array(
735 'unit' => 'px',
736 'size' => '120',
737 ),
738 'selectors' => array(
739 '{{WRAPPER}} .premium-title-style7-stripe' => 'width: {{SIZE}}{{UNIT}};',
740 ),
741 'label_block' => true,
742 'condition' => array(
743 'premium_title_style' => 'style7',
744 ),
745 )
746 );
747
748 $this->add_responsive_control(
749 'premium_title_style7_strip_height',
750 array(
751 'label' => __( 'Stripe Height (PX)', 'premium-addons-for-elementor' ),
752 'type' => Controls_Manager::SLIDER,
753 'size_units' => array( 'px', 'em' ),
754 'default' => array(
755 'unit' => 'px',
756 'size' => '5',
757 ),
758 'label_block' => true,
759 'selectors' => array(
760 '{{WRAPPER}} .premium-title-style7-stripe' => 'height: {{SIZE}}{{UNIT}};',
761 ),
762 'condition' => array(
763 'premium_title_style' => 'style7',
764 ),
765 )
766 );
767
768 $this->add_responsive_control(
769 'premium_title_style7_strip_top_spacing',
770 array(
771 'label' => __( 'Stripe Top Spacing (PX)', 'premium-addons-for-elementor' ),
772 'type' => Controls_Manager::SLIDER,
773 'size_units' => array( 'px', '%', 'em' ),
774 'selectors' => array(
775 '{{WRAPPER}} .premium-title-style7-stripe-wrap' => 'margin-top: {{SIZE}}{{UNIT}};',
776 ),
777 'label_block' => true,
778 'condition' => array(
779 'premium_title_style' => 'style7',
780 ),
781 )
782 );
783
784 $this->add_responsive_control(
785 'premium_title_style7_strip_bottom_spacing',
786 array(
787 'label' => __( 'Stripe Bottom Spacing (PX)', 'premium-addons-for-elementor' ),
788 'type' => Controls_Manager::SLIDER,
789 'size_units' => array( 'px', '%', 'em' ),
790 'label_block' => true,
791 'selectors' => array(
792 '{{WRAPPER}} .premium-title-style7-stripe-wrap' => 'margin-bottom: {{SIZE}}{{UNIT}};',
793 ),
794 'condition' => array(
795 'premium_title_style' => 'style7',
796 ),
797 )
798 );
799
800 $this->add_responsive_control(
801 'premium_title_style7_strip_align',
802 array(
803 'label' => __( 'Stripe Alignment', 'premium-addons-for-elementor' ),
804 'type' => Controls_Manager::CHOOSE,
805 'options' => array(
806 'flex-start' => array(
807 'title' => __( 'Left', 'premium-addons-for-elementor' ),
808 'icon' => 'eicon-text-align-left',
809 ),
810 'center' => array(
811 'title' => __( 'Center', 'premium-addons-for-elementor' ),
812 'icon' => 'eicon-text-align-center',
813 ),
814 'flex-end' => array(
815 'title' => __( 'Right', 'premium-addons-for-elementor' ),
816 'icon' => 'eicon-text-align-right',
817 ),
818 ),
819 'toggle' => false,
820 'default' => 'center',
821 'selectors' => array(
822 '{{WRAPPER}}:not(.premium-title-icon-column) .premium-title-style7-stripe-wrap' => 'justify-content: {{VALUE}}',
823 '{{WRAPPER}}.premium-title-icon-column .premium-title-style7-stripe-wrap' => 'align-self: {{VALUE}}',
824 ),
825 'condition' => array(
826 'premium_title_style' => 'style7',
827 ),
828 )
829 );
830
831 $this->add_control(
832 'link_switcher',
833 array(
834 'label' => __( 'Link', 'premium-addons-for-elementor' ),
835 'type' => Controls_Manager::SWITCHER,
836 )
837 );
838
839 $this->add_control(
840 'link_selection',
841 array(
842 'label' => __( 'Link Type', 'premium-addons-for-elementor' ),
843 'type' => Controls_Manager::SELECT,
844 'options' => array(
845 'url' => __( 'URL', 'premium-addons-for-elementor' ),
846 'link' => __( 'Existing Page', 'premium-addons-for-elementor' ),
847 ),
848 'default' => 'url',
849 'label_block' => true,
850 'condition' => array(
851 'link_switcher' => 'yes',
852 ),
853 )
854 );
855
856 $this->add_control(
857 'custom_link',
858 array(
859 'label' => __( 'Link', 'premium-addons-for-elementor' ),
860 'type' => Controls_Manager::URL,
861 'dynamic' => array( 'active' => true ),
862 'default' => array(
863 'url' => '#',
864 ),
865 'placeholder' => 'https://premiumaddons.com/',
866 'label_block' => true,
867 'separator' => 'after',
868 'condition' => array(
869 'link_switcher' => 'yes',
870 'link_selection' => 'url',
871 ),
872 )
873 );
874
875 $this->add_control(
876 'existing_link',
877 array(
878 'label' => __( 'Existing Page', 'premium-addons-for-elementor' ),
879 'type' => Controls_Manager::SELECT2,
880 'options' => $this->getTemplateInstance()->get_all_posts(),
881 'condition' => array(
882 'link_switcher' => 'yes',
883 'link_selection' => 'link',
884 ),
885 'multiple' => false,
886 'label_block' => true,
887 )
888 );
889
890 $this->add_control(
891 'background_text_switcher',
892 array(
893 'label' => __( 'Background Text', 'premium-addons-for-elementor' ),
894 'type' => Controls_Manager::SWITCHER,
895 )
896 );
897
898 $this->add_control(
899 'background_text',
900 array(
901 'label' => __( 'Text', 'premium-addons-for-elementor' ),
902 'type' => Controls_Manager::TEXT,
903 'default' => __( 'Awesome Title', 'premium-addons-for-elementor' ),
904 'condition' => array(
905 'background_text_switcher' => 'yes',
906 ),
907 )
908 );
909
910 $this->add_control(
911 'background_text_width',
912 array(
913 'label' => __( 'Width', 'premium-addons-for-elementor' ),
914 'type' => Controls_Manager::SELECT,
915 'options' => array(
916 'auto' => __( 'Auto', 'premium-addons-for-elementor' ),
917 '100%' => __( 'Full Width', 'premium-addons-for-elementor' ),
918 ),
919 'default' => 'auto',
920 'label_block' => true,
921 'selectors' => array(
922 '{{WRAPPER}} .premium-title-bg-text:before' => 'width: {{VALUE}}',
923 ),
924 'condition' => array(
925 'background_text_switcher' => 'yes',
926 ),
927 )
928 );
929
930 $this->add_responsive_control(
931 'background_text_left',
932 array(
933 'label' => __( 'Horizontal Offset', 'premium-addons-for-elementor' ),
934 'type' => Controls_Manager::SLIDER,
935 'size_units' => array( 'px', 'em', '%', 'custom' ),
936 'range' => array(
937 'px' => array(
938 'min' => -500,
939 'max' => 500,
940 ),
941 'em' => array(
942 'min' => -50,
943 'max' => 50,
944 ),
945 '%' => array(
946 'min' => -100,
947 'max' => 100,
948 ),
949 ),
950 'selectors' => array(
951 '{{WRAPPER}} .premium-title-bg-text:before' => 'left: {{SIZE}}{{UNIT}}',
952 ),
953 'condition' => array(
954 'background_text_switcher' => 'yes',
955 ),
956 )
957 );
958
959 $this->add_responsive_control(
960 'background_text_top',
961 array(
962 'label' => __( 'Vertical Offset', 'premium-addons-for-elementor' ),
963 'type' => Controls_Manager::SLIDER,
964 'size_units' => array( 'px', 'em', '%', 'custom' ),
965 'range' => array(
966 'px' => array(
967 'min' => -500,
968 'max' => 500,
969 ),
970 'em' => array(
971 'min' => -50,
972 'max' => 50,
973 ),
974 '%' => array(
975 'min' => -100,
976 'max' => 100,
977 ),
978 ),
979 'selectors' => array(
980 '{{WRAPPER}} .premium-title-bg-text:before' => 'top: {{SIZE}}{{UNIT}}',
981 ),
982 'condition' => array(
983 'background_text_switcher' => 'yes',
984 ),
985 )
986 );
987
988 $this->add_responsive_control(
989 'background_text_rotate',
990 array(
991 'label' => __( 'Rotate (degrees)', 'premium-addons-for-elementor' ),
992 'type' => Controls_Manager::SLIDER,
993 'size_units' => array( 'deg' ),
994 'default' => array(
995 'unit' => 'deg',
996 'size' => 0,
997 ),
998 'selectors' => array(
999 '{{WRAPPER}} .premium-title-bg-text:before' => 'transform: rotate({{SIZE}}{{UNIT}})',
1000 ),
1001 'condition' => array(
1002 'background_text_switcher' => 'yes',
1003 ),
1004 )
1005 );
1006
1007 $this->add_control(
1008 'mask_switcher',
1009 array(
1010 'label' => __( 'Minimal Mask Effect', 'premium-addons-for-elementor' ),
1011 'type' => Controls_Manager::SWITCHER,
1012 'description' => __( 'Note: This effect takes place once the element is in the viewport', 'premium-addons-for-elementor' ),
1013 'render_type' => 'template',
1014 'prefix_class' => 'premium-mask-',
1015 'condition' => array(
1016 'premium_title_style!' => 'style9',
1017 ),
1018 )
1019 );
1020
1021 $this->add_control(
1022 'mask_title_color',
1023 array(
1024 'label' => __( 'Mask Color', 'premium-addons-for-elementor' ),
1025 'type' => Controls_Manager::COLOR,
1026 'render_type' => 'template',
1027 'selectors' => array(
1028 '{{WRAPPER}}.premium-mask-yes .premium-mask-span::after' => 'background: {{VALUE}};',
1029 ),
1030 'condition' => array(
1031 'mask_switcher' => 'yes',
1032 'premium_title_style!' => 'style9',
1033 ),
1034 )
1035 );
1036
1037 $this->add_control(
1038 'mask_title_dir',
1039 array(
1040 'label' => __( 'Direction', 'premium-addons-for-elementor' ),
1041 'type' => Controls_Manager::SELECT,
1042 'default' => 'tr',
1043 'prefix_class' => 'premium-mask-',
1044 'render_type' => 'template',
1045 'options' => array(
1046 'tr' => __( 'To Right', 'premium-addons-for-elementor' ),
1047 'tl' => __( 'To Left', 'premium-addons-for-elementor' ),
1048 'tt' => __( 'To Top', 'premium-addons-for-elementor' ),
1049 'tb' => __( 'To Bottom', 'premium-addons-for-elementor' ),
1050 ),
1051 'condition' => array(
1052 'mask_switcher' => 'yes',
1053 'premium_title_style!' => 'style9',
1054 ),
1055 )
1056 );
1057
1058 $this->add_responsive_control(
1059 'mask_title_padding',
1060 array(
1061 'label' => __( 'Words Padding', 'premium-addons-for-elementor' ),
1062 'type' => Controls_Manager::DIMENSIONS,
1063 'size_units' => array( 'px', 'em', '%' ),
1064 'selectors' => array(
1065 '{{WRAPPER}} .premium-mask-span' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1066 ),
1067 'condition' => array(
1068 'mask_switcher' => 'yes',
1069 'premium_title_style!' => 'style9',
1070 ),
1071 )
1072 );
1073
1074 $this->add_control(
1075 'noise',
1076 array(
1077 'label' => __( 'Glitch Effect', 'premium-addons-for-elementor' ),
1078 'type' => Controls_Manager::SWITCHER,
1079 'prefix_class' => 'premium-title-noise-',
1080 'separator' => 'before',
1081 'render_type' => 'template',
1082 'condition' => array(
1083 'premium_title_style!' => 'style9',
1084 'mask_switcher!' => 'yes',
1085 'gradient_text_switcher!' => 'yes',
1086 'background_style' => 'color',
1087 ),
1088 )
1089 );
1090
1091 $this->end_controls_section();
1092
1093 $this->start_controls_section(
1094 'premium_title_style_section',
1095 array(
1096 'label' => __( 'Title', 'premium-addons-for-elementor' ),
1097 'tab' => Controls_Manager::TAB_STYLE,
1098 )
1099 );
1100
1101 $this->add_control(
1102 'premium_title_color',
1103 array(
1104 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1105 'type' => Controls_Manager::COLOR,
1106 'global' => array(
1107 'default' => Global_Colors::COLOR_PRIMARY,
1108 ),
1109 'selectors' => array(
1110 '{{WRAPPER}} .premium-title-header, {{WRAPPER}}.premium-title-noise-yes .premium-title-text::before, {{WRAPPER}}.premium-title-noise-yes .premium-title-text::after' => 'color: {{VALUE}}',
1111 '{{WRAPPER}}.premium-title-stroke-yes .premium-title-text' => '-webkit-text-fill-color: {{VALUE}}',
1112 '{{WRAPPER}} .premium-title-style8 .premium-title-text[data-animation="shiny"]' => '--base-color: {{VALUE}}',
1113 ),
1114 )
1115 );
1116
1117 $this->add_control(
1118 'premium_title_blur_color',
1119 array(
1120 'label' => __( 'Blur Color', 'booster-addons' ),
1121 'type' => Controls_Manager::COLOR,
1122 'default' => '#000',
1123 'selectors' => array( '{{WRAPPER}} .premium-title-header' => '--shadow-color: {{VALUE}};' ),
1124 'condition' => array(
1125 'premium_title_style' => 'style9',
1126 ),
1127 )
1128 );
1129
1130 $this->add_control(
1131 'shining_shiny_color_title',
1132 array(
1133 'label' => __( 'Shiny Color', 'premium-addons-for-elementor' ),
1134 'type' => Controls_Manager::COLOR,
1135 'default' => '#fff',
1136 'condition' => array(
1137 'premium_title_style' => 'style8',
1138 ),
1139 'selectors' => array( '{{WRAPPER}} .premium-title-style8 .premium-title-text[data-animation="shiny"]' => '--shiny-color: {{VALUE}}' ),
1140 )
1141 );
1142
1143 $this->add_group_control(
1144 Group_Control_Typography::get_type(),
1145 array(
1146 'name' => 'title_typography',
1147 'global' => array(
1148 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1149 ),
1150 'selector' => '{{WRAPPER}} .premium-title-header',
1151 )
1152 );
1153
1154 $this->add_group_control(
1155 Group_Control_Border::get_type(),
1156 array(
1157 'name' => 'style_one_border',
1158 'fields_options' => array(
1159 'border' => array(
1160 'default' => 'solid',
1161 ),
1162 ),
1163 'selector' => '{{WRAPPER}} .premium-title-style1',
1164 'condition' => array(
1165 'premium_title_style' => 'style1',
1166 ),
1167 )
1168 );
1169
1170 $this->add_control(
1171 'background_style',
1172 array(
1173 'label' => __( 'Background Style', 'premium-addons-for-elementor' ),
1174 'type' => Controls_Manager::SELECT,
1175 'description' => __( 'Choose ‘Normal’ to add a background behind the text and ‘Clipped’ so the background will be clipped on the text.', 'premium-addons-for-elementor' ),
1176 'options' => array(
1177 'color' => __( 'Normal', 'premium-addons-for-elementor' ),
1178 'clipped' => __( 'Clipped', 'premium-addons-for-elementor' ),
1179 ),
1180 'prefix_class' => 'premium-title-',
1181 'default' => 'color',
1182 'label_block' => true,
1183 'separator' => 'before',
1184 'condition' => array(
1185 'premium_title_style!' => array( 'style8', 'style9' ),
1186 ),
1187 )
1188 );
1189
1190 $this->add_group_control(
1191 Group_Control_Background::get_type(),
1192 array(
1193 'name' => 'title_background',
1194 'types' => array( 'classic', 'gradient' ),
1195 'condition' => array(
1196 'premium_title_style!' => array( 'style8', 'style9' ),
1197 'background_style!' => '',
1198 ),
1199 'selector' => '{{WRAPPER}}:not(.premium-title-clipped) .premium-title-header, {{WRAPPER}}.premium-title-clipped .premium-title-text',
1200 )
1201 );
1202
1203 $this->add_control(
1204 'premium_title_style2_background_color',
1205 array(
1206 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1207 'type' => Controls_Manager::COLOR,
1208 'global' => array(
1209 'default' => Global_Colors::COLOR_SECONDARY,
1210 ),
1211 'selectors' => array(
1212 '{{WRAPPER}}:not(.premium-title-clipped) .premium-title-style2, {{WRAPPER}}.premium-title-clipped .premium-title-text' => 'background-color: {{VALUE}};',
1213 ),
1214 'condition' => array(
1215 'premium_title_style' => 'style2',
1216 'background_style' => '',
1217 ),
1218 )
1219 );
1220
1221 $this->add_control(
1222 'premium_title_style3_background_color',
1223 array(
1224 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1225 'type' => Controls_Manager::COLOR,
1226 'global' => array(
1227 'default' => Global_Colors::COLOR_SECONDARY,
1228 ),
1229 'selectors' => array(
1230 '{{WRAPPER}}:not(.premium-title-clipped) .premium-title-style3, {{WRAPPER}}.premium-title-clipped .premium-title-text' => 'background-color: {{VALUE}};',
1231 ),
1232 'condition' => array(
1233 'premium_title_style' => 'style3',
1234 'background_style' => '',
1235 ),
1236 )
1237 );
1238
1239 $this->add_control(
1240 'premium_title_style5_header_line_color',
1241 array(
1242 'label' => __( 'Line Color', 'premium-addons-for-elementor' ),
1243 'type' => Controls_Manager::COLOR,
1244 'global' => array(
1245 'default' => Global_Colors::COLOR_PRIMARY,
1246 ),
1247 'selectors' => array(
1248 '{{WRAPPER}} .premium-title-style5' => 'border-bottom: 2px solid {{VALUE}};',
1249 ),
1250 'condition' => array(
1251 'premium_title_style' => 'style5',
1252 ),
1253 )
1254 );
1255
1256 $this->add_group_control(
1257 Group_Control_Border::get_type(),
1258 array(
1259 'name' => 'style_five_border',
1260 'selector' => '{{WRAPPER}} .premium-title-container',
1261 'condition' => array(
1262 'premium_title_style' => array( 'style2', 'style4', 'style5', 'style6' ),
1263 ),
1264 )
1265 );
1266
1267 $this->add_control(
1268 'premium_title_style6_header_line_color',
1269 array(
1270 'label' => __( 'Line Color', 'premium-addons-for-elementor' ),
1271 'type' => Controls_Manager::COLOR,
1272 'global' => array(
1273 'default' => Global_Colors::COLOR_PRIMARY,
1274 ),
1275 'selectors' => array(
1276 '{{WRAPPER}} .premium-title-style6' => 'border-bottom: 2px solid {{VALUE}};',
1277 ),
1278 'condition' => array(
1279 'premium_title_style' => 'style6',
1280 ),
1281 )
1282 );
1283
1284 $this->add_control(
1285 'premium_title_style6_triangle_color',
1286 array(
1287 'label' => __( 'Triangle Color', 'premium-addons-for-elementor' ),
1288 'type' => Controls_Manager::COLOR,
1289 'global' => array(
1290 'default' => Global_Colors::COLOR_PRIMARY,
1291 ),
1292 'selectors' => array(
1293 '{{WRAPPER}} .premium-title-style6:before' => 'border-bottom-color: {{VALUE}};',
1294 ),
1295 'condition' => array(
1296 'premium_title_style' => 'style6',
1297 ),
1298 )
1299 );
1300
1301 $this->add_control(
1302 'premium_title_style7_strip_color',
1303 array(
1304 'label' => __( 'Stripe Color', 'premium-addons-for-elementor' ),
1305 'type' => Controls_Manager::COLOR,
1306 'global' => array(
1307 'default' => Global_Colors::COLOR_PRIMARY,
1308 ),
1309 'selectors' => array(
1310 '{{WRAPPER}} .premium-title-style7-stripe' => 'background-color: {{VALUE}};',
1311 ),
1312 'condition' => array(
1313 'premium_title_style' => 'style7',
1314 ),
1315 )
1316 );
1317
1318 $this->add_group_control(
1319 Group_Control_Text_Shadow::get_type(),
1320 array(
1321 'label' => __( 'Shadow', 'premium-addons-for-elementor' ),
1322 'name' => 'premium_title_text_shadow',
1323 'selector' => '{{WRAPPER}} .premium-title-header',
1324 )
1325 );
1326
1327 $this->add_control(
1328 'premium_title_shadow_value',
1329 array(
1330 'label' => esc_html__( 'Blur Shadow Value (px)', 'booster-addons' ),
1331 'type' => Controls_Manager::NUMBER,
1332 'min' => '10',
1333 'max' => '500',
1334 'step' => '10',
1335 'dynamic' => array( 'active' => true ),
1336 'selectors' => array( '{{WRAPPER}} .premium-title-header' => '--shadow-value: {{VALUE}}px;' ),
1337 'default' => '120',
1338 'condition' => array(
1339 'premium_title_style' => 'style9',
1340 ),
1341 )
1342 );
1343
1344 $this->add_control(
1345 'premium_title_delay',
1346 array(
1347 'label' => esc_html__( 'Animation Delay (s)', 'premium-addons-for-elementor' ),
1348 'type' => Controls_Manager::NUMBER,
1349 'min' => '1',
1350 'max' => '30',
1351 'step' => 0.5,
1352 'condition' => array(
1353 'premium_title_style' => array( 'style8', 'style9' ),
1354 ),
1355 'render_type' => 'template',
1356 'dynamic' => array( 'active' => true ),
1357 'default' => '2',
1358 )
1359 );
1360
1361 $this->add_control(
1362 'shining_animation_duration',
1363 array(
1364 'label' => __( 'Animation Duration (s)', 'premium-addons-for-elementor' ),
1365 'type' => Controls_Manager::NUMBER,
1366 'default' => '1',
1367 'step' => 0.5,
1368 'condition' => array(
1369 'premium_title_style' => 'style8',
1370 ),
1371 'frontend_available' => true,
1372 'render_type' => 'template',
1373 'selectors' => array(
1374 '{{WRAPPER}} .premium-title-style8 .premium-title-text[data-animation="shiny"]' => '--animation-speed: {{VALUE}}s ',
1375 ),
1376 )
1377 );
1378
1379 $this->add_responsive_control(
1380 'premium_title_margin',
1381 array(
1382 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1383 'type' => Controls_Manager::DIMENSIONS,
1384 'size_units' => array( 'px', 'em', '%' ),
1385 'selectors' => array(
1386 '{{WRAPPER}} .premium-title-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1387 ),
1388 )
1389 );
1390
1391 $this->add_responsive_control(
1392 'premium_title_padding',
1393 array(
1394 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
1395 'type' => Controls_Manager::DIMENSIONS,
1396 'size_units' => array( 'px', 'em', '%' ),
1397 'selectors' => array(
1398 '{{WRAPPER}} .premium-title-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1399 ),
1400 )
1401 );
1402
1403 $this->add_control(
1404 'stroke_switcher',
1405 array(
1406 'label' => __( 'Stroke', 'premium-addons-for-elementor' ),
1407 'type' => Controls_Manager::SWITCHER,
1408 'prefix_class' => 'premium-title-stroke-',
1409 'condition' => array(
1410 'premium_title_style!' => 'style9',
1411 'background_style' => 'color',
1412 ),
1413 )
1414 );
1415
1416 $this->add_control(
1417 'stroke_text_color',
1418 array(
1419 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
1420 'type' => Controls_Manager::COLOR,
1421 'condition' => array(
1422 'stroke_switcher' => 'yes',
1423 'background_style' => 'color',
1424 'premium_title_style!' => 'style9',
1425 ),
1426 'selectors' => array(
1427 '{{WRAPPER}} .premium-title-text' => '-webkit-text-stroke-color: {{VALUE}};',
1428 ),
1429 )
1430 );
1431
1432 $this->add_responsive_control(
1433 'stroke_width',
1434 array(
1435 'label' => __( 'Stroke Fill Width', 'premium-addons-for-elementor' ),
1436 'type' => Controls_Manager::SLIDER,
1437 'condition' => array(
1438 'stroke_switcher' => 'yes',
1439 'background_style' => 'color',
1440 'premium_title_style!' => 'style9',
1441 ),
1442 'default' => array(
1443 'size' => 1,
1444 'unit' => 'px',
1445 ),
1446 'selectors' => array(
1447 '{{WRAPPER}} .premium-title-text' => '-webkit-text-stroke-width: {{SIZE}}px',
1448 ),
1449 )
1450 );
1451
1452 $this->add_control(
1453 'gradient_text_switcher',
1454 array(
1455 'label' => __( 'Animated Gradient', 'premium-addons-for-elementor' ),
1456 'type' => Controls_Manager::SWITCHER,
1457 'prefix_class' => 'premium-title-gradient-',
1458 'separator' => 'before',
1459 'condition' => array(
1460 'premium_title_style!' => array( 'style8', 'style9' ),
1461 'mask_switcher!' => 'yes',
1462 'stroke_switcher!' => 'yes',
1463 'background_style' => 'color',
1464 ),
1465 )
1466 );
1467
1468 $this->add_control(
1469 'animation_transition_speed',
1470 array(
1471 'label' => __( 'Animation Speed (sec)', 'premium-addons-for-elementor' ),
1472 'type' => Controls_Manager::SLIDER,
1473 'range' => array(
1474 'px' => array(
1475 'min' => 0,
1476 'max' => 10,
1477 'step' => .1,
1478 ),
1479 ),
1480 'selectors' => array(
1481 '{{WRAPPER}}.premium-title-gradient-yes .premium-title-text ,{{WRAPPER}}.premium-title-gradient-yes .premium-title-icon' => 'animation-duration: {{SIZE}}s ',
1482 ),
1483 'condition' => array(
1484 'gradient_text_switcher' => 'yes',
1485 'premium_title_style!' => array( 'style8', 'style9' ),
1486 'mask_switcher!' => 'yes',
1487 'stroke_switcher!' => 'yes',
1488 'background_style' => 'color',
1489 ),
1490 )
1491 );
1492
1493 $this->add_group_control(
1494 Group_Control_Background::get_type(),
1495 array(
1496 'name' => 'text_gradient',
1497 'types' => array( 'gradient' ),
1498 'selector' => '{{WRAPPER}}.premium-title-gradient-yes .premium-title-text, {{WRAPPER}}.premium-title-gradient-yes .premium-title-icon',
1499 'condition' => array(
1500 'gradient_text_switcher' => 'yes',
1501 'premium_title_style!' => array( 'style8', 'style9' ),
1502 'mask_switcher!' => 'yes',
1503 'stroke_switcher!' => 'yes',
1504 'background_style' => 'color',
1505 ),
1506 )
1507 );
1508
1509 $this->add_control(
1510 'noise_heading',
1511 array(
1512 'label' => __( 'Glitch Effect', 'premium-addons-for-elementor' ),
1513 'type' => Controls_Manager::HEADING,
1514 'condition' => array(
1515 'noise' => 'yes',
1516 ),
1517 )
1518 );
1519
1520 $this->add_control(
1521 'noise_first_color',
1522 array(
1523 'label' => __( 'Color #1', 'premium-addons-for-elementor' ),
1524 'type' => Controls_Manager::COLOR,
1525 'condition' => array(
1526 'noise' => 'yes',
1527 ),
1528 'selectors' => array(
1529 '{{WRAPPER}}.premium-title-noise-yes .premium-title-text::before' => 'text-shadow: 1px 0 {{VALUE}};',
1530 ),
1531 )
1532 );
1533
1534 $this->add_control(
1535 'noise_second_color',
1536 array(
1537 'label' => __( 'Color #2', 'premium-addons-for-elementor' ),
1538 'type' => Controls_Manager::COLOR,
1539 'condition' => array(
1540 'noise' => 'yes',
1541 ),
1542 'selectors' => array(
1543 '{{WRAPPER}}.premium-title-noise-yes .premium-title-text::after' => 'text-shadow: -1px 0 {{VALUE}};',
1544 ),
1545 )
1546 );
1547
1548 $this->end_controls_section();
1549
1550 $this->start_controls_section(
1551 'premium_title_icon_style_section',
1552 array(
1553 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
1554 'tab' => Controls_Manager::TAB_STYLE,
1555 'condition' => array(
1556 'premium_title_icon_switcher' => 'yes',
1557 ),
1558 )
1559 );
1560
1561 $this->add_control(
1562 'premium_title_icon_color',
1563 array(
1564 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1565 'type' => Controls_Manager::COLOR,
1566 'global' => array(
1567 'default' => Global_Colors::COLOR_PRIMARY,
1568 ),
1569 'selectors' => array(
1570 '{{WRAPPER}} .premium-title-icon' => 'color: {{VALUE}}',
1571 '{{WRAPPER}} .premium-drawable-icon *, {{WRAPPER}} svg:not([class*="premium-"])' => 'fill: {{VALUE}};',
1572 ),
1573 'condition' => array(
1574 'icon_type' => array( 'icon', 'svg' ),
1575 ),
1576 )
1577 );
1578
1579 if ( $draw_icon ) {
1580 $this->add_control(
1581 'stroke_color',
1582 array(
1583 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
1584 'type' => Controls_Manager::COLOR,
1585 'global' => array(
1586 'default' => Global_Colors::COLOR_ACCENT,
1587 ),
1588 'condition' => array(
1589 'icon_type' => array( 'icon', 'svg' ),
1590 ),
1591 'selectors' => array(
1592 '{{WRAPPER}} .premium-drawable-icon *, {{WRAPPER}} svg:not([class*="premium-"])' => 'stroke: {{VALUE}};',
1593 ),
1594 )
1595 );
1596
1597 $this->add_control(
1598 'svg_color',
1599 array(
1600 'label' => __( 'After Draw Fill Color', 'premium-addons-for-elementor' ),
1601 'type' => Controls_Manager::COLOR,
1602 'global' => false,
1603 'separator' => 'after',
1604 'condition' => array(
1605 'icon_type' => array( 'icon', 'svg' ),
1606 'draw_svg' => 'yes',
1607 ),
1608 )
1609 );
1610 }
1611
1612 $this->add_responsive_control(
1613 'premium_title_icon_size',
1614 array(
1615 'label' => __( 'Size', 'premium-addons-for-elementor' ),
1616 'type' => Controls_Manager::SLIDER,
1617 'size_units' => array( 'px', 'em', '%' ),
1618 'range' => array(
1619 'px' => array(
1620 'min' => 10,
1621 'max' => 300,
1622 ),
1623 'em' => array(
1624 'min' => 1,
1625 'max' => 30,
1626 ),
1627 ),
1628 'condition' => array(
1629 'icon_type!' => 'svg',
1630 ),
1631 'selectors' => array(
1632 '{{WRAPPER}} .premium-title-header i' => 'font-size: {{SIZE}}{{UNIT}}',
1633 '{{WRAPPER}} .premium-title-header svg, {{WRAPPER}} .premium-title-header img' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important',
1634 ),
1635 )
1636 );
1637
1638 $this->add_responsive_control(
1639 'svg_icon_width',
1640 array(
1641 'label' => __( 'Width', 'premium-addons-for-elementor' ),
1642 'type' => Controls_Manager::SLIDER,
1643 'size_units' => array( 'px', 'em', '%', 'custom' ),
1644 'range' => array(
1645 'px' => array(
1646 'min' => 1,
1647 'max' => 600,
1648 ),
1649 'em' => array(
1650 'min' => 1,
1651 'max' => 30,
1652 ),
1653 ),
1654 'default' => array(
1655 'size' => 100,
1656 'unit' => 'px',
1657 ),
1658 'condition' => array(
1659 'icon_type' => 'svg',
1660 ),
1661 'selectors' => array(
1662 '{{WRAPPER}} .premium-title-header svg' => 'width: {{SIZE}}{{UNIT}};',
1663 ),
1664 )
1665 );
1666
1667 $this->add_responsive_control(
1668 'svg_icon_height',
1669 array(
1670 'label' => __( 'Height', 'premium-addons-for-elementor' ),
1671 'type' => Controls_Manager::SLIDER,
1672 'size_units' => array( 'px', 'em', 'custom' ),
1673 'range' => array(
1674 'px' => array(
1675 'min' => 1,
1676 'max' => 300,
1677 ),
1678 'em' => array(
1679 'min' => 1,
1680 'max' => 30,
1681 ),
1682 ),
1683 'condition' => array(
1684 'icon_type' => 'svg',
1685 ),
1686 'selectors' => array(
1687 '{{WRAPPER}} .premium-title-header svg' => 'height: {{SIZE}}{{UNIT}}',
1688 ),
1689 )
1690 );
1691
1692 $this->add_group_control(
1693 Group_Control_Background::get_type(),
1694 array(
1695 'name' => 'premium_title_icon_background',
1696 'types' => array( 'classic', 'gradient' ),
1697 'selector' => '{{WRAPPER}} .premium-title-icon',
1698 )
1699 );
1700
1701 $this->add_group_control(
1702 Group_Control_Border::get_type(),
1703 array(
1704 'name' => 'premium_title_icon_border',
1705 'selector' => '{{WRAPPER}} .premium-title-icon',
1706 )
1707 );
1708
1709 $this->add_control(
1710 'premium_title_icon_border_radius',
1711 array(
1712 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1713 'type' => Controls_Manager::SLIDER,
1714 'size_units' => array( 'px', '%', 'em' ),
1715 'selectors' => array(
1716 '{{WRAPPER}} .premium-title-icon' => 'border-radius: {{SIZE}}{{UNIT}};',
1717 ),
1718 'condition' => array(
1719 'icon_adv_radius!' => 'yes',
1720 ),
1721 )
1722 );
1723
1724 $this->add_control(
1725 'icon_adv_radius',
1726 array(
1727 'label' => __( 'Advanced Border Radius', 'premium-addons-for-elementor' ),
1728 'type' => Controls_Manager::SWITCHER,
1729 'description' => __( 'Apply custom radius values. Get the radius value from ', 'premium-addons-for-elementor' ) . '<a href="https://9elements.github.io/fancy-border-radius/" target="_blank">here</a>',
1730 )
1731 );
1732
1733 $this->add_control(
1734 'icon_adv_radius_value',
1735 array(
1736 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1737 'type' => Controls_Manager::TEXT,
1738 'dynamic' => array( 'active' => true ),
1739 'selectors' => array(
1740 '{{WRAPPER}} .premium-title-icon' => 'border-radius: {{VALUE}};',
1741 ),
1742 'condition' => array(
1743 'icon_adv_radius' => 'yes',
1744 ),
1745 )
1746 );
1747
1748 $this->add_responsive_control(
1749 'premium_title_icon_margin',
1750 array(
1751 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1752 'type' => Controls_Manager::DIMENSIONS,
1753 'size_units' => array( 'px', 'em', '%' ),
1754 'selectors' => array(
1755 '{{WRAPPER}} .premium-title-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
1756 ),
1757 )
1758 );
1759
1760 $this->add_responsive_control(
1761 'premium_title_icon_padding',
1762 array(
1763 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
1764 'type' => Controls_Manager::DIMENSIONS,
1765 'size_units' => array( 'px', 'em', '%' ),
1766 'selectors' => array(
1767 '{{WRAPPER}} .premium-title-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
1768 ),
1769 )
1770 );
1771
1772 $this->add_group_control(
1773 Group_Control_Text_Shadow::get_type(),
1774 array(
1775 'label' => __( 'Icon Shadow', 'premium-addons-for-elementor' ),
1776 'name' => 'premium_title_icon_text_shadow',
1777 'selector' => '{{WRAPPER}} .premium-title-icon',
1778 'condition' => array(
1779 'icon_type' => 'icon',
1780 ),
1781 )
1782 );
1783
1784 $this->end_controls_section();
1785
1786 $this->start_controls_section(
1787 'background_text_style_section',
1788 array(
1789 'label' => __( 'Background Text', 'premium-addons-for-elementor' ),
1790 'tab' => Controls_Manager::TAB_STYLE,
1791 'condition' => array(
1792 'background_text_switcher' => 'yes',
1793 ),
1794 )
1795 );
1796
1797 $this->add_control(
1798 'background_text_color',
1799 array(
1800 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1801 'type' => Controls_Manager::COLOR,
1802 'global' => array(
1803 'default' => Global_Colors::COLOR_PRIMARY,
1804 ),
1805 'selectors' => array(
1806 '{{WRAPPER}} .premium-title-bg-text:before' => 'color: {{VALUE}}',
1807 ),
1808 )
1809 );
1810
1811 $this->add_group_control(
1812 Group_Control_Typography::get_type(),
1813 array(
1814 'name' => 'background_text_typography',
1815 'global' => array(
1816 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1817 ),
1818 'selector' => '{{WRAPPER}} .premium-title-bg-text:before',
1819 )
1820 );
1821
1822 $this->add_group_control(
1823 Group_Control_Text_Shadow::get_type(),
1824 array(
1825 'name' => 'background_text_shadow',
1826 'selector' => '{{WRAPPER}} .premium-title-bg-text:before',
1827 )
1828 );
1829
1830 $this->add_control(
1831 'bg_stroke_switcher',
1832 array(
1833 'label' => __( 'Stroke', 'premium-addons-for-elementor' ),
1834 'type' => Controls_Manager::SWITCHER,
1835 'prefix_class' => 'premium-title-bg-stroke-',
1836 )
1837 );
1838
1839 $this->add_control(
1840 'bg_stroke_text_color',
1841 array(
1842 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
1843 'type' => Controls_Manager::COLOR,
1844 'condition' => array(
1845 'bg_stroke_switcher' => 'yes',
1846 ),
1847 'selectors' => array(
1848 '{{WRAPPER}} .premium-title-bg-text::before' => '-webkit-text-stroke-color: {{VALUE}};',
1849 ),
1850 )
1851 );
1852
1853 $this->add_responsive_control(
1854 'bg_stroke_width',
1855 array(
1856 'label' => __( 'Stroke Fill Width', 'premium-addons-for-elementor' ),
1857 'type' => Controls_Manager::SLIDER,
1858 'default' => array(
1859 'size' => 1,
1860 'unit' => 'px',
1861 ),
1862 'condition' => array(
1863 'bg_stroke_switcher' => 'yes',
1864 ),
1865 'selectors' => array(
1866 '{{WRAPPER}} .premium-title-bg-text::before' => '-webkit-text-stroke-width: {{SIZE}}px',
1867 ),
1868 )
1869 );
1870
1871 $this->add_control(
1872 'background_text_mix_blend',
1873 array(
1874 'label' => __( 'Blend Mode', 'elementor' ),
1875 'type' => Controls_Manager::SELECT,
1876 'options' => array(
1877 '' => __( 'Normal', 'elementor' ),
1878 'multiply' => 'Multiply',
1879 'screen' => 'Screen',
1880 'overlay' => 'Overlay',
1881 'darken' => 'Darken',
1882 'lighten' => 'Lighten',
1883 'color-dodge' => 'Color Dodge',
1884 'saturation' => 'Saturation',
1885 'color' => 'Color',
1886 'luminosity' => 'Luminosity',
1887 ),
1888 'separator' => 'before',
1889 'selectors' => array(
1890 '{{WRAPPER}} .premium-title-bg-text:before' => 'mix-blend-mode: {{VALUE}}',
1891 ),
1892 )
1893 );
1894
1895 $this->add_control(
1896 'background_text_zindex',
1897 array(
1898 'label' => __( 'z-Index', 'premium-addons-for-elementor' ),
1899 'type' => Controls_Manager::NUMBER,
1900 'min' => -10,
1901 'max' => 20,
1902 'step' => 1,
1903 'selectors' => array(
1904 '{{WRAPPER}} .premium-title-bg-text:before' => 'z-index: {{VALUE}}',
1905 ),
1906 )
1907 );
1908
1909 $this->end_controls_section();
1910
1911 }
1912
1913 /**
1914 * Render title widget output on the frontend.
1915 *
1916 * Written in PHP and used to generate the final HTML.
1917 *
1918 * @since 1.0.0
1919 * @access protected
1920 */
1921 protected function render() {
1922
1923 $settings = $this->get_settings_for_display();
1924
1925 $this->add_inline_editing_attributes( 'premium_title_text', 'none' );
1926
1927 $this->add_render_attribute( 'premium_title_text', 'class', 'premium-title-text' );
1928
1929 $title_tag = Helper_Functions::validate_html_tag( $settings['premium_title_tag'] );
1930
1931 $selected_style = $settings['premium_title_style'];
1932
1933 $this->add_render_attribute( 'container', 'class', array( 'premium-title-container', $selected_style ) );
1934
1935 $this->add_render_attribute( 'title', 'class', array( 'premium-title-header', 'premium-title-' . $selected_style ) );
1936
1937 if ( 'style8' === $selected_style ) {
1938
1939 $this->add_render_attribute(
1940 'premium_title_text',
1941 array(
1942 'data-shiny-delay' => $settings['premium_title_delay'],
1943 'data-shiny-dur' => $settings['shining_animation_duration'],
1944 )
1945 );
1946
1947 } elseif ( 'style9' === $selected_style ) {
1948
1949 $this->add_render_attribute( 'title', 'data-blur-delay', $settings['premium_title_delay'] );
1950
1951 }
1952
1953 if ( 'yes' === $settings['noise'] ) {
1954
1955 $this->add_render_attribute( 'premium_title_text', 'data-text', $settings['premium_title_text'] );
1956
1957 }
1958
1959 $icon_position = '';
1960
1961 if ( 'yes' === $settings['premium_title_icon_switcher'] ) {
1962
1963 $icon_type = $settings['icon_type'];
1964
1965 $icon_position = $settings['icon_position'];
1966
1967 if ( 'icon' === $icon_type || 'svg' === $icon_type ) {
1968
1969 $this->add_render_attribute( 'icon', 'class', 'premium-drawable-icon' );
1970
1971 if ( 'icon' === $icon_type ) {
1972
1973 if ( ! empty( $settings['premium_title_icon'] ) ) {
1974
1975 $this->add_render_attribute(
1976 'icon',
1977 array(
1978 'class' => array(
1979 'premium-title-icon',
1980 $settings['premium_title_icon'],
1981 ),
1982 'aria-hidden' => 'true',
1983 )
1984 );
1985
1986 }
1987
1988 $migrated = isset( $settings['__fa4_migrated']['premium_title_icon_updated'] );
1989 $is_new = empty( $settings['premium_title_icon'] ) && Icons_Manager::is_migration_allowed();
1990
1991 }
1992
1993 if ( ( 'yes' === $settings['draw_svg'] && 'icon' === $icon_type ) || 'svg' === $icon_type ) {
1994 $this->add_render_attribute( 'icon', 'class', 'premium-title-icon' );
1995 }
1996
1997 if ( 'yes' === $settings['draw_svg'] ) {
1998
1999 $this->add_render_attribute(
2000 'container',
2001 'class',
2002 array(
2003 'elementor-invisible',
2004 'premium-drawer-hover',
2005 )
2006 );
2007
2008 if ( 'icon' === $icon_type ) {
2009
2010 $this->add_render_attribute( 'icon', 'class', $settings['premium_title_icon_updated']['value'] );
2011
2012 }
2013
2014 $this->add_render_attribute(
2015 'icon',
2016 array(
2017 'class' => 'premium-svg-drawer',
2018 'data-svg-reverse' => $settings['lottie_reverse'],
2019 'data-svg-loop' => $settings['lottie_loop'],
2020 'data-svg-sync' => $settings['svg_sync'],
2021 'data-svg-hover' => $settings['svg_hover'],
2022 'data-svg-fill' => $settings['svg_color'],
2023 'data-svg-frames' => $settings['frames'],
2024 'data-svg-yoyo' => $settings['svg_yoyo'],
2025 'data-svg-point' => $settings['lottie_reverse'] ? $settings['end_point']['size'] : $settings['start_point']['size'],
2026 )
2027 );
2028
2029 } else {
2030 $this->add_render_attribute( 'icon', 'class', 'premium-svg-nodraw' );
2031 }
2032 } elseif ( 'animation' === $icon_type ) {
2033 $this->add_render_attribute(
2034 'title_lottie',
2035 array(
2036 'class' => array(
2037 'premium-title-icon',
2038 'premium-lottie-animation',
2039 ),
2040 'data-lottie-url' => $settings['lottie_url'],
2041 'data-lottie-loop' => $settings['lottie_loop'],
2042 'data-lottie-reverse' => $settings['lottie_reverse'],
2043 )
2044 );
2045 } else {
2046
2047 $src = $settings['image_upload']['url'];
2048
2049 $alt = Control_Media::get_image_alt( $settings['image_upload'] );
2050
2051 $this->add_render_attribute(
2052 'title_img',
2053 array(
2054 'class' => 'premium-title-icon',
2055 'src' => $src,
2056 'alt' => $alt,
2057 )
2058 );
2059 }
2060 }
2061
2062 if ( 'yes' === $settings['link_switcher'] ) {
2063
2064 if ( 'link' === $settings['link_selection'] ) {
2065
2066 $this->add_render_attribute( 'link', 'href', get_permalink( $settings['existing_link'] ) );
2067
2068 } else {
2069
2070 $this->add_link_attributes( 'link', $settings['custom_link'] );
2071
2072 }
2073 }
2074
2075 if ( 'yes' === $settings['background_text_switcher'] ) {
2076 $this->add_render_attribute(
2077 'container',
2078 array(
2079 'class' => 'premium-title-bg-text',
2080 'data-background' => $settings['background_text'],
2081 )
2082 );
2083 }
2084
2085 ?>
2086
2087 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'container' ) ); ?>>
2088 <<?php echo wp_kses_post( $title_tag . ' ' . $this->get_render_attribute_string( 'title' ) ); ?>>
2089 <?php if ( 'style7' === $selected_style ) : ?>
2090 <?php if ( 'column' !== $icon_position ) : ?>
2091 <span class="premium-title-style7-stripe-wrap">
2092 <span class="premium-title-style7-stripe"></span>
2093 </span>
2094 <?php endif; ?>
2095 <div class="premium-title-style7-inner">
2096 <?php endif; ?>
2097
2098 <?php if ( 'yes' === $settings['premium_title_icon_switcher'] ) : ?>
2099 <?php if ( 'icon' === $icon_type ) : ?>
2100 <?php
2101 if ( ( $is_new || $migrated ) && 'yes' !== $settings['draw_svg'] ) :
2102 Icons_Manager::render_icon(
2103 $settings['premium_title_icon_updated'],
2104 array(
2105 'class' => array( 'premium-title-icon', 'premium-svg-nodraw', 'premium-drawable-icon' ),
2106 'aria-hidden' => 'true',
2107 )
2108 );
2109 else :
2110 ?>
2111 <i <?php echo wp_kses_post( $this->get_render_attribute_string( 'icon' ) ); ?>></i>
2112 <?php endif; ?>
2113
2114 <?php elseif ( 'svg' === $icon_type ) : ?>
2115 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'icon' ) ); ?>>
2116 <?php $this->print_unescaped_setting( 'custom_svg' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
2117 </div>
2118 <?php elseif ( 'animation' === $icon_type ) : ?>
2119 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'title_lottie' ) ); ?>></div>
2120 <?php else : ?>
2121 <?php if ( 'yes' === $settings['mask_switcher'] ) : ?>
2122 <span class="premium-title-img">
2123 <?php endif; ?>
2124 <img <?php echo wp_kses_post( $this->get_render_attribute_string( 'title_img' ) ); ?>></span>
2125 <?php if ( 'yes' === $settings['mask_switcher'] ) : ?>
2126 </span>
2127 <?php endif; ?>
2128 <?php endif; ?>
2129 <?php endif; ?>
2130
2131 <?php if ( 'style7' === $selected_style ) : ?>
2132 <?php if ( 'column' === $icon_position ) : ?>
2133 <span class="premium-title-style7-stripe-wrap">
2134 <span class="premium-title-style7-stripe"></span>
2135 </span>
2136 <?php endif; ?>
2137 <?php endif; ?>
2138 <?php if ( 'style9' !== $selected_style ) : ?>
2139 <span <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_title_text' ) ); ?> >
2140 <?php echo wp_kses_post( $settings['premium_title_text'] ); ?>
2141 </span>
2142 <?php
2143 else :
2144 $letters_html = '<span class="premium-letters-container"' . $this->get_render_attribute_string( 'premium_title_text' ) . '>';
2145 $title_array = preg_split( '//u', $settings['premium_title_text'], null, PREG_SPLIT_NO_EMPTY );
2146 foreach ( $title_array as $key => $letter ) :
2147 $key = $key++;
2148 $letters_html .= '<span class="premium-title-style9-letter" data-letter-index="' . esc_attr( $key + 1 ) . '" data-letter="' . esc_attr( $letter ) . '">' . $letter . '</span>';
2149 endforeach;
2150 $the_title = $letters_html . '</span>';
2151 echo wp_kses_post( $the_title );
2152 ?>
2153 <?php endif; ?>
2154
2155 <?php if ( 'style7' === $selected_style ) : ?>
2156 </div>
2157 <?php endif; ?>
2158 <?php if ( 'yes' === $settings['link_switcher'] ) : ?>
2159 <a <?php echo wp_kses_post( $this->get_render_attribute_string( 'link' ) ); ?>></a>
2160 <?php endif; ?>
2161 </<?php echo wp_kses_post( $title_tag ); ?>>
2162 </div>
2163
2164 <?php
2165 }
2166
2167 /**
2168 * Render Title widget output in the editor.
2169 *
2170 * Written as a Backbone JavaScript template and used to generate the live preview.
2171 *
2172 * @since 1.0.0
2173 * @access protected
2174 */
2175 protected function content_template() {
2176 ?>
2177 <#
2178
2179 view.addInlineEditingAttributes('premium_title_text', 'none');
2180
2181 view.addRenderAttribute('premium_title_text', 'class', 'premium-title-text');
2182
2183 var titleTag = elementor.helpers.validateHTMLTag( settings.premium_title_tag ),
2184
2185 selectedStyle = settings.premium_title_style,
2186
2187 titleIcon = settings.premium_title_icon,
2188
2189 titleText = settings.premium_title_text;
2190
2191 view.addRenderAttribute( 'container', 'class', [ 'premium-title-container', selectedStyle ] );
2192
2193 view.addRenderAttribute( 'premium_title', 'class', [ 'premium-title-header', 'premium-title-' + selectedStyle ] );
2194
2195 if ( selectedStyle === 'style9' ) {
2196 view.addRenderAttribute( 'premium_title', 'data-blur-delay', settings.premium_title_delay );
2197 } else if( selectedStyle === 'style8') {
2198 view.addRenderAttribute( 'premium_title_text', 'data-shiny-delay', settings.premium_title_delay );
2199 view.addRenderAttribute( 'premium_title_text', 'data-shiny-dur', settings.shining_animation_duration );
2200 }
2201
2202 if ( 'yes' === settings.noise ) {
2203
2204 view.addRenderAttribute( 'premium_title_text', 'data-text', settings.premium_title_text );
2205
2206 }
2207
2208 view.addRenderAttribute( 'icon', 'class', [ 'premium-title-icon', titleIcon ] );
2209
2210 var iconPosition = '';
2211
2212 if( 'yes' === settings.premium_title_icon_switcher ) {
2213
2214 var iconType = settings.icon_type;
2215
2216 iconPosition = settings.icon_position;
2217
2218 if( 'icon' === iconType || 'svg' === iconType ) {
2219
2220 view.addRenderAttribute( 'icon', 'class', 'premium-drawable-icon' );
2221
2222 if( 'icon' === iconType ) {
2223
2224 var iconHTML = 'yes' !== settings.draw_svg ? elementor.helpers.renderIcon( view, settings.premium_title_icon_updated, { 'class': ['premium-title-icon', 'premium-svg-nodraw', 'premium-drawable-icon'], 'aria-hidden': true }, 'i' , 'object' ) : false,
2225 migrated = elementor.helpers.isIconMigrated( settings, 'premium_title_icon_updated' );
2226
2227 }
2228
2229 if( ( 'yes' === settings.draw_svg && 'icon' === iconType ) || 'svg' === iconType ) {
2230 view.addRenderAttribute( 'icon', 'class', 'premium-title-icon' );
2231 }
2232
2233 if ( 'yes' === settings.draw_svg ) {
2234
2235 view.addRenderAttribute( 'container', 'class', 'premium-drawer-hover' );
2236
2237 if ( 'icon' === iconType ) {
2238
2239 view.addRenderAttribute( 'icon', 'class', settings.premium_title_icon_updated.value );
2240
2241 }
2242
2243 view.addRenderAttribute(
2244 'icon',
2245 {
2246 'class' : 'premium-svg-drawer',
2247 'data-svg-reverse' : settings.lottie_reverse,
2248 'data-svg-loop' : settings.lottie_loop,
2249 'data-svg-sync' : settings.svg_sync,
2250 'data-svg-hover' : settings.svg_hover,
2251 'data-svg-fill' : settings.svg_color,
2252 'data-svg-frames' : settings.frames,
2253 'data-svg-yoyo' : settings.svg_yoyo,
2254 'data-svg-point' : settings.lottie_reverse ? settings.end_point.size : settings.start_point.size,
2255 }
2256 );
2257
2258 } else {
2259 view.addRenderAttribute( 'icon', 'class', 'premium-svg-nodraw' );
2260 }
2261
2262 } else if( 'animation' === iconType ) {
2263
2264 view.addRenderAttribute( 'title_lottie', {
2265 'class': [
2266 'premium-title-icon',
2267 'premium-lottie-animation'
2268 ],
2269 'data-lottie-url': settings.lottie_url,
2270 'data-lottie-loop': settings.lottie_loop,
2271 'data-lottie-reverse': settings.lottie_reverse
2272 });
2273
2274 } else {
2275
2276 view.addRenderAttribute( 'title_img', {
2277 'class': 'premium-title-icon',
2278 'src': settings.image_upload.url
2279 });
2280
2281 }
2282
2283 }
2284
2285 if( 'yes' === settings.link_switcher ) {
2286
2287 var link = '';
2288
2289 if( settings.link_selection === 'link' ) {
2290
2291 link = settings.existing_link;
2292
2293 } else {
2294
2295 link = settings.custom_link.url;
2296
2297 }
2298
2299 view.addRenderAttribute( 'link', 'href', link );
2300
2301 }
2302
2303 if( 'yes' === settings.background_text_switcher ) {
2304 view.addRenderAttribute( 'container', {
2305 'class': 'premium-title-bg-text',
2306 'data-background': settings.background_text
2307 });
2308 }
2309
2310 #>
2311 <div {{{ view.getRenderAttributeString('container') }}}>
2312 <{{{titleTag}}} {{{view.getRenderAttributeString('premium_title')}}}>
2313 <# if( 'style7' === selectedStyle ) { #>
2314 <# if( 'column' !== iconPosition ) { #>
2315 <span class="premium-title-style7-stripe-wrap">
2316 <span class="premium-title-style7-stripe"></span>
2317 </span>
2318 <# } #>
2319 <div class="premium-title-style7-inner">
2320 <# }
2321 if( 'yes' === settings.premium_title_icon_switcher ) { #>
2322 <# if( 'icon' === iconType ) { #>
2323 <# if ( iconHTML && iconHTML.rendered && ( ! settings.premium_title_icon || migrated ) ) { #>
2324 {{{ iconHTML.value }}}
2325 <# } else { #>
2326 <i {{{ view.getRenderAttributeString( 'icon' ) }}}></i>
2327 <# } #>
2328
2329 <# } else if( 'svg' === iconType ) { #>
2330 <div {{{ view.getRenderAttributeString('icon') }}}>
2331 {{{ settings.custom_svg }}}
2332 </div>
2333 <# } else if( 'animation' === iconType ) { #>
2334 <div {{{ view.getRenderAttributeString('title_lottie') }}}></div>
2335 <# } else { #>
2336 <span class="premium-title-img"><img {{{ view.getRenderAttributeString('title_img') }}}></span>
2337 <# } #>
2338 <# } #>
2339 <# if( 'style7' === selectedStyle ) { #>
2340 <# if( 'column' === iconPosition ) { #>
2341 <span class="premium-title-style7-stripe-wrap">
2342 <span class="premium-title-style7-stripe"></span>
2343 </span>
2344 <# } #>
2345 <# } #>
2346 <# if( selectedStyle !== 'style9' ) {#>
2347 <span {{{ view.getRenderAttributeString('premium_title_text') }}} >{{{ titleText }}}</span>
2348 <# } else {
2349 lettersHtml = '<span class="premium-letters-container"'+ view.getRenderAttributeString('premium_title_text') +'>';
2350 text = titleText;
2351 titleArray = text.split('');
2352 key = 0;
2353 titleArray.forEach(function (item) {
2354 key = key + 1;
2355 lettersHtml +='<span class="premium-title-style9-letter" data-letter-index="'+(key+1)+'" data-letter="'+(item)+'">'+item+'</span>';
2356 });
2357 theTitle = lettersHtml + '</span>'; #>
2358 {{{theTitle}}}
2359 <#
2360 }
2361 #>
2362 <# if( 'style7' === selectedStyle ) { #>
2363 </div>
2364 <# } #>
2365 <# if( 'yes' === settings.link_switcher && '' !== link ) { #>
2366 <a {{{ view.getRenderAttributeString('link') }}}></a>
2367 <# } #>
2368 </{{{titleTag}}}>
2369 </div>
2370
2371 <?php
2372 }
2373 }
2374