PluginProbe ʕ •ᴥ•ʔ
Premium Addons for Elementor – Powerful Elementor Templates & Widgets / 4.1.0
Premium Addons for Elementor – Powerful Elementor Templates & Widgets v4.1.0
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 5 years ago premium-banner.php 5 years ago premium-blog.php 5 years ago premium-button.php 5 years ago premium-carousel.php 5 years ago premium-contactform.php 5 years ago premium-countdown.php 5 years ago premium-counter.php 5 years ago premium-dual-header.php 5 years ago premium-fancytext.php 5 years ago premium-grid.php 5 years ago premium-icon-list.php 5 years ago premium-image-button.php 5 years ago premium-image-scroll.php 5 years ago premium-image-separator.php 5 years ago premium-lottie.php 5 years ago premium-maps.php 5 years ago premium-modalbox.php 5 years ago premium-person.php 5 years ago premium-pricing-table.php 5 years ago premium-progressbar.php 5 years ago premium-testimonials.php 5 years ago premium-title.php 5 years ago premium-videobox.php 5 years ago premium-vscroll.php 5 years ago
premium-title.php
1428 lines
1 <?php
2
3 /**
4 * Premium Title.
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\Scheme_Color;
15 use Elementor\Scheme_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\Includes\Helper_Functions;
23 use PremiumAddons\Includes\Premium_Template_Tags;
24
25 if ( ! defined( 'ABSPATH' ) ) exit; // If this file is called directly, abort.
26
27 /**
28 * Class Premium_Title
29 */
30 class Premium_Title extends Widget_Base {
31
32 protected $templateInstance;
33
34 public function getTemplateInstance(){
35 return $this->templateInstance = Premium_Template_Tags::getInstance();
36 }
37
38 public function get_name() {
39 return 'premium-addon-title';
40 }
41
42 public function get_title() {
43 return sprintf( '%1$s %2$s', Helper_Functions::get_prefix(), __('Heading', 'premium-addons-for-elementor') );
44 }
45
46 public function get_icon() {
47 return 'pa-title';
48 }
49
50 public function get_style_depends() {
51 return [
52 'premium-addons'
53 ];
54 }
55
56 public function get_script_depends() {
57 return [
58 'premium-addons',
59 'lottie-js',
60 ];
61 }
62
63 public function get_categories() {
64 return [ 'premium-elements' ];
65 }
66
67 public function get_keywords() {
68 return [ 'heading', 'text' ];
69 }
70
71 public function get_custom_help_url() {
72 return 'https://premiumaddons.com/support/';
73 }
74
75 /**
76 * Register Title controls.
77 *
78 * @since 1.0.0
79 * @access protected
80 */
81 protected function _register_controls() {
82
83 $this->start_controls_section('premium_title_content',
84 [
85 'label' => __('Title', 'premium-addons-for-elementor'),
86 ]
87 );
88
89 $this->add_control('premium_title_text',
90 [
91 'label' => __('Title', 'premium-addons-for-elementor'),
92 'type' => Controls_Manager::TEXT,
93 'default' => __('Premium Title','premium-addons-for-elementor'),
94 'label_block' => true,
95 'dynamic' => [ 'active' => true ]
96 ]
97 );
98
99 $this->add_control('premium_title_style',
100 [
101 'label' => __('Style', 'premium-addons-for-elementor'),
102 'type' => Controls_Manager::SELECT,
103 'default' => 'style1',
104 'options' => [
105 'style1' => __('Style 1', 'premium-addons-for-elementor'),
106 'style2' => __('Style 2', 'premium-addons-for-elementor'),
107 'style3' => __('Style 3', 'premium-addons-for-elementor'),
108 'style4' => __('Style 4', 'premium-addons-for-elementor'),
109 'style5' => __('Style 5', 'premium-addons-for-elementor'),
110 'style6' => __('Style 6', 'premium-addons-for-elementor'),
111 'style7' => __('Style 7', 'premium-addons-for-elementor'),
112 'style8' => __('Style 8', 'premium-addons-for-elementor'),
113 'style9' => __('Style 9', 'premium-addons-for-elementor'),
114 ],
115 'label_block' => true,
116 ]
117 );
118
119 $this->add_control('premium_title_icon_switcher',
120 [
121 'label' => __('Icon', 'premium-addons-for-elementor'),
122 'type' => Controls_Manager::SWITCHER,
123 ]
124 );
125
126 $this->add_control('icon_type',
127 [
128 'label' => __( 'Icon Type', 'premium-addons-for-elementor' ),
129 'type' => Controls_Manager::SELECT,
130 'options' => [
131 'icon' => __('Icon', 'premium-addons-for-elementor'),
132 'image' => __('Image', 'premium-addons-for-elementor'),
133 'animation' => __('Lottie Animation', 'premium-addons-for-elementor'),
134 ],
135 'default' => 'icon',
136 'condition' => [
137 'premium_title_icon_switcher' => 'yes',
138 ]
139 ]
140 );
141
142 $this->add_control('premium_title_icon_updated',
143 [
144 'label' => __('Font Awesome Icon', 'premium-addons-for-elementor'),
145 'type' => Controls_Manager::ICONS,
146 'fa4compatibility' => 'premium_title_icon',
147 'default' => [
148 'value' => 'fas fa-bars',
149 'library' => 'fa-solid',
150 ],
151 'label_block' => true,
152 'condition' => [
153 'premium_title_icon_switcher' => 'yes',
154 'icon_type' => 'icon',
155 ]
156 ]
157 );
158
159 $this->add_control('image_upload',
160 [
161 'label' => __( 'Upload Image', 'premium-addons-for-elementor' ),
162 'type' => Controls_Manager::MEDIA,
163 'default' => [
164 'url' => Utils::get_placeholder_image_src(),
165 ],
166 'condition' => [
167 'premium_title_icon_switcher' => 'yes',
168 'icon_type' => 'image',
169 ],
170 ]
171 );
172
173 $this->add_control('lottie_url',
174 [
175 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ),
176 'type' => Controls_Manager::TEXT,
177 'dynamic' => [ 'active' => true ],
178 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>',
179 'label_block' => true,
180 'condition' => [
181 'premium_title_icon_switcher' => 'yes',
182 'icon_type' => 'animation',
183 ]
184 ]
185 );
186
187 $this->add_control('lottie_loop',
188 [
189 'label' => __('Loop','premium-addons-for-elementor'),
190 'type' => Controls_Manager::SWITCHER,
191 'return_value' => 'true',
192 'default' => 'true',
193 'condition' => [
194 'premium_title_icon_switcher' => 'yes',
195 'icon_type' => 'animation',
196 ]
197 ]
198 );
199
200 $this->add_control('lottie_reverse',
201 [
202 'label' => __('Reverse','premium-addons-for-elementor'),
203 'type' => Controls_Manager::SWITCHER,
204 'return_value' => 'true',
205 'condition' => [
206 'premium_title_icon_switcher' => 'yes',
207 'icon_type' => 'animation',
208 ]
209 ]
210 );
211
212 $this->add_responsive_control('icon_position',
213 [
214 'label' => __( 'Icon Position', 'premium-addons-for-elementor' ),
215 'type' => Controls_Manager::SELECT,
216 'options' => [
217 'row' => __('Before', 'premium-addons-for-elementor'),
218 'row-reverse' => __('After', 'premium-addons-for-elementor'),
219 'column' => __('Top', 'premium-addons-for-elementor'),
220 ],
221 'default' => 'row',
222 'toggle' => false,
223 'render_type' => 'template',
224 'prefix_class' => 'premium-title-icon-',
225 'selectors' => [
226 '{{WRAPPER}} .premium-title-header:not(.premium-title-style7), {{WRAPPER}} .premium-title-style7-inner' => 'flex-direction: {{VALUE}}',
227 ],
228 'condition' => [
229 'premium_title_icon_switcher' => 'yes'
230 ],
231 ]
232 );
233
234 $this->add_responsive_control('top_icon_align',
235 [
236 'label' => __( 'Icon Alignment', 'premium-addons-for-elementor' ),
237 'type' => Controls_Manager::CHOOSE,
238 'options' => [
239 'flex-start' => [
240 'title'=> __( 'Left', 'premium-addons-for-elementor' ),
241 'icon' => 'fa fa-align-left',
242 ],
243 'center' => [
244 'title'=> __( 'Center', 'premium-addons-for-elementor' ),
245 'icon' => 'fa fa-align-center',
246 ],
247 'flex-end' => [
248 'title'=> __( 'Right', 'premium-addons-for-elementor' ),
249 'icon' => 'fa fa-align-right',
250 ],
251 ],
252 'default' => 'center',
253 'toggle' => false,
254 'selectors' => [
255 '{{WRAPPER}}.premium-title-icon-column .premium-title-header:not(.premium-title-style7)' => 'align-items: {{VALUE}}',
256 '{{WRAPPER}}.premium-title-icon-column .premium-title-style7 .premium-title-icon' => 'align-self: {{VALUE}}',
257 ],
258 'condition' => [
259 'premium_title_icon_switcher' => 'yes',
260 'icon_position' => 'column',
261 'premium_title_style!' => [ 'style3', 'style4' ]
262 ]
263 ]
264 );
265
266 $this->add_control('premium_title_tag',
267 [
268 'label' => __('HTML Tag', 'premium-addons-for-elementor'),
269 'type' => Controls_Manager::SELECT,
270 'default' => 'h2',
271 'options' => [
272 'h1' => 'H1',
273 'h2' => 'H2',
274 'h3' => 'H3',
275 'h4' => 'H4',
276 'h5' => 'H5',
277 'h6' => 'H6',
278 'div' => 'div',
279 'span' => 'span',
280 ],
281 'separator' => 'before',
282 ]
283 );
284
285 $inline_flex = [ 'style1', 'style2', 'style5', 'style6', 'style7' , 'style8' , 'style9'];
286
287 $this->add_responsive_control('premium_title_align',
288 [
289 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
290 'type' => Controls_Manager::CHOOSE,
291 'options' => [
292 'left' => [
293 'title'=> __( 'Left', 'premium-addons-for-elementor' ),
294 'icon' => 'fa fa-align-left',
295 ],
296 'center' => [
297 'title'=> __( 'Center', 'premium-addons-for-elementor' ),
298 'icon' => 'fa fa-align-center',
299 ],
300 'right' => [
301 'title'=> __( 'Right', 'premium-addons-for-elementor' ),
302 'icon' => 'fa fa-align-right',
303 ],
304 ],
305 'default' => 'left',
306 'toggle' => false,
307 'selectors' => [
308 '{{WRAPPER}} .premium-title-container' => 'text-align: {{VALUE}};',
309 ],
310 'condition' => [
311 'premium_title_style' => $inline_flex
312 ]
313 ]
314 );
315
316 $this->add_responsive_control('premium_title_align_flex',
317 [
318 'label' => __( 'Alignment', 'premium-addons-for-elementor' ),
319 'type' => Controls_Manager::CHOOSE,
320 'options' => [
321 'flex-start' => [
322 'title'=> __( 'Left', 'premium-addons-for-elementor' ),
323 'icon' => 'fa fa-align-left',
324 ],
325 'center' => [
326 'title'=> __( 'Center', 'premium-addons-for-elementor' ),
327 'icon' => 'fa fa-align-center',
328 ],
329 'flex-end' => [
330 'title'=> __( 'Right', 'premium-addons-for-elementor' ),
331 'icon' => 'fa fa-align-right',
332 ],
333 ],
334 'default' => 'flex-start',
335 'toggle' => false,
336 'selectors' => [
337 '{{WRAPPER}}:not(.premium-title-icon-column) .premium-title-header' => 'justify-content: {{VALUE}}',
338 '{{WRAPPER}}.premium-title-icon-column .premium-title-header' => 'align-items: {{VALUE}}',
339 ],
340 'condition' => [
341 'premium_title_style' => [ 'style3', 'style4' ]
342 ]
343 ]
344 );
345
346 $this->add_control('alignment_notice',
347 [
348 'raw' => __('Please note that left/right alignment is reversed when Icon Position is set to After.', 'premium-addons-for-elementor'),
349 'type' => Controls_Manager::RAW_HTML,
350 'content_classes' => 'elementor-panel-alert elementor-panel-alert-info',
351 'condition' => [
352 'premium_title_icon_switcher' => 'yes',
353 'icon_position' => 'row-reverse',
354 'premium_title_style' => [ 'style3', 'style4']
355 ]
356 ]
357 );
358
359 $this->add_control('premium_title_stripe_pos',
360 [
361 'label' => __('Stripe Position', 'premium-addons-for-elementor'),
362 'type' => Controls_Manager::SELECT,
363 'options' => [
364 'top' => __('Top', 'premium-addons-for-elementor'),
365 'bottom' => __('Bottom', 'premium-addons-for-elementor')
366 ],
367 'selectors_dictionary' => [
368 'top' => 'initial',
369 'bottom' => '2',
370 ],
371 'default' => 'top',
372 'label_block' => true,
373 'separator' => 'before',
374 'condition' => [
375 'premium_title_style' => 'style7',
376 ],
377 'selectors' => [
378 '{{WRAPPER}} .premium-title-style7-stripe-wrap' => 'order: {{VALUE}}'
379 ]
380 ]
381 );
382
383 $this->add_responsive_control('premium_title_style7_strip_width',
384 [
385 'label' => __('Stripe Width (PX)', 'premium-addons-for-elementor'),
386 'type' => Controls_Manager::SLIDER,
387 'size_units' => ['px', '%', 'em'],
388 'default' => [
389 'unit' => 'px',
390 'size' => '120',
391 ],
392 'selectors' => [
393 '{{WRAPPER}} .premium-title-style7-stripe' => 'width: {{SIZE}}{{UNIT}};',
394 ],
395 'label_block' => true,
396 'condition' => [
397 'premium_title_style' => 'style7',
398 ]
399 ]
400 );
401
402 $this->add_responsive_control('premium_title_style7_strip_height',
403 [
404 'label' => __('Stripe Height (PX)', 'premium-addons-for-elementor'),
405 'type' => Controls_Manager::SLIDER,
406 'size_units' => ['px', 'em'],
407 'default' => [
408 'unit' => 'px',
409 'size' => '5',
410 ],
411 'label_block' => true,
412 'selectors' => [
413 '{{WRAPPER}} .premium-title-style7-stripe' => 'height: {{SIZE}}{{UNIT}};',
414 ],
415 'condition' => [
416 'premium_title_style' => 'style7',
417 ]
418 ]
419 );
420
421 $this->add_responsive_control('premium_title_style7_strip_top_spacing',
422 [
423 'label' => __('Stripe Top Spacing (PX)', 'premium-addons-for-elementor'),
424 'type' => Controls_Manager::SLIDER,
425 'size_units' => ['px', '%', 'em'],
426 'selectors' => [
427 '{{WRAPPER}} .premium-title-style7-stripe-wrap' => 'margin-top: {{SIZE}}{{UNIT}};',
428 ],
429 'label_block' => true,
430 'condition' => [
431 'premium_title_style' => 'style7',
432 ],
433 ]
434 );
435
436 $this->add_responsive_control('premium_title_style7_strip_bottom_spacing',
437 [
438 'label' => __('Stripe Bottom Spacing (PX)', 'premium-addons-for-elementor'),
439 'type' => Controls_Manager::SLIDER,
440 'size_units' => ['px', '%', 'em'],
441 'label_block' => true,
442 'selectors' => [
443 '{{WRAPPER}} .premium-title-style7-stripe-wrap' => 'margin-bottom: {{SIZE}}{{UNIT}};',
444 ],
445 'condition' => [
446 'premium_title_style' => 'style7',
447 ]
448 ]
449 );
450
451 $this->add_responsive_control('premium_title_style7_strip_align',
452 [
453 'label' => __( 'Stripe Alignment', 'premium-addons-for-elementor' ),
454 'type' => Controls_Manager::CHOOSE,
455 'options' => [
456 'flex-start' => [
457 'title' => __( 'Left', 'premium-addons-for-elementor' ),
458 'icon' => 'fa fa-align-left',
459 ],
460 'center' => [
461 'title' => __( 'Center', 'premium-addons-for-elementor' ),
462 'icon' => 'fa fa-align-center',
463 ],
464 'flex-end' => [
465 'title'=> __( 'Right', 'premium-addons-for-elementor' ),
466 'icon' => 'fa fa-align-right',
467 ],
468 ],
469 'toggle' => false,
470 'default' => 'center',
471 'selectors' => [
472 '{{WRAPPER}}:not(.premium-title-icon-column) .premium-title-style7-stripe-wrap' => 'justify-content: {{VALUE}}',
473 '{{WRAPPER}}.premium-title-icon-column .premium-title-style7-stripe-wrap' => 'align-self: {{VALUE}}',
474 ],
475 'condition' => [
476 'premium_title_style' => 'style7',
477 ]
478 ]
479 );
480
481 $this->add_control('link_switcher',
482 [
483 'label' => __('Link', 'premium-addons-for-elementor'),
484 'type' => Controls_Manager::SWITCHER,
485 ]
486 );
487
488 $this->add_control('link_selection',
489 [
490 'label' => __('Link Type', 'premium-addons-for-elementor'),
491 'type' => Controls_Manager::SELECT,
492 'options' => [
493 'url' => __('URL', 'premium-addons-for-elementor'),
494 'link' => __('Existing Page', 'premium-addons-for-elementor'),
495 ],
496 'default' => 'url',
497 'label_block' => true,
498 'condition' => [
499 'link_switcher' => 'yes',
500 ]
501 ]
502 );
503
504 $this->add_control('custom_link',
505 [
506 'label' => __('Link', 'premium-addons-for-elementor'),
507 'type' => Controls_Manager::URL,
508 'dynamic' => [ 'active' => true ],
509 'default' => [
510 'url' => '#',
511 ],
512 'placeholder' => 'https://premiumaddons.com/',
513 'label_block' => true,
514 'separator' => 'after',
515 'condition' => [
516 'link_switcher' => 'yes',
517 'link_selection' => 'url'
518 ]
519 ]
520 );
521
522 $this->add_control('existing_link',
523 [
524 'label' => __('Existing Page', 'premium-addons-for-elementor'),
525 'type' => Controls_Manager::SELECT2,
526 'options' => $this->getTemplateInstance()->get_all_posts(),
527 'condition' => [
528 'link_switcher' => 'yes',
529 'link_selection' => 'link',
530 ],
531 'multiple' => false,
532 'label_block' => true,
533 ]
534 );
535
536 $this->add_control('background_text_switcher',
537 [
538 'label' => __( 'Background Text', 'premium-addons-for-elementor' ),
539 'type' => Controls_Manager::SWITCHER,
540 ]
541 );
542
543 $this->add_control('background_text',
544 [
545 'label' => __('Text', 'premium-addons-for-elementor'),
546 'type' => Controls_Manager::TEXT,
547 'default' => __('Awesome Title','premium-addons-for-elementor'),
548 'condition' => [
549 'background_text_switcher' => 'yes'
550 ]
551 ]
552 );
553
554 $this->add_control('background_text_width',
555 [
556 'label' => __('Width', 'premium-addons-for-elementor'),
557 'type' => Controls_Manager::SELECT,
558 'options' => [
559 'auto' => __('Auto', 'premium-addons-for-elementor'),
560 '100%' => __('Full Width', 'premium-addons-for-elementor'),
561 ],
562 'default' => 'auto',
563 'label_block' => true,
564 'selectors' => [
565 '{{WRAPPER}} .premium-title-bg-text:before' => 'width: {{VALUE}}',
566 ],
567 'condition' => [
568 'background_text_switcher' => 'yes'
569 ]
570 ]
571 );
572
573 $this->add_responsive_control('background_text_left',
574 [
575 'label' => __('Horizontal Offset', 'premium-addons-for-elementor'),
576 'type' => Controls_Manager::SLIDER,
577 'size_units' => [ 'px', 'em', '%' ],
578 'range' => [
579 'px' => [
580 'min' => -500,
581 'max' => 500
582 ],
583 'em' => [
584 'min' => -50,
585 'max' => 50
586 ],
587 '%' => [
588 'min' => -100,
589 'max' => 100
590 ]
591 ],
592 'selectors' => [
593 '{{WRAPPER}} .premium-title-bg-text:before' => 'left: {{SIZE}}{{UNIT}}',
594 ],
595 'condition' => [
596 'background_text_switcher' => 'yes'
597 ]
598 ]
599 );
600
601 $this->add_responsive_control('background_text_top',
602 [
603 'label' => __('Vertical Offset', 'premium-addons-for-elementor'),
604 'type' => Controls_Manager::SLIDER,
605 'size_units' => [ 'px', 'em', '%' ],
606 'range' => [
607 'px' => [
608 'min' => -500,
609 'max' => 500
610 ],
611 'em' => [
612 'min' => -50,
613 'max' => 50
614 ],
615 '%' => [
616 'min' => -100,
617 'max' => 100
618 ]
619 ],
620 'selectors' => [
621 '{{WRAPPER}} .premium-title-bg-text:before' => 'top: {{SIZE}}{{UNIT}}',
622 ],
623 'condition' => [
624 'background_text_switcher' => 'yes'
625 ]
626 ]
627 );
628
629 $this->add_responsive_control('background_text_rotate',
630 [
631 'label' => __('Rotate (degrees)', 'premium-addons-for-elementor'),
632 'type' => Controls_Manager::SLIDER,
633 'size_units' => [ 'deg' ],
634 'default' => [
635 'unit' => 'deg',
636 'size' => 0,
637 ],
638 'selectors' => [
639 '{{WRAPPER}} .premium-title-bg-text:before' => 'transform: rotate({{SIZE}}{{UNIT}})'
640 ],
641 'condition' => [
642 'background_text_switcher' => 'yes'
643 ]
644 ]
645 );
646
647 $this->end_controls_section();
648
649 $this->start_controls_section('premium_title_style_section',
650 [
651 'label' => __('Title', 'premium-addons-for-elementor'),
652 'tab' => Controls_Manager::TAB_STYLE,
653 ]
654 );
655
656 $this->add_control('premium_title_color',
657 [
658 'label' => __('Color', 'premium-addons-for-elementor'),
659 'type' => Controls_Manager::COLOR,
660 'scheme' => [
661 'type' => Scheme_Color::get_type(),
662 'value' => Scheme_Color::COLOR_1,
663 ],
664 'selectors' => [
665 '{{WRAPPER}} .premium-title-header' => 'color: {{VALUE}};',
666 '{{WRAPPER}} .premium-title-style8 .premium-title-text[data-animation="shiny"]' => '--base-color: {{VALUE}} ',
667 ],
668 ]
669 );
670
671 $this->add_control('premium_title_blur_color',
672 [
673 'label' => esc_html__('Blur Color', 'booster-addons'),
674 'type' => Controls_Manager::COLOR,
675 'default' => '#000',
676 'selectors' => ['{{WRAPPER}} .premium-title-header' => '--shadow-color: {{VALUE}};'],
677 'condition' => [
678 'premium_title_style' => 'style9',
679 ],
680 ]
681 );
682
683 $this->add_control('shining_shiny_color_title',
684 [
685 'label' => __('Shiny Color', 'premium-addons-for-elementor'),
686 'type' => Controls_Manager::COLOR,
687 'default' => '#fff',
688 'condition' => [
689 'premium_title_style' => 'style8',
690 ],
691 'selectors' => ['{{WRAPPER}} .premium-title-style8 .premium-title-text[data-animation="shiny"]' => '--shiny-color: {{VALUE}}'],
692 ]
693 );
694
695 $this->add_group_control(
696 Group_Control_Typography::get_type(),
697 [
698 'name' => 'title_typography',
699 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
700 'selector' => '{{WRAPPER}} .premium-title-header',
701 ]
702 );
703
704 $this->add_group_control(
705 Group_Control_Border::get_type(),
706 [
707 'name' => 'style_one_border',
708 'selector' => '{{WRAPPER}} .premium-title-style1',
709 'condition' => [
710 'premium_title_style' => 'style1',
711 ],
712 ]
713 );
714
715 $this->add_control('premium_title_style2_background_color',
716 [
717 'label' => __('Background Color', 'premium-addons-for-elementor'),
718 'type' => Controls_Manager::COLOR,
719 'scheme' => [
720 'type' => Scheme_Color::get_type(),
721 'value' => Scheme_Color::COLOR_2,
722 ],
723 'selectors' => [
724 '{{WRAPPER}} .premium-title-style2' => 'background-color: {{VALUE}};',
725 ],
726 'condition' => [
727 'premium_title_style' => 'style2',
728 ],
729 ]
730 );
731
732 $this->add_control('premium_title_style3_background_color',
733 [
734 'label' => __('Background Color', 'premium-addons-for-elementor'),
735 'type' => Controls_Manager::COLOR,
736 'scheme' => [
737 'type' => Scheme_Color::get_type(),
738 'value' => Scheme_Color::COLOR_2
739 ],
740 'selectors' => [
741 '{{WRAPPER}} .premium-title-style3' => 'background-color: {{VALUE}};'
742 ],
743 'condition' => [
744 'premium_title_style' => 'style3'
745 ]
746 ]
747 );
748
749 $this->add_control('premium_title_style5_header_line_color',
750 [
751 'label' => __('Line Color', 'premium-addons-for-elementor'),
752 'type' => Controls_Manager::COLOR,
753 'scheme' => [
754 'type' => Scheme_Color::get_type(),
755 'value' => Scheme_Color::COLOR_1
756 ],
757 'selectors' => [
758 '{{WRAPPER}} .premium-title-style5' => 'border-bottom: 2px solid {{VALUE}};'
759 ],
760 'condition' => [
761 'premium_title_style' => 'style5'
762 ]
763 ]
764 );
765
766 $this->add_group_control(
767 Group_Control_Border::get_type(),
768 [
769 'name' => 'style_five_border',
770 'selector' => '{{WRAPPER}} .premium-title-container',
771 'condition' => [
772 'premium_title_style' => ['style2','style4','style5','style6']
773 ]
774 ]
775 );
776
777 $this->add_control('premium_title_style6_header_line_color',
778 [
779 'label' => __('Line Color', 'premium-addons-for-elementor'),
780 'type' => Controls_Manager::COLOR,
781 'scheme' => [
782 'type' => Scheme_Color::get_type(),
783 'value' => Scheme_Color::COLOR_1
784 ],
785 'selectors' => [
786 '{{WRAPPER}} .premium-title-style6' => 'border-bottom: 2px solid {{VALUE}};'
787 ],
788 'condition' => [
789 'premium_title_style' => 'style6'
790 ]
791 ]
792 );
793
794 $this->add_control('premium_title_style6_triangle_color',
795 [
796 'label' => __('Triangle Color', 'premium-addons-for-elementor'),
797 'type' => Controls_Manager::COLOR,
798 'scheme' => [
799 'type' => Scheme_Color::get_type(),
800 'value' => Scheme_Color::COLOR_1
801 ],
802 'selectors' => [
803 '{{WRAPPER}} .premium-title-style6:before' => 'border-bottom-color: {{VALUE}};'
804 ],
805 'condition' => [
806 'premium_title_style' => 'style6'
807 ]
808 ]
809 );
810
811 $this->add_control('premium_title_style7_strip_color',
812 [
813 'label' => __('Stripe Color', 'premium-addons-for-elementor'),
814 'type' => Controls_Manager::COLOR,
815 'scheme' => [
816 'type' => Scheme_Color::get_type(),
817 'value' => Scheme_Color::COLOR_1
818 ],
819 'selectors' => [
820 '{{WRAPPER}} .premium-title-style7-stripe' => 'background-color: {{VALUE}};'
821 ],
822 'condition' => [
823 'premium_title_style' => 'style7'
824 ]
825 ]
826 );
827
828 $this->add_group_control(
829 Group_Control_Text_Shadow::get_type(),
830 [
831 'label' => __('Shadow','premium-addons-for-elementor'),
832 'name' => 'premium_title_text_shadow',
833 'selector' => '{{WRAPPER}} .premium-title-header'
834 ]
835 );
836
837 $this->add_control('premium_title_shadow_value',
838 [
839 'label' => esc_html__('Blur Shadow Value (px)', 'booster-addons'),
840 'type' => Controls_Manager::NUMBER,
841 'min' => '10', 'max' => '500', 'step' => '10',
842 'dynamic' => ['active' => true],
843 'selectors' => ['{{WRAPPER}} .premium-title-header' => '--shadow-value: {{VALUE}}px;'],
844 'default' => '120',
845 'condition' => [
846 'premium_title_style' => 'style9',
847 ],
848 ]
849 );
850
851 $this->add_control('premium_title_delay',
852 [
853 'label' => esc_html__('Animation Delay (s)', 'premium-addons-for-elementor'),
854 'type' => Controls_Manager::NUMBER,
855 'min' => '1',
856 'max' => '30',
857 'step' => 0.5,
858 'condition' => [
859 'premium_title_style' => ['style8','style9'],
860 ],
861 'render_type' => 'template',
862 'dynamic' => ['active' => true],
863 'default' => '2'
864 ]
865 );
866
867 $this->add_control('shining_animation_duration',
868 [
869 'label' => __( 'Animation Duration (s)', 'premium-addons-for-elementor' ),
870 'type' => Controls_Manager::NUMBER,
871 'default' => '1',
872 'step' => 0.5,
873 'condition' => [
874 'premium_title_style' => 'style8'
875 ],
876 'frontend_available' => true,
877 'render_type' => 'template',
878 'selectors' => [
879 '{{WRAPPER}} .premium-title-style8 .premium-title-text[data-animation="shiny"]' => '--animation-speed: {{VALUE}}s ',
880 ]
881 ]
882 );
883
884 $this->add_responsive_control('premium_title_margin',
885 [
886 'label' => __('Margin', 'premium-addons-for-elementor'),
887 'type' => Controls_Manager::DIMENSIONS,
888 'size_units' => ['px', 'em', '%'],
889 'selectors' => [
890 '{{WRAPPER}} .premium-title-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
891 ]
892 ]
893 );
894
895 $this->add_responsive_control('premium_title_padding',
896 [
897 'label' => __('Padding', 'premium-addons-for-elementor'),
898 'type' => Controls_Manager::DIMENSIONS,
899 'size_units' => ['px', 'em', '%'],
900 'selectors' => [
901 '{{WRAPPER}} .premium-title-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
902 ]
903 ]
904 );
905
906
907 $this->end_controls_section();
908
909 $this->start_controls_section('premium_title_icon_style_section',
910 [
911 'label' => __('Icon', 'premium-addons-for-elementor'),
912 'tab' => Controls_Manager::TAB_STYLE,
913 'condition' => [
914 'premium_title_icon_switcher' => 'yes'
915 ]
916 ]
917 );
918
919 $this->add_control('premium_title_icon_color',
920 [
921 'label' => __('Color', 'premium-addons-for-elementor'),
922 'type' => Controls_Manager::COLOR,
923 'scheme' => [
924 'type' => Scheme_Color::get_type(),
925 'value' => Scheme_Color::COLOR_1
926 ],
927 'selectors' => [
928 '{{WRAPPER}} .premium-title-icon' => 'color: {{VALUE}};'
929 ],
930 'condition' => [
931 'premium_title_icon_switcher' => 'yes',
932 'icon_type' => 'icon'
933 ]
934 ]
935 );
936
937 $this->add_responsive_control('premium_title_icon_size',
938 [
939 'label' => __('Size', 'premium-addons-for-elementor'),
940 'type' => Controls_Manager::SLIDER,
941 'size_units' => ['px', 'em', '%'],
942 'range' => [
943 'px' => [
944 'min' => 10,
945 'max' => 300,
946 ],
947 'em' => [
948 'min' => 1,
949 'max' => 30,
950 ]
951 ],
952 'selectors' => [
953 '{{WRAPPER}} .premium-title-header i' => 'font-size: {{SIZE}}{{UNIT}}',
954 '{{WRAPPER}} .premium-title-header svg, {{WRAPPER}} .premium-title-header img' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}'
955 ]
956 ]
957 );
958
959 $this->add_group_control(
960 Group_Control_Background::get_type(),
961 [
962 'name' => 'premium_title_icon_background',
963 'types' => [ 'classic' , 'gradient' ],
964 'selector' => '{{WRAPPER}} .premium-title-icon'
965 ]
966 );
967
968 $this->add_group_control(
969 Group_Control_Border::get_type(),
970 [
971 'name' => 'premium_title_icon_border',
972 'selector' => '{{WRAPPER}} .premium-title-icon'
973 ]
974 );
975
976 $this->add_control('premium_title_icon_border_radius',
977 [
978 'label' => __('Border Radius', 'premium-addons-for-elementor'),
979 'type' => Controls_Manager::SLIDER,
980 'size_units' => ['px', '%', 'em'],
981 'selectors' => [
982 '{{WRAPPER}} .premium-title-icon' => 'border-radius: {{SIZE}}{{UNIT}};'
983 ]
984 ]
985 );
986
987 $this->add_responsive_control('premium_title_icon_margin',
988 [
989 'label' => __('Margin', 'premium-addons-for-elementor'),
990 'type' => Controls_Manager::DIMENSIONS,
991 'size_units' => [ 'px', 'em', '%' ],
992 'selectors' => [
993 '{{WRAPPER}} .premium-title-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}'
994 ]
995 ]
996 );
997
998 $this->add_responsive_control('premium_title_icon_padding',
999 [
1000 'label' => __('Padding', 'premium-addons-for-elementor'),
1001 'type' => Controls_Manager::DIMENSIONS,
1002 'size_units' => [ 'px', 'em', '%' ],
1003 'selectors' => [
1004 '{{WRAPPER}} .premium-title-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}'
1005 ]
1006 ]
1007 );
1008
1009 $this->add_group_control(
1010 Group_Control_Text_Shadow::get_type(),
1011 [
1012 'label' => __('Icon Shadow', 'premium-addons-for-elementor'),
1013 'name' => 'premium_title_icon_text_shadow',
1014 'selector' => '{{WRAPPER}} .premium-title-icon',
1015 'condition' => [
1016 'premium_title_icon_switcher' => 'yes',
1017 'icon_type' => 'icon'
1018 ]
1019 ]
1020 );
1021
1022 $this->end_controls_section();
1023
1024 $this->start_controls_section('background_text_style_section',
1025 [
1026 'label' => __('Background Text', 'premium-addons-for-elementor'),
1027 'tab' => Controls_Manager::TAB_STYLE,
1028 'condition' => [
1029 'background_text_switcher' =>'yes'
1030 ]
1031 ]
1032 );
1033
1034 $this->add_control('background_text_color',
1035 [
1036 'label' => __('Color', 'premium-addons-for-elementor'),
1037 'type' => Controls_Manager::COLOR,
1038 'scheme' => [
1039 'type' => Scheme_Color::get_type(),
1040 'value' => Scheme_Color::COLOR_1,
1041 ],
1042 'selectors' => [
1043 '{{WRAPPER}} .premium-title-bg-text:before' => 'color: {{VALUE}}',
1044 ],
1045 ]
1046 );
1047
1048 $this->add_group_control(
1049 Group_Control_Typography::get_type(),
1050 [
1051 'name' => 'background_text_typography',
1052 'scheme' => Scheme_Typography::TYPOGRAPHY_1,
1053 'selector' => '{{WRAPPER}} .premium-title-bg-text:before',
1054 ]
1055 );
1056
1057 $this->add_group_control(
1058 Group_Control_Text_Shadow::get_type(),
1059 [
1060 'name' => 'background_text_shadow',
1061 'selector' => '{{WRAPPER}} .premium-title-bg-text:before',
1062 ]
1063 );
1064
1065 $this->add_control('background_text_mix_blend',
1066 [
1067 'label' => __( 'Blend Mode', 'elementor' ),
1068 'type' => Controls_Manager::SELECT,
1069 'options' => [
1070 '' => __( 'Normal', 'elementor' ),
1071 'multiply' => 'Multiply',
1072 'screen' => 'Screen',
1073 'overlay' => 'Overlay',
1074 'darken' => 'Darken',
1075 'lighten' => 'Lighten',
1076 'color-dodge' => 'Color Dodge',
1077 'saturation' => 'Saturation',
1078 'color' => 'Color',
1079 'luminosity' => 'Luminosity',
1080 ],
1081 'separator' => 'before',
1082 'selectors' => [
1083 '{{WRAPPER}} .premium-title-bg-text:before' => 'mix-blend-mode: {{VALUE}}',
1084 ],
1085 ]
1086 );
1087
1088 $this->add_control('background_text_zindex',
1089 [
1090 'label' => __( 'z-Index', 'premium-addons-for-elementor' ),
1091 'type' => Controls_Manager::NUMBER,
1092 'min' => -10,
1093 'max' => 20,
1094 'step' => 1,
1095 'selectors' => [
1096 '{{WRAPPER}} .premium-title-bg-text:before' => 'z-index: {{VALUE}}',
1097 ]
1098 ]
1099 );
1100
1101 $this->end_controls_section();
1102
1103 }
1104
1105 /**
1106 * Render title widget output on the frontend.
1107 *
1108 * Written in PHP and used to generate the final HTML.
1109 *
1110 * @since 1.0.0
1111 * @access protected
1112 */
1113 protected function render() {
1114
1115 $settings = $this->get_settings_for_display();
1116
1117 $this->add_inline_editing_attributes('premium_title_text', 'none');
1118
1119 $this->add_render_attribute('premium_title_text', 'class', 'premium-title-text');
1120
1121 $title_tag = $settings['premium_title_tag'];
1122
1123 $selected_style = $settings['premium_title_style'];
1124
1125 $this->add_render_attribute( 'container', 'class', [ 'premium-title-container', $selected_style ] );
1126
1127 $this->add_render_attribute( 'title', 'class', [ 'premium-title-header', 'premium-title-' . $selected_style ] );
1128
1129 if( $selected_style === 'style8' ) {
1130
1131 $this->add_render_attribute( 'premium_title_text', 'data-shiny-delay', $settings['premium_title_delay'] );
1132 $this->add_render_attribute( 'premium_title_text', 'data-shiny-dur', $settings['shining_animation_duration'] );
1133
1134 } elseif ( $selected_style === 'style9' ) {
1135
1136 $this->add_render_attribute( 'title', 'data-blur-delay', $settings['premium_title_delay'] );
1137
1138 }
1139
1140 $icon_position = '';
1141 if( 'yes' === $settings['premium_title_icon_switcher'] ) {
1142
1143 $icon_type = $settings['icon_type'];
1144
1145 $icon_position = $settings['icon_position'];
1146
1147 if( 'icon' === $icon_type ) {
1148
1149 if ( ! empty ( $settings['premium_title_icon'] ) ) {
1150 $this->add_render_attribute( 'icon', 'class', $settings['premium_title_icon'] );
1151 $this->add_render_attribute( 'icon', 'aria-hidden', 'true' );
1152 }
1153
1154 $migrated = isset( $settings['__fa4_migrated']['premium_title_icon_updated'] );
1155 $is_new = empty( $settings['premium_title_icon'] ) && Icons_Manager::is_migration_allowed();
1156
1157 } elseif( 'animation' === $icon_type ) {
1158 $this->add_render_attribute( 'title_lottie', [
1159 'class' => [
1160 'premium-title-icon',
1161 'premium-lottie-animation'
1162 ],
1163 'data-lottie-url' => $settings['lottie_url'],
1164 'data-lottie-loop' => $settings['lottie_loop'],
1165 'data-lottie-reverse' => $settings['lottie_reverse']
1166 ]);
1167 } else {
1168
1169 $src = $settings['image_upload']['url'];
1170
1171 $alt = Control_Media::get_image_alt( $settings['image_upload'] );
1172
1173 $this->add_render_attribute( 'title_img', [
1174 'class' => 'premium-title-icon',
1175 'src' => $src,
1176 'alt' => $alt
1177 ]);
1178 }
1179 }
1180
1181 if( $settings['link_switcher'] === 'yes' ) {
1182
1183 $link = '';
1184
1185 if( $settings['link_selection'] === 'link' ) {
1186
1187 $link = get_permalink( $settings['existing_link'] );
1188
1189 } else {
1190
1191 $link = $settings['custom_link']['url'];
1192
1193 }
1194
1195 $this->add_render_attribute( 'link', 'href', $link );
1196
1197 if( ! empty( $settings['custom_link']['is_external'] ) ) {
1198 $this->add_render_attribute( 'link', 'target', "_blank" );
1199 }
1200
1201 if( ! empty( $settings['custom_link']['nofollow'] ) ) {
1202 $this->add_render_attribute( 'link', 'rel', "nofollow" );
1203 }
1204 }
1205
1206 if( $settings['background_text_switcher'] === 'yes') {
1207 $this->add_render_attribute( 'container', [
1208 'class' => 'premium-title-bg-text',
1209 'data-background' => $settings['background_text']
1210 ]);
1211 }
1212
1213 ?>
1214
1215 <div <?php echo $this->get_render_attribute_string('container') ?>>
1216 <<?php echo $title_tag . ' ' . $this->get_render_attribute_string('title') ; ?>>
1217 <?php if ( $selected_style === 'style7' ) : ?>
1218 <?php if( 'column' !== $icon_position ) : ?>
1219 <span class="premium-title-style7-stripe-wrap">
1220 <span class="premium-title-style7-stripe"></span>
1221 </span>
1222 <?php endif; ?>
1223 <div class="premium-title-style7-inner">
1224 <?php endif; ?>
1225
1226 <?php if( 'yes' === $settings['premium_title_icon_switcher'] ) : ?>
1227 <?php if( 'icon' === $icon_type ) : ?>
1228 <?php if ( $is_new || $migrated ) :
1229 Icons_Manager::render_icon( $settings['premium_title_icon_updated'], [ 'class' => 'premium-title-icon', 'aria-hidden' => 'true' ] );
1230 else: ?>
1231 <i <?php echo $this->get_render_attribute_string( 'icon' ); ?>></i>
1232 <?php endif; ?>
1233 <?php elseif( 'animation' === $icon_type ): ?>
1234 <div <?php echo $this->get_render_attribute_string( 'title_lottie' ); ?>></div>
1235 <?php else: ?>
1236 <img <?php echo $this->get_render_attribute_string( 'title_img' ); ?>>
1237 <?php endif; ?>
1238 <?php endif; ?>
1239
1240 <?php if ( $selected_style === 'style7' ) : ?>
1241 <?php if( 'column' === $icon_position ) : ?>
1242 <span class="premium-title-style7-stripe-wrap">
1243 <span class="premium-title-style7-stripe"></span>
1244 </span>
1245 <?php endif; ?>
1246 <?php endif; ?>
1247 <?php if( $selected_style !== 'style9' ) :?>
1248 <span <?php echo $this->get_render_attribute_string('premium_title_text'); ?> >
1249 <?php echo $settings['premium_title_text']; ?>
1250 </span>
1251 <?php else:
1252 $letters_html = '<span class="premium-letters-container"'.$this->get_render_attribute_string('premium_title_text').'>';
1253 $title_array = str_split(esc_html($settings['premium_title_text']));
1254 foreach ($title_array as $key => $letter):
1255 $key = $key+1;
1256 $letters_html .='<span class="premium-title-style9-letter" data-letter-index="'.esc_attr($key+1).'" data-letter="'.esc_attr($letter).'">'.$letter.'</span>';
1257 endforeach;
1258 $the_title = $letters_html.'</span>';
1259 echo $the_title;
1260 ?>
1261 <?php endif; ?>
1262
1263 <?php if ( $selected_style === 'style7' ) : ?>
1264 </div>
1265 <?php endif; ?>
1266 <?php if( $settings['link_switcher'] === 'yes' && !empty( $link ) ) : ?>
1267 <a <?php echo $this->get_render_attribute_string( 'link' ); ?>></a>
1268 <?php endif; ?>
1269 </<?php echo $title_tag; ?>>
1270 </div>
1271
1272 <?php
1273 }
1274
1275 /**
1276 * Render Title widget output in the editor.
1277 *
1278 * Written as a Backbone JavaScript template and used to generate the live preview.
1279 *
1280 * @since 1.0.0
1281 * @access protected
1282 */
1283 protected function content_template() {
1284 ?>
1285 <#
1286
1287 view.addInlineEditingAttributes('premium_title_text', 'none');
1288
1289 view.addRenderAttribute('premium_title_text', 'class', 'premium-title-text');
1290
1291 var titleTag = settings.premium_title_tag,
1292
1293 selectedStyle = settings.premium_title_style,
1294
1295 titleIcon = settings.premium_title_icon,
1296
1297 titleText = settings.premium_title_text;
1298
1299 view.addRenderAttribute( 'premium_title_container', 'class', [ 'premium-title-container', selectedStyle ] );
1300
1301 view.addRenderAttribute( 'premium_title', 'class', [ 'premium-title-header', 'premium-title-' + selectedStyle ] );
1302
1303 if ( selectedStyle === 'style9' ) {
1304 view.addRenderAttribute( 'premium_title', 'data-blur-delay', settings.premium_title_delay );
1305 }
1306
1307 if( selectedStyle === 'style8') {
1308 view.addRenderAttribute( 'premium_title_text', 'data-shiny-delay', settings.premium_title_delay );
1309 view.addRenderAttribute( 'premium_title_text', 'data-shiny-dur', settings.shining_animation_duration );
1310 }
1311
1312 view.addRenderAttribute( 'icon', 'class', [ 'premium-title-icon', titleIcon ] );
1313
1314 var iconPosition = '';
1315 if( 'yes' === settings.premium_title_icon_switcher ) {
1316
1317 var iconType = settings.icon_type;
1318
1319 iconPosition = settings.icon_position;
1320
1321 if( 'icon' === iconType ) {
1322 var iconHTML = elementor.helpers.renderIcon( view, settings.premium_title_icon_updated, { 'class': 'premium-title-icon', 'aria-hidden': true }, 'i' , 'object' ),
1323 migrated = elementor.helpers.isIconMigrated( settings, 'premium_title_icon_updated' );
1324 } else if( 'animation' === iconType ) {
1325
1326 view.addRenderAttribute( 'title_lottie', {
1327 'class': [
1328 'premium-title-icon',
1329 'premium-lottie-animation'
1330 ],
1331 'data-lottie-url': settings.lottie_url,
1332 'data-lottie-loop': settings.lottie_loop,
1333 'data-lottie-reverse': settings.lottie_reverse
1334 });
1335
1336 } else {
1337
1338 view.addRenderAttribute( 'title_img', 'class', 'premium-title-icon' );
1339 view.addRenderAttribute( 'title_img', 'src', settings.image_upload.url );
1340
1341 }
1342
1343 }
1344
1345 if( 'yes' === settings.link_switcher ) {
1346
1347 var link = '';
1348
1349 if( settings.link_selection === 'link' ) {
1350
1351 link = settings.existing_link;
1352
1353 } else {
1354
1355 link = settings.custom_link.url;
1356
1357 }
1358
1359 view.addRenderAttribute( 'link', 'href', link );
1360
1361 }
1362
1363 if( 'yes' === settings.background_text_switcher ) {
1364 view.addRenderAttribute( 'premium_title_container', {
1365 'class': 'premium-title-bg-text',
1366 'data-background': settings.background_text
1367 });
1368 }
1369
1370 #>
1371 <div {{{ view.getRenderAttributeString('premium_title_container') }}}>
1372 <{{{titleTag}}} {{{view.getRenderAttributeString('premium_title')}}}>
1373 <# if( 'style7' === selectedStyle ) { #>
1374 <# if( 'column' !== iconPosition ) { #>
1375 <span class="premium-title-style7-stripe-wrap">
1376 <span class="premium-title-style7-stripe"></span>
1377 </span>
1378 <# } #>
1379 <div class="premium-title-style7-inner">
1380 <# }
1381 if( 'yes' === settings.premium_title_icon_switcher ) { #>
1382 <# if( 'icon' === iconType ) { #>
1383 <# if ( iconHTML && iconHTML.rendered && ( ! settings.premium_title_icon || migrated ) ) { #>
1384 {{{ iconHTML.value }}}
1385 <# } else { #>
1386 <i {{{ view.getRenderAttributeString( 'icon' ) }}}></i>
1387 <# } #>
1388 <# } else if( 'animation' === iconType ) { #>
1389 <div {{{ view.getRenderAttributeString('title_lottie') }}}></div>
1390 <# } else { #>
1391 <img {{{ view.getRenderAttributeString('title_img') }}}>
1392 <# } #>
1393 <# } #>
1394 <# if( 'style7' === selectedStyle ) { #>
1395 <# if( 'column' === iconPosition ) { #>
1396 <span class="premium-title-style7-stripe-wrap">
1397 <span class="premium-title-style7-stripe"></span>
1398 </span>
1399 <# } #>
1400 <# } #>
1401 <# if( selectedStyle !== 'style9' ) {#>
1402 <span {{{ view.getRenderAttributeString('premium_title_text') }}} >{{{ titleText }}}</span>
1403 <# } else {
1404 lettersHtml = '<span class="premium-letters-container"'+ view.getRenderAttributeString('premium_title_text') +'>';
1405 text = titleText ;
1406 titleArray = text.split('');
1407 key=0;
1408 titleArray.forEach(function (item) {
1409 key = key+1;
1410 lettersHtml +='<span class="premium-title-style9-letter" data-letter-index="'+(key+1)+'" data-letter="'+(item)+'">'+item+'</span>';
1411 });
1412 theTitle = lettersHtml+'</span>'; #>
1413 {{{theTitle}}}
1414 <#
1415 }
1416 #>
1417 <# if( 'style7' === selectedStyle ) { #>
1418 </div>
1419 <# } #>
1420 <# if( 'yes' === settings.link_switcher && '' !== link ) { #>
1421 <a {{{ view.getRenderAttributeString('link') }}}></a>
1422 <# } #>
1423 </{{{titleTag}}}>
1424 </div>
1425
1426 <?php
1427 }
1428 }