tag in the footer). The widget now depends on Elementor's own registered // Font Awesome handles, which are loaded only on pages that use the widget. // Helper: returns wp_kses-allowed tags for Elementor icon HTML output. if ( ! function_exists( 'aafe_kses_icon_allowed' ) ) { function aafe_kses_icon_allowed(): array { return [ 'i' => [ 'class' => [], 'aria-hidden' => [], 'style' => [] ], 'span' => [ 'class' => [], 'aria-hidden' => [] ], 'svg' => [ 'class' => [], 'xmlns' => [], 'viewbox' => [], 'fill' => [], 'aria-hidden' => [], 'width' => [], 'height' => [], 'version' => [] ], 'path' => [ 'd' => [], 'fill' => [], 'fill-rule' => [], 'clip-rule' => [] ], 'g' => [ 'id' => [], 'fill' => [], 'transform' => [] ], ]; } } /** * Safely render an Elementor icon array as HTML string. * * Handles both the standard {'value':'fas fa-x','library':'fa-solid'} format AND * the legacy / inline-skin {'value':'fas fa-x'} format where library may be empty. * Always returns a non-empty string if value is set; empty string otherwise. */ if ( ! function_exists( 'aafe_get_icon_html' ) ) { function aafe_get_icon_html( $icon ): string { if ( empty( $icon ) ) { return ''; } // If legacy string format (from old skin='inline') if ( is_string( $icon ) ) { if ( false === strpos( $icon, '"' ) && false === strpos( $icon, '<' ) ) { return ''; } return ''; } if ( ! is_array( $icon ) ) { return ''; } $value = $icon['value'] ?? ''; $library = is_string( $icon['library'] ?? '' ) ? trim( $icon['library'] ?? '' ) : ''; if ( empty( $value ) ) { return ''; } // 1. SVG media attachment if ( 'svg' === $library && is_array( $value ) ) { $html = \Elementor\Icons_Manager::try_get_icon_html( $icon, [ 'aria-hidden' => 'true' ] ); if ( $html ) { return $html; } } // 2. Standard FA/eicon with library — let Elementor handle it if ( '' !== $library ) { $html = \Elementor\Icons_Manager::try_get_icon_html( $icon, [ 'aria-hidden' => 'true' ] ); if ( $html ) { return $html; } } // 3. Fallback: value is a CSS class string (e.g. "fas fa-arrow-right") // This handles old skin='inline' saved data and cases where library key is missing. if ( is_string( $value ) && '' !== $value && false === strpos( $value, '"' ) && false === strpos( $value, '<' ) && false === strpos( $value, '>' ) ) { return ''; } return ''; } } class Product_Features extends Widget_Base { use \AddronixAddons\Widget_Help_Url; const TD = 'addronix-addons-for-elementor'; public function get_name(): string { return 'aafe_product_features'; } public function get_title(): string { return esc_html__( 'AAFE Product Features', self::TD ); } public function get_icon(): string { return 'eicon-info-box'; } public function get_categories(): array { return [ 'addronix-addons-for-elementor' ]; } public function get_keywords(): array { return [ 'product', 'features', 'ingredients', 'showcase', 'details' ]; } public function get_style_depends(): array { return [ 'aafe-product-features-style', 'elementor-icons', 'elementor-icons-fa-solid', 'elementor-icons-fa-regular', 'elementor-icons-fa-brands' ]; } public static function get_widget_info(): array { return [ 'title' => esc_html__( 'AAFE Product Features', 'addronix-addons-for-elementor' ), 'icon' => 'eicon-info-box', 'description' => 'A 3-column product feature showcase with center image.', ]; } // ========================================================= // REGISTER CONTROLS // ========================================================= protected function register_controls(): void { $this->_register_content_controls(); $this->_register_style_controls(); } // ========================================================= // CONTENT TAB // ========================================================= private function _register_content_controls(): void { $this->_section_header_content(); $this->_section_center_image_content(); $this->_section_left_features_content(); $this->_section_right_features_content(); } // --------------------------------------------------------- // Header — Content // --------------------------------------------------------- private function _section_header_content(): void { $this->start_controls_section( 'section_header', [ 'label' => esc_html__( 'Header', self::TD ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); /* Pre-Title */ $this->add_control( 'pre_title', [ 'label' => esc_html__( 'Pre-Title', self::TD ), 'type' => Controls_Manager::TEXT, 'placeholder' => esc_html__( 'e.g. OUR PRODUCT FEATURES', self::TD ), 'default' => esc_html__( 'OUR PRODUCT FEATURES', self::TD ), 'dynamic' => [ 'active' => true ], ] ); $this->add_control( 'pre_title_tag', [ 'label' => esc_html__( 'Pre-Title HTML Tag', self::TD ), 'type' => Controls_Manager::SELECT, 'options' => [ 'span' => 'span', 'p' => 'p', 'div' => 'div', 'h6' => 'H6', 'h5' => 'H5' ], 'default' => 'span', ] ); /* Main Title */ $this->add_control( 'heading_main_title', [ 'label' => esc_html__( 'Title', self::TD ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'main_title', [ 'label' => esc_html__( 'Title Text', self::TD ), 'type' => Controls_Manager::TEXTAREA, 'default' => esc_html__( 'Smartwatch – Designed For Everyday Performance', self::TD ), 'dynamic' => [ 'active' => true ], ] ); $this->add_control( 'main_title_tag', [ 'label' => esc_html__( 'HTML Tag', self::TD ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h1' => 'H1', 'h2' => 'H2', 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', 'div' => 'div', 'p' => 'p' ], 'default' => 'h2', ] ); /* Description */ $this->add_control( 'heading_main_desc', [ 'label' => esc_html__( 'Description', self::TD ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'main_description', [ 'label' => esc_html__( 'Description Text', self::TD ), 'type' => Controls_Manager::WYSIWYG, 'default' => '', 'dynamic' => [ 'active' => true ], ] ); /* Header CTA Button */ $this->add_control( 'heading_header_btn', [ 'label' => esc_html__( 'CTA Button', self::TD ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'show_header_button', [ 'label' => esc_html__( 'Show Button', self::TD ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', self::TD ), 'label_off' => esc_html__( 'No', self::TD ), 'return_value' => 'yes', 'default' => '', ] ); $this->add_control( 'header_button_text', [ 'label' => esc_html__( 'Button Text', self::TD ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'Learn More', self::TD ), 'dynamic' => [ 'active' => true ], 'condition' => [ 'show_header_button' => 'yes' ], ] ); $this->add_control( 'header_button_url', [ 'label' => esc_html__( 'Button URL', self::TD ), 'type' => Controls_Manager::URL, 'placeholder' => 'https://your-link.com', 'dynamic' => [ 'active' => true ], 'condition' => [ 'show_header_button' => 'yes' ], ] ); $this->add_control( 'header_button_type', [ 'label' => esc_html__( 'Button Style', self::TD ), 'type' => Controls_Manager::SELECT, 'options' => [ 'solid' => esc_html__( 'Solid (Filled)', self::TD ), 'outline' => esc_html__( 'Outline', self::TD ), 'link' => esc_html__( 'Text Link', self::TD ), ], 'default' => 'solid', 'condition' => [ 'show_header_button' => 'yes' ], ] ); $this->add_control( 'header_button_icon', [ 'label' => esc_html__( 'Button Icon', self::TD ), 'type' => Controls_Manager::ICONS, 'default' => [ 'value' => '', 'library' => '' ], 'condition' => [ 'show_header_button' => 'yes' ], ] ); $this->add_control( 'header_button_icon_position', [ 'label' => esc_html__( 'Icon Position', self::TD ), 'type' => Controls_Manager::SELECT, 'options' => [ 'before' => esc_html__( 'Before Text', self::TD ), 'after' => esc_html__( 'After Text', self::TD ) ], 'default' => 'after', 'condition' => [ 'show_header_button' => 'yes' ], ] ); $this->end_controls_section(); } // --------------------------------------------------------- // Center Image — Content // --------------------------------------------------------- private function _section_center_image_content(): void { $this->start_controls_section( 'section_center_image', [ 'label' => esc_html__( 'Center Image', self::TD ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'center_image', [ 'label' => esc_html__( 'Image', self::TD ), 'type' => Controls_Manager::MEDIA, 'default' => [ 'url' => Utils::get_placeholder_image_src() ], 'dynamic' => [ 'active' => true ], ] ); $this->add_group_control( Group_Control_Image_Size::get_type(), [ 'name' => 'center_image', 'default' => 'large', 'separator' => 'none', ] ); /* Image Link */ $this->add_control( 'heading_img_link', [ 'label' => esc_html__( 'Image Link', self::TD ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'center_image_link', [ 'label' => esc_html__( 'URL', self::TD ), 'type' => Controls_Manager::URL, 'placeholder' => 'https://your-link.com', 'dynamic' => [ 'active' => true ], ] ); /* Hover Overlay */ $this->add_control( 'heading_img_overlay', [ 'label' => esc_html__( 'Hover Overlay', self::TD ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'show_image_overlay', [ 'label' => esc_html__( 'Enable Overlay on Hover', self::TD ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', self::TD ), 'label_off' => esc_html__( 'No', self::TD ), 'return_value' => 'yes', 'default' => '', ] ); $this->add_control( 'image_overlay_text', [ 'label' => esc_html__( 'Overlay Text', self::TD ), 'type' => Controls_Manager::TEXT, 'default' => '', 'dynamic' => [ 'active' => true ], 'condition' => [ 'show_image_overlay' => 'yes' ], ] ); $this->end_controls_section(); } // --------------------------------------------------------- // Repeater Builder // Organized: Icon → Badge → Content → Link → CTA Button // --------------------------------------------------------- private function _build_feature_repeater(): Repeater { $repeater = new Repeater(); // ── Icon / Image ────────────────────────────────────── $repeater->add_control( 'icon_type', [ 'label' => esc_html__( 'Icon Type', self::TD ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'icon' => [ 'title' => esc_html__( 'Icon', self::TD ), 'icon' => 'eicon-star' ], 'image' => [ 'title' => esc_html__( 'Image', self::TD ), 'icon' => 'eicon-image-bold' ], ], 'default' => 'image', ] ); $repeater->add_control( 'icon', [ 'label' => esc_html__( 'Icon', self::TD ), 'type' => Controls_Manager::ICONS, 'default' => [ 'value' => 'fas fa-leaf', 'library' => 'fa-solid' ], 'condition' => [ 'icon_type' => 'icon' ], ] ); $repeater->add_control( 'image', [ 'label' => esc_html__( 'Image', self::TD ), 'type' => Controls_Manager::MEDIA, 'default' => [ 'url' => Utils::get_placeholder_image_src() ], 'condition' => [ 'icon_type' => 'image' ], 'dynamic' => [ 'active' => true ], ] ); $repeater->add_responsive_control( 'icon_position', [ 'label' => esc_html__( 'Position', self::TD ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'top' => [ 'title' => esc_html__( 'Top', self::TD ), 'icon' => 'eicon-v-align-top' ], 'bottom' => [ 'title' => esc_html__( 'Bottom', self::TD ), 'icon' => 'eicon-v-align-bottom' ], 'left' => [ 'title' => esc_html__( 'Left', self::TD ), 'icon' => 'eicon-h-align-left' ], 'right' => [ 'title' => esc_html__( 'Right', self::TD ), 'icon' => 'eicon-h-align-right' ], ], 'default' => 'top', 'tablet_default' => 'top', 'mobile_default' => 'top', 'toggle' => false, ] ); $repeater->add_control( 'icon_inline_align', [ 'label' => esc_html__( 'Vertical Align', self::TD ), 'type' => Controls_Manager::SELECT, 'options' => [ 'flex-start' => esc_html__( 'Top', self::TD ), 'center' => esc_html__( 'Middle', self::TD ), 'flex-end' => esc_html__( 'Bottom', self::TD ), ], 'default' => 'flex-start', 'condition' => [ 'icon_position' => [ 'left', 'right' ] ], 'selectors' => [ '{{WRAPPER}} .elementor-repeater-item-{{ID}}.aafe-product-features__item' => 'align-items: {{VALUE}};' ], ] ); // ── Badge ───────────────────────────────────────────── $repeater->add_control( 'show_badge', [ 'label' => esc_html__( 'Show Badge', self::TD ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', self::TD ), 'label_off' => esc_html__( 'No', self::TD ), 'return_value' => 'yes', 'default' => '', 'separator' => 'before', ] ); $repeater->add_control( 'badge_text', [ 'label' => esc_html__( 'Badge Text', self::TD ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'New', self::TD ), 'condition' => [ 'show_badge' => 'yes' ], ] ); // ── Content ─────────────────────────────────────────── $repeater->add_control( 'title', [ 'label' => esc_html__( 'Title', self::TD ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'Feature Title', self::TD ), 'dynamic' => [ 'active' => true ], 'separator' => 'before', ] ); $repeater->add_control( 'show_divider', [ 'label' => esc_html__( 'Show Divider (after title)', self::TD ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', self::TD ), 'label_off' => esc_html__( 'No', self::TD ), 'return_value' => 'yes', 'default' => '', ] ); $repeater->add_control( 'description', [ 'label' => esc_html__( 'Description', self::TD ), 'type' => Controls_Manager::TEXTAREA, 'default' => esc_html__( 'Feature description text goes here.', self::TD ), 'dynamic' => [ 'active' => true ], ] ); // ── Item Link ───────────────────────────────────────── $repeater->add_control( 'link', [ 'label' => esc_html__( 'Item Link URL', self::TD ), 'description' => esc_html__( 'Makes the whole item clickable. If CTA Button is enabled below, this URL is used for the button.', self::TD ), 'type' => Controls_Manager::URL, 'dynamic' => [ 'active' => true ], 'placeholder' => 'https://your-link.com', 'separator' => 'before', ] ); // ── CTA Button ──────────────────────────────────────── $repeater->add_control( 'show_cta_button', [ 'label' => esc_html__( 'Show CTA Button', self::TD ), 'description' => esc_html__( 'Shows a button below description. Uses the Item Link URL above.', self::TD ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Yes', self::TD ), 'label_off' => esc_html__( 'No', self::TD ), 'return_value' => 'yes', 'default' => '', 'separator' => 'before', ] ); $repeater->add_control( 'cta_text', [ 'label' => esc_html__( 'Button Text', self::TD ), 'type' => Controls_Manager::TEXT, 'default' => esc_html__( 'Read More', self::TD ), 'placeholder' => esc_html__( 'e.g. Read More', self::TD ), 'dynamic' => [ 'active' => true ], 'condition' => [ 'show_cta_button' => 'yes' ], ] ); $repeater->add_control( 'cta_icon', [ 'label' => esc_html__( 'Button Icon', self::TD ), 'type' => Controls_Manager::ICONS, 'default' => [ 'value' => '', 'library' => '' ], 'fa4compatibility' => 'cta_icon_fa4', 'condition' => [ 'show_cta_button' => 'yes' ], ] ); $repeater->add_control( 'cta_icon_position', [ 'label' => esc_html__( 'Icon Position', self::TD ), 'type' => Controls_Manager::SELECT, 'options' => [ 'before' => esc_html__( 'Before Text', self::TD ), 'after' => esc_html__( 'After Text', self::TD ), ], 'default' => 'after', 'condition' => [ 'show_cta_button' => 'yes' ], ] ); return $repeater; } // --------------------------------------------------------- // Left Features — Content // --------------------------------------------------------- private function _section_left_features_content(): void { $this->start_controls_section( 'section_left_features', [ 'label' => esc_html__( 'Left Features', self::TD ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'left_features', [ 'label' => esc_html__( 'Items', self::TD ), 'type' => Controls_Manager::REPEATER, 'fields' => $this->_build_feature_repeater()->get_controls(), 'render_type' => 'template', 'default' => [ [ 'title' => 'Health Tracking', 'description' => 'Monitor your heart rate, steps, calories, and daily activity with ease.', 'icon_type' => 'icon', 'icon' => [ 'value' => 'fas fa-leaf', 'library' => 'fa-solid' ], 'icon_position' => 'right', 'show_cta_button' => 'yes', 'cta_text' => 'Read More', 'cta_icon' => [ 'value' => 'fas fa-arrow-right', 'library' => 'fa-solid' ], 'cta_icon_position' => 'after', ], [ 'title' => 'Smart Notifications', 'description' => 'Get calls, messages, and app alerts directly on your wrist.', 'icon_type' => 'icon', 'icon' => [ 'value' => 'fas fa-leaf', 'library' => 'fa-solid' ], 'icon_position' => 'right', 'show_cta_button' => 'yes', 'cta_text' => 'Read More', 'cta_icon' => [ 'value' => 'fas fa-arrow-right', 'library' => 'fa-solid' ], 'cta_icon_position' => 'after', ], [ 'title' => 'Fitness Modes', 'description' => 'Track different workouts and stay motivated with detailed activity insights.', 'icon_type' => 'icon', 'icon' => [ 'value' => 'fas fa-leaf', 'library' => 'fa-solid' ], 'icon_position' => 'right', 'show_cta_button' => 'yes', 'cta_text' => 'Read More', 'cta_icon' => [ 'value' => 'fas fa-arrow-right', 'library' => 'fa-solid' ], 'cta_icon_position' => 'after', ], ], 'title_field' => '{{{ title }}}', ] ); $this->add_control( 'left_title_tag', [ 'label' => esc_html__( 'Title HTML Tag', self::TD ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', 'div' => 'div', 'p' => 'p' ], 'default' => 'h4', 'separator' => 'before', ] ); $this->end_controls_section(); } // --------------------------------------------------------- // Right Features — Content // --------------------------------------------------------- private function _section_right_features_content(): void { $this->start_controls_section( 'section_right_features', [ 'label' => esc_html__( 'Right Features', self::TD ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'right_features', [ 'label' => esc_html__( 'Items', self::TD ), 'type' => Controls_Manager::REPEATER, 'fields' => $this->_build_feature_repeater()->get_controls(), 'render_type' => 'template', 'default' => [ [ 'title' => 'Long Battery', 'description' => 'Enjoy reliable performance with a battery designed to keep up with your day.', 'icon_type' => 'icon', 'icon' => [ 'value' => 'fas fa-leaf', 'library' => 'fa-solid' ], 'icon_position' => 'left', 'show_cta_button' => 'yes', 'cta_text' => 'Read More', 'cta_icon' => [ 'value' => 'fas fa-arrow-right', 'library' => 'fa-solid' ], 'cta_icon_position' => 'after', ], [ 'title' => 'Premium Display', 'description' => 'Experience a bright, sharp, and responsive display with a modern look.', 'icon_type' => 'icon', 'icon' => [ 'value' => 'fas fa-leaf', 'library' => 'fa-solid' ], 'icon_position' => 'left', 'show_cta_button' => 'yes', 'cta_text' => 'Read More', 'cta_icon' => [ 'value' => 'fas fa-arrow-right', 'library' => 'fa-solid' ], 'cta_icon_position' => 'after', ], [ 'title' => 'Water Resistant', 'description' => 'Designed to handle everyday splashes and active lifestyles with confidence.', 'icon_type' => 'icon', 'icon' => [ 'value' => 'fas fa-leaf', 'library' => 'fa-solid' ], 'icon_position' => 'left', 'show_cta_button' => 'yes', 'cta_text' => 'Read More', 'cta_icon' => [ 'value' => 'fas fa-arrow-right', 'library' => 'fa-solid' ], 'cta_icon_position' => 'after', ], ], 'title_field' => '{{{ title }}}', ] ); $this->add_control( 'right_title_tag', [ 'label' => esc_html__( 'Title HTML Tag', self::TD ), 'type' => Controls_Manager::SELECT, 'options' => [ 'h3' => 'H3', 'h4' => 'H4', 'h5' => 'H5', 'h6' => 'H6', 'div' => 'div', 'p' => 'p' ], 'default' => 'h4', 'separator' => 'before', ] ); $this->end_controls_section(); } // ========================================================= // STYLE TAB // ========================================================= private function _register_style_controls(): void { $this->_section_wrapper_style(); $this->_section_layout_style(); $this->_section_header_style(); $this->_section_center_image_style(); $this->_section_items_alignment_style(); $this->_section_items_icon_style(); $this->_section_items_icon_bg_style(); $this->_section_items_title_style(); $this->_section_items_divider_style(); $this->_section_items_description_style(); $this->_section_items_cta_style(); $this->_section_items_badge_style(); $this->_section_items_box_style(); $this->_section_items_hover_style(); } // --------------------------------------------------------- // Wrapper Style // --------------------------------------------------------- private function _section_wrapper_style(): void { $this->start_controls_section( 'style_wrapper', [ 'label' => esc_html__( 'Wrapper', self::TD ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'wrapper_background', 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .aafe-product-features-wrapper', ] ); $this->add_responsive_control( 'wrapper_padding', [ 'label' => esc_html__( 'Padding', self::TD ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%', 'vw' ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->add_responsive_control( 'wrapper_border_radius', [ 'label' => esc_html__( 'Border Radius', self::TD ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'wrapper_border', 'selector' => '{{WRAPPER}} .aafe-product-features-wrapper', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'wrapper_box_shadow', 'selector' => '{{WRAPPER}} .aafe-product-features-wrapper', ] ); $this->end_controls_section(); } // --------------------------------------------------------- // Layout Style // --------------------------------------------------------- private function _section_layout_style(): void { $this->start_controls_section( 'style_layout', [ 'label' => esc_html__( 'Layout', self::TD ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'main_layout', [ 'label' => esc_html__( 'Layout', self::TD ), 'type' => Controls_Manager::SELECT, 'options' => [ '3col' => esc_html__( '3 Columns — Left | Image | Right', self::TD ), '2col' => esc_html__( '2 Columns — Image Top, Features Below', self::TD ), '1col' => esc_html__( '1 Column — All Stacked', self::TD ), ], 'default' => '3col', 'tablet_default' => '2col', 'mobile_default' => '1col', 'render_type' => 'template', ] ); $this->add_responsive_control( 'columns_gap', [ 'label' => esc_html__( 'Columns Gap', self::TD ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 150 ] ], 'default' => [ 'size' => 40, 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__grid' => 'gap: {{SIZE}}{{UNIT}};' ], ] ); $this->add_responsive_control( 'features_gap', [ 'label' => esc_html__( 'Items Gap (between feature cards)', self::TD ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 150 ] ], 'default' => [ 'size' => 40, 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__column--left' => 'gap: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .aafe-product-features__column--right' => 'gap: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); } // --------------------------------------------------------- // Header Style // --------------------------------------------------------- private function _section_header_style(): void { $this->start_controls_section( 'style_header', [ 'label' => esc_html__( 'Header', self::TD ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'header_align', [ 'label' => esc_html__( 'Alignment', self::TD ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__( 'Left', self::TD ), 'icon' => 'eicon-text-align-left' ], 'center' => [ 'title' => esc_html__( 'Center', self::TD ), 'icon' => 'eicon-text-align-center' ], 'right' => [ 'title' => esc_html__( 'Right', self::TD ), 'icon' => 'eicon-text-align-right' ], ], 'default' => 'center', 'selectors' => [ '{{WRAPPER}} .aafe-product-features__header' => 'text-align: {{VALUE}}; align-items: {{VALUE}};' ], ] ); $this->add_responsive_control( 'header_max_width', [ 'label' => esc_html__( 'Max Width', self::TD ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'vw' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1400 ], '%' => [ 'min' => 0, 'max' => 100 ] ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__header' => 'max-width: {{SIZE}}{{UNIT}}; margin-left: auto; margin-right: auto;' ], ] ); $this->add_responsive_control( 'header_spacing', [ 'label' => esc_html__( 'Bottom Spacing', self::TD ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 150 ] ], 'default' => [ 'size' => 60, 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__header' => 'margin-bottom: {{SIZE}}{{UNIT}};' ], ] ); /* Pre-Title */ $this->add_control( 'heading_pretitle_style', [ 'label' => esc_html__( 'Pre-Title', self::TD ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'pre_title_color', [ 'label' => esc_html__( 'Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__pre-title' => 'color: {{VALUE}};' ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'pre_title_typography', 'selector' => '{{WRAPPER}} .aafe-product-features__pre-title', ] ); $this->add_responsive_control( 'pre_title_spacing', [ 'label' => esc_html__( 'Bottom Spacing', self::TD ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 60 ] ], 'default' => [ 'size' => 10, 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__pre-title' => 'margin-bottom: {{SIZE}}{{UNIT}};' ], ] ); /* Title */ $this->add_control( 'heading_title_style', [ 'label' => esc_html__( 'Title', self::TD ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'header_color', [ 'label' => esc_html__( 'Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__heading' => 'color: {{VALUE}};' ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'header_typography', 'selector' => '{{WRAPPER}} .aafe-product-features__heading', ] ); /* Description */ $this->add_control( 'heading_desc_style', [ 'label' => esc_html__( 'Description', self::TD ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'header_desc_color', [ 'label' => esc_html__( 'Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__header-desc' => 'color: {{VALUE}};' ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'header_desc_typography', 'selector' => '{{WRAPPER}} .aafe-product-features__header-desc', ] ); /* Header CTA Button Style */ $this->add_control( 'heading_btn_style', [ 'label' => esc_html__( 'CTA Button', self::TD ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_responsive_control( 'header_btn_icon_spacing', [ 'label' => esc_html__( 'Icon Spacing', self::TD ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 60 ] ], 'selectors' => [ '{{WRAPPER}} .aafe-btn-icon--before' => 'margin-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .aafe-btn-icon--after' => 'margin-left: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'btn_margin_top', [ 'label' => esc_html__( 'Top Spacing', self::TD ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 80 ] ], 'default' => [ 'size' => 24, 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__header-btn-wrap' => 'margin-top: {{SIZE}}{{UNIT}};' ], ] ); $this->start_controls_tabs( 'tabs_btn_style' ); $this->start_controls_tab( 'tab_btn_normal', [ 'label' => esc_html__( 'Normal', self::TD ) ] ); $this->add_control( 'btn_text_color', [ 'label' => esc_html__( 'Text Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__header-btn' => 'color: {{VALUE}};' ], ] ); $this->add_control( 'btn_bg_color', [ 'label' => esc_html__( 'Background Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__header-btn' => 'background-color: {{VALUE}};' ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'btn_border', 'selector' => '{{WRAPPER}} .aafe-product-features__header-btn' ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_btn_hover', [ 'label' => esc_html__( 'Hover', self::TD ) ] ); $this->add_control( 'btn_text_hover_color', [ 'label' => esc_html__( 'Text Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__header-btn:hover' => 'color: {{VALUE}};' ], ] ); $this->add_control( 'btn_bg_hover_color', [ 'label' => esc_html__( 'Background Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__header-btn:hover' => 'background-color: {{VALUE}};' ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'btn_border_hover', 'selector' => '{{WRAPPER}} .aafe-product-features__header-btn:hover' ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'btn_typography', 'selector' => '{{WRAPPER}} .aafe-product-features__header-btn', 'separator' => 'before', ] ); $this->add_responsive_control( 'btn_padding', [ 'label' => esc_html__( 'Padding', self::TD ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em' ], 'default' => [ 'top' => '12', 'right' => '28', 'bottom' => '12', 'left' => '28', 'unit' => 'px', 'isLinked' => false ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__header-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->add_responsive_control( 'btn_border_radius', [ 'label' => esc_html__( 'Border Radius', self::TD ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'default' => [ 'top' => '4', 'right' => '4', 'bottom' => '4', 'left' => '4', 'unit' => 'px', 'isLinked' => true ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__header-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->end_controls_section(); } // --------------------------------------------------------- // Center Image Style // --------------------------------------------------------- private function _section_center_image_style(): void { $this->start_controls_section( 'style_center_image', [ 'label' => esc_html__( 'Center Image', self::TD ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'image_width', [ 'label' => esc_html__( 'Width', self::TD ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'vw' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1200 ], '%' => [ 'min' => 0, 'max' => 100 ] ], 'default' => [ 'size' => 300, 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__center-img' => 'width: {{SIZE}}{{UNIT}};' ], ] ); $this->add_responsive_control( 'image_height', [ 'label' => esc_html__( 'Height', self::TD ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'vh' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 1200 ] ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__center-img' => 'height: {{SIZE}}{{UNIT}};' ], ] ); $this->add_control( 'image_object_fit', [ 'label' => esc_html__( 'Object Fit', self::TD ), 'type' => Controls_Manager::SELECT, 'options' => [ '' => 'Default', 'cover' => 'Cover', 'contain' => 'Contain', 'fill' => 'Fill' ], 'default' => '', 'selectors' => [ '{{WRAPPER}} .aafe-product-features__center-img' => 'object-fit: {{VALUE}};' ], ] ); $this->add_responsive_control( 'image_radius', [ 'label' => esc_html__( 'Border Radius', self::TD ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em' ], 'separator' => 'before', 'selectors' => [ '{{WRAPPER}} .aafe-product-features__center-img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .aafe-product-features__image-container' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'image_box_shadow', 'selector' => '{{WRAPPER}} .aafe-product-features__center-img', ] ); /* Overlay Style */ $this->add_control( 'heading_overlay_style', [ 'label' => esc_html__( 'Hover Overlay', self::TD ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', ] ); $this->add_control( 'overlay_color', [ 'label' => esc_html__( 'Overlay Color', self::TD ), 'type' => Controls_Manager::COLOR, 'default' => 'rgba(0,0,0,0.45)', 'selectors' => [ '{{WRAPPER}} .aafe-product-features__image-overlay' => 'background-color: {{VALUE}};' ], ] ); $this->add_control( 'overlay_text_color', [ 'label' => esc_html__( 'Text Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__image-overlay-text' => 'color: {{VALUE}};' ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'overlay_text_typography', 'selector' => '{{WRAPPER}} .aafe-product-features__image-overlay-text', ] ); $this->add_control( 'overlay_blur', [ 'label' => esc_html__( 'Blur Image on Hover', self::TD ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 20 ] ], 'default' => [ 'size' => 0 ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__image-container:hover .aafe-product-features__center-img' => 'filter: blur({{SIZE}}px);' ], ] ); $this->end_controls_section(); } // --------------------------------------------------------- // Items: Alignment // --------------------------------------------------------- private function _section_items_alignment_style(): void { $this->start_controls_section( 'style_items_alignment', [ 'label' => esc_html__( 'Items: Alignment', self::TD ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'left_align', [ 'label' => esc_html__( 'Left Column', self::TD ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'start' => [ 'title' => esc_html__( 'Left', self::TD ), 'icon' => 'eicon-text-align-left' ], 'center' => [ 'title' => esc_html__( 'Center', self::TD ), 'icon' => 'eicon-text-align-center' ], 'end' => [ 'title' => esc_html__( 'Right', self::TD ), 'icon' => 'eicon-text-align-right' ], ], 'default' => 'end', 'selectors' => [ '{{WRAPPER}} .aafe-product-features__item--left' => 'text-align: {{VALUE}};', '{{WRAPPER}} .aafe-product-features__item--left.aafe-icon-pos-top, {{WRAPPER}} .aafe-product-features__item--left.aafe-icon-pos-bottom' => 'align-items: {{VALUE}};', '{{WRAPPER}} .aafe-product-features__item--left .aafe-product-features__content' => 'align-items: {{VALUE}}; display: flex; flex-direction: column;', ], ] ); $this->add_responsive_control( 'right_align', [ 'label' => esc_html__( 'Right Column', self::TD ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'start' => [ 'title' => esc_html__( 'Left', self::TD ), 'icon' => 'eicon-text-align-left' ], 'center' => [ 'title' => esc_html__( 'Center', self::TD ), 'icon' => 'eicon-text-align-center' ], 'end' => [ 'title' => esc_html__( 'Right', self::TD ), 'icon' => 'eicon-text-align-right' ], ], 'default' => 'start', 'selectors' => [ '{{WRAPPER}} .aafe-product-features__item--right' => 'text-align: {{VALUE}};', '{{WRAPPER}} .aafe-product-features__item--right.aafe-icon-pos-top, {{WRAPPER}} .aafe-product-features__item--right.aafe-icon-pos-bottom' => 'align-items: {{VALUE}};', '{{WRAPPER}} .aafe-product-features__item--right .aafe-product-features__content' => 'align-items: {{VALUE}}; display: flex; flex-direction: column;', ], ] ); $this->end_controls_section(); } // --------------------------------------------------------- // Items: Icon / Image // --------------------------------------------------------- private function _section_items_icon_style(): void { $this->start_controls_section( 'style_items_icon', [ 'label' => esc_html__( 'Items: Icon / Image', self::TD ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'icon_size', [ 'label' => esc_html__( 'Size', self::TD ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em', 'rem' ], 'range' => [ 'px' => [ 'min' => 10, 'max' => 200 ] ], 'default' => [ 'size' => 50, 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__icon-wrap img' => 'width: {{SIZE}}{{UNIT}}; height: auto;', '{{WRAPPER}} .aafe-product-features__icon-wrap i' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .aafe-product-features__icon-wrap svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .aafe-product-features__icon' => 'font-size: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'icon_gap', [ 'label' => esc_html__( 'Icon Spacing', self::TD ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 60 ] ], 'default' => [ 'size' => 15, 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__item.aafe-icon-pos-top .aafe-product-features__icon-wrap' => 'margin-bottom: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .aafe-product-features__item.aafe-icon-pos-bottom .aafe-product-features__icon-wrap' => 'margin-top: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .aafe-product-features__item.aafe-icon-pos-left' => 'gap: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .aafe-product-features__item.aafe-icon-pos-right' => 'gap: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'icon_color', [ 'label' => esc_html__( 'Icon Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__icon-wrap' => 'color: {{VALUE}};', '{{WRAPPER}} .aafe-product-features__icon-wrap svg' => 'fill: {{VALUE}};', '{{WRAPPER}} .aafe-product-features__icon-wrap path' => 'fill: {{VALUE}};', ], ] ); $this->add_control( 'icon_hover_color', [ 'label' => esc_html__( 'Icon Hover Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__item:hover .aafe-product-features__icon-wrap' => 'color: {{VALUE}};', '{{WRAPPER}} .aafe-product-features__item:hover .aafe-product-features__icon-wrap svg' => 'fill: {{VALUE}};', '{{WRAPPER}} .aafe-product-features__item:hover .aafe-product-features__icon-wrap path' => 'fill: {{VALUE}};', ], ] ); $this->end_controls_section(); } // --------------------------------------------------------- // Items: Icon Background // --------------------------------------------------------- private function _section_items_icon_bg_style(): void { $this->start_controls_section( 'style_items_icon_bg', [ 'label' => esc_html__( 'Items: Icon Background', self::TD ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->start_controls_tabs( 'tabs_icon_bg' ); $this->start_controls_tab( 'tab_icon_bg_normal', [ 'label' => esc_html__( 'Normal', self::TD ) ] ); $this->add_control( 'icon_bg_color', [ 'label' => esc_html__( 'Background Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__icon-wrap' => 'background-color: {{VALUE}};' ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'icon_bg_border', 'selector' => '{{WRAPPER}} .aafe-product-features__icon-wrap', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'icon_bg_shadow', 'selector' => '{{WRAPPER}} .aafe-product-features__icon-wrap', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_icon_bg_hover', [ 'label' => esc_html__( 'Hover', self::TD ) ] ); $this->add_control( 'icon_bg_hover_color', [ 'label' => esc_html__( 'Background Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__item:hover .aafe-product-features__icon-wrap' => 'background-color: {{VALUE}};' ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'icon_bg_hover_shadow', 'selector' => '{{WRAPPER}} .aafe-product-features__item:hover .aafe-product-features__icon-wrap', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'icon_bg_padding', [ 'label' => esc_html__( 'Padding (background size)', self::TD ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em' ], 'default' => [ 'top' => '12', 'right' => '12', 'bottom' => '12', 'left' => '12', 'unit' => 'px', 'isLinked' => true ], 'separator' => 'before', 'selectors' => [ '{{WRAPPER}} .aafe-product-features__icon-wrap' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->add_responsive_control( 'icon_bg_radius', [ 'label' => esc_html__( 'Border Radius', self::TD ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'description' => esc_html__( 'Leave empty to use per-item Background Shape (circle / square / rounded).', self::TD ), 'selectors' => [ '{{WRAPPER}} .aafe-product-features__icon-wrap' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;' ], ] ); $this->end_controls_section(); } // --------------------------------------------------------- // Items: Title // --------------------------------------------------------- private function _section_items_title_style(): void { $this->start_controls_section( 'style_items_title', [ 'label' => esc_html__( 'Items: Title', self::TD ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'item_title_color', [ 'label' => esc_html__( 'Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__title' => 'color: {{VALUE}};' ], ] ); $this->add_control( 'item_title_hover_color', [ 'label' => esc_html__( 'Hover Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__item:hover .aafe-product-features__title' => 'color: {{VALUE}};' ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'item_title_typography', 'selector' => '{{WRAPPER}} .aafe-product-features__title', ] ); $this->add_responsive_control( 'title_spacing', [ 'label' => esc_html__( 'Bottom Spacing', self::TD ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 60 ] ], 'default' => [ 'size' => 8, 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__title' => 'margin-bottom: {{SIZE}}{{UNIT}};' ], ] ); $this->end_controls_section(); } // --------------------------------------------------------- // Items: Divider Line // --------------------------------------------------------- private function _section_items_divider_style(): void { $this->start_controls_section( 'style_items_divider', [ 'label' => esc_html__( 'Items: Divider Line', self::TD ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'divider_color', [ 'label' => esc_html__( 'Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__divider' => 'background-color: {{VALUE}};' ], ] ); $this->add_responsive_control( 'divider_width', [ 'label' => esc_html__( 'Width', self::TD ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'range' => [ 'px' => [ 'min' => 10, 'max' => 300 ] ], 'default' => [ 'size' => 40, 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__divider' => 'width: {{SIZE}}{{UNIT}};' ], ] ); $this->add_control( 'divider_height', [ 'label' => esc_html__( 'Height (thickness)', self::TD ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 1, 'max' => 10 ] ], 'default' => [ 'size' => 2 ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__divider' => 'height: {{SIZE}}px;' ], ] ); $this->add_responsive_control( 'divider_spacing', [ 'label' => esc_html__( 'Spacing (Top / Bottom)', self::TD ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em' ], 'default' => [ 'top' => '8', 'right' => '0', 'bottom' => '12', 'left' => '0', 'unit' => 'px', 'isLinked' => false ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__divider' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->end_controls_section(); } // --------------------------------------------------------- // Items: Description // --------------------------------------------------------- private function _section_items_description_style(): void { $this->start_controls_section( 'style_items_description', [ 'label' => esc_html__( 'Items: Description', self::TD ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'item_desc_color', [ 'label' => esc_html__( 'Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__desc' => 'color: {{VALUE}};' ], ] ); $this->add_control( 'item_desc_hover_color', [ 'label' => esc_html__( 'Hover Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__item:hover .aafe-product-features__desc' => 'color: {{VALUE}};' ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'item_desc_typography', 'selector' => '{{WRAPPER}} .aafe-product-features__desc', ] ); $this->end_controls_section(); } // --------------------------------------------------------- // Items: CTA Button // --------------------------------------------------------- private function _section_items_cta_style(): void { $this->start_controls_section( 'style_items_cta', [ 'label' => esc_html__( 'Items: CTA Button', self::TD ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'cta_icon_spacing', [ 'label' => esc_html__( 'Icon Spacing', self::TD ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 60 ] ], 'selectors' => [ '{{WRAPPER}} .aafe-cta-icon--before' => 'margin-right: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .aafe-cta-icon--after' => 'margin-left: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'cta_spacing', [ 'label' => esc_html__( 'Top Spacing', self::TD ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 40 ] ], 'default' => [ 'size' => 12, 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__cta' => 'margin-top: {{SIZE}}{{UNIT}};' ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'cta_typography', 'selector' => '{{WRAPPER}} .aafe-product-features__cta', ] ); $this->start_controls_tabs( 'tabs_cta_btn' ); $this->start_controls_tab( 'tab_cta_btn_normal', [ 'label' => esc_html__( 'Normal', self::TD ) ] ); $this->add_control( 'cta_btn_text_color', [ 'label' => esc_html__( 'Text Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__cta' => 'color: {{VALUE}};' ], ] ); $this->add_control( 'cta_btn_bg_color', [ 'label' => esc_html__( 'Background', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__cta' => 'background-color: {{VALUE}};' ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'cta_btn_border', 'selector' => '{{WRAPPER}} .aafe-product-features__cta', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'cta_btn_box_shadow', 'selector' => '{{WRAPPER}} .aafe-product-features__cta', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_cta_btn_hover', [ 'label' => esc_html__( 'Hover', self::TD ) ] ); $this->add_control( 'cta_btn_text_hover_color', [ 'label' => esc_html__( 'Text Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__item:hover .aafe-product-features__cta' => 'color: {{VALUE}};' ], ] ); $this->add_control( 'cta_btn_bg_hover_color', [ 'label' => esc_html__( 'Background', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__item:hover .aafe-product-features__cta' => 'background-color: {{VALUE}};' ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'cta_btn_border_hover', 'selector' => '{{WRAPPER}} .aafe-product-features__item:hover .aafe-product-features__cta', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'cta_btn_hover_box_shadow', 'selector' => '{{WRAPPER}} .aafe-product-features__item:hover .aafe-product-features__cta', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'cta_btn_padding', [ 'label' => esc_html__( 'Button Padding', self::TD ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em' ], 'separator' => 'before', 'selectors' => [ '{{WRAPPER}} .aafe-product-features__cta' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->add_responsive_control( 'cta_btn_radius', [ 'label' => esc_html__( 'Border Radius', self::TD ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__cta' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->end_controls_section(); } // --------------------------------------------------------- // Items: Badge // --------------------------------------------------------- private function _section_items_badge_style(): void { $this->start_controls_section( 'style_items_badge', [ 'label' => esc_html__( 'Items: Badge', self::TD ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'badge_bg_color', [ 'label' => esc_html__( 'Background Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__badge' => 'background-color: {{VALUE}};' ], ] ); $this->add_control( 'badge_text_color', [ 'label' => esc_html__( 'Text Color', self::TD ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .aafe-product-features__badge' => 'color: {{VALUE}};' ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'badge_typography', 'selector' => '{{WRAPPER}} .aafe-product-features__badge', ] ); $this->add_responsive_control( 'badge_padding', [ 'label' => esc_html__( 'Padding', self::TD ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em' ], 'default' => [ 'top' => '3', 'right' => '10', 'bottom' => '3', 'left' => '10', 'unit' => 'px', 'isLinked' => false ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->add_responsive_control( 'badge_border_radius', [ 'label' => esc_html__( 'Border Radius', self::TD ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'default' => [ 'top' => '20', 'right' => '20', 'bottom' => '20', 'left' => '20', 'unit' => 'px', 'isLinked' => true ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->add_responsive_control( 'badge_spacing', [ 'label' => esc_html__( 'Bottom Spacing', self::TD ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 30 ] ], 'default' => [ 'size' => 8, 'unit' => 'px' ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__badge' => 'margin-bottom: {{SIZE}}{{UNIT}};' ], ] ); $this->end_controls_section(); } // --------------------------------------------------------- // Items: Item Box (Padding, Border, Background, Shadow) // --------------------------------------------------------- private function _section_items_box_style(): void { $this->start_controls_section( 'style_items_box', [ 'label' => esc_html__( 'Items: Item Box', self::TD ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'item_padding', [ 'label' => esc_html__( 'Padding', self::TD ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'item_border', 'selector' => '{{WRAPPER}} .aafe-product-features__item', ] ); $this->add_responsive_control( 'item_border_radius', [ 'label' => esc_html__( 'Border Radius', self::TD ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__item' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->start_controls_tabs( 'tabs_item_bg' ); $this->start_controls_tab( 'tab_item_bg_normal', [ 'label' => esc_html__( 'Normal', self::TD ) ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'item_background', 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .aafe-product-features__item', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'item_box_shadow', 'selector' => '{{WRAPPER}} .aafe-product-features__item', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_item_bg_hover', [ 'label' => esc_html__( 'Hover', self::TD ) ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'item_hover_background', 'types' => [ 'classic', 'gradient' ], 'selector' => '{{WRAPPER}} .aafe-product-features__item:hover', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'item_hover_box_shadow', 'selector' => '{{WRAPPER}} .aafe-product-features__item:hover', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); } // --------------------------------------------------------- // Items: Hover Animation // --------------------------------------------------------- private function _section_items_hover_style(): void { $this->start_controls_section( 'style_items_hover', [ 'label' => esc_html__( 'Items: Hover Animation', self::TD ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'hover_effect_type', [ 'label' => esc_html__( 'Effect', self::TD ), 'type' => Controls_Manager::SELECT, 'options' => [ 'none' => esc_html__( 'None', self::TD ), 'lift' => esc_html__( 'Lift (Translate Up)', self::TD ), 'scale' => esc_html__( 'Scale', self::TD ), 'glow' => esc_html__( 'Glow', self::TD ), 'border-pop' => esc_html__( 'Border Pop + Shadow', self::TD ), ], 'default' => 'none', ] ); $this->add_control( 'hover_scale_amount', [ 'label' => esc_html__( 'Scale Amount', self::TD ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 1.00, 'max' => 1.30, 'step' => 0.01 ] ], 'default' => [ 'size' => 1.03 ], 'condition' => [ 'hover_effect_type' => 'scale' ], ] ); $this->add_control( 'hover_transition_duration', [ 'label' => esc_html__( 'Transition Duration (ms)', self::TD ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 100, 'max' => 1000, 'step' => 50 ] ], 'default' => [ 'size' => 300 ], 'selectors' => [ '{{WRAPPER}} .aafe-product-features__item' => '--aafe-transition: {{SIZE}}ms;' ], ] ); $this->end_controls_section(); } // ========================================================= // RENDER // ========================================================= protected function render(): void { $s = $this->get_settings_for_display(); $title_tag = esc_attr( $s['main_title_tag'] ?? 'h2' ); $pre_tag = esc_attr( $s['pre_title_tag'] ?? 'span' ); $left_tag = esc_attr( $s['left_title_tag'] ?? 'h4' ); $right_tag = esc_attr( $s['right_title_tag'] ?? 'h4' ); $hover_type = $s['hover_effect_type'] ?? 'none'; $hover_scale = (float) ( $s['hover_scale_amount']['size'] ?? 1.03 ); $layout = esc_attr( $s['main_layout'] ?? '3col' ); $layout_tablet = esc_attr( $s['main_layout_tablet'] ?? '2col' ); $layout_mobile = esc_attr( $s['main_layout_mobile'] ?? '1col' ); // Fallback: print FA5 in wp_footer — static method prevents duplicate hooks on multi-widget pages. self::_maybe_enqueue_fa5_footer(); ?>