PluginProbe ʕ •ᴥ•ʔ
Essential Addons for Elementor – Popular Elementor Templates & Widgets / 5.8.7
Essential Addons for Elementor – Popular Elementor Templates & Widgets v5.8.7
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 years ago Adv_Tabs.php 2 years ago Advanced_Data_Table.php 2 years ago Better_Payment.php 4 years ago Betterdocs_Category_Box.php 2 years ago Betterdocs_Category_Grid.php 2 years ago Betterdocs_Search_Form.php 2 years ago Business_Reviews.php 2 years ago Caldera_Forms.php 2 years ago Career_Page.php 4 years ago Contact_Form_7.php 2 years ago Content_Ticker.php 2 years ago Countdown.php 2 years ago Creative_Button.php 2 years ago Crowdfundly_All_Campaign.php 4 years ago Crowdfundly_Organization.php 4 years ago Crowdfundly_Single_Campaign.php 4 years ago Cta_Box.php 2 years ago Data_Table.php 2 years ago Dual_Color_Header.php 2 years ago EmbedPress.php 4 years ago Event_Calendar.php 2 years ago Facebook_Feed.php 2 years ago Fancy_Text.php 2 years ago Feature_List.php 2 years ago Filterable_Gallery.php 2 years ago Flip_Box.php 2 years ago FluentForm.php 2 years ago Formstack.php 2 years ago GravityForms.php 2 years ago Image_Accordion.php 2 years ago Info_Box.php 2 years ago Interactive_Circle.php 2 years ago Login_Register.php 2 years ago NFT_Gallery.php 2 years ago NinjaForms.php 2 years ago Post_Grid.php 2 years ago Post_Timeline.php 2 years ago Pricing_Table.php 2 years ago Product_Grid.php 2 years ago Progress_Bar.php 2 years ago SVG_Draw.php 3 years ago Simple_Menu.php 2 years ago Sticky_Video.php 2 years ago Team_Member.php 2 years ago Testimonial.php 2 years ago Tooltip.php 2 years ago Twitter_Feed.php 2 years ago TypeForm.php 2 years ago WeForms.php 2 years ago Woo_Cart.php 2 years ago Woo_Checkout.php 2 years ago Woo_Product_Carousel.php 2 years ago Woo_Product_Compare.php 4 years ago Woo_Product_Gallery.php 2 years ago Woocommerce_Review.php 4 years ago WpForms.php 2 years ago index.php 3 years ago
Progress_Bar.php
1035 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 public function get_custom_help_url()
58 {
59 return 'https://essential-addons.com/elementor/docs/progress-bar/';
60 }
61
62 protected function register_controls()
63 {
64
65 /*-----------------------------------------------------------------------------------*/
66 /* CONTENT TAB
67 /*-----------------------------------------------------------------------------------*/
68
69 /**
70 * Content Tab: Layout
71 */
72 $this->start_controls_section(
73 'progress_bar_section_layout',
74 [
75 'label' => __('Layout', 'essential-addons-for-elementor-lite'),
76 ]
77 );
78
79 // Progressbar Layout Options
80 $options = apply_filters(
81 'add_eael_progressbar_layout',
82 [
83 'layouts' => [
84 'line' => __('Line', 'essential-addons-for-elementor-lite'),
85 'line_rainbow' => __('Line Rainbow (Pro)', 'essential-addons-for-elementor-lite'),
86 'circle' => __('Circle', 'essential-addons-for-elementor-lite'),
87 'circle_fill' => __('Circle Fill (Pro)', 'essential-addons-for-elementor-lite'),
88 'half_circle' => __('Half Circle', 'essential-addons-for-elementor-lite'),
89 'half_circle_fill' => __('Half Circle Fill (Pro)', 'essential-addons-for-elementor-lite'),
90 'box' => __('Box (Pro)', 'essential-addons-for-elementor-lite'),
91 ],
92 'conditions' => [
93 'line_rainbow', 'circle_fill', 'half_circle_fill', 'box',
94 ],
95 ]
96 );
97
98 $this->add_control(
99 'progress_bar_layout',
100 [
101 'label' => __('Layout', 'essential-addons-for-elementor-lite'),
102 'type' => Controls_Manager::SELECT,
103 'options' => $options['layouts'],
104 'default' => 'line',
105 ]
106 );
107
108 $this->add_control(
109 'eael_pricing_table_style_pro_alert',
110 [
111 'label' => esc_html__('Only Available in Pro Version!', 'essential-addons-for-elementor-lite'),
112 'type' => Controls_Manager::HEADING,
113 'condition' => [
114 'progress_bar_layout' => $options['conditions'],
115 ],
116 ]
117 );
118
119 $this->add_control(
120 'progress_bar_title',
121 [
122 'label' => __('Title', 'essential-addons-for-elementor-lite'),
123 'type' => Controls_Manager::TEXT,
124 'dynamic' => [
125 'active' => true,
126 ],
127 'default' => __('Progress Bar', 'essential-addons-for-elementor-lite'),
128 'separator' => 'before',
129 'ai' => [
130 'active' => false,
131 ],
132 ]
133 );
134
135 $this->add_control(
136 'progress_bar_title_html_tag',
137 [
138 'label' => __('Title HTML Tag', 'essential-addons-for-elementor-lite'),
139 'type' => Controls_Manager::SELECT,
140 'options' => [
141 'h1' => __('H1', 'essential-addons-for-elementor-lite'),
142 'h2' => __('H2', 'essential-addons-for-elementor-lite'),
143 'h3' => __('H3', 'essential-addons-for-elementor-lite'),
144 'h4' => __('H4', 'essential-addons-for-elementor-lite'),
145 'h5' => __('H5', 'essential-addons-for-elementor-lite'),
146 'h6' => __('H6', 'essential-addons-for-elementor-lite'),
147 'div' => __('div', 'essential-addons-for-elementor-lite'),
148 'span' => __('span', 'essential-addons-for-elementor-lite'),
149 'p' => __('p', 'essential-addons-for-elementor-lite'),
150 ],
151 'default' => 'div',
152 'separator' => 'after',
153 ]
154 );
155
156 $style_condition = apply_filters('eael_progressbar_general_style_condition', ['line']);
157
158 $this->add_control(
159 'progress_bar_title_inner_show',
160 [
161 'label' => esc_html__('Inner Title', 'essential-addons-for-elementor-lite'),
162 'type' => Controls_Manager::SWITCHER,
163 'return_value' => 'yes',
164 'default' => '',
165 'condition' => [
166 'progress_bar_layout' => $style_condition,
167 ],
168 ]
169 );
170
171 $this->add_control(
172 'progress_bar_title_inner',
173 [
174 'label' => __('Inner Title', 'essential-addons-for-elementor-lite'),
175 'type' => Controls_Manager::TEXT,
176 'dynamic' => [
177 'active' => true,
178 ],
179 'default' => __('Progress Bar', 'essential-addons-for-elementor-lite'),
180 'condition' => [
181 'progress_bar_layout' => $style_condition,
182 'progress_bar_title_inner_show' => 'yes',
183 ],
184 'ai' => [
185 'active' => false,
186 ],
187 ]
188 );
189
190 $this->add_control(
191 'progress_bar_value_type',
192 [
193 'label' => esc_html__('Counter Value Type', 'essential-addons-for-elementor-lite'),
194 'type' => Controls_Manager::SELECT,
195 'options' => [
196 'static' => __('Static', 'essential-addons-for-elementor-lite'),
197 'dynamic' => __('Dynamic', 'essential-addons-for-elementor-lite'),
198 ],
199 'separator' => 'before',
200 'default' => 'static',
201 ]
202 );
203
204 $this->add_control(
205 'progress_bar_value',
206 [
207 'label' => __('Counter Value', 'essential-addons-for-elementor-lite'),
208 'type' => Controls_Manager::SLIDER,
209 'size_units' => ['%'],
210 'range' => [
211 '%' => [
212 'min' => 0,
213 'max' => 100,
214 'step' => 1,
215 ],
216 ],
217 'default' => [
218 'unit' => '%',
219 'size' => 50,
220 ],
221 'condition' => [
222 'progress_bar_value_type' => 'static',
223 ],
224 ]
225 );
226
227 $this->add_control(
228 'progress_bar_value_dynamic',
229 [
230 'label' => __('Counter Value', 'essential-addons-for-elementor-lite'),
231 'type' => Controls_Manager::NUMBER,
232 'min' => 0,
233 'max' => 100,
234 'step' => 1,
235 'dynamic' => [
236 'active' => true,
237 ],
238 'condition' => [
239 'progress_bar_value_type' => 'dynamic',
240 ],
241 ]
242 );
243
244 $this->add_control(
245 'progress_bar_show_count',
246 [
247 'label' => esc_html__('Display Count', 'essential-addons-for-elementor-lite'),
248 'type' => Controls_Manager::SWITCHER,
249 'return_value' => 'yes',
250 'default' => 'yes',
251 ]
252 );
253
254 $this->add_control(
255 'progress_bar_animation_duration',
256 [
257 'label' => __('Animation Duration', 'essential-addons-for-elementor-lite'),
258 'type' => Controls_Manager::SLIDER,
259 'size_units' => ['px'],
260 'range' => [
261 'px' => [
262 'min' => 1000,
263 'max' => 10000,
264 'step' => 100,
265 ],
266 ],
267 'default' => [
268 'unit' => 'px',
269 'size' => 1500,
270 ],
271 'separator' => 'before',
272 ]
273 );
274
275 $this->add_control(
276 'progress_bar_prefix_label',
277 [
278 'label' => __('Prefix Label', 'essential-addons-for-elementor-lite'),
279 'type' => Controls_Manager::TEXT,
280 'dynamic' => [ 'active' => true ],
281 'default' => __('Prefix', 'essential-addons-for-elementor-lite'),
282 'condition' => [
283 'progress_bar_layout' => 'half_circle',
284 ],
285 'separator' => 'before',
286 'ai' => [
287 'active' => false,
288 ],
289 ]
290 );
291
292 $this->add_control(
293 'progress_bar_postfix_label',
294 [
295 'label' => __('Postfix Label', 'essential-addons-for-elementor-lite'),
296 'type' => Controls_Manager::TEXT,
297 'dynamic' => [ 'active' => true ],
298 'default' => __('Postfix', 'essential-addons-for-elementor-lite'),
299 'condition' => [
300 'progress_bar_layout' => 'half_circle',
301 ],
302 'separator' => 'before',
303 'ai' => [
304 'active' => false,
305 ],
306 ]
307 );
308
309 $this->end_controls_section();
310
311 if (!apply_filters('eael/pro_enabled', false)) {
312 $this->start_controls_section(
313 'eael_section_pro',
314 [
315 'label' => __('Go Premium for More Features', 'essential-addons-for-elementor-lite'),
316 ]
317 );
318
319 $this->add_control(
320 'eael_control_get_pro',
321 [
322 'label' => __('Unlock more possibilities', 'essential-addons-for-elementor-lite'),
323 'type' => Controls_Manager::CHOOSE,
324 'options' => [
325 '1' => [
326 'title' => '',
327 'icon' => 'fa fa-unlock-alt',
328 ],
329 ],
330 'default' => '1',
331 '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>',
332 ]
333 );
334
335 $this->end_controls_section();
336 }
337
338 /*-----------------------------------------------------------------------------------*/
339 /* STYLE TAB
340 /*-----------------------------------------------------------------------------------*/
341
342 /**
343 * Style Tab: General(Line)
344 */
345
346 $this->start_controls_section(
347 'progress_bar_section_style_general_line',
348 [
349 'label' => __('General', 'essential-addons-for-elementor-lite'),
350 'tab' => Controls_Manager::TAB_STYLE,
351 'condition' => [
352 'progress_bar_layout' => $style_condition,
353 ],
354 ]
355 );
356
357 $this->add_control(
358 'progress_bar_line_alignment',
359 [
360 'label' => __('Alignment', 'essential-addons-for-elementor-lite'),
361 'type' => \Elementor\Controls_Manager::CHOOSE,
362 'options' => [
363 'left' => [
364 'title' => __('Left', 'essential-addons-for-elementor-lite'),
365 'icon' => 'eicon-text-align-left',
366 ],
367 'center' => [
368 'title' => __('Center', 'essential-addons-for-elementor-lite'),
369 'icon' => 'eicon-text-align-center',
370 ],
371 'right' => [
372 'title' => __('Right', 'essential-addons-for-elementor-lite'),
373 'icon' => 'eicon-text-align-right',
374 ],
375 ],
376 'default' => 'center',
377 ]
378 );
379
380 $this->end_controls_section();
381
382 /**
383 * Style Tab: Background
384 */
385 $this->start_controls_section(
386 'progress_bar_section_style_bg',
387 [
388 'label' => __('Background', 'essential-addons-for-elementor-lite'),
389 'tab' => Controls_Manager::TAB_STYLE,
390 'condition' => [
391 'progress_bar_layout' => $style_condition, // ['line', 'line_rainbow'] ( Pro Only )
392 ],
393 ]
394 );
395
396 $this->add_control(
397 'progress_bar_line_width',
398 [
399 'label' => __('Width', 'essential-addons-for-elementor-lite'),
400 'type' => Controls_Manager::SLIDER,
401 'size_units' => ['px', '%'],
402 'range' => [
403 'px' => [
404 'min' => 100,
405 'max' => 1000,
406 'step' => 1,
407 ],
408 '%' => [
409 'min' => 1,
410 'max' => 100,
411 'step' => 1,
412 ],
413 ],
414 'default' => [
415 'unit' => '%',
416 'size' => 100,
417 ],
418 'selectors' => [
419 '{{WRAPPER}} .eael-progressbar-line-container' => 'width: {{SIZE}}{{UNIT}}',
420 ],
421 ]
422 );
423
424 $this->add_control(
425 'progress_bar_line_height',
426 [
427 'label' => __('Height', 'essential-addons-for-elementor-lite'),
428 'type' => Controls_Manager::SLIDER,
429 'size_units' => ['px'],
430 'range' => [
431 'px' => [
432 'min' => 0,
433 'max' => 100,
434 'step' => 1,
435 ],
436 ],
437 'default' => [
438 'unit' => 'px',
439 'size' => 12,
440 ],
441 'selectors' => [
442 '{{WRAPPER}} .eael-progressbar-line' => 'height: {{SIZE}}{{UNIT}}',
443 ],
444 'condition' => [
445 'progress_bar_title_inner_show!' => 'yes',
446 ]
447 ]
448 );
449
450 $this->add_control(
451 'progress_bar_line_height_inner_title',
452 [
453 'label' => __('Height', 'essential-addons-for-elementor-lite'),
454 'type' => Controls_Manager::SLIDER,
455 'size_units' => ['px'],
456 'range' => [
457 'px' => [
458 'min' => 0,
459 'max' => 100,
460 'step' => 1,
461 ],
462 ],
463 'default' => [
464 'unit' => 'px',
465 'size' => 24,
466 ],
467 'selectors' => [
468 '{{WRAPPER}} .eael-progressbar-line' => 'height: {{SIZE}}{{UNIT}}',
469 ],
470 'condition' => [
471 'progress_bar_title_inner_show' => 'yes',
472 ]
473 ]
474 );
475
476 $this->add_control(
477 'progress_bar_line_bg_color',
478 [
479 'label' => __('Color', 'essential-addons-for-elementor-lite'),
480 'type' => Controls_Manager::COLOR,
481 'default' => '#eee',
482 'selectors' => [
483 '{{WRAPPER}} .eael-progressbar-line' => 'background-color: {{VALUE}}',
484 ],
485 'separator' => 'before',
486 ]
487 );
488
489 $this->end_controls_section();
490
491 /**
492 * Style Tab: Fill
493 */
494 $this->start_controls_section(
495 'progress_bar_section_style_fill',
496 [
497 'label' => __('Fill', 'essential-addons-for-elementor-lite'),
498 'tab' => Controls_Manager::TAB_STYLE,
499 'condition' => [
500 'progress_bar_layout' => $style_condition, // will here ['line', 'line_rainbow'] ( Pro Only )
501 ],
502 ]
503 );
504
505 $this->add_control(
506 'progress_bar_line_fill_height',
507 [
508 'label' => __('Height', 'essential-addons-for-elementor-lite'),
509 'type' => Controls_Manager::SLIDER,
510 'size_units' => ['px'],
511 'range' => [
512 'px' => [
513 'min' => 0,
514 'max' => 100,
515 'step' => 1,
516 ],
517 ],
518 'default' => [
519 'unit' => 'px',
520 'size' => 12,
521 ],
522 'selectors' => [
523 '{{WRAPPER}} .eael-progressbar-line-fill' => 'height: {{SIZE}}{{UNIT}}',
524 ],
525 'condition' => [
526 'progress_bar_title_inner_show!' => 'yes',
527 ]
528 ]
529 );
530
531 $this->add_control(
532 'progress_bar_line_fill_height_inner_title',
533 [
534 'label' => __('Height', 'essential-addons-for-elementor-lite'),
535 'type' => Controls_Manager::SLIDER,
536 'size_units' => ['px'],
537 'range' => [
538 'px' => [
539 'min' => 0,
540 'max' => 100,
541 'step' => 1,
542 ],
543 ],
544 'default' => [
545 'unit' => 'px',
546 'size' => 24,
547 ],
548 'selectors' => [
549 '{{WRAPPER}} .eael-progressbar-line-fill' => 'height: {{SIZE}}{{UNIT}}',
550 ],
551 'condition' => [
552 'progress_bar_title_inner_show' => 'yes',
553 ]
554 ]
555 );
556
557 if (apply_filters('eael/pro_enabled', false)) {
558 $line_fill_color_condition = [
559 'progress_bar_layout' => 'line',
560 ];
561 } else {
562 $line_fill_color_condition = [];
563 }
564 $this->add_group_control(
565 Group_Control_Background::get_type(),
566 [
567 'name' => 'progress_bar_line_fill_color',
568 'label' => __('Color', 'essential-addons-for-elementor-lite'),
569 'types' => ['classic', 'gradient'],
570 'exclude' => [
571 'image',
572 ],
573 'condition' => $line_fill_color_condition,
574 'selector' => '{{WRAPPER}} .eael-progressbar-line-fill',
575 'separator' => 'before',
576 ]
577 );
578
579 $this->add_control(
580 'progress_bar_line_fill_stripe',
581 [
582 'label' => __('Show Stripe', 'essential-addons-for-elementor-lite'),
583 'type' => \Elementor\Controls_Manager::SWITCHER,
584 'return_value' => 'yes',
585 'condition' => $line_fill_color_condition,
586 'default' => 'no',
587 'separator' => 'before',
588 ]
589 );
590
591 $fill_stripe_animate_condition = apply_filters('eael_progressbar_line_fill_stripe_condition', ['progress_bar_line_fill_stripe' => 'yes']);
592
593 $this->add_control(
594 'progress_bar_line_fill_stripe_animate',
595 [
596 'label' => __('Stripe Animation', 'essential-addons-for-elementor-lite'),
597 'type' => Controls_Manager::SELECT,
598 'options' => [
599 'normal' => __('Left To Right', 'essential-addons-for-elementor-lite'),
600 'reverse' => __('Right To Left', 'essential-addons-for-elementor-lite'),
601 'none' => __('Disabled', 'essential-addons-for-elementor-lite'),
602 ],
603 'default' => 'none',
604 'condition' => $fill_stripe_animate_condition,
605 ]
606 );
607
608 $this->end_controls_section();
609
610 /**
611 * Style Tab: General(Circle)
612 */
613 $circle_general_condition = apply_filters('eael_circle_style_general_condition', ['circle', 'half_circle']);
614
615 $this->start_controls_section(
616 'progress_bar_section_style_general_circle',
617 [
618 'label' => __('General', 'essential-addons-for-elementor-lite'),
619 'tab' => Controls_Manager::TAB_STYLE,
620 'condition' => [
621 'progress_bar_layout' => $circle_general_condition,
622 ],
623 ]
624 );
625
626 $this->add_control(
627 'progress_bar_circle_alignment',
628 [
629 'label' => __('Alignment', 'essential-addons-for-elementor-lite'),
630 'type' => \Elementor\Controls_Manager::CHOOSE,
631 'options' => [
632 'left' => [
633 'title' => __('Left', 'essential-addons-for-elementor-lite'),
634 'icon' => 'eicon-text-align-left',
635 ],
636 'center' => [
637 'title' => __('Center', 'essential-addons-for-elementor-lite'),
638 'icon' => 'eicon-text-align-center',
639 ],
640 'right' => [
641 'title' => __('Right', 'essential-addons-for-elementor-lite'),
642 'icon' => 'eicon-text-align-right',
643 ],
644 ],
645 'default' => 'center',
646 ]
647 );
648
649 $this->add_control(
650 'progress_bar_circle_size',
651 [
652 'label' => __('Size', 'essential-addons-for-elementor-lite'),
653 'type' => Controls_Manager::SLIDER,
654 'size_units' => ['px'],
655 'range' => [
656 'px' => [
657 'min' => 50,
658 'max' => 500,
659 'step' => 1,
660 ],
661 ],
662 'default' => [
663 'unit' => 'px',
664 'size' => 200,
665 ],
666 'selectors' => [
667 '{{WRAPPER}} .eael-progressbar-circle' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
668 '{{WRAPPER}} .eael-progressbar-half-circle' => 'width: {{SIZE}}{{UNIT}}; height: calc({{SIZE}} / 2 * 1{{UNIT}});',
669 '{{WRAPPER}} .eael-progressbar-half-circle-after' => 'width: {{SIZE}}{{UNIT}};',
670 '{{WRAPPER}} .eael-progressbar-circle-shadow' => 'width: calc({{SIZE}}{{UNIT}} + 20px); height: calc({{SIZE}}{{UNIT}} + 20px);',
671 ],
672 'separator' => 'before',
673 ]
674 );
675
676 $this->add_control(
677 'progress_bar_circle_bg_color',
678 [
679 'label' => __('Background Color', 'essential-addons-for-elementor-lite'),
680 'type' => Controls_Manager::COLOR,
681 'default' => '#fff',
682 'selectors' => [
683 '{{WRAPPER}} .eael-progressbar-circle-inner' => 'background-color: {{VALUE}}',
684 ],
685 'separator' => 'before',
686 ]
687 );
688
689 $this->add_control(
690 'progress_bar_circle_stroke_width',
691 [
692 'label' => __('Stroke Width', 'essential-addons-for-elementor-lite'),
693 'type' => Controls_Manager::SLIDER,
694 'size_units' => ['px'],
695 'range' => [
696 'px' => [
697 'min' => 0,
698 'max' => 100,
699 'step' => 1,
700 ],
701 ],
702 'default' => [
703 'unit' => 'px',
704 'size' => 12,
705 ],
706 'selectors' => [
707 '{{WRAPPER}} .eael-progressbar-circle-inner' => 'border-width: {{SIZE}}{{UNIT}}',
708 '{{WRAPPER}} .eael-progressbar-circle-half' => 'border-width: {{SIZE}}{{UNIT}}',
709 ],
710 'separator' => 'before',
711 ]
712 );
713
714 $this->add_control(
715 'progress_bar_circle_stroke_color',
716 [
717 'label' => __('Stroke Color', 'essential-addons-for-elementor-lite'),
718 'type' => Controls_Manager::COLOR,
719 'default' => '#eee',
720 'selectors' => [
721 '{{WRAPPER}} .eael-progressbar-circle-inner' => 'border-color: {{VALUE}}',
722 ],
723 ]
724 );
725
726 if (apply_filters('eael/pro_enabled', false)) {
727 $circle_fill_color_condition = [
728 '{{WRAPPER}} .eael-progressbar-circle-half' => 'border-color: {{VALUE}}',
729 '{{WRAPPER}} .eael-progressbar-circle-fill .eael-progressbar-circle-half' => 'background-color: {{VALUE}}',
730 '{{WRAPPER}} .eael-progressbar-half-circle-fill .eael-progressbar-circle-half' => 'background-color: {{VALUE}}',
731 ];
732 } else {
733 $circle_fill_color_condition = [
734 '{{WRAPPER}} .eael-progressbar-circle-half' => 'border-color: {{VALUE}}',
735 ];
736 }
737
738 $this->add_control(
739 'progress_bar_circle_fill_color',
740 [
741 'label' => __('Fill Color', 'essential-addons-for-elementor-lite'),
742 'type' => Controls_Manager::COLOR,
743 'default' => '#000',
744 'selectors' => $circle_fill_color_condition,
745 'separator' => 'before',
746 ]
747 );
748
749 $this->add_group_control(
750 Group_Control_Box_Shadow::get_type(),
751 [
752 'name' => 'progress_bar_circle_box_shadow',
753 'label' => __('Box Shadow', 'essential-addons-for-elementor-lite'),
754 'selector' => '{{WRAPPER}} .eael-progressbar-circle-shadow',
755 'condition' => [
756 'progress_bar_layout' => 'circle',
757 ],
758 'separator' => 'before',
759 ]
760 );
761
762 $this->end_controls_section();
763
764 // Import progress bar style controlls
765 do_action('add_progress_bar_control', $this);
766
767 /**
768 * Style Tab: Typography
769 */
770 $this->start_controls_section(
771 'progress_bar_section_style_typography',
772 [
773 'label' => __('Typography', 'essential-addons-for-elementor-lite'),
774 'tab' => Controls_Manager::TAB_STYLE,
775 ]
776 );
777
778 $this->add_group_control(
779 Group_Control_Typography::get_type(),
780 [
781 'name' => 'progress_bar_title_typography',
782 'label' => __('Title', 'essential-addons-for-elementor-lite'),
783 'global' => [
784 'default' => Global_Typography::TYPOGRAPHY_PRIMARY
785 ],
786 'selector' => '{{WRAPPER}} .eael-progressbar-title',
787 ]
788 );
789
790 $this->add_control(
791 'progress_bar_title_color',
792 [
793 'label' => __('Title Color', 'essential-addons-for-elementor-lite'),
794 'type' => Controls_Manager::COLOR,
795 'default' => '',
796 'selectors' => [
797 '{{WRAPPER}} .eael-progressbar-title' => 'color: {{VALUE}}',
798 ],
799 'separator' => 'after',
800 ]
801 );
802
803 $this->add_group_control(
804 Group_Control_Typography::get_type(),
805 [
806 'name' => 'progress_bar_inner_title_typography',
807 'label' => __('Inner Title', 'essential-addons-for-elementor-lite'),
808 'global' => [
809 'default' => Global_Typography::TYPOGRAPHY_PRIMARY
810 ],
811 'selector' => '{{WRAPPER}} .eael-progressbar-line-fill.eael-has-inner-title',
812 ]
813 );
814
815 $this->add_control(
816 'progress_bar_inner_title_color',
817 [
818 'label' => __('Inner Title Color', 'essential-addons-for-elementor-lite'),
819 'type' => Controls_Manager::COLOR,
820 'default' => '#fff',
821 'selectors' => [
822 '{{WRAPPER}} .eael-progressbar-line-fill.eael-has-inner-title' => 'color: {{VALUE}}',
823 ],
824 ]
825 );
826
827 $this->add_responsive_control(
828 'progress_bar_inner_title_padding',
829 [
830 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'),
831 'type' => Controls_Manager::DIMENSIONS,
832 'size_units' => ['px', 'em', '%'],
833 'selectors' => [
834 '{{WRAPPER}} .eael-progressbar-line-fill.eael-has-inner-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
835 ],
836 'separator' => 'after',
837 ]
838 );
839
840 $this->add_group_control(
841 Group_Control_Typography::get_type(),
842 [
843 'name' => 'progress_bar_count_typography',
844 'label' => __('Counter', 'essential-addons-for-elementor-lite'),
845 'global' => [
846 'default' => Global_Typography::TYPOGRAPHY_PRIMARY
847 ],
848 'selector' => '{{WRAPPER}} .eael-progressbar-count-wrap',
849 ]
850 );
851
852 $this->add_control(
853 'progress_bar_count_color',
854 [
855 'label' => __('Counter Color', 'essential-addons-for-elementor-lite'),
856 'type' => Controls_Manager::COLOR,
857 'default' => '',
858 'selectors' => [
859 '{{WRAPPER}} .eael-progressbar-count-wrap' => 'color: {{VALUE}}',
860 ],
861 'separator' => 'after',
862 ]
863 );
864
865 $this->add_group_control(
866 Group_Control_Typography::get_type(),
867 [
868 'name' => 'progress_bar_after_typography',
869 'label' => __('Prefix/Postfix', 'essential-addons-for-elementor-lite'),
870 'global' => [
871 'default' => Global_Typography::TYPOGRAPHY_PRIMARY
872 ],
873 'selector' => '{{WRAPPER}} .eael-progressbar-half-circle-after span',
874 'condition' => [
875 'progress_bar_layout' => 'half_circle',
876 ],
877 ]
878 );
879
880 $this->add_control(
881 'progress_bar_after_color',
882 [
883 'label' => __('Prefix/Postfix Color', 'essential-addons-for-elementor-lite'),
884 'type' => Controls_Manager::COLOR,
885 'default' => '',
886 'selectors' => [
887 '{{WRAPPER}} .eael-progressbar-half-circle-after' => 'color: {{VALUE}}',
888 ],
889 'condition' => [
890 'progress_bar_layout' => 'half_circle',
891 ],
892 ]
893 );
894
895 $this->end_controls_section();
896
897 }
898
899 protected function render()
900 {
901 $settings = $this->get_settings_for_display();
902 $wrap_classes = ['eael-progressbar'];
903 $circle_wrapper = [];
904 $settings['progress_bar_title'] = Helper::eael_wp_kses($settings['progress_bar_title']);
905
906 $has_inner_title = ! empty( $settings['progress_bar_title_inner_show'] ) && ! empty( $settings['progress_bar_title_inner'] );
907 $has_inner_title_class = $has_inner_title ? 'eael-has-inner-title' : '';
908 $settings['progress_bar_title_inner'] = $has_inner_title ? Helper::eael_wp_kses( $settings['progress_bar_title_inner'] ) : '';
909
910 if (!apply_filters('eael/pro_enabled', false)) {
911 if (in_array($settings['progress_bar_layout'], ['line', 'line_rainbow', 'circle_fill', 'half_circle_fill', 'box'])) {
912 $settings['progress_bar_layout'] = 'line';
913 }
914 }
915
916 if ($settings['progress_bar_layout'] == 'line' || $settings['progress_bar_layout'] == 'line_rainbow') {
917 $wrap_classes[] = 'eael-progressbar-line';
918 $wrap_classes = apply_filters('eael_progressbar_rainbow_wrap_class', $wrap_classes, $settings);
919
920 if ($settings['progress_bar_line_fill_stripe'] == 'yes') {
921 $wrap_classes[] = 'eael-progressbar-line-stripe';
922 }
923
924 if ($settings['progress_bar_line_fill_stripe_animate'] == 'normal') {
925 $wrap_classes[] = 'eael-progressbar-line-animate';
926 } else if ($settings['progress_bar_line_fill_stripe_animate'] == 'reverse') {
927 $wrap_classes[] = 'eael-progressbar-line-animate-rtl';
928 }
929
930 $this->add_render_attribute('eael-progressbar-line', [
931 'class' => $wrap_classes,
932 'data-layout' => 'line',
933 'data-count' => $settings['progress_bar_value_type'] == 'static' ? $settings['progress_bar_value']['size'] : $settings['progress_bar_value_dynamic'],
934 'data-duration' => $settings['progress_bar_animation_duration']['size'],
935 ]);
936
937 $this->add_render_attribute('eael-progressbar-line-fill', [
938 'class' => 'eael-progressbar-line-fill ' . esc_attr( $has_inner_title_class ),
939 '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;',
940 ]);
941
942 echo '<div class="eael-progressbar-line-container ' . $settings['progress_bar_line_alignment'] . '">
943 ' . ($settings['progress_bar_title'] ? sprintf('<%1$s class="%2$s">', Helper::eael_validate_html_tag($settings['progress_bar_title_html_tag']), 'eael-progressbar-title') . Helper::eael_wp_kses($settings['progress_bar_title']) . sprintf('</%1$s>', Helper::eael_validate_html_tag($settings['progress_bar_title_html_tag'])) : '') . '
944
945 <div ' . $this->get_render_attribute_string('eael-progressbar-line') . '>
946 ' . ($settings['progress_bar_show_count'] === 'yes' ? '<span class="eael-progressbar-count-wrap"><span class="eael-progressbar-count">0</span><span class="postfix">' . __('%', 'essential-addons-for-elementor-lite') . '</span></span>' : '') . '
947 <span ' . $this->get_render_attribute_string('eael-progressbar-line-fill') . '>' . Helper::eael_wp_kses( $settings['progress_bar_title_inner'] ) . '</span>
948 </div>
949 </div>';
950 }
951
952 if ($settings['progress_bar_layout'] == 'circle' || $settings['progress_bar_layout'] == 'circle_fill') {
953 $wrap_classes[] = 'eael-progressbar-circle';
954 $wrap_classes = apply_filters('eael_progressbar_circle_fill_wrap_class', $wrap_classes, $settings);
955
956 $this->add_render_attribute(
957 'eael-progressbar-circle',
958 [
959 'class' => $wrap_classes,
960 'data-layout' => $settings['progress_bar_layout'],
961 'data-count' => $settings['progress_bar_value_type'] == 'static' ? $settings['progress_bar_value']['size'] : $settings['progress_bar_value_dynamic'],
962 'data-duration' => $settings['progress_bar_animation_duration']['size'],
963 ]
964 );
965
966 echo '<div class="eael-progressbar-circle-container ' . $settings['progress_bar_circle_alignment'] . '">
967 ' . ($settings['progress_bar_circle_box_shadow_box_shadow'] ? '<div class="eael-progressbar-circle-shadow">' : '') . '
968
969 <div ' . $this->get_render_attribute_string('eael-progressbar-circle') . '>
970 <div class="eael-progressbar-circle-pie">
971 <div class="eael-progressbar-circle-half-left eael-progressbar-circle-half"></div>
972 <div class="eael-progressbar-circle-half-right eael-progressbar-circle-half"></div>
973 </div>
974 <div class="eael-progressbar-circle-inner"></div>
975 <div class="eael-progressbar-circle-inner-content">
976 ' . ($settings['progress_bar_title'] ? sprintf('<%1$s class="%2$s">', Helper::eael_validate_html_tag($settings['progress_bar_title_html_tag']), 'eael-progressbar-title') . $settings['progress_bar_title'] . sprintf('</%1$s>', Helper::eael_validate_html_tag($settings['progress_bar_title_html_tag'])) : '') . '
977 ' . ($settings['progress_bar_show_count'] === 'yes' ? '<span class="eael-progressbar-count-wrap"><span class="eael-progressbar-count">0</span><span class="postfix">' . __('%', '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">' . __('%', 'essential-addons-for-elementor-lite') . '</span></span>') . '
978 </div>
979 </div>
980
981 ' . ($settings['progress_bar_circle_box_shadow_box_shadow'] ? '</div>' : '') . '
982 </div>';
983 }
984
985 if (apply_filters('eael/pro_enabled', false)) {
986 $circle_condition = $settings['progress_bar_layout'] == 'half_circle' || $settings['progress_bar_layout'] == 'half_circle_fill';
987 } else {
988 $circle_condition = $settings['progress_bar_layout'] == 'half_circle';
989 }
990
991 if ($circle_condition) {
992 $wrap_classes[] = 'eael-progressbar-half-circle';
993 $wrap_classes = apply_filters('eael_progressbar_half_circle_wrap_class', $wrap_classes, $settings);
994
995 $this->add_render_attribute(
996 'eael-progressbar-circle-half',
997 [
998 'class' => 'eael-progressbar-circle-half',
999 '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;',
1000 ]
1001 );
1002
1003 $this->add_render_attribute(
1004 'eael-progressbar-half-circle',
1005 [
1006 'class' => $wrap_classes,
1007 'data-layout' => $settings['progress_bar_layout'],
1008 'data-count' => $settings['progress_bar_value_type'] == 'static' ? $settings['progress_bar_value']['size'] : $settings['progress_bar_value_dynamic'],
1009 'data-duration' => $settings['progress_bar_animation_duration']['size'],
1010 ]
1011 );
1012
1013 echo '<div class="eael-progressbar-circle-container ' . $settings['progress_bar_circle_alignment'] . '">
1014 <div ' . $this->get_render_attribute_string('eael-progressbar-half-circle') . '>
1015 <div class="eael-progressbar-circle">
1016 <div class="eael-progressbar-circle-pie">
1017 <div ' . $this->get_render_attribute_string('eael-progressbar-circle-half') . '></div>
1018 </div>
1019 <div class="eael-progressbar-circle-inner"></div>
1020 </div>
1021 <div class="eael-progressbar-circle-inner-content">
1022 ' . ($settings['progress_bar_title'] ? sprintf('<%1$s class="%2$s">', Helper::eael_validate_html_tag($settings['progress_bar_title_html_tag']), 'eael-progressbar-title') . $settings['progress_bar_title'] . sprintf('</%1$s>', Helper::eael_validate_html_tag($settings['progress_bar_title_html_tag'])) : '') . '
1023 ' . ($settings['progress_bar_show_count'] === 'yes' ? '<span class="eael-progressbar-count-wrap"><span class="eael-progressbar-count">0</span><span class="postfix">' . __('%', 'essential-addons-for-elementor-lite') . '</span></span>' : '') . '
1024 </div>
1025 </div>
1026 <div class="eael-progressbar-half-circle-after">
1027 ' . ($settings['progress_bar_prefix_label'] ? sprintf('<span class="eael-progressbar-prefix-label">%1$s</span>', Helper::eael_wp_kses($settings['progress_bar_prefix_label'])) : '') . '
1028 ' . ($settings['progress_bar_postfix_label'] ? sprintf('<span class="eael-progressbar-postfix-label">%1$s</span>', Helper::eael_wp_kses($settings['progress_bar_postfix_label'])) : '') . '
1029 </div>
1030 </div>';
1031 }
1032 do_action('add_eael_progressbar_block', $settings, $this, $wrap_classes);
1033 }
1034 }
1035