start_controls_section( 'content_section', [ 'label' => __( 'Content', 'addonnest' ), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'feature_icon', [ 'label' => __( 'Icon', 'addonnest' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'fas fa-star', 'library' => 'fa-solid', ], ] ); $this->add_control( 'title_text', [ 'label' => __( 'Title', 'addonnest' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'Premium Feature', 'addonnest' ), 'placeholder' => __( 'Enter your title', 'addonnest' ), ] ); $this->add_control( 'description_text', [ 'label' => __( 'Description', 'addonnest' ), 'type' => \Elementor\Controls_Manager::TEXTAREA, 'default' => __( 'This feature provides amazing benefits that will help you achieve your goals.', 'addonnest' ), 'placeholder' => __( 'Enter your description', 'addonnest' ), ] ); $this->add_control( 'show_button', [ 'label' => __( 'Show Button', 'addonnest' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'addonnest' ), 'label_off' => __( 'Hide', 'addonnest' ), 'return_value' => 'yes', 'default' => 'no', ] ); $this->add_control( 'button_text', [ 'label' => __( 'Button Text', 'addonnest' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => __( 'Learn More', 'addonnest' ), 'condition' => [ 'show_button' => 'yes', ], ] ); $this->add_control( 'link', [ 'label' => __( 'Link', 'addonnest' ), 'type' => \Elementor\Controls_Manager::URL, 'placeholder' => __( 'https://your-link.com', 'addonnest' ), 'show_external' => true, 'default' => [ 'url' => '', 'is_external' => false, 'nofollow' => false, ], ] ); $this->end_controls_section(); // Style Section $this->start_controls_section( 'box_style', [ 'label' => __( 'Box', 'addonnest' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'box_bg_color', [ 'label' => __( 'Background Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .addonnest-feature-box' => 'background-color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'box_border', 'selector' => '{{WRAPPER}} .addonnest-feature-box', ] ); $this->add_control( 'box_border_radius', [ 'label' => __( 'Border Radius', 'addonnest' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .addonnest-feature-box' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'box_shadow', 'selector' => '{{WRAPPER}} .addonnest-feature-box', ] ); $this->add_responsive_control( 'box_padding', [ 'label' => __( 'Padding', 'addonnest' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .addonnest-feature-box .addonnest-feature-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'box_hover_animation', [ 'label' => __( 'Hover Animation', 'addonnest' ), 'type' => \Elementor\Controls_Manager::HOVER_ANIMATION, ] ); $this->end_controls_section(); // Icon Style $this->start_controls_section( 'icon_style', [ 'label' => __( 'Icon', 'addonnest' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'icon_color', [ 'label' => __( 'Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#3a3a3a', 'selectors' => [ '{{WRAPPER}} .addonnest-feature-icon i' => 'color: {{VALUE}};', '{{WRAPPER}} .addonnest-feature-icon svg' => 'fill: {{VALUE}};', ], ] ); $this->add_control( 'icon_bg_color', [ 'label' => __( 'Background Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#f5f5f5', 'selectors' => [ '{{WRAPPER}} .addonnest-feature-icon' => 'background-color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'icon_size', [ 'label' => __( 'Size', 'addonnest' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 10, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .addonnest-feature-icon i' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .addonnest-feature-icon svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'icon_box_size', [ 'label' => __( 'Box Size', 'addonnest' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 30, 'max' => 150, ], ], 'selectors' => [ '{{WRAPPER}} .addonnest-feature-icon' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'icon_border_radius', [ 'label' => __( 'Border Radius', 'addonnest' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .addonnest-feature-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'icon_spacing', [ 'label' => __( 'Spacing', 'addonnest' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .addonnest-feature-icon' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); // Title Style $this->start_controls_section( 'title_style', [ 'label' => __( 'Title', 'addonnest' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'title_color', [ 'label' => __( 'Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#3a3a3a', 'selectors' => [ '{{WRAPPER}} .addonnest-feature-title' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'selector' => '{{WRAPPER}} .addonnest-feature-title', ] ); $this->add_responsive_control( 'title_spacing', [ 'label' => __( 'Spacing', 'addonnest' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} .addonnest-feature-title' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); // Description Style $this->start_controls_section( 'description_style', [ 'label' => __( 'Description', 'addonnest' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'description_color', [ 'label' => __( 'Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#666666', 'selectors' => [ '{{WRAPPER}} .addonnest-feature-description' => 'color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'description_typography', 'selector' => '{{WRAPPER}} .addonnest-feature-description', ] ); $this->add_responsive_control( 'description_spacing', [ 'label' => __( 'Spacing', 'addonnest' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} .addonnest-feature-description' => 'margin-bottom: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); // Button Style $this->start_controls_section( 'button_style', [ 'label' => __( 'Button', 'addonnest' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'condition' => [ 'show_button' => 'yes', ], ] ); $this->add_control( 'button_color', [ 'label' => __( 'Text Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .addonnest-feature-button' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'button_bg_color', [ 'label' => __( 'Background Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#3a3a3a', 'selectors' => [ '{{WRAPPER}} .addonnest-feature-button' => 'background-color: {{VALUE}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'button_typography', 'selector' => '{{WRAPPER}} .addonnest-feature-button', ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'button_border', 'selector' => '{{WRAPPER}} .addonnest-feature-button', ] ); $this->add_control( 'button_border_radius', [ 'label' => __( 'Border Radius', 'addonnest' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .addonnest-feature-button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_padding', [ 'label' => __( 'Padding', 'addonnest' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em' ], 'selectors' => [ '{{WRAPPER}} .addonnest-feature-button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_spacing', [ 'label' => __( 'Spacing', 'addonnest' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .addonnest-feature-button' => 'margin-top: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'button_hover_heading', [ 'label' => __( 'Hover', 'addonnest' ), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'button_hover_color', [ 'label' => __( 'Text Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .addonnest-feature-button:hover' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'button_hover_bg_color', [ 'label' => __( 'Background Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .addonnest-feature-button:hover' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'button_hover_border_color', [ 'label' => __( 'Border Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .addonnest-feature-button:hover' => 'border-color: {{VALUE}};', ], ] ); $this->end_controls_section(); } protected function render() { $settings = $this->get_settings_for_display(); $this->add_render_attribute( 'feature_box', 'class', 'addonnest-feature-box' ); if ( $settings['box_hover_animation'] ) { $this->add_render_attribute( 'feature_box', 'class', 'elementor-animation-' . $settings['box_hover_animation'] ); } $this->add_render_attribute( 'title', 'class', 'addonnest-feature-title' ); $this->add_render_attribute( 'description', 'class', 'addonnest-feature-description' ); if ( ! empty( $settings['link']['url'] ) ) { $this->add_link_attributes( 'link', $settings['link'] ); } ?>
get_render_attribute_string( 'feature_box' ); ?>>
'true' ] ); ?>

get_render_attribute_string( 'title' ); ?>>

get_render_attribute_string( 'description' ); ?>>
get_render_attribute_string( 'link' ); ?> class="addonnest-feature-button">
widgets_manager->register_widget_type( new AddonNest_Widget_Features() );