/home/techb158/public_html/wp-content/themes/engitech/inc/backend/elementor-widgets
Edit: /home/techb158/public_html/wp-content/themes/engitech/inc/backend/elementor-widgets/counter-2.php (9834B)
start_controls_section(
'content_section',
[
'label' => __( 'Counter', 'engitech' ),
]
);
$this->add_responsive_control(
'align',
[
'label' => __( 'Alignment', 'engitech' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => __( 'Left', 'engitech' ),
'icon' => 'fa fa-align-left',
],
'center' => [
'title' => __( 'Center', 'engitech' ),
'icon' => 'fa fa-align-center',
],
'right' => [
'title' => __( 'Right', 'engitech' ),
'icon' => 'fa fa-align-right',
],
],
// 'prefix_class' => 'engitech%s-align-',
'selectors' => [
'{{WRAPPER}}' => 'text-align: {{VALUE}};',
],
]
);
$this->add_control(
'title',
[
'label' => __( 'Title:', 'engitech' ),
'type' => Controls_Manager::TEXT,
'default' => __( 'Countries Worldwide', 'engitech' ),
]
);
$this->add_control(
'des',
[
'label' => 'Description',
'type' => Controls_Manager::TEXTAREA,
'default' => __( 'To succeed, every software solution must be deeply integrated into the existing tech environment...', 'engitech' ),
]
);
$this->add_control(
'btn_box',
[
'label' => __( 'Button', 'engitech' ),
'type' => Controls_Manager::TEXT,
'default' => __( '
LEARN MORE', 'engitech' ),
'label_block' => true,
]
);
$this->add_control(
'link',
[
'label' => __( 'Link', 'engitech' ),
'type' => Controls_Manager::URL,
'placeholder' => __( 'https://your-link.com', 'engitech' ),
'default' => [
'url' => '#',
],
]
);
$this->add_control(
'number',
[
'label' => 'Number:',
'type' => Controls_Manager::TEXT,
'default' => __( '15', 'engitech' ),
]
);
$this->add_control(
'extra',
[
'label' => __( 'After Number:', 'engitech' ),
'type' => Controls_Manager::TEXT,
'default' => __( '+', 'engitech' ),
]
);
$this->add_control(
'time',
[
'label' => __( 'Duration', 'engitech' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 1000,
'max' => 10000,
'step' => 1000,
],
],
'default' => [
'unit' => 'px',
'size' => 2000,
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'style_content_section',
[
'label' => __( 'Style', 'engitech' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'heading_box',
[
'label' => __( 'Box', 'engitech' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_responsive_control(
'box_padding',
[
'label' => __( 'Padding Box', 'engitech' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [
'{{WRAPPER}} .ot-counter2' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
//Number Main
$this->add_control(
'heading_number',
[
'label' => __( 'Number Main', 'engitech' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_responsive_control(
'number_space',
[
'label' => __( 'Spacing', 'engitech' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 100,
],
],
'selectors' => [
'{{WRAPPER}} .ot-counter2 .s-num' => 'margin-bottom: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'number_color',
[
'label' => __( 'Color', 'engitech' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .ot-counter2 .s-num' => 'color: {{VALUE}};',
]
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'number_typography',
'selector' => '{{WRAPPER}} .ot-counter2 .s-num',
]
);
//Title
$this->add_control(
'heading_title',
[
'label' => __( 'Title', 'engitech' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_responsive_control(
'title_space',
[
'label' => __( 'Spacing', 'engitech' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 100,
],
],
'selectors' => [
'{{WRAPPER}} .ot-counter2 h6' => 'margin-bottom: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'title_color',
[
'label' => __( 'Color', 'engitech' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .ot-counter2 h6' => 'color: {{VALUE}};',
]
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'selector' => '{{WRAPPER}} .ot-counter2 h6',
]
);
//Des
$this->add_control(
'heading_des',
[
'label' => __( 'Description', 'engitech' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_responsive_control(
'des_space',
[
'label' => __( 'Spacing', 'engitech' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 100,
],
],
'selectors' => [
'{{WRAPPER}} .ot-counter2 p' => 'margin-bottom: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'des_color',
[
'label' => __( 'Color', 'engitech' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .ot-counter2 p' => 'color: {{VALUE}};',
]
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'des_typography',
'selector' => '{{WRAPPER}} .ot-counter2 p',
]
);
//Button
$this->add_control(
'heading_btn',
[
'label' => __( 'Button', 'engitech' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'btn_color',
[
'label' => __( 'Color', 'engitech' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .ot-counter2 .btn-details' => 'color: {{VALUE}};',
]
]
);
//Number Big
$this->add_control(
'heading_bnumber',
[
'label' => __( 'Big Number', 'engitech' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'bnumber_color',
[
'label' => __( 'Color', 'engitech' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .ot-counter2 .b-num' => 'color: {{VALUE}};',
]
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'bnumber_typography',
'selector' => '{{WRAPPER}} .ot-counter2 .b-num',
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
if ( ! empty( $settings['link']['url'] ) ) {
$this->add_render_attribute( 'button', 'href', $settings['link']['url'] );
if ( $settings['link']['is_external'] ) {
$this->add_render_attribute( 'button', 'target', '_blank' );
}
if ( $settings['link']['nofollow'] ) {
$this->add_render_attribute( 'button', 'rel', 'nofollow' );
}
}
$this->add_render_attribute( 'button', 'class', 'btn-details' );
?>
widgets_manager->register_widget_type( new Engitech_Counter2() );