PluginProbe ʕ •ᴥ•ʔ
Essential Addons for Elementor – Popular Elementor Templates & Widgets / 6.6.9
Essential Addons for Elementor – Popular Elementor Templates & Widgets v6.6.9
6.6.9 6.6.8 6.6.7 6.6.6 6.6.5 6.6.4 6.6.3 5.7.3 5.7.4 5.8.0 5.8.1 5.8.10 5.8.11 5.8.12 5.8.13 5.8.14 5.8.15 5.8.16 5.8.18 5.8.2 5.8.3 5.8.4 5.8.5 5.8.6 5.8.7 5.8.8 5.8.9 5.9.0 5.9.1 5.9.10 5.9.11 5.9.12 5.9.13 5.9.14 5.9.15 5.9.16 5.9.17 5.9.18 5.9.19 5.9.2 5.9.20 5.9.21 5.9.22 5.9.23 5.9.24 5.9.25 5.9.26 5.9.27 5.9.3 5.9.4 5.9.5 5.9.6 5.9.7 5.9.8 5.9.9 6.0.0 6.0.1 6.0.10 6.0.11 6.0.12 6.0.13 6.0.14 6.0.15 6.0.2 6.0.3 6.0.4 6.0.5 6.0.6 6.0.7 6.0.8 6.0.9 6.1.0 6.1.1 6.1.10 6.1.11 trunk 6.1.12 1.0.0 6.1.13 1.0.1 6.1.14 1.1.0 6.1.15 2.0 6.1.17 2.1 6.1.18 2.10.0 6.1.19 2.10.1 6.1.2 2.10.2 6.1.20 2.10.3 6.1.3 2.10.4 6.1.4 2.10.5 6.1.5 2.2.0 6.1.6 2.2.1 6.1.7 2.2.2 6.1.8 2.2.3 6.1.9 2.2.4 6.2.0 2.2.5 6.2.1 2.3.0 6.2.2 2.3.1 6.2.3 2.4.0 6.2.4 2.4.1 6.3.0 2.4.2 6.3.1 2.4.3 6.3.2 2.5.0 6.3.3 2.6.0 6.4.0 2.7.0 6.5.0 2.7.1 6.5.1 2.7.10 6.5.10 2.7.11 6.5.11 2.7.2 6.5.12 2.7.3 6.5.13 2.7.4 6.5.2 2.7.5 6.5.3 2.7.6 6.5.4 2.7.7 6.5.5 2.7.8 6.5.6 2.7.9 6.5.7 2.8.0 6.5.8 2.8.1 6.5.9 2.8.2 6.6.0 2.8.3 6.6.1 2.8.4 6.6.2 2.8.5 2.8.6 2.8.7 2.9.0 2.9.1 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 2.9.9 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.4.1 3.1.5 3.2.0 3.3.0 3.3.1 3.3.2 3.3.3 3.4.0 3.5.0 3.5.1 3.5.2 3.6.0 3.6.1 3.6.2 3.7.0 3.7.1 3.7.2 3.8.0 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.2.0 4.2.1 4.2.2 4.2.3 4.2.4 4.3.0 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.3.6 4.3.7 4.3.8 4.3.9 4.4.0 4.4.1 4.5.0 4.5.1 4.5.2 4.5.3 4.5.4 4.5.5 4.6.0 4.6.1 4.6.2 4.6.3 4.6.4 4.6.5 4.6.6 4.7.0 4.7.1 4.7.2 4.7.3 4.7.4 4.7.5 4.8.0 4.8.1 4.8.2 4.8.3 4.8.4 4.9.0 4.9.1 4.9.2 4.9.3 4.9.4 4.9.5 4.9.6 4.9.7 5.0.0 5.0.1 5.0.10 5.0.11 5.0.12 5.0.13 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.0.9 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.1.8 5.1.9 5.2.0 5.2.1 5.2.2 5.2.3 5.2.4 5.3.0 5.3.1 5.3.2 5.4.6 5.5.5 5.6.5 5.7.2
essential-addons-for-elementor-lite / includes / Elements / Progress_Bar.php
essential-addons-for-elementor-lite / includes / Elements Last commit date
Adv_Accordion.php 2 months ago Adv_Tabs.php 2 months ago Advanced_Data_Table.php 2 weeks ago Better_Payment.php 4 years ago Betterdocs_Category_Box.php 3 months ago Betterdocs_Category_Grid.php 3 months ago Betterdocs_Search_Form.php 2 months ago Breadcrumbs.php 2 months ago Business_Reviews.php 6 days ago Caldera_Forms.php 2 months ago Career_Page.php 4 years ago Code_Snippet.php 4 months ago Contact_Form_7.php 2 months ago Content_Ticker.php 4 months ago Countdown.php 2 months ago Creative_Button.php 1 month ago Cta_Box.php 2 months ago Data_Table.php 2 months ago Dual_Color_Header.php 6 days ago EmbedPress.php 4 years ago Event_Calendar.php 1 week ago Facebook_Feed.php 4 months ago Fancy_Text.php 2 months ago Feature_List.php 4 months ago Filterable_Gallery.php 6 days ago Flip_Box.php 2 months ago FluentForm.php 2 months ago Formstack.php 2 months ago GravityForms.php 6 days ago Image_Accordion.php 2 months ago Info_Box.php 6 days ago Interactive_Circle.php 2 months ago Login_Register.php 6 days ago NFT_Gallery.php 4 months ago NinjaForms.php 2 months ago Post_Grid.php 4 months ago Post_Timeline.php 10 months ago Pricing_Table.php 2 months ago Product_Grid.php 3 weeks ago Progress_Bar.php 2 months ago SVG_Draw.php 4 months ago Simple_Menu.php 6 days ago Sticky_Video.php 4 months ago Team_Member.php 4 months ago Testimonial.php 2 months ago Tooltip.php 2 months ago Twitter_Feed.php 4 months ago TypeForm.php 5 months ago WeForms.php 1 year ago Woo_Add_To_Cart.php 2 months ago Woo_Cart.php 4 months ago Woo_Checkout.php 4 months ago Woo_Product_Carousel.php 1 month ago Woo_Product_Compare.php 1 year ago Woo_Product_Gallery.php 4 months ago Woo_Product_Images.php 1 month ago Woo_Product_List.php 2 months ago Woo_Product_Price.php 2 months ago Woo_Product_Rating.php 2 months ago WpForms.php 2 months ago index.php 3 years ago
Progress_Bar.php
1047 lines
1 <?php
2 namespace Essential_Addons_Elementor\Elements;
3
4 // If this file is called directly, abort.
5 if (!defined('ABSPATH')) {
6 exit;
7 }
8
9 use \Elementor\Controls_Manager;
10 use \Elementor\Group_Control_Background;
11 use \Elementor\Group_Control_Box_Shadow;
12 use \Elementor\Group_Control_Typography;
13 use \Elementor\Core\Kits\Documents\Tabs\Global_Typography;
14 use \Elementor\Widget_Base;
15
16 use \Essential_Addons_Elementor\Classes\Helper;
17
18 class Progress_Bar extends Widget_Base
19 {
20
21 public function get_name()
22 {
23 return 'eael-progress-bar';
24 }
25
26 public function get_title()
27 {
28 return esc_html__('Progress Bar', 'essential-addons-for-elementor-lite');
29 }
30
31 public function get_icon()
32 {
33 return 'eaicon-progress-bar';
34 }
35
36 public function get_categories()
37 {
38 return ['essential-addons-elementor'];
39 }
40
41 public function get_keywords()
42 {
43 return [
44 'ea progessbar',
45 'ea progess bar',
46 'status bar',
47 'ea status bar',
48 'indicator',
49 'progress indicator',
50 'gradient',
51 'ea',
52 'scroll indicator',
53 'essential addons',
54 ];
55 }
56
57 protected function is_dynamic_content():bool {
58 return false;
59 }
60
61 public function has_widget_inner_wrapper(): bool {
62 return ! Helper::eael_e_optimized_markup();
63 }
64
65 public function get_custom_help_url()
66 {
67 return 'https://essential-addons.com/elementor/docs/progress-bar/';
68 }
69
70 protected function register_controls()
71 {
72
73 /*-----------------------------------------------------------------------------------*/
74 /* CONTENT TAB
75 /*-----------------------------------------------------------------------------------*/
76
77 /**
78 * Content Tab: Layout
79 */
80 $this->start_controls_section(
81 'progress_bar_section_layout',
82 [
83 'label' => __('Layout', 'essential-addons-for-elementor-lite'),
84 ]
85 );
86
87 // Progressbar Layout Options
88 $options = apply_filters(
89 // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
90 'add_eael_progressbar_layout',
91 [
92 'layouts' => [
93 'line' => __('Line', 'essential-addons-for-elementor-lite'),
94 'line_rainbow' => __('Line Rainbow (Pro)', 'essential-addons-for-elementor-lite'),
95 'circle' => __('Circle', 'essential-addons-for-elementor-lite'),
96 'circle_fill' => __('Circle Fill (Pro)', 'essential-addons-for-elementor-lite'),
97 'half_circle' => __('Half Circle', 'essential-addons-for-elementor-lite'),
98 'half_circle_fill' => __('Half Circle Fill (Pro)', 'essential-addons-for-elementor-lite'),
99 'box' => __('Box (Pro)', 'essential-addons-for-elementor-lite'),
100 ],
101 'conditions' => [
102 'line_rainbow', 'circle_fill', 'half_circle_fill', 'box',
103 ],
104 ]
105 );
106
107 $this->add_control(
108 'progress_bar_layout',
109 [
110 'label' => __('Layout', 'essential-addons-for-elementor-lite'),
111 'type' => Controls_Manager::SELECT,
112 'options' => $options['layouts'],
113 'default' => 'line',
114 ]
115 );
116
117 $this->add_control(
118 'eael_pricing_table_style_pro_alert',
119 [
120 'label' => esc_html__('Only Available in Pro Version!', 'essential-addons-for-elementor-lite'),
121 'type' => Controls_Manager::HEADING,
122 'condition' => [
123 'progress_bar_layout' => $options['conditions'],
124 ],
125 ]
126 );
127
128 $this->add_control(
129 'progress_bar_title',
130 [
131 'label' => __('Title', 'essential-addons-for-elementor-lite'),
132 'type' => Controls_Manager::TEXT,
133 'dynamic' => [
134 'active' => true,
135 ],
136 'default' => __('Progress Bar', 'essential-addons-for-elementor-lite'),
137 'separator' => 'before',
138 'ai' => [
139 'active' => true,
140 ],
141 ]
142 );
143
144 $this->add_control(
145 'progress_bar_title_html_tag',
146 [
147 'label' => __('Title HTML Tag', 'essential-addons-for-elementor-lite'),
148 'type' => Controls_Manager::SELECT,
149 'options' => [
150 'h1' => __('H1', 'essential-addons-for-elementor-lite'),
151 'h2' => __('H2', 'essential-addons-for-elementor-lite'),
152 'h3' => __('H3', 'essential-addons-for-elementor-lite'),
153 'h4' => __('H4', 'essential-addons-for-elementor-lite'),
154 'h5' => __('H5', 'essential-addons-for-elementor-lite'),
155 'h6' => __('H6', 'essential-addons-for-elementor-lite'),
156 'div' => __('div', 'essential-addons-for-elementor-lite'),
157 'span' => __('span', 'essential-addons-for-elementor-lite'),
158 'p' => __('p', 'essential-addons-for-elementor-lite'),
159 ],
160 'default' => 'div',
161 'separator' => 'after',
162 ]
163 );
164
165 $style_condition = apply_filters('eael_progressbar_general_style_condition', ['line']);
166
167 $this->add_control(
168 'progress_bar_title_inner_show',
169 [
170 'label' => esc_html__('Inner Title', 'essential-addons-for-elementor-lite'),
171 'type' => Controls_Manager::SWITCHER,
172 'return_value' => 'yes',
173 'default' => '',
174 'condition' => [
175 'progress_bar_layout' => $style_condition,
176 ],
177 ]
178 );
179
180 $this->add_control(
181 'progress_bar_title_inner',
182 [
183 'label' => __('Inner Title', 'essential-addons-for-elementor-lite'),
184 'type' => Controls_Manager::TEXT,
185 'dynamic' => [
186 'active' => true,
187 ],
188 'default' => __('Progress Bar', 'essential-addons-for-elementor-lite'),
189 'condition' => [
190 'progress_bar_layout' => $style_condition,
191 'progress_bar_title_inner_show' => 'yes',
192 ],
193 'ai' => [
194 'active' => true,
195 ],
196 ]
197 );
198
199 $this->add_control(
200 'progress_bar_value_type',
201 [
202 'label' => esc_html__('Counter Value Type', 'essential-addons-for-elementor-lite'),
203 'type' => Controls_Manager::SELECT,
204 'options' => [
205 'static' => __('Static', 'essential-addons-for-elementor-lite'),
206 'dynamic' => __('Dynamic', 'essential-addons-for-elementor-lite'),
207 ],
208 'separator' => 'before',
209 'default' => 'static',
210 ]
211 );
212
213 $this->add_control(
214 'progress_bar_value',
215 [
216 'label' => __('Counter Value', 'essential-addons-for-elementor-lite'),
217 'type' => Controls_Manager::SLIDER,
218 'size_units' => ['%'],
219 'range' => [
220 '%' => [
221 'min' => 0,
222 'max' => 100,
223 'step' => 1,
224 ],
225 ],
226 'default' => [
227 'unit' => '%',
228 'size' => 50,
229 ],
230 'condition' => [
231 'progress_bar_value_type' => 'static',
232 ],
233 ]
234 );
235
236 $this->add_control(
237 'progress_bar_value_dynamic',
238 [
239 'label' => __('Counter Value', 'essential-addons-for-elementor-lite'),
240 'type' => Controls_Manager::NUMBER,
241 'min' => 0,
242 'max' => 100,
243 'step' => 1,
244 'dynamic' => [
245 'active' => true,
246 ],
247 'condition' => [
248 'progress_bar_value_type' => 'dynamic',
249 ],
250 ]
251 );
252
253 $this->add_control(
254 'progress_bar_show_count',
255 [
256 'label' => esc_html__('Display Count', 'essential-addons-for-elementor-lite'),
257 'type' => Controls_Manager::SWITCHER,
258 'return_value' => 'yes',
259 'default' => 'yes',
260 ]
261 );
262
263 $this->add_control(
264 'progress_bar_animation_duration',
265 [
266 'label' => __('Animation Duration', 'essential-addons-for-elementor-lite'),
267 'type' => Controls_Manager::SLIDER,
268 'size_units' => ['px'],
269 'range' => [
270 'px' => [
271 'min' => 1000,
272 'max' => 10000,
273 'step' => 100,
274 ],
275 ],
276 'default' => [
277 'unit' => 'px',
278 'size' => 1500,
279 ],
280 'separator' => 'before',
281 ]
282 );
283
284 $this->add_control(
285 'progress_bar_prefix_label',
286 [
287 'label' => __('Prefix Label', 'essential-addons-for-elementor-lite'),
288 'type' => Controls_Manager::TEXT,
289 'dynamic' => [ 'active' => true ],
290 'default' => __('Prefix', 'essential-addons-for-elementor-lite'),
291 'condition' => [
292 'progress_bar_layout' => 'half_circle',
293 ],
294 'separator' => 'before',
295 'ai' => [
296 'active' => true,
297 ],
298 ]
299 );
300
301 $this->add_control(
302 'progress_bar_postfix_label',
303 [
304 'label' => __('Postfix Label', 'essential-addons-for-elementor-lite'),
305 'type' => Controls_Manager::TEXT,
306 'dynamic' => [ 'active' => true ],
307 'default' => __('Postfix', 'essential-addons-for-elementor-lite'),
308 'condition' => [
309 'progress_bar_layout' => 'half_circle',
310 ],
311 'separator' => 'before',
312 'ai' => [
313 'active' => true,
314 ],
315 ]
316 );
317
318 $this->end_controls_section();
319
320 if (!apply_filters('eael/pro_enabled', false)) {
321 $this->start_controls_section(
322 'eael_section_pro',
323 [
324 'label' => __('Go Premium for More Features', 'essential-addons-for-elementor-lite'),
325 ]
326 );
327
328 $this->add_control(
329 'eael_control_get_pro',
330 [
331 'label' => __('Unlock more possibilities', 'essential-addons-for-elementor-lite'),
332 'type' => Controls_Manager::CHOOSE,
333 'options' => [
334 '1' => [
335 'title' => '',
336 'icon' => 'fa fa-unlock-alt',
337 ],
338 ],
339 'default' => '1',
340 'description' => '<span class="pro-feature"> Get the <a href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank">Pro version</a> for more stunning elements and customization options.</span>',
341 ]
342 );
343
344 $this->end_controls_section();
345 }
346
347 /*-----------------------------------------------------------------------------------*/
348 /* STYLE TAB
349 /*-----------------------------------------------------------------------------------*/
350
351 /**
352 * Style Tab: General(Line)
353 */
354
355 $this->start_controls_section(
356 'progress_bar_section_style_general_line',
357 [
358 'label' => __('General', 'essential-addons-for-elementor-lite'),
359 'tab' => Controls_Manager::TAB_STYLE,
360 'condition' => [
361 'progress_bar_layout' => $style_condition,
362 ],
363 ]
364 );
365
366 $this->add_control(
367 'progress_bar_line_alignment',
368 [
369 'label' => __('Alignment', 'essential-addons-for-elementor-lite'),
370 'type' => \Elementor\Controls_Manager::CHOOSE,
371 'options' => [
372 'left' => [
373 'title' => __('Left', 'essential-addons-for-elementor-lite'),
374 'icon' => 'eicon-text-align-left',
375 ],
376 'center' => [
377 'title' => __('Center', 'essential-addons-for-elementor-lite'),
378 'icon' => 'eicon-text-align-center',
379 ],
380 'right' => [
381 'title' => __('Right', 'essential-addons-for-elementor-lite'),
382 'icon' => 'eicon-text-align-right',
383 ],
384 ],
385 'default' => 'center',
386 ]
387 );
388
389 $this->end_controls_section();
390
391 /**
392 * Style Tab: Background
393 */
394 $this->start_controls_section(
395 'progress_bar_section_style_bg',
396 [
397 'label' => __('Background', 'essential-addons-for-elementor-lite'),
398 'tab' => Controls_Manager::TAB_STYLE,
399 'condition' => [
400 'progress_bar_layout' => $style_condition, // ['line', 'line_rainbow'] ( Pro Only )
401 ],
402 ]
403 );
404
405 $this->add_control(
406 'progress_bar_line_width',
407 [
408 'label' => __('Width', 'essential-addons-for-elementor-lite'),
409 'type' => Controls_Manager::SLIDER,
410 'size_units' => ['px', '%'],
411 'range' => [
412 'px' => [
413 'min' => 100,
414 'max' => 1000,
415 'step' => 1,
416 ],
417 '%' => [
418 'min' => 1,
419 'max' => 100,
420 'step' => 1,
421 ],
422 ],
423 'default' => [
424 'unit' => '%',
425 'size' => 100,
426 ],
427 'selectors' => [
428 '{{WRAPPER}} .eael-progressbar-line-container' => 'width: {{SIZE}}{{UNIT}}',
429 ],
430 ]
431 );
432
433 $this->add_control(
434 'progress_bar_line_height',
435 [
436 'label' => __('Height', 'essential-addons-for-elementor-lite'),
437 'type' => Controls_Manager::SLIDER,
438 'size_units' => ['px'],
439 'range' => [
440 'px' => [
441 'min' => 0,
442 'max' => 100,
443 'step' => 1,
444 ],
445 ],
446 'default' => [
447 'unit' => 'px',
448 'size' => 12,
449 ],
450 'selectors' => [
451 '{{WRAPPER}} .eael-progressbar-line' => 'height: {{SIZE}}{{UNIT}}',
452 ],
453 'condition' => [
454 'progress_bar_title_inner_show!' => 'yes',
455 ]
456 ]
457 );
458
459 $this->add_control(
460 'progress_bar_line_height_inner_title',
461 [
462 'label' => __('Height', 'essential-addons-for-elementor-lite'),
463 'type' => Controls_Manager::SLIDER,
464 'size_units' => ['px'],
465 'range' => [
466 'px' => [
467 'min' => 0,
468 'max' => 100,
469 'step' => 1,
470 ],
471 ],
472 'default' => [
473 'unit' => 'px',
474 'size' => 24,
475 ],
476 'selectors' => [
477 '{{WRAPPER}} .eael-progressbar-line' => 'height: {{SIZE}}{{UNIT}}',
478 ],
479 'condition' => [
480 'progress_bar_title_inner_show' => 'yes',
481 ]
482 ]
483 );
484
485 $this->add_control(
486 'progress_bar_line_bg_color',
487 [
488 'label' => __('Color', 'essential-addons-for-elementor-lite'),
489 'type' => Controls_Manager::COLOR,
490 'default' => '#eee',
491 'selectors' => [
492 '{{WRAPPER}} .eael-progressbar-line' => 'background-color: {{VALUE}}',
493 ],
494 'separator' => 'before',
495 ]
496 );
497
498 $this->end_controls_section();
499
500 /**
501 * Style Tab: Fill
502 */
503 $this->start_controls_section(
504 'progress_bar_section_style_fill',
505 [
506 'label' => __('Fill', 'essential-addons-for-elementor-lite'),
507 'tab' => Controls_Manager::TAB_STYLE,
508 'condition' => [
509 'progress_bar_layout' => $style_condition, // will here ['line', 'line_rainbow'] ( Pro Only )
510 ],
511 ]
512 );
513
514 $this->add_control(
515 'progress_bar_line_fill_height',
516 [
517 'label' => __('Height', 'essential-addons-for-elementor-lite'),
518 'type' => Controls_Manager::SLIDER,
519 'size_units' => ['px'],
520 'range' => [
521 'px' => [
522 'min' => 0,
523 'max' => 100,
524 'step' => 1,
525 ],
526 ],
527 'default' => [
528 'unit' => 'px',
529 'size' => 12,
530 ],
531 'selectors' => [
532 '{{WRAPPER}} .eael-progressbar-line-fill' => 'height: {{SIZE}}{{UNIT}}',
533 ],
534 'condition' => [
535 'progress_bar_title_inner_show!' => 'yes',
536 ]
537 ]
538 );
539
540 $this->add_control(
541 'progress_bar_line_fill_height_inner_title',
542 [
543 'label' => __('Height', 'essential-addons-for-elementor-lite'),
544 'type' => Controls_Manager::SLIDER,
545 'size_units' => ['px'],
546 'range' => [
547 'px' => [
548 'min' => 0,
549 'max' => 100,
550 'step' => 1,
551 ],
552 ],
553 'default' => [
554 'unit' => 'px',
555 'size' => 24,
556 ],
557 'selectors' => [
558 '{{WRAPPER}} .eael-progressbar-line-fill' => 'height: {{SIZE}}{{UNIT}}',
559 ],
560 'condition' => [
561 'progress_bar_title_inner_show' => 'yes',
562 ]
563 ]
564 );
565
566 if (apply_filters('eael/pro_enabled', false)) {
567 $line_fill_color_condition = [
568 'progress_bar_layout' => 'line',
569 ];
570 } else {
571 $line_fill_color_condition = [];
572 }
573 $this->add_group_control(
574 Group_Control_Background::get_type(),
575 [
576 'name' => 'progress_bar_line_fill_color',
577 'label' => __('Color', 'essential-addons-for-elementor-lite'),
578 'types' => ['classic', 'gradient'],
579 'exclude' => [
580 'image',
581 ],
582 'condition' => $line_fill_color_condition,
583 'selector' => '{{WRAPPER}} .eael-progressbar-line-fill',
584 'separator' => 'before',
585 ]
586 );
587
588 $this->add_control(
589 'progress_bar_line_fill_stripe',
590 [
591 'label' => __('Show Stripe', 'essential-addons-for-elementor-lite'),
592 'type' => \Elementor\Controls_Manager::SWITCHER,
593 'return_value' => 'yes',
594 'condition' => $line_fill_color_condition,
595 'default' => 'no',
596 'separator' => 'before',
597 ]
598 );
599
600 $fill_stripe_animate_condition = apply_filters('eael_progressbar_line_fill_stripe_condition', ['progress_bar_line_fill_stripe' => 'yes']);
601
602 $this->add_control(
603 'progress_bar_line_fill_stripe_animate',
604 [
605 'label' => __('Stripe Animation', 'essential-addons-for-elementor-lite'),
606 'type' => Controls_Manager::SELECT,
607 'options' => [
608 'normal' => __('Left To Right', 'essential-addons-for-elementor-lite'),
609 'reverse' => __('Right To Left', 'essential-addons-for-elementor-lite'),
610 'none' => __('Disabled', 'essential-addons-for-elementor-lite'),
611 ],
612 'default' => 'none',
613 'condition' => $fill_stripe_animate_condition,
614 ]
615 );
616
617 $this->end_controls_section();
618
619 /**
620 * Style Tab: General(Circle)
621 */
622 $circle_general_condition = apply_filters('eael_circle_style_general_condition', ['circle', 'half_circle']);
623
624 $this->start_controls_section(
625 'progress_bar_section_style_general_circle',
626 [
627 'label' => __('General', 'essential-addons-for-elementor-lite'),
628 'tab' => Controls_Manager::TAB_STYLE,
629 'condition' => [
630 'progress_bar_layout' => $circle_general_condition,
631 ],
632 ]
633 );
634
635 $this->add_control(
636 'progress_bar_circle_alignment',
637 [
638 'label' => __('Alignment', 'essential-addons-for-elementor-lite'),
639 'type' => \Elementor\Controls_Manager::CHOOSE,
640 'options' => [
641 'left' => [
642 'title' => __('Left', 'essential-addons-for-elementor-lite'),
643 'icon' => 'eicon-text-align-left',
644 ],
645 'center' => [
646 'title' => __('Center', 'essential-addons-for-elementor-lite'),
647 'icon' => 'eicon-text-align-center',
648 ],
649 'right' => [
650 'title' => __('Right', 'essential-addons-for-elementor-lite'),
651 'icon' => 'eicon-text-align-right',
652 ],
653 ],
654 'default' => 'center',
655 ]
656 );
657
658 $this->add_control(
659 'progress_bar_circle_size',
660 [
661 'label' => __('Size', 'essential-addons-for-elementor-lite'),
662 'type' => Controls_Manager::SLIDER,
663 'size_units' => ['px'],
664 'range' => [
665 'px' => [
666 'min' => 50,
667 'max' => 500,
668 'step' => 1,
669 ],
670 ],
671 'default' => [
672 'unit' => 'px',
673 'size' => 200,
674 ],
675 'selectors' => [
676 '{{WRAPPER}} .eael-progressbar-circle' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
677 '{{WRAPPER}} .eael-progressbar-half-circle' => 'width: {{SIZE}}{{UNIT}}; height: calc({{SIZE}} / 2 * 1{{UNIT}});',
678 '{{WRAPPER}} .eael-progressbar-half-circle-after' => 'width: {{SIZE}}{{UNIT}};',
679 '{{WRAPPER}} .eael-progressbar-circle-shadow' => 'width: calc({{SIZE}}{{UNIT}} + 20px); height: calc({{SIZE}}{{UNIT}} + 20px);',
680 ],
681 'separator' => 'before',
682 ]
683 );
684
685 $this->add_control(
686 'progress_bar_circle_bg_color',
687 [
688 'label' => __('Background Color', 'essential-addons-for-elementor-lite'),
689 'type' => Controls_Manager::COLOR,
690 'default' => '#fff',
691 'selectors' => [
692 '{{WRAPPER}} .eael-progressbar-circle-inner' => 'background-color: {{VALUE}}',
693 ],
694 'separator' => 'before',
695 ]
696 );
697
698 $this->add_control(
699 'progress_bar_circle_stroke_width',
700 [
701 'label' => __('Stroke Width', 'essential-addons-for-elementor-lite'),
702 'type' => Controls_Manager::SLIDER,
703 'size_units' => ['px'],
704 'range' => [
705 'px' => [
706 'min' => 0,
707 'max' => 100,
708 'step' => 1,
709 ],
710 ],
711 'default' => [
712 'unit' => 'px',
713 'size' => 12,
714 ],
715 'selectors' => [
716 '{{WRAPPER}} .eael-progressbar-circle-inner' => 'border-width: {{SIZE}}{{UNIT}}',
717 '{{WRAPPER}} .eael-progressbar-circle-half' => 'border-width: {{SIZE}}{{UNIT}}',
718 ],
719 'separator' => 'before',
720 ]
721 );
722
723 $this->add_control(
724 'progress_bar_circle_stroke_color',
725 [
726 'label' => __('Stroke Color', 'essential-addons-for-elementor-lite'),
727 'type' => Controls_Manager::COLOR,
728 'default' => '#eee',
729 'selectors' => [
730 '{{WRAPPER}} .eael-progressbar-circle-inner' => 'border-color: {{VALUE}}',
731 ],
732 ]
733 );
734
735 if (apply_filters('eael/pro_enabled', false)) {
736 $circle_fill_color_condition = [
737 '{{WRAPPER}} .eael-progressbar-circle-half' => 'border-color: {{VALUE}}',
738 '{{WRAPPER}} .eael-progressbar-circle-fill .eael-progressbar-circle-half' => 'background-color: {{VALUE}}',
739 '{{WRAPPER}} .eael-progressbar-half-circle-fill .eael-progressbar-circle-half' => 'background-color: {{VALUE}}',
740 ];
741 } else {
742 $circle_fill_color_condition = [
743 '{{WRAPPER}} .eael-progressbar-circle-half' => 'border-color: {{VALUE}}',
744 ];
745 }
746
747 $this->add_control(
748 'progress_bar_circle_fill_color',
749 [
750 'label' => __('Fill Color', 'essential-addons-for-elementor-lite'),
751 'type' => Controls_Manager::COLOR,
752 'default' => '#000',
753 'selectors' => $circle_fill_color_condition,
754 'separator' => 'before',
755 ]
756 );
757
758 $this->add_group_control(
759 Group_Control_Box_Shadow::get_type(),
760 [
761 'name' => 'progress_bar_circle_box_shadow',
762 'label' => __('Box Shadow', 'essential-addons-for-elementor-lite'),
763 'selector' => '{{WRAPPER}} .eael-progressbar-circle-shadow',
764 'condition' => [
765 'progress_bar_layout' => 'circle',
766 ],
767 'separator' => 'before',
768 ]
769 );
770
771 $this->end_controls_section();
772
773 // Import progress bar style controlls
774 do_action('add_progress_bar_control', $this); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
775
776 /**
777 * Style Tab: Typography
778 */
779 $this->start_controls_section(
780 'progress_bar_section_style_typography',
781 [
782 'label' => __('Typography', 'essential-addons-for-elementor-lite'),
783 'tab' => Controls_Manager::TAB_STYLE,
784 ]
785 );
786
787 $this->add_group_control(
788 Group_Control_Typography::get_type(),
789 [
790 'name' => 'progress_bar_title_typography',
791 'label' => __('Title', 'essential-addons-for-elementor-lite'),
792 'global' => [
793 'default' => Global_Typography::TYPOGRAPHY_PRIMARY
794 ],
795 'selector' => '{{WRAPPER}} .eael-progressbar-title',
796 ]
797 );
798
799 $this->add_control(
800 'progress_bar_title_color',
801 [
802 'label' => __('Title Color', 'essential-addons-for-elementor-lite'),
803 'type' => Controls_Manager::COLOR,
804 'default' => '',
805 'selectors' => [
806 '{{WRAPPER}} .eael-progressbar-title' => 'color: {{VALUE}}',
807 ],
808 'separator' => 'after',
809 ]
810 );
811
812 $this->add_group_control(
813 Group_Control_Typography::get_type(),
814 [
815 'name' => 'progress_bar_inner_title_typography',
816 'label' => __('Inner Title', 'essential-addons-for-elementor-lite'),
817 'global' => [
818 'default' => Global_Typography::TYPOGRAPHY_PRIMARY
819 ],
820 'selector' => '{{WRAPPER}} .eael-progressbar-line-fill.eael-has-inner-title',
821 ]
822 );
823
824 $this->add_control(
825 'progress_bar_inner_title_color',
826 [
827 'label' => __('Inner Title Color', 'essential-addons-for-elementor-lite'),
828 'type' => Controls_Manager::COLOR,
829 'default' => '#fff',
830 'selectors' => [
831 '{{WRAPPER}} .eael-progressbar-line-fill.eael-has-inner-title' => 'color: {{VALUE}}',
832 ],
833 ]
834 );
835
836 $this->add_responsive_control(
837 'progress_bar_inner_title_padding',
838 [
839 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
840 'type' => Controls_Manager::DIMENSIONS,
841 'size_units' => ['px', 'em', '%'],
842 'selectors' => [
843 '{{WRAPPER}} .eael-progressbar-line-fill.eael-has-inner-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
844 ],
845 'separator' => 'after',
846 ]
847 );
848
849 $this->add_group_control(
850 Group_Control_Typography::get_type(),
851 [
852 'name' => 'progress_bar_count_typography',
853 'label' => __('Counter', 'essential-addons-for-elementor-lite'),
854 'global' => [
855 'default' => Global_Typography::TYPOGRAPHY_PRIMARY
856 ],
857 'selector' => '{{WRAPPER}} .eael-progressbar-count-wrap',
858 ]
859 );
860
861 $this->add_control(
862 'progress_bar_count_color',
863 [
864 'label' => __('Counter Color', 'essential-addons-for-elementor-lite'),
865 'type' => Controls_Manager::COLOR,
866 'default' => '',
867 'selectors' => [
868 '{{WRAPPER}} .eael-progressbar-count-wrap' => 'color: {{VALUE}}',
869 ],
870 'separator' => 'after',
871 ]
872 );
873
874 $this->add_group_control(
875 Group_Control_Typography::get_type(),
876 [
877 'name' => 'progress_bar_after_typography',
878 'label' => __('Prefix/Postfix', 'essential-addons-for-elementor-lite'),
879 'global' => [
880 'default' => Global_Typography::TYPOGRAPHY_PRIMARY
881 ],
882 'selector' => '{{WRAPPER}} .eael-progressbar-half-circle-after span',
883 'condition' => [
884 'progress_bar_layout' => 'half_circle',
885 ],
886 ]
887 );
888
889 $this->add_control(
890 'progress_bar_after_color',
891 [
892 'label' => __('Prefix/Postfix Color', 'essential-addons-for-elementor-lite'),
893 'type' => Controls_Manager::COLOR,
894 'default' => '',
895 'selectors' => [
896 '{{WRAPPER}} .eael-progressbar-half-circle-after' => 'color: {{VALUE}}',
897 ],
898 'condition' => [
899 'progress_bar_layout' => 'half_circle',
900 ],
901 ]
902 );
903
904 $this->end_controls_section();
905
906 }
907
908 protected function render()
909 {
910 $settings = $this->get_settings_for_display();
911 $wrap_classes = ['eael-progressbar'];
912 $circle_wrapper = [];
913 $settings['progress_bar_title'] = Helper::eael_wp_kses($settings['progress_bar_title']);
914
915 $has_inner_title = ! empty( $settings['progress_bar_title_inner_show'] ) && ! empty( $settings['progress_bar_title_inner'] );
916 $has_inner_title_class = $has_inner_title ? 'eael-has-inner-title' : '';
917 $settings['progress_bar_title_inner'] = $has_inner_title ? Helper::eael_wp_kses( $settings['progress_bar_title_inner'] ) : '';
918
919 if (!apply_filters('eael/pro_enabled', false)) {
920 if (in_array($settings['progress_bar_layout'], ['line', 'line_rainbow', 'circle_fill', 'half_circle_fill', 'box'])) {
921 $settings['progress_bar_layout'] = 'line';
922 }
923 }
924
925 if ($settings['progress_bar_layout'] == 'line' || $settings['progress_bar_layout'] == 'line_rainbow') {
926 $wrap_classes[] = 'eael-progressbar-line';
927 $wrap_classes = apply_filters('eael_progressbar_rainbow_wrap_class', $wrap_classes, $settings);
928
929 if ($settings['progress_bar_line_fill_stripe'] == 'yes') {
930 $wrap_classes[] = 'eael-progressbar-line-stripe';
931 }
932
933 if ($settings['progress_bar_line_fill_stripe_animate'] == 'normal') {
934 $wrap_classes[] = 'eael-progressbar-line-animate';
935 } else if ($settings['progress_bar_line_fill_stripe_animate'] == 'reverse') {
936 $wrap_classes[] = 'eael-progressbar-line-animate-rtl';
937 }
938
939 $this->add_render_attribute('eael-progressbar-line', [
940 'class' => $wrap_classes,
941 'data-layout' => 'line',
942 'data-count' => $settings['progress_bar_value_type'] == 'static' ? $settings['progress_bar_value']['size'] : $settings['progress_bar_value_dynamic'],
943 'data-duration' => $settings['progress_bar_animation_duration']['size'],
944 ]);
945
946 $this->add_render_attribute('eael-progressbar-line-fill', [
947 'class' => 'eael-progressbar-line-fill ' . esc_attr( $has_inner_title_class ),
948 'style' => '-webkit-transition-duration:' . $settings['progress_bar_animation_duration']['size'] . 'ms;-o-transition-duration:' . $settings['progress_bar_animation_duration']['size'] . 'ms;transition-duration:' . $settings['progress_bar_animation_duration']['size'] . 'ms;',
949 ]);
950
951 $title_tag = Helper::eael_validate_html_tag( $settings['progress_bar_title_html_tag'] );
952 echo '<div class="eael-progressbar-line-container ' . esc_attr( $settings['progress_bar_line_alignment'] ) . '">
953 ' . ($settings['progress_bar_title'] ? sprintf('<%1$s class="eael-progressbar-title">%2$s</%1$s>', esc_html( $title_tag ), wp_kses( $settings['progress_bar_title'], Helper::eael_allowed_tags() )) : '') . '
954
955 <div '; $this->print_render_attribute_string('eael-progressbar-line'); echo '>
956 ' . ($settings['progress_bar_show_count'] === 'yes' ? '<span class="eael-progressbar-count-wrap"><span class="eael-progressbar-count">0</span><span class="postfix">' . esc_html__('%', 'essential-addons-for-elementor-lite') . '</span></span>' : '') . '
957 <span '; $this->print_render_attribute_string('eael-progressbar-line-fill'); echo '>' . wp_kses( $settings['progress_bar_title_inner'], Helper::eael_allowed_tags() ) . '</span>
958 </div>
959 </div>';
960 }
961
962 if ($settings['progress_bar_layout'] == 'circle' || $settings['progress_bar_layout'] == 'circle_fill') {
963 $wrap_classes[] = 'eael-progressbar-circle';
964 $wrap_classes = apply_filters('eael_progressbar_circle_fill_wrap_class', $wrap_classes, $settings);
965
966 $this->add_render_attribute(
967 'eael-progressbar-circle',
968 [
969 'class' => $wrap_classes,
970 'data-layout' => $settings['progress_bar_layout'],
971 'data-count' => $settings['progress_bar_value_type'] == 'static' ? $settings['progress_bar_value']['size'] : $settings['progress_bar_value_dynamic'],
972 'data-duration' => $settings['progress_bar_animation_duration']['size'],
973 ]
974 );
975
976 $has_shadow = isset( $settings['progress_bar_circle_box_shadow_box_shadow'] ) && !empty( $settings['progress_bar_circle_box_shadow_box_shadow'] );
977
978 echo '<div class="eael-progressbar-circle-container ' . esc_attr( $settings['progress_bar_circle_alignment'] ) . '">
979 ' . ( $has_shadow ? '<div class="eael-progressbar-circle-shadow">' : '') . '
980
981 <div '; $this->print_render_attribute_string('eael-progressbar-circle'); echo '>
982 <div class="eael-progressbar-circle-pie">
983 <div class="eael-progressbar-circle-half-left eael-progressbar-circle-half"></div>
984 <div class="eael-progressbar-circle-half-right eael-progressbar-circle-half"></div>
985 </div>
986 <div class="eael-progressbar-circle-inner"></div>
987 <div class="eael-progressbar-circle-inner-content">
988 ' . ($settings['progress_bar_title'] ? sprintf('<%1$s class="eael-progressbar-title">%2$s</%1$s>', esc_html( Helper::eael_validate_html_tag( $settings['progress_bar_title_html_tag'] ) ), wp_kses( $settings['progress_bar_title'], Helper::eael_allowed_tags() ) ) : '') . '
989 ' . ($settings['progress_bar_show_count'] === 'yes' ? '<span class="eael-progressbar-count-wrap"><span class="eael-progressbar-count">0</span><span class="postfix">' . esc_html__('%', 'essential-addons-for-elementor-lite') . '</span></span>' : '<span class="eael-progressbar-count-wrap" style="display: none;"><span class="eael-progressbar-count">0</span><span class="postfix">' . esc_html__('%', 'essential-addons-for-elementor-lite') . '</span></span>') . '
990 </div>
991 </div>
992
993 ' . ( $has_shadow ? '</div>' : '') . '
994 </div>';
995 }
996
997 if (apply_filters('eael/pro_enabled', false)) {
998 $circle_condition = $settings['progress_bar_layout'] == 'half_circle' || $settings['progress_bar_layout'] == 'half_circle_fill';
999 } else {
1000 $circle_condition = $settings['progress_bar_layout'] == 'half_circle';
1001 }
1002
1003 if ($circle_condition) {
1004 $wrap_classes[] = 'eael-progressbar-half-circle';
1005 $wrap_classes = apply_filters('eael_progressbar_half_circle_wrap_class', $wrap_classes, $settings);
1006
1007 $this->add_render_attribute(
1008 'eael-progressbar-circle-half',
1009 [
1010 'class' => 'eael-progressbar-circle-half',
1011 'style' => '-webkit-transition-duration:' . $settings['progress_bar_animation_duration']['size'] . 'ms;-o-transition-duration:' . $settings['progress_bar_animation_duration']['size'] . 'ms;transition-duration:' . $settings['progress_bar_animation_duration']['size'] . 'ms;',
1012 ]
1013 );
1014
1015 $this->add_render_attribute(
1016 'eael-progressbar-half-circle',
1017 [
1018 'class' => $wrap_classes,
1019 'data-layout' => $settings['progress_bar_layout'],
1020 'data-count' => $settings['progress_bar_value_type'] == 'static' ? $settings['progress_bar_value']['size'] : $settings['progress_bar_value_dynamic'],
1021 'data-duration' => $settings['progress_bar_animation_duration']['size'],
1022 ]
1023 );
1024
1025 echo '<div class="eael-progressbar-circle-container ' . esc_attr( $settings['progress_bar_circle_alignment'] ) . '">
1026 <div '; $this->print_render_attribute_string('eael-progressbar-half-circle'); echo '>
1027 <div class="eael-progressbar-circle">
1028 <div class="eael-progressbar-circle-pie">
1029 <div '; $this->print_render_attribute_string('eael-progressbar-circle-half'); echo '></div>
1030 </div>
1031 <div class="eael-progressbar-circle-inner"></div>
1032 </div>
1033 <div class="eael-progressbar-circle-inner-content">
1034 ' . ($settings['progress_bar_title'] ? sprintf('<%1$s class="eael-progressbar-title">%2$s</%1$s>', esc_html( Helper::eael_validate_html_tag( $settings['progress_bar_title_html_tag'] ) ), wp_kses( $settings['progress_bar_title'], Helper::eael_allowed_tags() ) ) : '') . '
1035 ' . ($settings['progress_bar_show_count'] === 'yes' ? '<span class="eael-progressbar-count-wrap"><span class="eael-progressbar-count">0</span><span class="postfix">' . esc_html__('%', 'essential-addons-for-elementor-lite') . '</span></span>' : '') . '
1036 </div>
1037 </div>
1038 <div class="eael-progressbar-half-circle-after">
1039 ' . ($settings['progress_bar_prefix_label'] ? sprintf('<span class="eael-progressbar-prefix-label">%1$s</span>', wp_kses($settings['progress_bar_prefix_label'], Helper::eael_allowed_tags() ) ) : '') . '
1040 ' . ($settings['progress_bar_postfix_label'] ? sprintf('<span class="eael-progressbar-postfix-label">%1$s</span>', wp_kses( $settings['progress_bar_postfix_label'], Helper::eael_allowed_tags() ) ) : '') . '
1041 </div>
1042 </div>';
1043 }
1044 do_action('add_eael_progressbar_block', $settings, $this, $wrap_classes); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound
1045 }
1046 }
1047