/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/tech-box.php (10130B)
start_controls_section(
'content_section',
[
'label' => __( 'Tech Box', '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}};',
],
'default' => 'center',
]
);
$this->add_control(
'icon_type',
[
'label' => __( 'Icon Type', 'engitech' ),
'type' => Controls_Manager::SELECT,
'default' => 'font',
'options' => [
'font' => __( 'Font Icon', 'engitech' ),
'image' => __( 'Image Icon', 'engitech' ),
'class' => __( 'Custom Icon', 'engitech' ),
]
]
);
$this->add_control(
'icon_font',
[
'label' => __( 'Icon', 'engitech' ),
'type' => Controls_Manager::ICONS,
'label_block' => true,
'fa4compatibility' => 'icon',
'default' => [
'value' => 'fas fa-star',
'library' => 'fa-solid',
],
'condition' => [
'icon_type' => 'font',
]
]
);
$this->add_control(
'icon_image',
[
'label' => esc_html__( 'Photo', 'engitech' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => get_template_directory_uri().'/images/analysis.png',
],
'condition' => [
'icon_type' => 'image',
]
]
);
$this->add_control(
'icon_class',
[
'label' => __( 'Custom Class', 'engitech' ),
'type' => Controls_Manager::TEXT,
'default' => __( 'flaticon-apple', 'engitech' ),
'condition' => [
'icon_type' => 'class',
]
]
);
$this->add_control(
'title',
[
'label' => __( 'Title', 'engitech' ),
'type' => Controls_Manager::TEXT,
'default' => __( 'IOS', 'engitech' ),
'label_block' => true,
]
);
$this->add_control(
'link',
[
'label' => __( 'Link', 'engitech' ),
'type' => Controls_Manager::URL,
'placeholder' => __( 'https://your-link.com', 'engitech' ),
]
);
$this->end_controls_section();
//Style
$this->start_controls_section(
'style_box_section',
[
'label' => __( 'Box', 'engitech' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'box_padding',
[
'label' => __( 'Padding Box', 'engitech' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [
'{{WRAPPER}} .tech-box' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
'separator' => 'before',
]
);
//Hover
$this->start_controls_tabs( 'tabs_box_style' );
$this->start_controls_tab(
'tab_box_normal',
[
'label' => __( 'Normal', 'engitech' ),
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'box_border',
'selector' => '{{WRAPPER}} .tech-box',
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'ibox_bg',
'label' => __( 'Background', 'engitech' ),
'types' => [ 'classic', 'gradient' ],
'selector' => '{{WRAPPER}} .tech-box',
'separator' => 'before',
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'tab_box_hover',
[
'label' => __( 'Hover', 'engitech' ),
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'box_hover_border',
'selector' => '{{WRAPPER}} .tech-box:hover',
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'ibox_hover_bg',
'label' => __( 'Background', 'engitech' ),
'types' => [ 'classic', 'gradient' ],
'selector' => '{{WRAPPER}} .tech-box:hover',
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
//Content
$this->start_controls_section(
'style_icon_section',
[
'label' => __( 'Content', 'engitech' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
//Icon
$this->add_control(
'heading_icon',
[
'label' => __( 'Icon', 'engitech' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_responsive_control(
'icon_size',
[
'label' => __( 'Size', 'engitech' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 200,
],
],
'default' => [
'unit' => 'px',
'size' => 32,
],
'selectors' => [
'{{WRAPPER}} .tech-box i, {{WRAPPER}} .tech-box span:before' => 'font-size: {{SIZE}}{{UNIT}};',
'{{WRAPPER}} .icon-main svg' => 'width: {{SIZE}}{{UNIT}};'
],
'condition' => [
'icon_type' => ['font','class']
]
]
);
$this->add_responsive_control(
'icon_space',
[
'label' => __( 'Spacing', 'engitech' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 100,
],
],
'selectors' => [
'{{WRAPPER}} .tech-box .icon-main' => 'margin-bottom: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_control(
'icon_color',
[
'label' => __( 'Color', 'engitech' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .tech-box i, {{WRAPPER}} .tech-box span' => 'color: {{VALUE}};',
'{{WRAPPER}} .tech-box svg' => 'fill: {{VALUE}};',
],
'condition' => [
'icon_type' => ['font','class']
]
]
);
$this->add_control(
'icon_hover_color',
[
'label' => __( 'Hover Box Color', 'engitech' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .tech-box:hover i, {{WRAPPER}} .tech-box:hover span' => 'color: {{VALUE}};',
'{{WRAPPER}} .tech-box:hover svg' => 'fill: {{VALUE}};',
],
'condition' => [
'icon_type' => ['font','class']
]
]
);
//Title
$this->add_control(
'heading_title',
[
'label' => __( 'Title', 'engitech' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$this->add_control(
'title_color',
[
'label' => __( 'Color', 'engitech' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .tech-box h5' => 'color: {{VALUE}};',
]
]
);
$this->add_control(
'title_hover_color',
[
'label' => __( 'Hover Box Color', 'engitech' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .tech-box:hover h5' => 'color: {{VALUE}};',
]
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'selector' => '{{WRAPPER}} .tech-box h5',
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
if ( ! empty( $settings['link']['url'] ) ) {
$this->add_render_attribute( 'techbox', 'href', $settings['link']['url'] );
if ( $settings['link']['is_external'] ) {
$this->add_render_attribute( 'techbox', 'target', '_blank' );
}
if ( $settings['link']['nofollow'] ) {
$this->add_render_attribute( 'techbox', 'rel', 'nofollow' );
}
}
?>
get_render_attribute_string( 'techbox' ); ?>>
'true' ] ); } ?>
widgets_manager->register_widget_type( new Engitech_TechBox() );