HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wptrinityconsulting/wp-content/plugins/finbuzz-core/elementor/widgets/rt-counter.php
<?php
/**
 * @author  RadiusTheme
 * @since   1.0
 * @version 1.0
 */

namespace radiustheme\Finbuzz_Core;
use Elementor\Utils;
use Elementor\Controls_Manager;

if ( ! defined( 'ABSPATH' ) ) exit;

class RT_Counter extends Custom_Widget_Base {

	public function __construct( $data = [], $args = null ){
		$this->rt_name = __( 'RT Counter', 'finbuzz-core' );
		$this->rt_base = 'rt-counter';
		parent::__construct( $data, $args );
	}

	private function rt_load_scripts(){
		wp_enqueue_script( 'appear' );
	}

	public function rt_fields(){
		$fields = array(
			array(
				'mode'    => 'section_start',
				'id'      => 'sec_general',
				'label'   => esc_html__( 'General', 'finbuzz-core' ),
			),			
			array(
				'type'    => Controls_Manager::SELECT2,
				'id'      => 'style',
				'label'   => esc_html__( 'Style', 'finbuzz-core' ),
				'options' => array(
					'style1' => esc_html__( 'Style 1', 'finbuzz-core' ),
					'style2' => esc_html__( 'Style 2', 'finbuzz-core' ),
					'style3' => esc_html__( 'Style 3', 'finbuzz-core' ),
					'style4' => esc_html__( 'Style 4', 'finbuzz-core' ),
				),
				'default' => 'style1',
			),
			array(
				'type'    => Controls_Manager::SELECT2,
				'id'      => 'iconalign',
				'label'   => esc_html__( 'Counter Align', 'finbuzz-core' ),
				'options' => array(
					'left' => esc_html__( 'left', 'finbuzz-core' ),
					'center' => esc_html__( 'Center', 'finbuzz-core' ),
					'right' => esc_html__( 'Right', 'finbuzz-core' ),
				),
				'default' => 'left',
				'condition'   => array( 'style' => array('style1','style3')),
			),
			
			/*Icon Start*/
			
			array(
				'type'    => Controls_Manager::TEXT,
				'id'      => 'title',
				'label_block'=>true,
				'label'   => esc_html__( 'Title', 'finbuzz-core' ),
				'default' => esc_html__( 'Organizations & Financial', 'finbuzz-core' ),
			),
			array(
				'type'    => Controls_Manager::NUMBER,
				'id'      => 'number',
				'label'   => esc_html__( 'Counter Number', 'finbuzz-core' ),
				'default' => 3000,
			),
			array(
				'type'    => Controls_Manager::NUMBER,
				'id'      => 'speed',
				'label'   => esc_html__( 'Animation Speed', 'finbuzz-core' ),
				'default' => 2000,
				'description' => esc_html__( 'The total duration of the count animation in milisecond eg. 5000', 'finbuzz-core' ),
			),
			array(
				'type'    => Controls_Manager::DIMENSIONS,
				'id'      => 'content_padding',
				'mode'    => 'responsive',
				'label'   => esc_html__( 'Content Padding', 'finbuzz-core' ),
				'size_units' => [ 'px', '%' ],
				'selectors' => [
					'{{WRAPPER}} .counter-style2 .success-count-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
					'{{WRAPPER}} .counter-style4 .success-count-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
				'condition' =>array('style'=>array('style2','style4'))
			),
			array(
				'type'    => Controls_Manager::DIMENSIONS,
				'id'      => 'title_margin',
				'mode'    => 'responsive',
				'label'   => esc_html__( 'Title Space', 'finbuzz-core' ),
				'size_units' => [ 'px', '%' ],
				'selectors' => [
					'{{WRAPPER}} .counter-style2 .success-count-wrap .count-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
					'{{WRAPPER}} .counter-style4 .success-count-wrap .count-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
				],
				'condition' =>array('style'=>array('style2','style4'))
			),
			array(
				'mode' => 'section_end',
			),
			array(
				'mode'    => 'section_start',
				'id'      => 'sec_colors',
				'label'   => esc_html__( 'Colors', 'finbuzz-core' ),
				'tab'     => Controls_Manager::TAB_STYLE,
			),
			array(
				'type'    => Controls_Manager::COLOR,
				'id'      => 'title_color',
				'label'   => esc_html__( 'Title Color', 'finbuzz-core' ),
				'default' => '',
				'selectors' => array(
					'{{WRAPPER}} .counter-style1 .success-count-wrap .count-text' => 'color: {{VALUE}}',
					'{{WRAPPER}} .counter-style2 .success-count-wrap .count-text' => 'color: {{VALUE}}',
					'{{WRAPPER}} .counter-style3 .success-count-wrap .count-text' => 'color: {{VALUE}}',
					'{{WRAPPER}} .counter-style4 .success-count-wrap .count-text' => 'color: {{VALUE}}',
				),
			),
			array(
				'type'    => Controls_Manager::COLOR,
				'id'      => 'counter_color',
				'label'   => esc_html__( 'Counter Color', 'finbuzz-core' ),
				'default' => '',
				'selectors' => array(
					'{{WRAPPER}} .counter-style1 .success-count-wrap .count' => 'color: {{VALUE}}',
					'{{WRAPPER}} .counter-style2 .success-count-wrap .count' => 'color: {{VALUE}}',
					'{{WRAPPER}} .counter-style3 .success-count-wrap .count' => 'color: {{VALUE}}',
					'{{WRAPPER}} .counter-style4 .success-count-wrap .count' => 'color: {{VALUE}}',
				),
			),
			array(
				'type'    => Controls_Manager::COLOR,
				'id'      => 'counter_bg_color',
				'label'   => esc_html__( 'Counter Background', 'finbuzz-core' ),
				'default' => '',
				'selectors' => array(
					'{{WRAPPER}} .counter-style2' => 'background-color: {{VALUE}}',
					'{{WRAPPER}} .counter-style4' => 'background-color: {{VALUE}}',
				),
				'condition'=>array('style'=>array('style2','style4'))
			),
			array(
				'type'    => Controls_Manager::NUMBER,
				'id'      => 'title_size',
				'mode'       => 'responsive',
				'label'   => esc_html__( 'Title Font Size', 'finbuzz-core' ),
				'default' => '',
				'selectors' => array(
					'{{WRAPPER}} .counter-style1 .success-count-wrap .count-text' => 'font-size: {{VALUE}}px',
					'{{WRAPPER}} .counter-style2 .success-count-wrap .count-text' => 'font-size: {{VALUE}}px',
					'{{WRAPPER}} .counter-style3 .success-count-wrap .count-text' => 'font-size: {{VALUE}}px',
					'{{WRAPPER}} .counter-style4 .success-count-wrap .count-text' => 'font-size: {{VALUE}}px',
				),
			),
			array(
				'type'    => Controls_Manager::NUMBER,
				'id'      => 'counter_size',
				'mode'    => 'responsive',
				'label'   => esc_html__( 'Counter Font Size', 'finbuzz-core' ),
				'default' => '',
				'selectors' => array(
					'{{WRAPPER}} .counter-style1 .success-count-wrap .count' => 'font-size: {{VALUE}}px',
					'{{WRAPPER}} .counter-style2 .success-count-wrap .count' => 'font-size: {{VALUE}}px',
					'{{WRAPPER}} .counter-style3 .success-count-wrap .count' => 'font-size: {{VALUE}}px',
					'{{WRAPPER}} .counter-style4 .success-count-wrap .count' => 'font-size: {{VALUE}}px',
				),
			),
			array(
				'mode' => 'section_end',
			),
		);
		return $fields;
	}

	protected function render() {
		$data = $this->get_settings();
		$this->rt_load_scripts();
		switch ( $data['style'] ) {
			case 'style4':
			$template = 'counter-4';
			break;
			case 'style3':
			$template = 'counter-3';
			break;
			case 'style2':
			$template = 'counter-2';
			break;
			default:
			$template = 'counter-1';
			break;
		}

		return $this->rt_template( $template, $data );
	}
}