PATH:
home
/
letacommog
/
aperobusiness
/
wp-content
/
themes
/
deep
/
inc
/
core
/
elementor
/
widgets
<?php namespace Elementor; class Webnus_Element_Widgets_Max_Counter extends \Elementor\Widget_Base { /** * Retrieve Max Counter widget name. * * @since 1.0.0 * @access public * * @return string Widget name. */ public function get_name() { return 'max-counter'; } /** * Retrieve Max Counter widget title. * * @since 1.0.0 * @access public * * @return string Widget title. */ public function get_title() { return esc_html__( 'Webnus Max Counter', 'deep' ); } /** * Retrieve Max Counter widget icon. * * @since 1.0.0 * @access public * * @return string Widget icon. */ public function get_icon() { return 'icon-basic-cup'; } /** * Set widget category. * * @since 1.0.0 * @access public * * @return array Widget category. */ public function get_categories() { return [ 'webnus' ]; } /** * Register Max Counter widget controls. * * * @since 1.0.0 * @access protected */ protected function _register_controls() { // Content Tab $this->start_controls_section( 'content_section', [ 'label' => esc_html__( 'General', 'deep' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); // Select Max Counter Type $this->add_control( 'type', //param_name [ 'label' => esc_html__( 'Select Type', 'deep' ), //heading 'type' => Controls_Manager::SELECT, //type 'default' => '1', 'options' => [ '1' => esc_html__( 'Type 1', 'deep' ), '2' => esc_html__( 'Type 2', 'deep' ), '3' => esc_html__( 'Type 3', 'deep' ), '4' => esc_html__( 'Type 4', 'deep' ), '5' => esc_html__( 'Type 5', 'deep' ), '6' => esc_html__( 'Type 6', 'deep' ), ], ] ); // Counter $this->add_control( 'count', [ 'label' => esc_html__( 'count', 'deep' ), 'type' => Controls_Manager::NUMBER, 'default' => 3600, 'min' => 0, 'max' => 999999, 'step' => 5, ] ); // Title $this->add_control( 'title', //param_name [ 'label' => esc_html__( 'Title', 'deep' ), //heading 'type' => Controls_Manager::TEXT, //type 'placeholder' => esc_html__( 'Type your title text here', 'deep' ), ] ); // Prefix $this->add_control( 'prefix', //param_name [ 'label' => esc_html__( 'Prefix', 'deep' ), //heading 'type' => Controls_Manager::TEXT, //type 'placeholder' => esc_html__( 'Type your title text here', 'deep' ), ] ); // Suffix $this->add_control( 'suffix', //param_name [ 'label' => esc_html__( 'Suffix', 'deep' ), //heading 'type' => Controls_Manager::TEXT, //type 'placeholder' => esc_html__( 'Type your title text here', 'deep' ), ] ); // Icon $this->add_control( 'icon', [ 'label' => __( 'Icons', 'deep' ), 'type' => Controls_Manager::ICON, 'default' => 'icon-basic-cup', 'condition' => array( 'type' => array( '1','2', '3', '4','5', ), ), ] ); $this->end_controls_section(); // Class & ID Tab $this->start_controls_section( 'classid_section', [ 'label' => __( 'Class & ID', 'deep' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'shortcodeclass', [ 'label' => esc_html__( 'Extra Class', 'deep' ), 'type' => Controls_Manager::TEXT, ] ); $this->add_control( 'shortcodeid', [ 'label' => esc_html__( 'ID', 'deep' ), 'type' => Controls_Manager::TEXT, ] ); $this->end_controls_section(); // Icon style $this->start_controls_section( 'section_icon_style', [ 'label' => __( 'Icon Style', 'deep' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'color', [ 'label' => __( 'Icon Color', 'deep' ), 'type' => Controls_Manager::COLOR, 'scheme' => [ 'type' => Scheme_Color::get_type(), 'value' => Scheme_Color::COLOR_1, ], 'default' => '#437df9', 'selectors' => [ '{{WRAPPER}} .icon-counter' => 'color: {{VALUE}} !important', ], 'condition' => array( 'type' => array( '1','2', '3', '4','5', ), ), ] ); $this->add_control( 'icon_size', [ 'label' => __( 'Icon Size', 'deep' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1000, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .icon-counter' => 'font-size: {{SIZE}}{{UNIT}};', ], 'condition' => array( 'type' => array( '1','2', '3', '4','5', ), ), ] ); $this->end_controls_section(); // Style $this->start_controls_section( 'section_number_style', [ 'label' => __( 'Number Style', 'deep' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'number_typography', 'label' => __( 'Typography', 'deep' ), 'scheme' => Scheme_Typography::TYPOGRAPHY_2, 'selector' => '#wrap {{WRAPPER}} .max-counter .max-count', ] ); $this->add_control( 'number_color', //param_name [ 'label' => __( 'Color', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::COLOR, //type 'selectors' => [ '#wrap {{WRAPPER}} .max-counter .max-count' => 'color: {{VALUE}} !important', ], ] ); $this->add_control( 'number_padding', //param_name [ 'label' => __( 'Padding', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '#wrap {{WRAPPER}} .max-counter .max-count' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'number_margin', //param_name [ 'label' => __( 'Margin', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '#wrap {{WRAPPER}} .max-counter .max-count' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_title_style', [ 'label' => __( 'Title Style', 'deep' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'label' => __( 'Typography', 'deep' ), 'scheme' => Scheme_Typography::TYPOGRAPHY_2, 'selector' => '#wrap {{WRAPPER}} .max-counter h5', ] ); $this->add_control( 'title_color', //param_name [ 'label' => __( 'Color', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::COLOR, //type 'selectors' => [ '#wrap {{WRAPPER}} .max-counter h5' => 'color: {{VALUE}} !important', ], ] ); $this->add_control( 'title_padding', //param_name [ 'label' => __( 'Padding', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '#wrap {{WRAPPER}} .max-counter h5' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'title_margin', //param_name [ 'label' => __( 'Margin', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '#wrap {{WRAPPER}} .max-counter h5' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_prefix_style', [ 'label' => __( 'Prefix Style', 'deep' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'prefix_typography', 'label' => __( 'Typography', 'deep' ), 'scheme' => Scheme_Typography::TYPOGRAPHY_2, 'selector' => '#wrap {{WRAPPER}} .max-counter .pre-counter', ] ); $this->add_control( 'prefix_color', //param_name [ 'label' => __( 'Color', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::COLOR, //type 'selectors' => [ '#wrap {{WRAPPER}} .max-counter .pre-counter' => 'color: {{VALUE}} !important', ], ] ); $this->add_control( 'prefix_padding', //param_name [ 'label' => __( 'Padding', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '#wrap {{WRAPPER}} .max-counter .pre-counter' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'prefix_margin', //param_name [ 'label' => __( 'Margin', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '#wrap {{WRAPPER}} .max-counter .pre-counter' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_suffix_style', [ 'label' => __( 'Suffix Style', 'deep' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'suffix_typography', 'label' => __( 'Typography', 'deep' ), 'scheme' => Scheme_Typography::TYPOGRAPHY_2, 'selector' => '#wrap {{WRAPPER}} .max-counter .suf-counter', ] ); $this->add_control( 'suffix_color', //param_name [ 'label' => __( 'Color', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::COLOR, //type 'selectors' => [ '#wrap {{WRAPPER}} .max-counter .suf-counter' => 'color: {{VALUE}} !important', ], ] ); $this->add_control( 'suffix_padding', //param_name [ 'label' => __( 'Padding', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '#wrap {{WRAPPER}} .max-counter .suf-counter' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'suffix_margin', //param_name [ 'label' => __( 'Margin', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '#wrap {{WRAPPER}} .max-counter .suf-counter' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'section_box_style', [ 'label' => __( 'Box Style', 'deep' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'box_bg', 'label' => __( 'Background', 'deep' ), 'types' => [ 'classic' , 'gradient' ], 'selector' => '#wrap {{WRAPPER}} .max-counter', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'box_border', 'label' => __( 'Border', 'deep' ), 'selector' => '#wrap {{WRAPPER}} .max-counter', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'box_shadow', 'label' => __( 'Box Shadow', 'deep' ), 'selector' => '#wrap {{WRAPPER}} .max-counter', ] ); $this->add_control( 'box_padding', //param_name [ 'label' => __( 'Padding', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '#wrap {{WRAPPER}} .max-counter' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'box_margin', //param_name [ 'label' => __( 'Margin', 'deep' ), //heading 'type' => \Elementor\Controls_Manager::DIMENSIONS, //type 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '#wrap {{WRAPPER}} .max-counter' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); // Custom css tab $this->start_controls_section( 'custom_css_section', [ 'label' => __( 'Custom CSS', 'deep' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'custom_css', [ 'label' => __( 'Custom CSS', 'deep' ), 'type' => \Elementor\Controls_Manager::CODE, 'language' => 'css', 'rows' => 20, 'show_label' => true, ] ); $this->end_controls_section(); } /** * Render Max Counter widget output on the frontend. * * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings(); wp_enqueue_style( 'wn-deep-max-counter0', DEEP_ASSETS_URL . 'css/frontend/max-counter/max-counter0.css' ); wp_enqueue_style( 'wn-deep-max-counter' . $settings['type'], DEEP_ASSETS_URL . 'css/frontend/max-counter/max-counter' . $settings['type'] . '.css' ); $type = $settings['type']; $count = $settings['count']; $title = $settings['title']; $prefix = $settings['prefix']; $suffix = $settings['suffix']; // Class & ID $shortcodeclass = $settings['shortcodeclass'] ? $settings['shortcodeclass'] : ''; $shortcodeid = $settings['shortcodeid'] ? ' id="' . $settings['shortcodeid'] . '"' : ''; if ($type == '1' || $type == '2' || $type == '3' || $type == '4' || $type == '5') { $color = $settings['color']; $icon = $settings['icon']; } else { $color = ' '; $icon = ' '; } $out = '<div class="'; switch( $type ) { case 1: $out .= 'm-counter'; break; case 2: $out .= 's-counter'; break; case 3: $out .= 't-counter'; break; case 4: $out .= 'f-counter'; break; case 5: $out .= 'd-counter'; break; case 6: $out .= 'e-counter'; break; } // Fix King Composer if ( empty( $type ) ) $out .= 'm-counter' ; $out .= ' max-counter' . $shortcodeclass . '" ' . $shortcodeid . ' data-effecttype="counter" data-counter="' . $count . '">'; if ( $icon ) { $out .= '<i class="colorf icon-counter '. $icon .'"></i>'; } if( !empty( $prefix ) ) $out .= '<span class="pre-counter">'. $prefix .'</span>'; if( !empty( $count ) ) $out .= '<span class="max-count">'. $count .'</span>'; if( !empty( $suffix ) ) $out .= '<span class="suf-counter">'. $suffix .'</span>'; if( $type == 5 ) $out .= '<span class="after colorb"></span>'; if( !empty( $title ) ) $out .= '<h5>'. $title .'</h5>'; $out .= '</div>'; $custom_css = $settings['custom_css']; if ( $custom_css != '' ) { echo '<style>'. $custom_css .'</style>'; } echo $out; } }
[+]
..
[-] our-client.php
[edit]
[-] icons.php
[edit]
[-] collection.php
[edit]
[-] testimonial-tab.php
[edit]
[-] teaserbox.php
[edit]
[-] instagram.php
[edit]
[-] our-team.php
[edit]
[-] content-carousel.php
[edit]
[-] videoteaser.php
[edit]
[-] like-view-share.php
[edit]
[-] courses-instructors.php
[edit]
[-] widget-flickr.php
[edit]
[-] reservation.php
[edit]
[-] list.php
[edit]
[-] road-map.php
[edit]
[-] max-counter.php
[edit]
[-] magazine.php
[edit]
[-] prayer-wall-items.php
[edit]
[-] facebook-button.php
[edit]
[-] icon-divider.php
[edit]
[-] featured-products.php
[edit]
[-] review-items.php
[edit]
[-] iconbox.php
[edit]
[-] widget-googleplus.php
[edit]
[-] content-slider.php
[edit]
[-] service-carousel.php
[edit]
[-] contact-form.php
[edit]
[-] twitter-feed.php
[edit]
[-] blog.php
[edit]
[-] process-carousel.php
[edit]
[-] course-category.php
[edit]
[-] virtual-coins.php
[edit]
[-] speakers.php
[edit]
[-] the-grid.php
[edit]
[-] custom-menu.php
[edit]
[-] widget-youtube.php
[edit]
[-] testimonial.php
[edit]
[-] callout.php
[edit]
[-] testimonial-slider.php
[edit]
[-] category-tab.php
[edit]
[-] testimonial-carousel.php
[edit]
[-] button.php
[edit]
[-] facebook-comments.php
[edit]
[-] widget-login.php
[edit]
[-] subscribe.php
[edit]
[-] googlemap.php
[edit]
[-] widget-social-icon.php
[edit]
[-] postslider.php
[edit]
[-] alert.php
[edit]
[-] video-play-button.php
[edit]
[-] quote.php
[edit]
[-] donate.php
[edit]
[-] dropcap.php
[edit]
[-] before-after-image.php
[edit]
[-] pricing-tables.php
[edit]
[-] facebook-page.php
[edit]
[-] shop-products.php
[edit]
[-] single-goal.php
[edit]
[-] info-box.php
[edit]
[-] latestfromblog.php
[edit]
[-] goals.php
[edit]
[-] revolution-slider.php
[edit]
[-] widget-subscribe.php
[edit]
[-] tablepress.php
[edit]
[-] tab-content.php
[edit]
[-] schedule.php
[edit]
[-] sermon-category.php
[edit]
[-] pricing-plan.php
[edit]
[-] tabs.php
[edit]
[-] widget-latest-posts.php
[edit]
[-] distance.php
[edit]
[-] widget-popular-posts.php
[edit]
[-] recipes.php
[edit]
[-] causes.php
[edit]
[-] widget-testimonial.php
[edit]
[-] widget-about.php
[edit]
[-] special-offers.php
[edit]
[-] tooltip.php
[edit]
[-] food-menu.php
[edit]
[-] wp-hotel-booking.php
[edit]
[-] widget-tab.php
[edit]
[-] courses.php
[edit]
[-] login.php
[edit]
[-] post-from-blog.php
[edit]
[-] socials.php
[edit]
[-] line.php
[edit]
[-] gallery.php
[edit]
[-] faq.php
[edit]
[-] piecharts.php
[edit]
[-] image-hotspot.php
[edit]
[-] link.php
[edit]
[-] prayer-wall-form.php
[edit]
[-] rooms.php
[edit]
[-] countdown.php
[edit]
[-] portfolio-carousel.php
[edit]
[-] facebook-embed.php
[edit]
[-] single-cause.php
[edit]
[-] review-form.php
[edit]
[-] buy-process.php
[edit]
[-] sermons.php
[edit]
[-] widget-facebook.php
[edit]
[-] single-sermon.php
[edit]
[-] single-course.php
[edit]
[-] image-carousel.php
[edit]
[-] toggle-box.php
[edit]
[-] our-process.php
[edit]
[-] svg.php
[edit]
[-] w-title.php
[edit]
[-] block-quote.php
[edit]