D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
proc
/
self
/
cwd
/
wp-content
/
plugins
/
aeen-core
/
elementor
/
progress-box
/
Filename :
class.php
back
Copy
<?php /** * This file can be overridden by copying it to yourtheme/elementor-custom/title/class.php * * @author RadiusTheme * @since 1.0 * @version 1.0 */ namespace radiustheme\Aeen_Core; use Elementor\Widget_Base; use Elementor\Controls_Manager; use Elementor\Group_Control_Typography; use Elementor\Group_Control_Background; if ( ! defined( 'ABSPATH' ) ) exit; class Progress_Box extends Custom_Widget_Base { public function __construct( $data = [], $args = null ){ $this->rt_name = __( 'RT Progress Box', 'aeen-core' ); $this->rt_base = 'rt-prograss-box'; parent::__construct( $data, $args ); } public function rt_fields(){ $repeater = new \Elementor\Repeater(); $repeater->add_control( 'progress_number', [ 'type' => Controls_Manager::NUMBER, 'label' => esc_html__( 'Counter Number', 'aeen-core' ), 'default' => __( '1825', 'aeen-core' ), ] ); $repeater->add_control( 'progress_title', [ 'type' => Controls_Manager::TEXT, 'label' => esc_html__( 'Title', 'aeen-core' ), 'default' => esc_html__( 'Completed Works', 'aeen-core' ), ] ); $repeater->add_control( 'animation_delay', [ 'label' =>esc_html__( 'Animation Delay', 'aeen-core' ), 'type' => Controls_Manager::NUMBER, 'default' => 0.2, 'description' =>esc_html__( 'Animation delay in second', 'aeen-core' ), ] ); $repeater->add_control( 'box_background', [ 'label' =>esc_html__( 'Animation Delay', 'aeen-core' ), 'type' => Controls_Manager::SWITCHER, 'description' => esc_html__( 'Animation delay in second', 'aeen-core' ), 'label' => esc_html__( 'Background Color', 'aeen-core' ), 'label_on' => esc_html__( 'On', 'aeen-core' ), 'label_off' => esc_html__( 'Off', 'aeen-core' ), 'default' => 'no', 'description' => esc_html__( 'Change Background Color', 'aeen-core' ), ] ); $fields = array( array( 'mode' => 'section_start', 'id' => 'sec_general', 'label' => esc_html__( 'General', 'aeen-core' ), ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'layout', 'label' => esc_html__( 'Layout', 'aeen-core' ), 'options' => array( 'layout1' => esc_html__( 'Layout 1', 'aeen-core' ), 'layout2' => esc_html__( 'Layout 2', 'aeen-core' ), 'layout3' => esc_html__( 'Layout 3', 'aeen-core' ), ), 'default' => 'layout1', ), array( 'type' => Controls_Manager::SELECT2, 'id' => 'icontype', 'label' => esc_html__( 'Icon Type', 'aeen-core' ), 'options' => array( 'icon' => esc_html__( 'Icon', 'aeen-core' ), 'image' => esc_html__( 'Custom Image', 'aeen-core' ), ), 'default' => 'icon', 'condition' => array( 'layout' => array( 'layout1' )), ), array( 'type' => Controls_Manager::ICONS, 'id' => 'icon', 'label' => esc_html__( 'Icon', 'aeen-core' ), 'default' => [ 'value' => 'fas fa-smile-wink', 'library' => 'fa-solid', ], 'condition' => array( 'icontype' => array( 'icon' ), 'layout' => array( 'layout1' )), ), array( 'type' => Controls_Manager::MEDIA, 'id' => 'image', 'label' => esc_html__( 'Image', 'aeen-core' ), 'condition' => array( 'icontype' => array( 'image' ) ), 'description' => esc_html__( 'Recommended image Background', 'aeen-core' ), 'condition' => array( 'icontype' => array( 'image' ), 'layout' => array( 'layout1' )), ), array( 'type' => Controls_Manager::NUMBER, 'id' => 'number', 'label' => esc_html__( 'Counter Number', 'aeen-core' ), 'default' => 1825, 'condition' => array( 'layout' => array( 'layout1', 'layout3' )), ), array( 'type' => Controls_Manager::TEXT, 'id' => 'title', 'label' => esc_html__( 'Title', 'aeen-core' ), 'default' => esc_html__( 'Residential Projects', 'aeen-core' ), 'condition' => array( 'layout' => array( 'layout1', 'layout3' )), ), array( 'id' => 'animation_delay', 'label' =>esc_html__( 'Animation Delay', 'aeen-core' ), 'type' => Controls_Manager::NUMBER, 'default' => 0.2, 'description' =>esc_html__( 'Animation delay in second', 'aeen-core' ), 'condition' => array( 'layout' => array( 'layout1' ) ), ), // Progress Style 2 Repeater array ( 'type' => Controls_Manager::REPEATER, 'id' => 'progress_boxes', 'label' => esc_html__( 'Add as many boxes as you want', 'aeen-core' ), 'fields' => $repeater->get_controls(), 'default' => [ ['progress_number' => __( '1825', 'aeen-core' ) ], ['progress_number' => __( '532', 'aeen-core' ) ], ['progress_number' => __( '69', 'aeen-core' ) ], ['progress_number' => __( '27', 'aeen-core' ) ], ] ), array( 'mode' => 'section_end', ), // Title style array( 'mode' => 'section_start', 'id' => 'counter_style', 'label' => esc_html__( 'Icon Style', 'aeen-core' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => array( 'layout' => array( 'layout1' )), ), array( 'type' => Controls_Manager::COLOR, 'id' => 'counter_icon_color', 'label' => __( 'Icon Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .progress-box-layout1 .item-icon i:before' => 'color: {{VALUE}}', ), ), array( 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'id' => 'counter_icon_padding', 'label' => __( 'Padding', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .progress-box-layout1 .item-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ), 'separator' => 'before', ), array( 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'id' => 'counter_icon_margin', 'label' => __( 'Margin', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .progress-box-layout1 .item-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ), 'separator' => 'before', ), array( 'mode' => 'section_end', ), // Number style array( 'mode' => 'section_start', 'id' => 'counter_number_style', 'label' => esc_html__( 'Counter Number Style', 'aeen-core' ), 'tab' => Controls_Manager::TAB_STYLE, ), array( 'type' => Controls_Manager::COLOR, 'id' => 'count_number_color', 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .progress-box-layout1 .item-content .counting-text' => 'color: {{VALUE}}', '{{WRAPPER}} .progress-box-layout2 .counting-text' => 'color: {{VALUE}}', ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'counter_number_font_size', 'label' => esc_html__( 'Typography', 'aeen-core' ), 'selector' =>'{{WRAPPER}} .progress-box-layout1 .item-content .counting-text, {{WRAPPER}} .progress-box-layout2 .counting-text', ), array( 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'id' => 'counter_number_padding', 'label' => __( 'Padding', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .progress-box-layout1 .item-content .counting-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', '{{WRAPPER}} .progress-box-layout2 .counting-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ), 'separator' => 'before', ), array( 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'id' => 'counter_number_margin', 'label' => __( 'Margin', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .progress-box-layout1 .item-content .counting-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', '{{WRAPPER}} .progress-box-layout2 .counting-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ), 'separator' => 'before', ), array( 'mode' => 'section_end', ), // Title style array( 'mode' => 'section_start', 'id' => 'counter_title_style', 'label' => esc_html__( 'Counter Title Style', 'aeen-core' ), 'tab' => Controls_Manager::TAB_STYLE, ), array( 'type' => Controls_Manager::COLOR, 'id' => 'count_title_color', 'label' => __( 'Color', 'aeen-core' ), 'default' => '', 'selectors' => array( '{{WRAPPER}} .progress-box-layout1 .item-content .item-title' => 'color: {{VALUE}}', '{{WRAPPER}} .progress-box-layout2 .item-title' => 'color: {{VALUE}}', ), ), array( 'mode' => 'group', 'type' => Group_Control_Typography::get_type(), 'name' => 'counter_title_font_size', 'label' => esc_html__( 'Typography', 'aeen-core' ), 'selector' =>'{{WRAPPER}} .progress-box-layout1 .item-content .item-title, {{WRAPPER}} .progress-box-layout2 .item-title', ), array( 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'id' => 'counter_title_padding', 'label' => __( 'Padding', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .progress-box-layout1 .item-content .item-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', '{{WRAPPER}} .progress-box-layout2 .item-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ), 'separator' => 'before', ), array( 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'id' => 'counter_title_margin', 'label' => __( 'Margin', 'aeen-core' ), 'selectors' => array( '{{WRAPPER}} .progress-box-layout1 .item-content .item-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', '{{WRAPPER}} .progress-box-layout2 .item-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;', ), 'separator' => 'before', ), array( 'mode' => 'section_end', ), ); return $fields; } protected function render() { $data = $this->get_settings(); switch ( $data['layout'] ) { case 'layout3': $template = 'view-3'; break; case 'layout2': $template = 'view-2'; break; default: $template = 'view-1'; break; } return $this->rt_template( $template, $data ); } }