start_controls_section( 'section_progress', [ 'label' => esc_html__( 'Progress Bar', 'easy-elements' ), ] ); $this->add_control( 'select_style', [ 'label' => esc_html__( 'Select Style', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'style1', 'options' => [ 'style1' => esc_html__( 'Style 1', 'easy-elements' ), 'style2' => esc_html__( 'Style 2', 'easy-elements' ), ], ] ); $this->add_control( 'title', [ 'label' => esc_html__( 'Title', 'easy-elements' ), 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'placeholder' => esc_html__( 'Web Designer', 'easy-elements' ), 'default' => esc_html__( 'Web Designer', 'easy-elements' ), 'label_block' => true, ] ); $this->add_control( 'easy_percent', [ 'label' => __( 'Percent', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'min' => 0, 'max' => 100, 'default' => 50, ] ); $this->end_controls_section(); $this->start_controls_section( 'rt_progress_style', [ 'label' => esc_html__( 'Progress', 'easy-elements' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'progress_color', [ 'label' => esc_html__( 'Progress Color', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .easyel-progress-bar .progress' => 'background: {{VALUE}}', ], 'condition' => [ 'select_style' => 'style1' ] ] ); $this->add_control( 'progress_bar_color', [ 'label' => esc_html__( 'Progress Bar Color', 'easy-elements' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .easyel-progress-bar .progress-bar' => 'background: {{VALUE}}', ], 'condition' => [ 'select_style' => 'style1' ] ] ); // progress style 2 bg settings $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'progress_color', 'types' => [ 'classic', 'gradient', 'video' ], 'selector' => '{{WRAPPER}} .easyel-progress-bar .progress', 'condition' => [ 'select_style' => 'style2' ] ] ); $this->add_control( 'progress_height', [ 'label' => esc_html__( 'Height', 'easy-elements' ), 'type' => Controls_Manager::SLIDER, 'selectors' => [ '{{WRAPPER}} .easyel-progress-bar .progress' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'progress_radius',[ 'label' => esc_html__( 'Border Radius', 'easy-elements' ), 'type' => Controls_Manager::SLIDER, 'selectors' => [ '{{WRAPPER}} .easyel-progress-bar .progress' => 'border-radius: {{SIZE}}{{UNIT}};', ] ] ); $this->end_controls_section(); $this->start_controls_section( 'title_styles', [ 'label' => esc_html__( 'Title', 'easy-elements' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'title_color', [ 'label' => esc_html__( 'Color', 'easy-elements' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .easyel-progress-bar .title' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'selector' => '{{WRAPPER}} .easyel-progress-bar .title', ] ); $this->end_controls_section(); $this->start_controls_section( 'easy_percent_styles', [ 'label' => esc_html__( 'Percent', 'easy-elements' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'easy_percent_color', [ 'label' => esc_html__( 'Color', 'easy-elements' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .easyel-progress-bar .easy_percent' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'easy_percent_typography', 'selector' => '{{WRAPPER}} .easyel-progress-bar .easy_percent', ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); $easy_percent = !empty($settings['easy_percent']) ? rtrim($settings['easy_percent']) : 0; $title = !empty($settings['title']) ? $settings['title'] : ''; ?>