PluginProbe ʕ •ᴥ•ʔ
Premium Addons for Elementor – Powerful Elementor Templates & Widgets / 4.10.15
Premium Addons for Elementor – Powerful Elementor Templates & Widgets v4.10.15
4.11.79 4.11.78 4.11.77 4.11.76 4.11.75 3.20.5 4.11.69 3.20.6 4.11.7 3.20.7 4.11.70 3.20.8 4.11.71 3.20.9 4.11.72 3.21.1 4.11.73 3.21.2 4.11.74 3.21.3 4.11.8 3.21.4 4.11.9 3.21.5 4.2.0 3.21.6 4.2.1 3.3.0 4.2.2 3.3.1 4.2.3 3.3.2 4.2.4 3.3.3 4.2.5 3.3.4 4.2.6 3.3.5 4.2.7 3.3.6 4.2.8 3.3.7 4.2.9 3.3.8 4.3.0 3.3.9 4.3.1 3.4.0 4.3.2 3.4.1 4.3.3 3.4.2 4.3.4 3.4.3 4.3.5 3.4.4 4.3.6 3.4.5 4.3.7 3.4.6 4.3.8 3.4.7 4.3.9 3.4.8 4.4.0 3.4.9 4.4.1 3.5.0 4.4.2 3.5.1 4.4.3 3.5.2 4.4.4 3.5.3 4.4.5 3.5.4 4.4.6 3.5.5 4.4.7 3.5.6 4.4.8 3.5.7 4.4.9 3.5.8 4.5.0 3.5.9 4.5.1 3.6.0 4.5.2 3.6.1 4.5.3 3.6.2 4.5.4 3.6.3 4.5.5 3.6.4 4.5.6 3.6.5 4.5.7 3.6.6 4.5.8 3.6.7 4.5.9 3.6.8 4.6.0 3.6.9 4.6.1 3.7.0 4.7.0 3.7.1 4.7.1 3.7.2 4.7.2 3.7.3 4.7.3 3.7.4 4.7.4 3.7.5 4.7.5 3.7.6 4.7.6 3.7.7 4.7.7 3.7.8 4.7.8 3.7.9 4.7.9 3.8.0 4.8.0 3.8.1 4.8.1 3.8.2 4.8.10 3.8.3 4.8.11 3.8.4 4.8.2 3.8.5 4.8.3 3.8.6 4.8.4 3.8.7 4.8.5 3.8.8 4.8.6 3.8.9 4.8.7 3.9.0 4.8.8 3.9.1 4.8.9 3.9.2 4.9.0 3.9.3 4.9.0-beta1 3.9.4 4.9.0-beta2 3.9.5 4.9.1 3.9.6 4.9.10 3.9.7 4.9.11 3.9.8 4.9.12 3.9.9 4.9.13 4.0.1 4.9.14 4.0.3 4.9.15 4.0.4 4.9.16 4.0.5 4.9.17 4.0.6 4.9.18 4.0.7 4.9.19 4.0.8 4.9.2 4.0.9 4.9.20 4.1.0 4.9.21 4.1.1 4.9.22 4.1.2 4.9.23 4.1.3 4.9.24 trunk 4.1.4 4.9.25 1.0 4.1.5 4.9.26 1.01 4.1.6 4.9.27 1.02 4.1.7 4.9.28 1.03 4.1.8 4.9.29 1.04 4.1.9 4.9.3 1.05 4.10.0 4.9.30 1.06 4.10.1 4.9.31 1.07 4.10.10 4.9.32 1.08 4.10.11 4.9.33 1.09 4.10.12 4.9.34 2.0 4.10.13 4.9.35 2.0.1 4.10.14 4.9.36 2.0.2 4.10.15 4.9.37 2.0.3 4.10.16 4.9.38 2.0.4 4.10.17 4.9.39 2.0.5 4.10.18 4.9.4 2.0.6 4.10.19 4.9.40 2.0.7 4.10.2 4.9.41 2.0.8 4.10.20 4.9.42 2.0.9 4.10.21 4.9.43 2.1.0 4.10.22 4.9.45 2.1.1 4.10.23 4.9.46 2.1.2 4.10.24 4.9.47 2.1.3 4.10.25 4.9.48 2.1.4 4.10.26 4.9.49 2.1.5 4.10.27 4.9.5 2.1.5-beta1 4.10.28 4.9.50 2.1.6 4.10.29 4.9.51 2.1.7 4.10.3 4.9.52 2.1.8 4.10.30 4.9.53 2.1.9 4.10.31 4.9.54 2.2.0 4.10.32 4.9.55 2.2.1 4.10.33 4.9.56 2.2.2 4.10.34 4.9.57 2.2.3 4.10.35 4.9.6 2.2.4 4.10.36 4.9.7 2.2.5 4.10.37 4.9.8 2.2.6 4.10.38 4.9.9 2.2.7 4.10.39 2.2.8 4.10.4 2.2.9 4.10.40 2.3.0 4.10.41 2.3.1 4.10.42 2.3.2 4.10.43 2.3.3 4.10.44 2.3.4 4.10.45 2.3.5 4.10.46 2.3.6 4.10.47 2.3.7 4.10.48 2.3.8 4.10.49 2.3.9 4.10.5 2.4.0 4.10.50 2.4.1 4.10.51 2.5.0 4.10.52 2.5.1 4.10.53 2.5.2 4.10.54 2.5.3 4.10.55 2.5.4 4.10.56 2.5.5 4.10.57 2.5.6 4.10.58 2.5.7 4.10.59 2.5.8 4.10.6 2.5.9 4.10.60 2.6.0 4.10.61 2.6.1 4.10.62 2.6.2 4.10.63 2.6.3 4.10.64 2.6.4 4.10.65 2.6.5 4.10.66 2.6.6 4.10.67 2.6.7 4.10.68 2.6.8 4.10.69 2.6.9 4.10.7 2.7.0 4.10.70 2.7.1 4.10.71 2.7.2 4.10.72 2.7.3 4.10.73 2.7.4 4.10.74 2.7.5 4.10.75 2.7.6 4.10.76 2.7.7 4.10.77 2.7.8 4.10.78 2.7.9 4.10.79 2.8.0 4.10.8 2.8.1 4.10.80 2.8.2 4.10.81 2.8.3 4.10.82 2.8.4 4.10.83 2.8.5 4.10.84 2.8.6 4.10.85 2.8.7 4.10.86 2.8.8 4.10.87 2.8.9 4.10.88 2.9.0 4.10.89 2.9.1 4.10.9 2.9.2 4.10.90 2.9.3 4.11.0 2.9.4 4.11.1 2.9.5 4.11.10 2.9.6 4.11.11 2.9.7 4.11.12 2.9.8 4.11.13 2.9.9 4.11.14 3.0.0 4.11.15 3.0.1 4.11.16 3.0.2 4.11.17 3.0.3 4.11.18 3.0.4 4.11.19 3.0.5 4.11.2 3.0.6 4.11.20 3.0.7 4.11.21 3.0.8 4.11.22 3.0.9 4.11.23 3.1.0 4.11.24 3.1.1 4.11.25 3.1.2 4.11.26 3.1.3 4.11.27 3.1.4 4.11.28 3.1.5 4.11.29 3.1.6 4.11.3 3.1.7 4.11.30 3.1.8 4.11.31 3.1.9 4.11.32 3.10.0 4.11.33 3.10.1 4.11.34 3.10.2 4.11.35 3.10.3 4.11.36 3.10.4 4.11.37 3.10.5 4.11.38 3.10.6 4.11.39 3.10.7 4.11.4 3.10.8 4.11.40 3.10.9 4.11.41 3.11.0 4.11.42 3.11.1 4.11.43 3.11.2 4.11.44 3.11.3 4.11.45 3.11.4 4.11.46 3.11.5 4.11.47 3.11.6 4.11.48 3.11.7 4.11.49 3.11.8 4.11.5 3.11.9 4.11.50 3.12.0 4.11.51 3.12.1 4.11.52 3.12.2 4.11.53 3.12.3 4.11.54 3.2.0 4.11.55 3.2.1 4.11.56 3.2.2 4.11.57 3.2.3 4.11.58 3.2.4 4.11.59 3.2.5 4.11.6 3.2.6 4.11.60 3.2.7 4.11.61 3.2.8 4.11.62 3.2.9 4.11.63 3.20.0 4.11.64 3.20.1 4.11.65 3.20.2 4.11.66 3.20.3 4.11.67 3.20.4 4.11.68
premium-addons-for-elementor / widgets / premium-progressbar.php
premium-addons-for-elementor / widgets Last commit date
dep 2 years ago premium-banner.php 2 years ago premium-blog.php 2 years ago premium-button.php 2 years ago premium-carousel.php 2 years ago premium-contactform.php 2 years ago premium-countdown.php 2 years ago premium-counter.php 2 years ago premium-dual-header.php 2 years ago premium-fancytext.php 2 years ago premium-grid.php 2 years ago premium-icon-list.php 2 years ago premium-image-button.php 2 years ago premium-image-scroll.php 2 years ago premium-image-separator.php 2 years ago premium-lottie.php 2 years ago premium-maps.php 2 years ago premium-media-wheel.php 2 years ago premium-modalbox.php 2 years ago premium-nav-menu.php 2 years ago premium-notifications.php 2 years ago premium-person.php 2 years ago premium-pinterest-feed.php 2 years ago premium-post-ticker.php 2 years ago premium-pricing-table.php 2 years ago premium-progressbar.php 2 years ago premium-svg-drawer.php 2 years ago premium-tcloud.php 2 years ago premium-testimonials.php 2 years ago premium-tiktok-feed.php 2 years ago premium-title.php 2 years ago premium-videobox.php 2 years ago premium-vscroll.php 2 years ago premium-weather.php 2 years ago premium-world-clock.php 2 years ago
premium-progressbar.php
1952 lines
1 <?php
2 /**
3 * Premium Progress Bar.
4 */
5
6 namespace PremiumAddons\Widgets;
7
8 // Elementor Classes.
9 use Elementor\Widget_Base;
10 use Elementor\Utils;
11 use Elementor\Controls_Manager;
12 use Elementor\Icons_Manager;
13 use Elementor\Repeater;
14 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
15 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
16 use Elementor\Group_Control_Typography;
17 use Elementor\Group_Control_Background;
18 use Elementor\Group_Control_Border;
19
20 // PremiumAddons Classes.
21 use PremiumAddons\Admin\Includes\Admin_Helper;
22 use PremiumAddons\Includes\Helper_Functions;
23
24 if ( ! defined( 'ABSPATH' ) ) {
25 exit; // If this file is called directly, abort.
26 }
27
28 /**
29 * Class Premium_Progressbar
30 */
31 class Premium_Progressbar extends Widget_Base {
32
33 /**
34 * Check Icon Draw Option.
35 *
36 * @since 4.9.26
37 * @access public
38 */
39 public function check_icon_draw() {
40 $is_enabled = Admin_Helper::check_svg_draw( 'premium-progressbar' );
41 return $is_enabled;
42 }
43
44 /**
45 * Retrieve Widget Name.
46 *
47 * @since 1.0.0
48 * @access public
49 */
50 public function get_name() {
51 return 'premium-addon-progressbar';
52 }
53
54 /**
55 * Retrieve Widget Title.
56 *
57 * @since 1.0.0
58 * @access public
59 */
60 public function get_title() {
61 return __( 'Progress Bar', 'premium-addons-for-elementor' );
62 }
63
64 /**
65 * Retrieve Widget Icon.
66 *
67 * @since 1.0.0
68 * @access public
69 *
70 * @return string widget icon.
71 */
72 public function get_icon() {
73 return 'pa-progress-bar';
74 }
75
76 /**
77 * Retrieve Widget Categories.
78 *
79 * @since 1.5.1
80 * @access public
81 *
82 * @return array Widget categories.
83 */
84 public function get_categories() {
85 return array( 'premium-elements' );
86 }
87
88 /**
89 * Retrieve Widget Dependent CSS.
90 *
91 * @since 1.0.0
92 * @access public
93 *
94 * @return array CSS style handles.
95 */
96 public function get_style_depends() {
97 return array(
98 'premium-addons',
99 );
100 }
101
102 /**
103 * Retrieve Widget Dependent JS.
104 *
105 * @since 1.0.0
106 * @access public
107 *
108 * @return array JS script handles.
109 */
110 public function get_script_depends() {
111
112 $draw_scripts = $this->check_icon_draw() ? array(
113 'pa-fontawesome-all',
114 'pa-tweenmax',
115 'pa-motionpath',
116 ) : array();
117
118 return array_merge(
119 $draw_scripts,
120 array(
121 'elementor-waypoints',
122 'lottie-js',
123 'premium-addons',
124 )
125 );
126
127 }
128
129 /**
130 * Retrieve Widget Keywords.
131 *
132 * @since 1.0.0
133 * @access public
134 *
135 * @return string Widget keywords.
136 */
137 public function get_keywords() {
138 return array( 'pa', 'premium', 'circle', 'chart', 'line', 'graph', 'percent' );
139 }
140
141 /**
142 * Retrieve Widget Support URL.
143 *
144 * @access public
145 *
146 * @return string support URL.
147 */
148 public function get_custom_help_url() {
149 return 'https://premiumaddons.com/support/';
150 }
151
152 /**
153 * Register Progress Bar controls.
154 *
155 * @since 1.0.0
156 * @access protected
157 */
158 protected function register_controls() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
159
160 $draw_icon = $this->check_icon_draw();
161
162 $this->start_controls_section(
163 'premium_progressbar_labels',
164 array(
165 'label' => __( 'Progress Bar Settings', 'premium-addons-for-elementor' ),
166 )
167 );
168
169 $this->add_control(
170 'layout_type',
171 array(
172 'label' => __( 'Type', 'premium-addons-for-elementor' ),
173 'type' => Controls_Manager::SELECT,
174 'options' => array(
175 'line' => __( 'Line', 'premium-addons-for-elementor' ),
176 'half-circle' => __( 'Half Circle', 'premium-addons-for-elementor' ),
177 'circle' => __( 'Circle', 'premium-addons-for-elementor' ),
178 'dots' => __( 'Dots', 'premium-addons-for-elementor' ),
179 ),
180 'default' => 'line',
181 'label_block' => true,
182 )
183 );
184
185 $this->add_responsive_control(
186 'dot_size',
187 array(
188 'label' => __( 'Dot Size', 'premium-addons-for-elementor' ),
189 'type' => Controls_Manager::SLIDER,
190 'range' => array(
191 'px' => array(
192 'min' => 1,
193 'max' => 60,
194 ),
195 ),
196 'default' => array(
197 'size' => 25,
198 'unit' => 'px',
199 ),
200 'condition' => array(
201 'layout_type' => 'dots',
202 ),
203 'render_type' => 'template',
204 'selectors' => array(
205 '{{WRAPPER}} .progress-segment' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}',
206 ),
207 )
208 );
209
210 $this->add_responsive_control(
211 'dot_spacing',
212 array(
213 'label' => __( 'Spacing', 'premium-addons-for-elementor' ),
214 'type' => Controls_Manager::SLIDER,
215 'range' => array(
216 'px' => array(
217 'min' => 1,
218 'max' => 10,
219 ),
220 ),
221 'default' => array(
222 'size' => 8,
223 'unit' => 'px',
224 ),
225 'condition' => array(
226 'layout_type' => 'dots',
227 ),
228 'render_type' => 'template',
229 'selectors' => array(
230 '{{WRAPPER}} .progress-segment:not(:first-child):not(:last-child)' => 'margin-right: calc( {{SIZE}}{{UNIT}}/2 ); margin-left: calc( {{SIZE}}{{UNIT}}/2 )',
231 '{{WRAPPER}} .progress-segment:first-child' => 'margin-right: calc( {{SIZE}}{{UNIT}}/2 )',
232 '{{WRAPPER}} .progress-segment:last-child' => 'margin-left: calc( {{SIZE}}{{UNIT}}/2 )',
233 ),
234 )
235 );
236
237 $this->add_responsive_control(
238 'circle_size',
239 array(
240 'label' => __( 'Size', 'premium-addons-for-elementor' ),
241 'type' => Controls_Manager::SLIDER,
242 'range' => array(
243 'px' => array(
244 'min' => 50,
245 'max' => 500,
246 'step' => 1,
247 ),
248 ),
249 'default' => array(
250 'size' => 200,
251 ),
252 'selectors' => array(
253 '{{WRAPPER}} .premium-progressbar-circle-wrap, {{WRAPPER}} .premium-progressbar-hf-container' => 'width: {{SIZE}}px; height: {{SIZE}}px',
254 '{{WRAPPER}} .premium-progressbar-hf-circle-wrap' => 'width: {{SIZE}}{{UNIT}}; height: calc({{SIZE}} / 2 * 1{{UNIT}});',
255 '{{WRAPPER}} .premium-progressbar-hf-labels' => 'width: {{SIZE}}{{UNIT}};',
256 ),
257 'condition' => array(
258 'layout_type' => array( 'half-circle', 'circle' ),
259 ),
260 )
261 );
262
263 $this->add_control(
264 'premium_progressbar_select_label',
265 array(
266 'label' => __( 'Labels', 'premium-addons-for-elementor' ),
267 'type' => Controls_Manager::SELECT,
268 'default' => 'left_right_labels',
269 'options' => array(
270 'left_right_labels' => __( 'Left & Right Labels', 'premium-addons-for-elementor' ),
271 'more_labels' => __( 'Multiple Labels', 'premium-addons-for-elementor' ),
272 ),
273 'label_block' => true,
274 'condition' => array(
275 'layout_type!' => array( 'half-circle', 'circle' ),
276 ),
277 )
278 );
279
280 $this->add_control(
281 'premium_progressbar_left_label',
282 array(
283 'label' => __( 'Left Label', 'premium-addons-for-elementor' ),
284 'type' => Controls_Manager::TEXT,
285 'dynamic' => array( 'active' => true ),
286 'default' => __( 'My Skill', 'premium-addons-for-elementor' ),
287 'label_block' => true,
288 'condition' => array(
289 'premium_progressbar_select_label' => 'left_right_labels',
290 ),
291 )
292 );
293
294 $this->add_responsive_control(
295 'title_width',
296 array(
297 'label' => __( 'Title Max Width', 'premium-addons-for-elementor' ),
298 'type' => Controls_Manager::SLIDER,
299 'size_units' => array( 'px', '%', 'em' ),
300 'selectors' => array(
301 '{{WRAPPER}} .premium-progressbar-left-label' => 'max-width: {{SIZE}}{{UNIT}}',
302 ),
303 'condition' => array(
304 'layout_type' => array( 'half-circle', 'circle' ),
305 ),
306 )
307 );
308
309 $this->add_control(
310 'premium_progressbar_right_label',
311 array(
312 'label' => __( 'Right Label', 'premium-addons-for-elementor' ),
313 'type' => Controls_Manager::TEXT,
314 'dynamic' => array( 'active' => true ),
315 'default' => __( '50%', 'premium-addons-for-elementor' ),
316 'label_block' => true,
317 'condition' => array(
318 'premium_progressbar_select_label' => 'left_right_labels',
319 'layout_type!' => array( 'half-circle', 'circle' ),
320 ),
321 )
322 );
323
324 $common_conditions = array(
325 'layout_type' => array( 'half-circle', 'circle' ),
326 );
327
328 $this->add_control(
329 'icon_type',
330 array(
331 'label' => __( 'Icon Type', 'premium-addons-for-elementor' ),
332 'type' => Controls_Manager::SELECT,
333 'options' => array(
334 'icon' => __( 'Icon', 'premium-addons-for-elementor' ),
335 'image' => __( 'Custom Image', 'premium-addons-for-elementor' ),
336 'animation' => __( 'Lottie Animation', 'premium-addons-for-elementor' ),
337 'svg' => __( 'SVG Code', 'premium-addons-for-elementor' ),
338 ),
339 'default' => 'icon',
340 'separator' => 'before',
341 'condition' => $common_conditions,
342 )
343 );
344
345 $this->add_control(
346 'icon_select',
347 array(
348 'label' => __( 'Select an Icon', 'premium-addons-for-elementor' ),
349 'type' => Controls_Manager::ICONS,
350 'condition' => array_merge(
351 $common_conditions,
352 array(
353 'icon_type' => 'icon',
354 )
355 ),
356 )
357 );
358
359 $this->add_control(
360 'image_upload',
361 array(
362 'label' => __( 'Upload Image', 'premium-addons-for-elementor' ),
363 'type' => Controls_Manager::MEDIA,
364 'default' => array(
365 'url' => Utils::get_placeholder_image_src(),
366 ),
367 'condition' => array_merge(
368 $common_conditions,
369 array(
370 'icon_type' => 'image',
371 )
372 ),
373 )
374 );
375
376 $this->add_control(
377 'custom_svg',
378 array(
379 'label' => __( 'SVG Code', 'premium-addons-for-elementor' ),
380 'type' => Controls_Manager::TEXTAREA,
381 'description' => 'You can use these sites to create SVGs: <a href="https://danmarshall.github.io/google-font-to-svg-path/" target="_blank">Google Fonts</a> and <a href="https://boxy-svg.com/" target="_blank">Boxy SVG</a>',
382 'condition' => array_merge(
383 $common_conditions,
384 array(
385 'icon_type' => 'svg',
386 )
387 ),
388 )
389 );
390
391 $this->add_control(
392 'lottie_url',
393 array(
394 'label' => __( 'Animation JSON URL', 'premium-addons-for-elementor' ),
395 'type' => Controls_Manager::TEXT,
396 'dynamic' => array( 'active' => true ),
397 'description' => 'Get JSON code URL from <a href="https://lottiefiles.com/" target="_blank">here</a>',
398 'label_block' => true,
399 'condition' => array_merge(
400 $common_conditions,
401 array(
402 'icon_type' => 'animation',
403 )
404 ),
405 )
406 );
407
408 $this->add_control(
409 'draw_svg',
410 array(
411 'label' => __( 'Draw Icon', 'premium-addons-for-elementor' ),
412 'type' => Controls_Manager::SWITCHER,
413 'classes' => $draw_icon ? '' : 'editor-pa-control-disabled',
414 'condition' => array_merge(
415 $common_conditions,
416 array(
417 'icon_type' => array( 'icon', 'svg' ),
418 'icon_select[library]!' => 'svg',
419 )
420 ),
421 )
422 );
423
424 $animation_conds = array(
425 'terms' => array(
426 array(
427 'relation' => 'or',
428 'terms' => array(
429 array(
430 'name' => 'layout_type',
431 'value' => 'half-circle',
432 ),
433 array(
434 'name' => 'layout_type',
435 'value' => 'circle',
436 ),
437 ),
438 ),
439 array(
440 'relation' => 'or',
441 'terms' => array(
442 array(
443 'name' => 'icon_type',
444 'value' => 'animation',
445 ),
446 array(
447 'terms' => array(
448 array(
449 'relation' => 'or',
450 'terms' => array(
451 array(
452 'name' => 'icon_type',
453 'value' => 'icon',
454 ),
455 array(
456 'name' => 'icon_type',
457 'value' => 'svg',
458 ),
459 ),
460 ),
461 array(
462 'name' => 'draw_svg',
463 'value' => 'yes',
464 ),
465 ),
466 ),
467 ),
468 ),
469 ),
470 );
471
472 if ( $draw_icon ) {
473 $this->add_control(
474 'path_width',
475 array(
476 'label' => __( 'Path Thickness', 'premium-addons-for-elementor' ),
477 'type' => Controls_Manager::SLIDER,
478 'range' => array(
479 'px' => array(
480 'min' => 0,
481 'max' => 50,
482 'step' => 0.1,
483 ),
484 ),
485 'condition' => array_merge(
486 $common_conditions,
487 array(
488 'icon_type' => array( 'icon', 'svg' ),
489 )
490 ),
491 'selectors' => array(
492 '{{WRAPPER}} .premium-progressbar-circle-content svg *' => 'stroke-width: {{SIZE}}',
493 ),
494 )
495 );
496
497 $this->add_control(
498 'svg_sync',
499 array(
500 'label' => __( 'Draw All Paths Together', 'premium-addons-for-elementor' ),
501 'type' => Controls_Manager::SWITCHER,
502 'condition' => array_merge(
503 $common_conditions,
504 array(
505 'icon_type' => array( 'icon', 'svg' ),
506 'draw_svg' => 'yes',
507 )
508 ),
509 )
510 );
511
512 $this->add_control(
513 'frames',
514 array(
515 'label' => __( 'Speed', 'premium-addons-for-elementor' ),
516 'type' => Controls_Manager::NUMBER,
517 'description' => __( 'Larger value means longer animation duration.', 'premium-addons-for-elementor' ),
518 'default' => 5,
519 'min' => 1,
520 'max' => 100,
521 'condition' => array_merge(
522 $common_conditions,
523 array(
524 'icon_type' => array( 'icon', 'svg' ),
525 'draw_svg' => 'yes',
526 )
527 ),
528 )
529 );
530 } else {
531
532 Helper_Functions::get_draw_svg_notice(
533 $this,
534 'bar',
535 array_merge(
536 $common_conditions,
537 array(
538 'icon_type' => array( 'icon', 'svg' ),
539 'icon_select[library]!' => 'svg',
540 )
541 )
542 );
543
544 }
545
546 $this->add_control(
547 'lottie_loop',
548 array(
549 'label' => __( 'Loop', 'premium-addons-for-elementor' ),
550 'type' => Controls_Manager::SWITCHER,
551 'return_value' => 'true',
552 'default' => 'true',
553 'conditions' => $animation_conds,
554 )
555 );
556
557 $this->add_control(
558 'lottie_reverse',
559 array(
560 'label' => __( 'Reverse', 'premium-addons-for-elementor' ),
561 'type' => Controls_Manager::SWITCHER,
562 'return_value' => 'true',
563 'conditions' => $animation_conds,
564 )
565 );
566
567 if ( $draw_icon ) {
568 $this->add_control(
569 'start_point',
570 array(
571 'label' => __( 'Start Point (%)', 'premium-addons-for-elementor' ),
572 'type' => Controls_Manager::SLIDER,
573 'description' => __( 'Set the point that the SVG should start from.', 'premium-addons-for-elementor' ),
574 'default' => array(
575 'unit' => '%',
576 'size' => 0,
577 ),
578 'condition' => array_merge(
579 $common_conditions,
580 array(
581 'icon_type' => array( 'icon', 'svg' ),
582 'draw_svg' => 'yes',
583 'lottie_reverse!' => 'true',
584 )
585 ),
586 )
587 );
588
589 $this->add_control(
590 'end_point',
591 array(
592 'label' => __( 'End Point (%)', 'premium-addons-for-elementor' ),
593 'type' => Controls_Manager::SLIDER,
594 'description' => __( 'Set the point that the SVG should end at.', 'premium-addons-for-elementor' ),
595 'default' => array(
596 'unit' => '%',
597 'size' => 0,
598 ),
599 'condition' => array_merge(
600 $common_conditions,
601 array(
602 'icon_type' => array( 'icon', 'svg' ),
603 'draw_svg' => 'yes',
604 'lottie_reverse' => 'true',
605 )
606 ),
607
608 )
609 );
610
611 $this->add_control(
612 'svg_hover',
613 array(
614 'label' => __( 'Only Play on Hover', 'premium-addons-for-elementor' ),
615 'type' => Controls_Manager::SWITCHER,
616 'return_value' => 'true',
617 'condition' => array_merge(
618 $common_conditions,
619 array(
620 'icon_type' => array( 'icon', 'svg' ),
621 'draw_svg' => 'yes',
622 )
623 ),
624 )
625 );
626
627 $this->add_control(
628 'svg_yoyo',
629 array(
630 'label' => __( 'Yoyo Effect', 'premium-addons-for-elementor' ),
631 'type' => Controls_Manager::SWITCHER,
632 'condition' => array_merge(
633 $common_conditions,
634 array(
635 'icon_type' => array( 'icon', 'svg' ),
636 'draw_svg' => 'yes',
637 'lottie_loop' => 'true',
638 )
639 ),
640 )
641 );
642 }
643
644 $this->add_responsive_control(
645 'icon_size',
646 array(
647 'label' => __( 'Icon Size', 'premium-addons-for-elementor' ),
648 'type' => Controls_Manager::SLIDER,
649 'condition' => array_merge(
650 $common_conditions,
651 array(
652 'icon_type!' => 'svg',
653 )
654 ),
655 'default' => array(
656 'unit' => 'px',
657 'size' => 30,
658 ),
659 'selectors' => array(
660 '{{WRAPPER}} .premium-progressbar-circle-content i' => 'font-size: {{SIZE}}px',
661 '{{WRAPPER}} .premium-progressbar-circle-content svg, {{WRAPPER}} .premium-progressbar-circle-content img' => 'width: {{SIZE}}px !important; height: {{SIZE}}px !important',
662 ),
663 )
664 );
665
666 $this->add_responsive_control(
667 'svg_icon_width',
668 array(
669 'label' => __( 'Width', 'premium-addons-for-elementor' ),
670 'type' => Controls_Manager::SLIDER,
671 'size_units' => array( 'px', 'em', '%' ),
672 'range' => array(
673 'px' => array(
674 'min' => 1,
675 'max' => 600,
676 ),
677 'em' => array(
678 'min' => 1,
679 'max' => 30,
680 ),
681 ),
682 'default' => array(
683 'size' => 100,
684 'unit' => 'px',
685 ),
686 'condition' => array_merge(
687 $common_conditions,
688 array(
689 'icon_type' => 'svg',
690 )
691 ),
692 'selectors' => array(
693 '{{WRAPPER}} .premium-progressbar-circle-content svg' => 'width: {{SIZE}}{{UNIT}};',
694 ),
695 )
696 );
697
698 $this->add_responsive_control(
699 'svg_icon_height',
700 array(
701 'label' => __( 'Height', 'premium-addons-for-elementor' ),
702 'type' => Controls_Manager::SLIDER,
703 'size_units' => array( 'px', 'em' ),
704 'range' => array(
705 'px' => array(
706 'min' => 1,
707 'max' => 300,
708 ),
709 'em' => array(
710 'min' => 1,
711 'max' => 30,
712 ),
713 ),
714 'condition' => array_merge(
715 $common_conditions,
716 array(
717 'icon_type' => 'svg',
718 )
719 ),
720 'selectors' => array(
721 '{{WRAPPER}} .premium-progressbar-circle-content svg' => 'height: {{SIZE}}{{UNIT}}',
722 ),
723 )
724 );
725
726 $this->add_control(
727 'show_percentage_value',
728 array(
729 'label' => __( 'Show Percentage Value', 'premium-addons-for-elementor' ),
730 'type' => Controls_Manager::SWITCHER,
731 'default' => 'yes',
732 'separator' => 'before',
733 'condition' => array(
734 'layout_type' => array( 'half-circle', 'circle' ),
735 ),
736 )
737 );
738
739 $repeater = new REPEATER();
740
741 $repeater->add_control(
742 'text',
743 array(
744 'label' => __( 'Label', 'premium-addons-for-elementor' ),
745 'type' => Controls_Manager::TEXT,
746 'dynamic' => array( 'active' => true ),
747 'label_block' => true,
748 'placeholder' => __( 'label', 'premium-addons-for-elementor' ),
749 'default' => __( 'label', 'premium-addons-for-elementor' ),
750 )
751 );
752
753 $repeater->add_control(
754 'number',
755 array(
756 'label' => __( 'Percentage', 'premium-addons-for-elementor' ),
757 'dynamic' => array( 'active' => true ),
758 'type' => Controls_Manager::TEXT,
759 'default' => 50,
760 )
761 );
762
763 $this->add_control(
764 'premium_progressbar_multiple_label',
765 array(
766 'label' => __( 'Label', 'premium-addons-for-elementor' ),
767 'type' => Controls_Manager::REPEATER,
768 'default' => array(
769 array(
770 'text' => __( 'Label', 'premium-addons-for-elementor' ),
771 'number' => 50,
772 ),
773 ),
774 'fields' => $repeater->get_controls(),
775 'condition' => array(
776 'premium_progressbar_select_label' => 'more_labels',
777 'layout_type!' => 'circle',
778 ),
779 )
780 );
781
782 $this->add_control(
783 'premium_progress_bar_space_percentage_switcher',
784 array(
785 'label' => __( 'Enable Percentage', 'premium-addons-for-elementor' ),
786 'type' => Controls_Manager::SWITCHER,
787 'default' => 'yes',
788 'description' => __( 'Enable percentage for labels', 'premium-addons-for-elementor' ),
789 'condition' => array(
790 'premium_progressbar_select_label' => 'more_labels',
791 'layout_type!' => 'circle',
792 ),
793 )
794 );
795
796 $this->add_control(
797 'premium_progressbar_select_label_icon',
798 array(
799 'label' => __( 'Labels Indicator', 'premium-addons-for-elementor' ),
800 'type' => Controls_Manager::SELECT,
801 'default' => 'line_pin',
802 'options' => array(
803 '' => __( 'None', 'premium-addons-for-elementor' ),
804 'line_pin' => __( 'Pin', 'premium-addons-for-elementor' ),
805 'arrow' => __( 'Arrow', 'premium-addons-for-elementor' ),
806 ),
807 'condition' => array(
808 'premium_progressbar_select_label' => 'more_labels',
809 'layout_type!' => 'circle',
810 ),
811 )
812 );
813
814 $this->add_control(
815 'premium_progressbar_more_labels_align',
816 array(
817 'label' => __( 'Labels Alignment', 'premuim-addons-for-elementor' ),
818 'type' => Controls_Manager::CHOOSE,
819 'options' => array(
820 'left' => array(
821 'title' => __( 'Left', 'premium-addons-for-elementor' ),
822 'icon' => 'eicon-text-align-left',
823 ),
824 'center' => array(
825 'title' => __( 'Center', 'premium-addons-for-elementor' ),
826 'icon' => 'eicon-text-align-center',
827 ),
828 'right' => array(
829 'title' => __( 'Right', 'premium-addons-for-elementor' ),
830 'icon' => 'eicon-text-align-right',
831 ),
832 ),
833 'default' => 'center',
834 'condition' => array(
835 'premium_progressbar_select_label' => 'more_labels',
836 'layout_type!' => 'circle',
837 ),
838 )
839 );
840
841 $this->add_control(
842 'premium_progressbar_progress_percentage',
843 array(
844 'label' => __( 'Value', 'premium-addons-for-elementor' ),
845 'type' => Controls_Manager::TEXT,
846 'dynamic' => array( 'active' => true ),
847 'default' => 50,
848 )
849 );
850
851 $this->add_control(
852 'premium_progressbar_progress_style',
853 array(
854 'label' => __( 'Style', 'premium-addons-for-elementor' ),
855 'type' => Controls_Manager::SELECT,
856 'default' => 'solid',
857 'options' => array(
858 'solid' => __( 'Solid', 'premium-addons-for-elementor' ),
859 'stripped' => __( 'Striped', 'premium-addons-for-elementor' ),
860 'gradient' => __( 'Animated Gradient', 'premium-addons-for-elementor' ),
861 ),
862 'condition' => array(
863 'layout_type' => 'line',
864 ),
865 )
866 );
867
868 $this->add_control(
869 'premium_progressbar_speed',
870 array(
871 'label' => __( 'Speed (milliseconds)', 'premium-addons-for-elementor' ),
872 'type' => Controls_Manager::NUMBER,
873 )
874 );
875
876 $this->add_control(
877 'premium_progressbar_progress_animation',
878 array(
879 'label' => __( 'Animated', 'premium-addons-for-elementor' ),
880 'type' => Controls_Manager::SWITCHER,
881 'condition' => array(
882 'premium_progressbar_progress_style' => 'stripped',
883 'layout_type' => 'line',
884 ),
885 )
886 );
887
888 $this->add_control(
889 'gradient_colors',
890 array(
891 'label' => __( 'Gradient Colors', 'premium-addons-for-elementor' ),
892 'type' => Controls_Manager::TEXT,
893 'description' => __( 'Enter Colors separated with \' , \'.', 'premium-addons-for-elementor' ),
894 'default' => '#6EC1E4,#54595F',
895 'label_block' => true,
896 'condition' => array(
897 'layout_type' => 'line',
898 'premium_progressbar_progress_style' => 'gradient',
899 ),
900 )
901 );
902
903 $this->add_control(
904 'half_prefix_label',
905 array(
906 'label' => __( 'Prefix Label', 'premium-addons-for-elementor' ),
907 'type' => Controls_Manager::TEXT,
908 'dynamic' => array( 'active' => true ),
909 'default' => __( '0', 'premium-addons-for-elementor' ),
910 'condition' => array(
911 'layout_type' => 'half-circle',
912 ),
913 'separator' => 'before',
914 )
915 );
916
917 $this->add_control(
918 'half_suffix_label',
919 array(
920 'label' => __( 'Suffix Label', 'premium-addons-for-elementor' ),
921 'type' => Controls_Manager::TEXT,
922 'dynamic' => array( 'active' => true ),
923 'default' => __( '100%', 'premium-addons-for-elementor' ),
924 'condition' => array(
925 'layout_type' => 'half-circle',
926 ),
927 )
928 );
929
930 $this->add_control(
931 'magic_scroll',
932 array(
933 'label' => __( 'Use With Magic Scroll', 'premium-addons-for-elementor' ),
934 'type' => Controls_Manager::SWITCHER,
935 'description' => __( 'Enable this option if you want to animate the progress bar using ', 'premium-addons-for-elementor' ) . '<a href="https://premiumaddons.com/elementor-magic-scroll-global-addon/" target="_blank">Magic Scroll addon.</a>',
936 'condition' => array(
937 'layout_type!' => 'dots',
938 ),
939 )
940 );
941
942 $this->end_controls_section();
943
944 $this->start_controls_section(
945 'section_pa_docs',
946 array(
947 'label' => __( 'Helpful Documentations', 'premium-addons-for-elementor' ),
948 )
949 );
950
951 $doc1_url = Helper_Functions::get_campaign_link( 'https://premiumaddons.com/docs/premium-progress-bar-widget/', 'editor-page', 'wp-editor', 'get-support' );
952
953 $this->add_control(
954 'doc_1',
955 array(
956 'type' => Controls_Manager::RAW_HTML,
957 'raw' => sprintf( '<a href="%s" target="_blank">%s</a>', $doc1_url, __( 'Gettings started »', 'premium-addons-for-elementor' ) ),
958 'content_classes' => 'editor-pa-doc',
959 )
960 );
961
962 $this->end_controls_section();
963
964 $this->start_controls_section(
965 'premium_progressbar_progress_bar_settings',
966 array(
967 'label' => __( 'Progress Bar', 'premium-addons-for-elementor' ),
968 'tab' => Controls_Manager::TAB_STYLE,
969 )
970 );
971
972 $this->add_control(
973 'premium_progressbar_progress_bar_height',
974 array(
975 'label' => __( 'Height', 'premium-addons-for-elementor' ),
976 'type' => Controls_Manager::SLIDER,
977 'default' => array(
978 'size' => 25,
979 ),
980 'label_block' => true,
981 'selectors' => array(
982 '{{WRAPPER}} .premium-progressbar-bar-wrap, {{WRAPPER}} .premium-progressbar-bar' => 'height: {{SIZE}}px;',
983 ),
984 'condition' => array(
985 'layout_type' => 'line',
986 ),
987 )
988 );
989
990 $this->add_control(
991 'premium_progressbar_progress_bar_radius',
992 array(
993 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
994 'type' => Controls_Manager::SLIDER,
995 'size_units' => array( 'px', '%', 'em' ),
996 'range' => array(
997 'px' => array(
998 'min' => 0,
999 'max' => 60,
1000 ),
1001 ),
1002 'selectors' => array(
1003 '{{WRAPPER}} .premium-progressbar-bar-wrap, {{WRAPPER}} .premium-progressbar-bar, {{WRAPPER}} .progress-segment' => 'border-radius: {{SIZE}}{{UNIT}};',
1004 ),
1005 'condition' => array(
1006 'layout_type!' => array( 'half-circle', 'circle' ),
1007 ),
1008 )
1009 );
1010
1011 $this->add_control(
1012 'circle_border_width',
1013 array(
1014 'label' => __( 'Border Width', 'premium-addons-for-elementor' ),
1015 'type' => Controls_Manager::SLIDER,
1016 'selectors' => array(
1017 '{{WRAPPER}} .premium-progressbar-circle-base, {{WRAPPER}} .premium-progressbar-circle div, {{WRAPPER}} .premium-progressbar-circle-inner, {{WRAPPER}} .premium-progressbar-hf-circle-progress' => 'border-width: {{SIZE}}{{UNIT}}',
1018 '{{WRAPPER}} .premium-progressbar-hf-label-left' => 'transform: translateX( calc( {{SIZE}} / 4 * 1{{UNIT}} ) )',
1019 ),
1020 'condition' => array(
1021 'layout_type' => array( 'half-circle', 'circle' ),
1022 ),
1023 )
1024 );
1025
1026 $this->add_control(
1027 'circle_base_border_color',
1028 array(
1029 'label' => __( 'Border Color', 'premium-addons-for-elementor' ),
1030 'type' => Controls_Manager::COLOR,
1031 'global' => array(
1032 'default' => Global_Colors::COLOR_PRIMARY,
1033 ),
1034 'selectors' => array(
1035 '{{WRAPPER}} .premium-progressbar-circle-base, {{WRAPPER}} .premium-progressbar-circle-inner' => 'border-color: {{VALUE}};',
1036 ),
1037 'condition' => array(
1038 'layout_type' => array( 'half-circle', 'circle' ),
1039 ),
1040 )
1041 );
1042
1043 $this->add_control(
1044 'fill_colors_title',
1045 array(
1046 'label' => __( 'Fill', 'premium-addons-for-elementor' ),
1047 'type' => Controls_Manager::HEADING,
1048 )
1049 );
1050
1051 $this->add_group_control(
1052 Group_Control_Background::get_type(),
1053 array(
1054 'name' => 'premium_progressbar_progress_color',
1055 'types' => array( 'classic', 'gradient' ),
1056 'selector' => '{{WRAPPER}} .premium-progressbar-bar, {{WRAPPER}} .segment-inner',
1057 'condition' => array(
1058 'layout_type!' => array( 'half-circle', 'circle' ),
1059 ),
1060 )
1061 );
1062
1063 $this->add_control(
1064 'circle_fill_color',
1065 array(
1066 'label' => __( 'Select Color', 'premium-addons-for-elementor' ),
1067 'type' => Controls_Manager::COLOR,
1068 'global' => array(
1069 'default' => Global_Colors::COLOR_SECONDARY,
1070 ),
1071 'condition' => array(
1072 'layout_type' => array( 'half-circle', 'circle' ),
1073 ),
1074 'selectors' => array(
1075 '{{WRAPPER}} .premium-progressbar-circle div, {{WRAPPER}} .premium-progressbar-hf-circle-progress' => 'border-color: {{VALUE}};',
1076 ),
1077 )
1078 );
1079
1080 $this->add_control(
1081 'base_colors_title',
1082 array(
1083 'label' => __( 'Base', 'premium-addons-for-elementor' ),
1084 'type' => Controls_Manager::HEADING,
1085 )
1086 );
1087
1088 $this->add_group_control(
1089 Group_Control_Background::get_type(),
1090 array(
1091 'name' => 'premium_progressbar_background',
1092 'types' => array( 'classic', 'gradient' ),
1093 'selector' => '{{WRAPPER}} .premium-progressbar-bar-wrap:not(.premium-progressbar-dots), {{WRAPPER}} .premium-progressbar-circle-base, {{WRAPPER}} .progress-segment, {{WRAPPER}} .premium-progressbar-circle-inner',
1094 )
1095 );
1096
1097 $this->add_responsive_control(
1098 'premium_progressbar_container_margin',
1099 array(
1100 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1101 'type' => Controls_Manager::DIMENSIONS,
1102 'size_units' => array( 'px', 'em', '%' ),
1103 'selectors' => array(
1104 '{{WRAPPER}} .premium-progressbar-bar-wrap' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1105 ),
1106 'condition' => array(
1107 'layout_type!' => array( 'half-circle', 'circle' ),
1108 ),
1109 )
1110 );
1111
1112 $this->end_controls_section();
1113
1114 $this->start_controls_section(
1115 'premium_progressbar_labels_section',
1116 array(
1117 'label' => __( 'Labels', 'premium-addons-for-elementor' ),
1118 'tab' => Controls_Manager::TAB_STYLE,
1119 'condition' => array(
1120 'premium_progressbar_select_label' => 'left_right_labels',
1121 ),
1122 )
1123 );
1124
1125 $this->add_control(
1126 'premium_progressbar_left_label_hint',
1127 array(
1128 'label' => __( 'Title', 'premium-addons-for-elementor' ),
1129 'type' => Controls_Manager::HEADING,
1130 )
1131 );
1132
1133 $this->add_control(
1134 'premium_progressbar_left_label_color',
1135 array(
1136 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1137 'type' => Controls_Manager::COLOR,
1138 'global' => array(
1139 'default' => Global_Colors::COLOR_PRIMARY,
1140 ),
1141 'selectors' => array(
1142 '{{WRAPPER}} .premium-progressbar-left-label' => 'color: {{VALUE}};',
1143 ),
1144 )
1145 );
1146
1147 $this->add_group_control(
1148 Group_Control_Typography::get_type(),
1149 array(
1150 'name' => 'left_label_typography',
1151 'global' => array(
1152 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1153 ),
1154 'selector' => '{{WRAPPER}} .premium-progressbar-left-label',
1155 )
1156 );
1157
1158 $this->add_responsive_control(
1159 'premium_progressbar_left_label_margin',
1160 array(
1161 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1162 'type' => Controls_Manager::DIMENSIONS,
1163 'size_units' => array( 'px', 'em', '%' ),
1164 'selectors' => array(
1165 '{{WRAPPER}} .premium-progressbar-left-label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1166 ),
1167 )
1168 );
1169
1170 $this->add_control(
1171 'premium_progressbar_right_label_hint',
1172 array(
1173 'label' => __( 'Percentage', 'premium-addons-for-elementor' ),
1174 'type' => Controls_Manager::HEADING,
1175 'separator' => 'before',
1176 )
1177 );
1178
1179 $this->add_control(
1180 'premium_progressbar_right_label_color',
1181 array(
1182 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1183 'type' => Controls_Manager::COLOR,
1184 'global' => array(
1185 'default' => Global_Colors::COLOR_PRIMARY,
1186 ),
1187 'selectors' => array(
1188 '{{WRAPPER}} .premium-progressbar-right-label' => 'color: {{VALUE}};',
1189 ),
1190 )
1191 );
1192
1193 $this->add_group_control(
1194 Group_Control_Typography::get_type(),
1195 array(
1196 'name' => 'right_label_typography',
1197 'global' => array(
1198 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1199 ),
1200 'selector' => '{{WRAPPER}} .premium-progressbar-right-label',
1201 )
1202 );
1203
1204 $this->add_responsive_control(
1205 'premium_progressbar_right_label_margin',
1206 array(
1207 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1208 'type' => Controls_Manager::DIMENSIONS,
1209 'size_units' => array( 'px', 'em', '%' ),
1210 'selectors' => array(
1211 '{{WRAPPER}} .premium-progressbar-right-label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1212 ),
1213 )
1214 );
1215
1216 $this->end_controls_section();
1217
1218 $this->start_controls_section(
1219 'icon_style',
1220 array(
1221 'label' => __( 'Icon', 'premium-addons-for-elementor' ),
1222 'tab' => Controls_Manager::TAB_STYLE,
1223 'condition' => array(
1224 'layout_type' => array( 'half-circle', 'circle' ),
1225 ),
1226 )
1227 );
1228
1229 $this->add_control(
1230 'icon_color',
1231 array(
1232 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1233 'type' => Controls_Manager::COLOR,
1234 'global' => array(
1235 'default' => Global_Colors::COLOR_PRIMARY,
1236 ),
1237 'selectors' => array(
1238 '{{WRAPPER}} .premium-progressbar-circle-icon' => 'color: {{VALUE}}',
1239 '{{WRAPPER}} .premium-drawable-icon *, {{WRAPPER}} svg:not([class*="premium-"])' => 'fill: {{VALUE}};',
1240 ),
1241 'condition' => array(
1242 'icon_type' => array( 'icon', 'svg' ),
1243 ),
1244 )
1245 );
1246
1247 if ( $draw_icon ) {
1248 $this->add_control(
1249 'stroke_color',
1250 array(
1251 'label' => __( 'Stroke Color', 'premium-addons-for-elementor' ),
1252 'type' => Controls_Manager::COLOR,
1253 'global' => array(
1254 'default' => Global_Colors::COLOR_ACCENT,
1255 ),
1256 'condition' => array(
1257 'icon_type' => array( 'icon', 'svg' ),
1258 ),
1259 'selectors' => array(
1260 '{{WRAPPER}} .premium-drawable-icon *, {{WRAPPER}} svg:not([class*="premium-"])' => 'stroke: {{VALUE}};',
1261 ),
1262 )
1263 );
1264 }
1265
1266 $this->add_control(
1267 'svg_color',
1268 array(
1269 'label' => __( 'After Draw Fill Color', 'premium-addons-for-elementor' ),
1270 'type' => Controls_Manager::COLOR,
1271 'global' => false,
1272 'separator' => 'after',
1273 'condition' => array(
1274 'icon_type' => array( 'icon', 'svg' ),
1275 'draw_svg' => 'yes',
1276 ),
1277 )
1278 );
1279
1280 $this->add_control(
1281 'icon_background_color',
1282 array(
1283 'label' => __( 'Background Color', 'premium-addons-for-elementor' ),
1284 'type' => Controls_Manager::COLOR,
1285 'selectors' => array(
1286 '{{WRAPPER}} .premium-progressbar-circle-icon, {{WRAPPER}} .premium-progressbar-circle-content svg' => 'background-color: {{VALUE}};',
1287 ),
1288 'condition' => array(
1289 'icon_type!' => 'image',
1290 ),
1291 )
1292 );
1293
1294 $this->add_group_control(
1295 Group_Control_Border::get_type(),
1296 array(
1297 'name' => 'icon_border',
1298 'selector' => '{{WRAPPER}} .premium-progressbar-circle-icon, {{WRAPPER}} .premium-progressbar-circle-content svg',
1299 )
1300 );
1301
1302 $this->add_responsive_control(
1303 'icon_border_radius',
1304 array(
1305 'label' => __( 'Border Radius', 'premium-addons-for-elementor' ),
1306 'type' => Controls_Manager::DIMENSIONS,
1307 'size_units' => array( 'px', 'em', '%' ),
1308 'selectors' => array(
1309 '{{WRAPPER}} .premium-progressbar-circle-icon, {{WRAPPER}} .premium-progressbar-circle-content svg' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}}',
1310 ),
1311 )
1312 );
1313
1314 $this->add_responsive_control(
1315 'icon_margin',
1316 array(
1317 'label' => __( 'Margin', 'premium-addons-for-elementor' ),
1318 'type' => Controls_Manager::DIMENSIONS,
1319 'size_units' => array( 'px', 'em', '%' ),
1320 'selectors' => array(
1321 '{{WRAPPER}} .premium-progressbar-circle-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1322 ),
1323 )
1324 );
1325
1326 $this->add_responsive_control(
1327 'icon_padding',
1328 array(
1329 'label' => __( 'Padding', 'premium-addons-for-elementor' ),
1330 'type' => Controls_Manager::DIMENSIONS,
1331 'size_units' => array( 'px', 'em', '%' ),
1332 'selectors' => array(
1333 '{{WRAPPER}} .premium-progressbar-circle-icon, {{WRAPPER}} .premium-progressbar-circle-content svg' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1334 ),
1335 )
1336 );
1337
1338 $this->end_controls_section();
1339
1340 $this->start_controls_section(
1341 'premium_progressbar_multiple_labels_section',
1342 array(
1343 'label' => __( 'Multiple Labels', 'premium-addons-for-elementor' ),
1344 'tab' => Controls_Manager::TAB_STYLE,
1345 'condition' => array(
1346 'premium_progressbar_select_label' => 'more_labels',
1347 ),
1348 )
1349 );
1350
1351 $this->add_control(
1352 'premium_progressbar_multiple_label_color',
1353 array(
1354 'label' => __( 'Labels\' Color', 'premium-addons-for-elementor' ),
1355 'type' => Controls_Manager::COLOR,
1356 'global' => array(
1357 'default' => Global_Colors::COLOR_PRIMARY,
1358 ),
1359 'selectors' => array(
1360 '{{WRAPPER}} .premium-progressbar-center-label' => 'color: {{VALUE}};',
1361 ),
1362 )
1363 );
1364
1365 $this->add_group_control(
1366 Group_Control_Typography::get_type(),
1367 array(
1368 'label' => __( 'Labels\' Typography', 'premium-addons-for-elementor' ),
1369 'name' => 'more_label_typography',
1370 'global' => array(
1371 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1372 ),
1373 'selector' => '{{WRAPPER}} .premium-progressbar-center-label',
1374 )
1375 );
1376
1377 $this->add_control(
1378 'premium_progressbar_value_label_color',
1379 array(
1380 'label' => __( 'Percentage Color', 'premium-addons-for-elementor' ),
1381 'type' => Controls_Manager::COLOR,
1382 'global' => array(
1383 'default' => Global_Colors::COLOR_PRIMARY,
1384 ),
1385 'condition' => array(
1386 'premium_progress_bar_space_percentage_switcher' => 'yes',
1387 ),
1388 'selectors' => array(
1389 '{{WRAPPER}} .premium-progressbar-percentage' => 'color: {{VALUE}};',
1390 ),
1391 )
1392 );
1393
1394 $this->add_group_control(
1395 Group_Control_Typography::get_type(),
1396 array(
1397 'label' => __( 'Percentage Typography', 'premium-addons-for-elementor' ),
1398 'name' => 'percentage_typography',
1399 'condition' => array(
1400 'premium_progress_bar_space_percentage_switcher' => 'yes',
1401 ),
1402 'global' => array(
1403 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1404 ),
1405 'selector' => '{{WRAPPER}} .premium-progressbar-percentage',
1406 )
1407 );
1408
1409 $this->end_controls_section();
1410
1411 $this->start_controls_section(
1412 'premium_progressbar_multiple_labels_arrow_section',
1413 array(
1414 'label' => __( 'Arrow', 'premium-addons-for-elementor' ),
1415 'tab' => Controls_Manager::TAB_STYLE,
1416 'condition' => array(
1417 'premium_progressbar_select_label' => 'more_labels',
1418 'premium_progressbar_select_label_icon' => 'arrow',
1419 ),
1420 )
1421 );
1422
1423 $this->add_control(
1424 'premium_progressbar_arrow_color',
1425 array(
1426 'label' => __( 'Color', 'premium_elementor' ),
1427 'type' => Controls_Manager::COLOR,
1428 'global' => array(
1429 'default' => Global_Colors::COLOR_PRIMARY,
1430 ),
1431 'condition' => array(
1432 'premium_progressbar_select_label_icon' => 'arrow',
1433 ),
1434 'selectors' => array(
1435 '{{WRAPPER}} .premium-progressbar-arrow' => 'color: {{VALUE}}',
1436 ),
1437 )
1438 );
1439
1440 $this->add_responsive_control(
1441 'premium_arrow_size',
1442 array(
1443 'label' => __( 'Size', 'premium-addons-for-elementor' ),
1444 'type' => Controls_Manager::SLIDER,
1445 'size_units' => array( 'px', 'em' ),
1446 'condition' => array(
1447 'premium_progressbar_select_label_icon' => 'arrow',
1448 ),
1449 'selectors' => array(
1450 '{{WRAPPER}} .premium-progressbar-arrow' => 'border-width: {{SIZE}}{{UNIT}};',
1451 ),
1452 )
1453 );
1454
1455 $this->end_controls_section();
1456
1457 $this->start_controls_section(
1458 'premium_progressbar_multiple_labels_pin_section',
1459 array(
1460 'label' => __( 'Indicator', 'premium-addons-for-elementor' ),
1461 'tab' => Controls_Manager::TAB_STYLE,
1462 'condition' => array(
1463 'premium_progressbar_select_label' => 'more_labels',
1464 'premium_progressbar_select_label_icon' => 'line_pin',
1465 ),
1466 )
1467 );
1468
1469 $this->add_control(
1470 'premium_progressbar_line_pin_color',
1471 array(
1472 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1473 'type' => Controls_Manager::COLOR,
1474 'global' => array(
1475 'default' => Global_Colors::COLOR_SECONDARY,
1476 ),
1477 'condition' => array(
1478 'premium_progressbar_select_label_icon' => 'line_pin',
1479 ),
1480 'selectors' => array(
1481 '{{WRAPPER}} .premium-progressbar-pin' => 'border-color: {{VALUE}};',
1482 ),
1483 )
1484 );
1485
1486 $this->add_responsive_control(
1487 'premium_pin_size',
1488 array(
1489 'label' => __( 'Size', 'premium-addons-for-elementor' ),
1490 'type' => Controls_Manager::SLIDER,
1491 'size_units' => array( 'px', 'em' ),
1492 'condition' => array(
1493 'premium_progressbar_select_label_icon' => 'line_pin',
1494 ),
1495 'selectors' => array(
1496 '{{WRAPPER}} .premium-progressbar-pin' => 'border-left-width: {{SIZE}}{{UNIT}};',
1497 ),
1498 )
1499 );
1500
1501 $this->add_responsive_control(
1502 'premium_pin_height',
1503 array(
1504 'label' => __( 'Height', 'premium-addons-for-elementor' ),
1505 'type' => Controls_Manager::SLIDER,
1506 'size_units' => array( 'px', 'em' ),
1507 'condition' => array(
1508 'premium_progressbar_select_label_icon' => 'line_pin',
1509 ),
1510 'selectors' => array(
1511 '{{WRAPPER}} .premium-progressbar-pin' => 'height: {{SIZE}}{{UNIT}};',
1512 ),
1513 )
1514 );
1515
1516 $this->end_controls_section();
1517
1518 $this->start_controls_section(
1519 'prefix_suffix_style',
1520 array(
1521 'label' => __( 'Prefix & Suffix', 'premium-addons-for-elementor' ),
1522 'tab' => Controls_Manager::TAB_STYLE,
1523 'condition' => array(
1524 'layout_type' => 'half-circle',
1525 ),
1526 )
1527 );
1528
1529 $this->add_responsive_control(
1530 'labels_top_spacing',
1531 array(
1532 'label' => __( 'Top Spacing', 'premium-addons-for-elementor' ),
1533 'type' => Controls_Manager::SLIDER,
1534 'range' => array(
1535 'px' => array(
1536 'min' => 1,
1537 'max' => 300,
1538 ),
1539 ),
1540 'selectors' => array(
1541 '{{WRAPPER}} .premium-progressbar-hf-labels' => 'margin-top: {{SIZE}}px;',
1542 ),
1543 )
1544 );
1545
1546 $this->add_control(
1547 'prefix_title',
1548 array(
1549 'label' => __( 'Prefix', 'premium-addons-for-elementor' ),
1550 'type' => Controls_Manager::HEADING,
1551 )
1552 );
1553
1554 $this->add_control(
1555 'prefix_label_color',
1556 array(
1557 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1558 'type' => Controls_Manager::COLOR,
1559 'global' => array(
1560 'default' => Global_Colors::COLOR_PRIMARY,
1561 ),
1562 'selectors' => array(
1563 '{{WRAPPER}} .premium-progressbar-hf-label-left' => 'color: {{VALUE}};',
1564 ),
1565 )
1566 );
1567
1568 $this->add_group_control(
1569 Group_Control_Typography::get_type(),
1570 array(
1571 'name' => 'prefix_label_typo',
1572 'global' => array(
1573 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1574 ),
1575 'selector' => '{{WRAPPER}} .premium-progressbar-hf-label-left',
1576 )
1577 );
1578
1579 $pfx_direction = is_rtl() ? 'right' : 'left';
1580 $sfx_direction = is_rtl() ? 'left' : 'right';
1581
1582 $this->add_responsive_control(
1583 'prefix_spacing',
1584 array(
1585 'label' => __( 'Spacing', 'premium-addons-for-elementor' ),
1586 'type' => Controls_Manager::SLIDER,
1587 'selectors' => array(
1588 '{{WRAPPER}} .premium-progressbar-hf-label-left' => 'margin-' . $pfx_direction . ': {{SIZE}}px;',
1589 ),
1590 )
1591 );
1592
1593 $this->add_control(
1594 'suffix_title',
1595 array(
1596 'label' => __( 'Suffix', 'premium-addons-for-elementor' ),
1597 'type' => Controls_Manager::HEADING,
1598 )
1599 );
1600
1601 $this->add_control(
1602 'suffix_label_color',
1603 array(
1604 'label' => __( 'Color', 'premium-addons-for-elementor' ),
1605 'type' => Controls_Manager::COLOR,
1606 'separator' => 'before',
1607 'global' => array(
1608 'default' => Global_Colors::COLOR_PRIMARY,
1609 ),
1610 'selectors' => array(
1611 '{{WRAPPER}} .premium-progressbar-hf-label-right' => 'color: {{VALUE}};',
1612 ),
1613 )
1614 );
1615
1616 $this->add_group_control(
1617 Group_Control_Typography::get_type(),
1618 array(
1619 'name' => 'suffix_label_typo',
1620 'global' => array(
1621 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1622 ),
1623 'selector' => '{{WRAPPER}} .premium-progressbar-hf-label-right',
1624 )
1625 );
1626
1627 $this->add_responsive_control(
1628 'suffix_spacing',
1629 array(
1630 'label' => __( 'Spacing', 'premium-addons-for-elementor' ),
1631 'type' => Controls_Manager::SLIDER,
1632 'selectors' => array(
1633 '{{WRAPPER}} .premium-progressbar-hf-label-right' => 'margin-' . $sfx_direction . ': {{SIZE}}px;',
1634 ),
1635 )
1636 );
1637
1638 $this->end_controls_section();
1639 }
1640
1641 /**
1642 * Render Progress Bar widget output on the frontend.
1643 *
1644 * Written in PHP and used to generate the final HTML.
1645 *
1646 * @since 1.0.0
1647 * @access protected
1648 */
1649 protected function render() {
1650
1651 $settings = $this->get_settings_for_display();
1652
1653 $this->add_inline_editing_attributes( 'premium_progressbar_left_label' );
1654 $this->add_render_attribute( 'premium_progressbar_left_label', 'class', 'premium-progressbar-left-label' );
1655
1656 $this->add_inline_editing_attributes( 'premium_progressbar_right_label' );
1657 $this->add_render_attribute( 'premium_progressbar_right_label', 'class', 'premium-progressbar-right-label' );
1658
1659 $length = isset( $settings['premium_progressbar_progress_percentage']['size'] ) ? $settings['premium_progressbar_progress_percentage']['size'] : $settings['premium_progressbar_progress_percentage'];
1660
1661 $style = $settings['premium_progressbar_progress_style'];
1662 $type = $settings['layout_type'];
1663
1664 $progressbar_settings = array(
1665 'progress_length' => $length,
1666 'speed' => ! empty( $settings['premium_progressbar_speed'] ) ? $settings['premium_progressbar_speed'] : 1000,
1667 'type' => $type,
1668 'mScroll' => $settings['magic_scroll'],
1669 );
1670
1671 if ( 'dots' === $type ) {
1672 $progressbar_settings['dot'] = $settings['dot_size']['size'];
1673 $progressbar_settings['spacing'] = $settings['dot_spacing']['size'];
1674 }
1675
1676 $this->add_render_attribute( 'progressbar', 'class', 'premium-progressbar-container' );
1677
1678 if ( 'stripped' === $style ) {
1679 $this->add_render_attribute( 'progressbar', 'class', 'premium-progressbar-striped' );
1680 } elseif ( 'gradient' === $style ) {
1681 $this->add_render_attribute( 'progressbar', 'class', 'premium-progressbar-gradient' );
1682 $progressbar_settings['gradient'] = $settings['gradient_colors'];
1683 }
1684
1685 if ( 'yes' === $settings['premium_progressbar_progress_animation'] ) {
1686 $this->add_render_attribute( 'progressbar', 'class', 'premium-progressbar-active' );
1687 }
1688
1689 $this->add_render_attribute( 'progressbar', 'data-settings', wp_json_encode( $progressbar_settings ) );
1690
1691 if ( 'circle' !== $type && 'half-circle' !== $type ) {
1692 $this->add_render_attribute( 'wrap', 'class', 'premium-progressbar-bar-wrap' );
1693
1694 if ( 'dots' === $type ) {
1695 $this->add_render_attribute( 'wrap', 'class', 'premium-progressbar-dots' );
1696 }
1697 } else {
1698
1699 $class = 'half-circle' === $type ? '-hf' : '';
1700
1701 $this->add_render_attribute( 'wrap', 'class', 'premium-progressbar' . $class . '-circle-wrap' );
1702
1703 }
1704
1705 if ( 'yes' === $settings['draw_svg'] ) {
1706
1707 $this->add_render_attribute(
1708 'progressbar',
1709 'class',
1710 array(
1711 'elementor-invisible',
1712 'premium-drawer-hover',
1713 )
1714 );
1715 }
1716
1717 ?>
1718
1719 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'progressbar' ) ); ?>>
1720
1721 <?php if ( 'left_right_labels' === $settings['premium_progressbar_select_label'] ) : ?>
1722 <p <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_progressbar_left_label' ) ); ?>>
1723 <?php echo wp_kses_post( $settings['premium_progressbar_left_label'] ); ?>
1724 </p>
1725 <p <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_progressbar_right_label' ) ); ?>>
1726 <?php echo wp_kses_post( 'yes' !== $settings['magic_scroll'] ? $settings['premium_progressbar_right_label'] : '0%' ); ?>
1727 </p>
1728 <?php endif; ?>
1729
1730 <?php if ( 'more_labels' === $settings['premium_progressbar_select_label'] ) : ?>
1731 <div class="premium-progressbar-container-label" style="position:relative;">
1732 <?php
1733 $direction = is_rtl() ? 'right' : 'left';
1734
1735 foreach ( $settings['premium_progressbar_multiple_label'] as $item ) {
1736 if ( 'center' === $this->get_settings( 'premium_progressbar_more_labels_align' ) ) {
1737 if ( 'yes' === $settings['premium_progress_bar_space_percentage_switcher'] ) {
1738 if ( 'arrow' === $settings['premium_progressbar_select_label_icon'] ) {
1739 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-45%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p><p class="premium-progressbar-arrow" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1740 } elseif ( 'line_pin' === $settings['premium_progressbar_select_label_icon'] ) {
1741 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-45%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p><p class="premium-progressbar-pin" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1742 } else {
1743 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-45%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p></div>';
1744 }
1745 } else {
1746 if ( 'arrow' === $settings['premium_progressbar_select_label_icon'] ) {
1747 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-45%);">' . esc_attr( $item['text'] ) . '</p><p class="premium-progressbar-arrow" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1748 } elseif ( 'line_pin' === $settings['premium_progressbar_select_label_icon'] ) {
1749 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-45%)">' . esc_attr( $item['text'] ) . '</p><p class="premium-progressbar-pin" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1750 } else {
1751 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-45%);">' . esc_attr( $item['text'] ) . '</p></div>';
1752 }
1753 }
1754 } elseif ( 'left' === $this->get_settings( 'premium_progressbar_more_labels_align' ) ) {
1755 if ( 'yes' === $settings['premium_progress_bar_space_percentage_switcher'] ) {
1756 if ( 'arrow' === $settings['premium_progressbar_select_label_icon'] ) {
1757 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-10%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p><p class="premium-progressbar-arrow" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1758 } elseif ( 'line_pin' === $settings['premium_progressbar_select_label_icon'] ) {
1759 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-2%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p><p class="premium-progressbar-pin" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1760 } else {
1761 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-2%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p></div>';
1762 }
1763 } else {
1764 if ( 'arrow' === $settings['premium_progressbar_select_label_icon'] ) {
1765 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-10%);">' . esc_attr( $item['text'] ) . '</p><p class="premium-progressbar-arrow" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1766 } elseif ( 'line_pin' === $settings['premium_progressbar_select_label_icon'] ) {
1767 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-2%);">' . esc_attr( $item['text'] ) . '</p><p class="premium-progressbar-pin" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1768 } else {
1769 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-2%);">' . esc_attr( $item['text'] ) . '</p></div>';
1770 }
1771 }
1772 } else {
1773 if ( 'yes' === $settings['premium_progress_bar_space_percentage_switcher'] ) {
1774 if ( 'arrow' === $settings['premium_progressbar_select_label_icon'] ) {
1775 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-82%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p><p class="premium-progressbar-arrow" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1776 } elseif ( 'line_pin' === $settings['premium_progressbar_select_label_icon'] ) {
1777 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-95%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p><p class="premium-progressbar-pin" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1778 } else {
1779 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-96%);">' . esc_attr( $item['text'] ) . ' <span class="premium-progressbar-percentage">' . esc_attr( $item['number'] ) . '%</span></p></div>';
1780 }
1781 } else {
1782 if ( 'arrow' === $settings['premium_progressbar_select_label_icon'] ) {
1783 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-71%);">' . esc_attr( $item['text'] ) . '</p><p class="premium-progressbar-arrow" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1784 } elseif ( 'line_pin' === $settings['premium_progressbar_select_label_icon'] ) {
1785 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-97%);">' . esc_attr( $item['text'] ) . '</p><p class="premium-progressbar-pin" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%; transform:translateX(50%);"></p></div>';
1786 } else {
1787 echo '<div class="premium-progressbar-multiple-label" style="' . esc_attr( $direction . ':' . $item['number'] ) . '%;"><p class = "premium-progressbar-center-label" style="transform:translateX(-96%);">' . esc_attr( $item['text'] ) . '</p></div>';
1788 }
1789 }
1790 }
1791 }
1792 ?>
1793 </div>
1794 <?php endif; ?>
1795
1796 <?php if ( 'circle' !== $type ) : ?>
1797 <div class="clearfix"></div>
1798 <?php endif; ?>
1799
1800 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'wrap' ) ); ?>>
1801 <?php if ( 'line' === $type ) : ?>
1802 <div class="premium-progressbar-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100"></div>
1803 <?php elseif ( 'circle' === $type ) : ?>
1804
1805 <div class="premium-progressbar-circle-base"></div>
1806 <div class="premium-progressbar-circle">
1807 <div class="premium-progressbar-circle-left"></div>
1808 <div class="premium-progressbar-circle-right"></div>
1809 </div>
1810
1811 <?php $this->render_progressbar_content(); ?>
1812
1813 <?php elseif ( 'half-circle' === $type ) : ?>
1814
1815 <div class="premium-progressbar-hf-container">
1816 <div class="premium-progressbar-hf-circle">
1817 <div class="premium-progressbar-hf-circle-progress"></div>
1818 </div>
1819
1820 <div class="premium-progressbar-circle-inner"></div>
1821 </div>
1822
1823 <?php $this->render_progressbar_content(); ?>
1824
1825 <?php endif; ?>
1826 </div>
1827
1828 <?php if ( 'half-circle' === $type ) : ?>
1829 <div class="premium-progressbar-hf-labels">
1830 <span class="premium-progressbar-hf-label-left">
1831 <?php echo wp_kses_post( $settings['half_prefix_label'] ); ?>
1832 </span>
1833 <span class="premium-progressbar-hf-label-right">
1834 <?php echo wp_kses_post( $settings['half_suffix_label'] ); ?>
1835 </span>
1836 </div>
1837 <?php endif; ?>
1838
1839 </div>
1840
1841 <?php
1842 }
1843
1844 /**
1845 * Get Progressbar Content
1846 *
1847 * @since 4.9.13
1848 * @access private
1849 */
1850 private function render_progressbar_content() {
1851
1852 $settings = $this->get_settings_for_display();
1853
1854 $icon_type = $settings['icon_type'];
1855
1856 if ( 'icon' === $icon_type || 'svg' === $icon_type ) {
1857
1858 $this->add_render_attribute( 'icon', 'class', 'premium-drawable-icon' );
1859
1860 if ( ( 'yes' === $settings['draw_svg'] && 'icon' === $icon_type ) || 'svg' === $icon_type ) {
1861 $this->add_render_attribute( 'icon', 'class', 'premium-progressbar-circle-icon' );
1862 }
1863
1864 if ( 'yes' === $settings['draw_svg'] ) {
1865
1866 if ( 'icon' === $icon_type ) {
1867
1868 $this->add_render_attribute( 'icon', 'class', $settings['icon_select']['value'] );
1869
1870 }
1871
1872 $this->add_render_attribute(
1873 'icon',
1874 array(
1875 'class' => 'premium-svg-drawer',
1876 'data-svg-reverse' => $settings['lottie_reverse'],
1877 'data-svg-loop' => $settings['lottie_loop'],
1878 'data-svg-sync' => $settings['svg_sync'],
1879 'data-svg-hover' => $settings['svg_hover'],
1880 'data-svg-fill' => $settings['svg_color'],
1881 'data-svg-frames' => $settings['frames'],
1882 'data-svg-yoyo' => $settings['svg_yoyo'],
1883 'data-svg-point' => $settings['lottie_reverse'] ? $settings['end_point']['size'] : $settings['start_point']['size'],
1884 )
1885 );
1886
1887 } else {
1888 $this->add_render_attribute( 'icon', 'class', 'premium-svg-nodraw' );
1889 }
1890 } elseif ( 'animation' === $icon_type ) {
1891 $this->add_render_attribute(
1892 'progress_lottie',
1893 array(
1894 'class' => array(
1895 'premium-progressbar-circle-icon',
1896 'premium-lottie-animation',
1897 ),
1898 'data-lottie-url' => $settings['lottie_url'],
1899 'data-lottie-loop' => $settings['lottie_loop'],
1900 'data-lottie-reverse' => $settings['lottie_reverse'],
1901 )
1902 );
1903 }
1904
1905 ?>
1906
1907 <div class="premium-progressbar-circle-content">
1908
1909 <?php
1910 if ( 'icon' === $icon_type ) :
1911 if ( 'yes' !== $settings['draw_svg'] ) :
1912 Icons_Manager::render_icon(
1913 $settings['icon_select'],
1914 array(
1915 'class' => array( 'premium-progressbar-circle-icon', 'premium-svg-nodraw', 'premium-drawable-icon' ),
1916 'aria-hidden' => 'true',
1917 )
1918 );
1919 else :
1920 ?>
1921 <i <?php echo wp_kses_post( $this->get_render_attribute_string( 'icon' ) ); ?>></i>
1922 <?php
1923 endif;
1924
1925 elseif ( 'svg' === $icon_type ) :
1926 ?>
1927 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'icon' ) ); ?>>
1928 <?php $this->print_unescaped_setting( 'custom_svg' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
1929 </div>
1930 <?php
1931 elseif ( 'image' === $icon_type ) :
1932 ?>
1933 <img class="premium-progressbar-circle-icon" src="<?php echo esc_attr( $settings['image_upload']['url'] ); ?>">
1934 <?php else : ?>
1935 <div <?php echo wp_kses_post( $this->get_render_attribute_string( 'progress_lottie' ) ); ?>></div>
1936 <?php endif; ?>
1937
1938 <p <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_progressbar_left_label' ) ); ?>>
1939 <?php echo wp_kses_post( $settings['premium_progressbar_left_label'] ); ?>
1940 </p>
1941 <?php if ( 'yes' === $settings['show_percentage_value'] ) : ?>
1942 <?php if ( 'yes' === $settings['show_percentage_value'] ) : ?>
1943 <p <?php echo wp_kses_post( $this->get_render_attribute_string( 'premium_progressbar_right_label' ) ); ?>>0%</p>
1944 <?php endif; ?>
1945 <?php endif; ?>
1946 </div>
1947
1948 <?php
1949
1950 }
1951 }
1952