widget_icon_classes('team');
}
/**
* Get widget categories.
*
* @since 1.0.0
* @access public
*
* @return array Widget categories.
*/
public function get_categories() {
return [ 'ai-elements' ];
}
/**
* Retrieve the list of scripts the counter widget depended on.
*
* Used to set scripts dependencies required to run the widget.
*
* @since 1.3.0
* @access public
*
* @return array Widget scripts dependencies.
*/
public function get_script_depends() {
return [ 'ai-front-end' ];
}
public function get_style_depends() {
return [ 'themify-icons', 'bootstrap-icons' ];
}
/**
* Get widget keywords.
* @return array widget keywords.
*/
public function get_keywords() {
return [ 'team', 'member', 'user', 'employee', 'staff', 'profile' ];
}
public function get_help_url() {
return 'https://aiaddons.ai/team-demo/';
}
/**
* Register Team widget controls.
*
* @since 1.0.0
* @access protected
*/
protected function register_controls() {
//Layouts Section
$this->start_controls_section(
'icon_layouts_section',
[
'label' => esc_html__( 'Layouts', 'ai-addons' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'aiea_icon_startup',
[
'label' => __( 'Icon', 'ai-addons' ),
'type' => Controls_Manager::ICONS,
'fa4compatibility' => 'social',
'default' => [
'value' => 'fab fa-wordpress',
'library' => 'fa-brands',
]
]
);
$this->add_control(
'team_layout',
[
'label' => esc_html__( 'Choose Layout', 'ai-addons' ),
'type' => 'aiea-image-select',
'default' => 'layout-1',
'choices' => [
'layout-1' => [ 'thumbnail' => AIEA_URL .'assets/images/layouts/team/layout-1.jpg', 'image' => 'https://aiaddons.ai/ai-import/widget-layouts/team/layout-1.jpg', 'label' => esc_html__( 'Layout 1', 'ai-addons' ) ],
'layout-2' => [ 'thumbnail' => AIEA_URL .'assets/images/layouts/team/layout-2.jpg', 'image' => 'https://aiaddons.ai/ai-import/widget-layouts/team/layout-2.jpg', 'label' => esc_html__( 'Layout 2', 'ai-addons' ) ],
'layout-3' => [ 'thumbnail' => AIEA_URL .'assets/images/layouts/team/layout-3.jpg', 'image' => 'https://aiaddons.ai/ai-import/widget-layouts/team/layout-3.jpg', 'label' => esc_html__( 'Layout 3(Pro)', 'ai-addons' ) ],
'layout-4' => [ 'thumbnail' => AIEA_URL .'assets/images/layouts/team/layout-4.jpg', 'image' => 'https://aiaddons.ai/ai-import/widget-layouts/team/layout-4.jpg', 'label' => esc_html__( 'Layout 4(Pro)', 'ai-addons' ) ],
'custom' => [ 'thumbnail' => AIEA_URL .'assets/images/layouts/custom-xs.jpg', 'image' => AIEA_URL .'assets/images/layouts/custom.jpg', 'label' => esc_html__( 'Custom(Pro)', 'ai-addons' ) ],
]
]
);
$this->add_control(
'layout_pro_alert',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => esc_html__( 'Only available in pro version!', 'ai-addons'),
'content_classes' => 'ai-elementor-warning',
'condition' => [
'team_layout!' => $this->get_free_options('team_layout'),
]
]
);
$this->end_controls_section();
//Overlay Section
$this->start_controls_section(
'overlay_section',
[
'label' => esc_html__( 'Overlay', 'ai-addons' ),
'tab' => Controls_Manager::TAB_CONTENT,
'condition' => [ 'team_layout' => 'layout-2'],
]
);
$this->add_control(
'overlay_enable',
[
'label' => esc_html__( 'Overlay Enable', 'ai-addons' ),
'type' => Controls_Manager::SWITCHER,
'default' => 'yes',
'prefix_class' => 'team-overlay-'
]
);
$this->end_controls_section();
//Title Section
$this->start_controls_section(
'title_section',
[
'label' => esc_html__( 'Name', 'ai-addons' ),
'tab' => Controls_Manager::TAB_CONTENT
]
);
$this->add_control(
'title',
[
'type' => Controls_Manager::TEXT,
'label' => esc_html__( 'Name', 'ai-addons' ),
'default' => esc_html__( 'Member', 'ai-addons' )
]
);
$this->add_control(
'title_head',
[
'label' => esc_html__( 'Heading Tag', 'ai-addons' ),
'type' => Controls_Manager::SELECT,
'default' => 'h3',
'options' => [
'h1' => esc_html__( 'h1', 'ai-addons' ),
'h2' => esc_html__( 'h2', 'ai-addons' ),
'h3' => esc_html__( 'h3', 'ai-addons' ),
'h4' => esc_html__( 'h4', 'ai-addons' ),
'h5' => esc_html__( 'h5', 'ai-addons' ),
'h6' => esc_html__( 'h6', 'ai-addons' ),
'p' => esc_html__( 'p', 'ai-addons' ),
'span' => esc_html__( 'span', 'ai-addons' ),
'div' => esc_html__( 'div', 'ai-addons' ),
'i' => esc_html__( 'i', 'ai-addons' )
]
]
);
$this->add_control(
'title_text_trans',
[
'label' => esc_html__( 'Transform', 'ai-addons' ),
'type' => Controls_Manager::SELECT,
'default' => 'none',
'options' => [
'none' => esc_html__( 'Default', 'ai-addons' ),
'capitalize' => esc_html__( 'Capitalized', 'ai-addons' ),
'uppercase' => esc_html__( 'Upper Case', 'ai-addons' ),
'lowercase' => esc_html__( 'Lower Case', 'ai-addons' )
],
'selectors' => [
'{{WRAPPER}} .team-wrapper .team-title' => 'text-transform: {{VALUE}};'
],
]
);
$this->end_controls_section();
//Designation Section
$this->start_controls_section(
'des_section',
[
'label' => esc_html__( 'Designation', 'ai-addons' ),
'tab' => Controls_Manager::TAB_CONTENT
]
);
$this->add_control(
'member_designation',
[
'type' => Controls_Manager::TEXT,
'label' => esc_html__( 'Name', 'ai-addons' ),
'default' => esc_html__( 'CEO', 'ai-addons' )
]
);
$this->add_control(
'des_head',
[
'label' => esc_html__( 'Heading Tag', 'ai-addons' ),
'type' => Controls_Manager::SELECT,
'default' => 'h5',
'options' => [
'h1' => esc_html__( 'h1', 'ai-addons' ),
'h2' => esc_html__( 'h2', 'ai-addons' ),
'h3' => esc_html__( 'h3', 'ai-addons' ),
'h4' => esc_html__( 'h4', 'ai-addons' ),
'h5' => esc_html__( 'h5', 'ai-addons' ),
'h6' => esc_html__( 'h6', 'ai-addons' ),
'p' => esc_html__( 'p', 'ai-addons' ),
'span' => esc_html__( 'span', 'ai-addons' ),
'div' => esc_html__( 'div', 'ai-addons' ),
'i' => esc_html__( 'i', 'ai-addons' )
]
]
);
$this->end_controls_section();
// Image Section
$this->start_controls_section(
'image_section',
[
'label' => esc_html__( 'Image', 'ai-addons' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'image',
[
'type' => Controls_Manager::MEDIA,
'label' => esc_html__( 'Image', 'ai-addons' ),
'dynamic' => [
'active' => true,
],
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
]
);
$this->add_group_control(
Group_Control_Image_Size::get_type(),
[
'name' => 'thumbnail',
'default' => 'full',
'separator' => 'none',
]
);
$this->add_control(
'image_position_trigger',
[
'label' => esc_html__( 'Image Position Trigger', 'ai-addons' ),
'type' => 'ai-trigger',
'default' => 'nothing',
'classes' => 'ai-hidden-trigger-control'
]
);
$this->end_controls_section();
//Social Icons Section
$this->start_controls_section(
'icons_section',
[
'label' => esc_html__( 'Social Icons', 'ai-addons' ),
'tab' => Controls_Manager::TAB_CONTENT
]
);
$this->add_control(
'shape',
[
'label' => esc_html__( 'Shape', 'ai-addons' ),
'type' => Controls_Manager::SELECT,
'default' => 'circle',
'options' => [
'rounded' => esc_html__( 'Rounded', 'ai-addons' ),
'square' => esc_html__( 'Square', 'ai-addons' ),
'circle' => esc_html__( 'Circle', 'ai-addons' ),
],
'prefix_class' => 'elementor-shape-',
]
);
$repeater = new Repeater();
$repeater->add_control(
'social_icon',
[
'label' => __( 'Icon', 'ai-addons' ),
'type' => Controls_Manager::ICONS,
'fa4compatibility' => 'social',
'default' => [
'value' => 'fab fa-wordpress',
'library' => 'fa-brands',
],
'recommended' => [
'fa-brands' => [
'android',
'apple',
'behance',
'bitbucket',
'codepen',
'delicious',
'deviantart',
'digg',
'dribbble',
'elementor',
'facebook',
'flickr',
'foursquare',
'free-code-camp',
'github',
'gitlab',
'globe',
'houzz',
'instagram',
'jsfiddle',
'linkedin',
'medium',
'meetup',
'mix',
'mixcloud',
'odnoklassniki',
'pinterest',
'product-hunt',
'reddit',
'shopping-cart',
'skype',
'slideshare',
'snapchat',
'soundcloud',
'spotify',
'stack-overflow',
'steam',
'telegram',
'thumb-tack',
'tripadvisor',
'tumblr',
'twitch',
'twitter',
'viber',
'vimeo',
'vk',
'weibo',
'weixin',
'whatsapp',
'wordpress',
'xing',
'yelp',
'youtube',
'500px',
],
'fa-solid' => [
'envelope',
'link',
'rss',
],
],
]
);
$repeater->add_control(
'link',
[
'label' => __( 'Link', 'ai-addons' ),
'type' => Controls_Manager::URL,
'default' => [
'is_external' => 'true',
],
'dynamic' => [
'active' => true,
],
'placeholder' => 'https://your-link.com',
]
);
$repeater->add_control(
'link_color',
[
'label' => esc_html__( 'Color', 'ai-addons' ),
'type' => Controls_Manager::SELECT,
'default' => 'default',
'options' => [
'default' => esc_html__( 'Official Color', 'ai-addons' ),
'custom' => esc_html__( 'Custom', 'ai-addons' ),
],
]
);
$repeater->add_control(
'link_primary_color',
[
'label' => esc_html__( 'Background Color', 'ai-addons' ),
'type' => Controls_Manager::COLOR,
'condition' => [
'link_color' => 'custom',
],
'selectors' => [
'{{WRAPPER}} {{CURRENT_ITEM}}.elementor-social-icon' => 'background-color: {{VALUE}};',
],
]
);
$repeater->add_control(
'link_secondary_color',
[
'label' => esc_html__( 'Color', 'ai-addons' ),
'type' => Controls_Manager::COLOR,
'condition' => [
'link_color' => 'custom',
],
'selectors' => [
'{{WRAPPER}} {{CURRENT_ITEM}}.elementor-social-icon i' => 'color: {{VALUE}};',
'{{WRAPPER}} {{CURRENT_ITEM}}.elementor-social-icon svg' => 'fill: {{VALUE}};',
],
]
);
$this->add_control(
'social_icon_list',
[
'label' => __( 'Social Icons', 'ai-addons' ),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'default' => [
[
'social_icon' => [
'value' => 'fab fa-facebook',
'library' => 'fa-brands',
],
],
[
'social_icon' => [
'value' => 'fab fa-twitter',
'library' => 'fa-brands',
],
],
[
'social_icon' => [
'value' => 'fab fa-youtube',
'library' => 'fa-brands',
],
],
],
'title_field' => '<# var migrated = "undefined" !== typeof __fa4_migrated, social = ( "undefined" === typeof social ) ? false : social; #>{{{ elementor.helpers.getSocialNetworkNameFromIcon( social_icon, social, true, migrated, true ) }}}',
]
);
$this->end_controls_section();
// Content
$this->start_controls_section(
'content_section',
[
'label' => esc_html__( 'Content', 'ai-addons' ),
'tab' => Controls_Manager::TAB_CONTENT,
'condition' => [ 'team_layout' => 'layout-1'],
]
);
// Openai part
$openaiea_api_key = aiea_addon_base()->aiea_options('openai-api');
$this->add_control(
'aiea_content_opt',
[
'label' => esc_html__( 'OpenAI Content?', 'ai-addons' ),
'type' => Controls_Manager::SWITCHER,
'default' => 'no'
]
);
if( !$openaiea_api_key ) {
$this->add_control(
'aiea_msg',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => sprintf( 'You should put OpenAI api key on plugin settings. %s', __( 'AI addons -> settings -> OpenAI API Key', 'ai-addons' ) ),
'content_classes' => 'ai-elementor-warning',
'condition' => [
'aiea_content_opt' => 'yes'
],
]
);
} else {
$this->add_control(
'aiea_content_box',
[
'type' => 'aiea_prompt',
'label' => esc_html__( 'Enter anything', 'rc-custom' ),
'btn_txt' => esc_html__( 'Search', 'ai-addons' ),
'loading_text' => esc_html__( 'Loading..', 'ai-addons' ),
'default' => '',
'description' => __( 'Example 1: 50 words about space
Example 2: 50 words about space in french', 'ai-addons' ),
'condition' => [
'aiea_content_opt' => 'yes'
],
]
);
}
$this->add_control(
'content',
[
'type' => Controls_Manager::WYSIWYG,
'label' => esc_html__( 'Content', 'ai-addons' ),
'default' => aiea_addon_base()->make_default_content('team'),
]
);
$this->end_controls_section();
// Go premium section
$this->start_controls_section(
'aiea_section_pro',
[
'label' => esc_html__( 'Go Premium for More Features', 'ai-addons' )
]
);
$this->add_control(
'aiea_get_pro',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => ' Get the Pro version for more ai elements and customization options.',
'content_classes' => 'ai-elementor-warning'
]
);
$this->end_controls_section();
// Style Section
$this->start_controls_section(
'section_style_team',
[
'label' => __( 'Team', 'ai-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->start_controls_tabs( 'team_content_styles' );
$this->start_controls_tab(
'icon_box_content_normal',
[
'label' => esc_html__( 'Normal', 'ai-addons' ),
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'bg_color',
'types' => [ 'classic', 'gradient' ],
'selector' => '{{WRAPPER}} .team-inner > *',
]
);
$this->add_responsive_control(
'content_align',
[
'label' => esc_html__( 'Alignment', 'ai-addons' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => esc_html__( 'Left', 'ai-addons' ),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => esc_html__( 'Center', 'ai-addons' ),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => esc_html__( 'Right', 'ai-addons' ),
'icon' => 'eicon-text-align-right',
],
'justify' => [
'title' => esc_html__( 'Justified', 'ai-addons' ),
'icon' => 'eicon-text-align-justify',
],
],
'selectors' => [
'{{WRAPPER}} .team-inner *' => 'text-align: {{VALUE}};',
]
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'team_border',
'selector' => '{{WRAPPER}} .team-inner > *',
'separator' => 'before',
]
);
$this->add_responsive_control(
'team_border_radius',
[
'label' => esc_html__( 'Border Radius', 'ai-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'selectors' => [
'{{WRAPPER}} .team-inner > *' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
]
]
);
$this->add_responsive_control(
'team_padding',
[
'label' => esc_html__( 'Padding', 'ai-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [
'{{WRAPPER}} .team-inner > *' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
]
]
);
$this->add_responsive_control(
'team_margin',
[
'label' => esc_html__( 'Margin', 'ai-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [
'{{WRAPPER}} .team-inner > *' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
]
]
);
$this->add_control(
'shadow_opt',
[
'label' => esc_html__( 'Box Shadow', 'ai-addons' ),
'type' => Controls_Manager::SWITCHER,
'default' => 'no'
]
);
$this->add_control(
'box_shadow',
[
'label' => esc_html__( 'Box Shadow', 'ai-addons' ),
'type' => Controls_Manager::BOX_SHADOW,
'condition' => [
'shadow_opt' => 'yes',
],
'selectors' => [
'{{WRAPPER}} .team-inner > *' => 'box-shadow: {{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{SPREAD}}px {{COLOR}} {{icon_box_shadow_pos.VALUE}};',
]
]
);
$this->add_control(
'box_shadow_pos',
[
'label' => esc_html__( 'Box Shadow Position', 'ai-addons' ),
'type' => Controls_Manager::SELECT,
'options' => [
' ' => esc_html__( 'Outline', 'ai-addons' ),
'inset' => esc_html__( 'Inset', 'ai-addons' ),
],
'condition' => [
'shadow_opt' => 'yes',
],
'default' => ' ',
'render_type' => 'ui',
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'team_content_hover',
[
'label' => esc_html__( 'Hover', 'ai-addons' ),
]
);
$this->add_control(
'bg_hcolor',
[
'label' => esc_html__( 'Background Color', 'ai-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .team-inner:hover > *' => 'background-color: {{VALUE}};'
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'team_hover_border',
'selector' => '{{WRAPPER}} .team-inner:hover > *',
'separator' => 'before',
]
);
$this->add_control(
'shadow_hopt',
[
'label' => esc_html__( 'Box Shadow', 'ai-addons' ),
'type' => Controls_Manager::SWITCHER,
'default' => 'no'
]
);
$this->add_control(
'team_hbox_shadow',
[
'label' => esc_html__( 'Box Shadow', 'ai-addons' ),
'type' => Controls_Manager::BOX_SHADOW,
'condition' => [
'shadow_hopt' => 'yes',
],
'selectors' => [
'{{WRAPPER}} .team-inner:hover > *' => 'box-shadow: {{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{SPREAD}}px {{COLOR}} {{icon_box_hbox_shadow_pos.VALUE}};',
]
]
);
$this->add_control(
'team_hbox_shadow_pos',
[
'label' => esc_html__( 'Box Shadow Position', 'ai-addons' ),
'type' => Controls_Manager::SELECT,
'options' => [
' ' => esc_html__( 'Outline', 'ai-addons' ),
'inset' => esc_html__( 'Inset', 'ai-addons' ),
],
'condition' => [
'shadow_hopt' => 'yes',
],
'default' => ' ',
'render_type' => 'ui',
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->end_controls_section();
// Style Overlay Section
$this->start_controls_section(
'section_style_overlay',
[
'label' => __( 'Overlay', 'ai-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => [ 'overlay_enable' => 'yes'],
]
);
$this->add_control(
'bg_overlay_color',
[
'label' => esc_html__( 'Background', 'ai-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .ai-team-img:after' => 'background-color: {{VALUE}};'
],
]
);
$this->add_responsive_control(
'overlay_border_radius',
[
'label' => esc_html__( 'Border Radius', 'ai-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'selectors' => [
'{{WRAPPER}} .ai-team-img:after' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
]
]
);
$this->add_responsive_control(
'overlay_opacity',
[
'label' => esc_html__( 'Opacity', 'ai-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px' ],
'default' => [
'size' => 6,
],
'range' => [
'px' => [
'min' => 0,
'max' => 10,
],
],
'selectors' => [
'{{WRAPPER}} .ai-team-img:after' => 'opacity: calc( {{SIZE}} / 10 );'
]
]
);
$this->add_responsive_control(
'overlay_content_pos',
[
'label' => esc_html__( 'Overlay Content Position', 'ai-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ '%' ],
'range' => [
'%' => [
'min' => 0,
'max' => 100,
],
],
'default' => [
'unit' => '%',
'size' => 50,
],
'selectors' => [
'{{WRAPPER}} .team-inner:hover .team-overlay-wrapper .team-overlay-inner' => 'top: {{SIZE}}%;',
],
]
);
$this->end_controls_section();
// Style Title Section
$this->start_controls_section(
'section_style_title',
[
'label' => __( 'Name', 'ai-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->start_controls_tabs( 'title_colors' );
$this->start_controls_tab(
'title_colors_normal',
[
'label' => esc_html__( 'Normal', 'ai-addons' ),
]
);
$this->add_control(
'title_color',
[
'type' => Controls_Manager::COLOR,
'label' => esc_html__( 'Color', 'ai-addons' ),
'default' => '',
'selectors' => [
'{{WRAPPER}} .team-title' => 'color: {{VALUE}};'
],
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'title_colors_hover',
[
'label' => esc_html__( 'Hover', 'ai-addons' ),
]
);
$this->add_control(
'title_hcolor',
[
'type' => Controls_Manager::COLOR,
'label' => esc_html__( 'Color', 'ai-addons' ),
'default' => '',
'selectors' => [
'{{WRAPPER}}:hover .team-title' => 'color: {{VALUE}};'
],
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_responsive_control(
'title_margin',
[
'label' => esc_html__( 'Margin', 'ai-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'selectors' => [
'{{WRAPPER}} .team-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
]
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'icon_box_title_typography',
'selector' => '{{WRAPPER}} .team-title'
]
);
$this->end_controls_section();
// Style Designation Section
$this->start_controls_section(
'section_style_des',
[
'label' => __( 'Designation', 'ai-addons' ),
'tab' => Controls_Manager::TAB_STYLE
]
);
$this->start_controls_tabs( 'des_colors' );
$this->start_controls_tab(
'des_colors_normal',
[
'label' => esc_html__( 'Normal', 'ai-addons' ),
]
);
$this->add_control(
'des_color',
[
'type' => Controls_Manager::COLOR,
'label' => esc_html__( 'Color', 'ai-addons' ),
'default' => '',
'selectors' => [
'{{WRAPPER}} .team-member-des' => 'color: {{VALUE}};'
],
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'des_colors_hover',
[
'label' => esc_html__( 'Hover', 'ai-addons' ),
]
);
$this->add_control(
'des_hcolor',
[
'type' => Controls_Manager::COLOR,
'label' => esc_html__( 'Color', 'ai-addons' ),
'default' => '',
'selectors' => [
'{{WRAPPER}}:hover .team-member-des' => 'color: {{VALUE}};'
],
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_responsive_control(
'des_margin',
[
'label' => esc_html__( 'Margin', 'ai-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'selectors' => [
'{{WRAPPER}} .team-member-des' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
]
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'team_des_typography',
'selector' => '{{WRAPPER}} .team-member-des'
]
);
$this->end_controls_section();
// Style Image Section
$this->start_controls_section(
'section_style_image',
[
'label' => __( 'Image', 'ai-addons' ),
'tab' => Controls_Manager::TAB_STYLE
]
);
$this->add_control(
'hover_animation',
[
'label' => __( 'Hover Animation', 'ai-addons' ),
'type' => Controls_Manager::HOVER_ANIMATION,
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_control(
'resize_opt',
[
'label' => esc_html__( 'Resize Option', 'ai-addons' ),
'type' => Controls_Manager::SWITCHER,
'default' => 'no'
]
);
$this->add_responsive_control(
'image_width',
[
'label' => esc_html__( 'Image Width', 'ai-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px' ],
'range' => [
'px' => [
'min' => 0,
'max' => 1000,
],
],
'default' => [
'unit' => 'px',
'size' => 50,
],
'condition' => [
'resize_opt' => 'yes',
],
'selectors' => [
'{{WRAPPER}} .ai-team-img > img' => 'width: {{SIZE}}px;',
],
]
);
$this->add_responsive_control(
'image_height',
[
'label' => esc_html__( 'Image height', 'ai-addons' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px' ],
'range' => [
'px' => [
'min' => 0,
'max' => 1000,
],
],
'default' => [
'unit' => 'px',
'size' => 50,
],
'condition' => [
'resize_opt' => 'yes',
],
'selectors' => [
'{{WRAPPER}} .ai-team-img > img' => 'height: {{SIZE}}px;',
],
]
);
$this->add_responsive_control(
'image_margin',
[
'label' => esc_html__( 'Margin', 'ai-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'selectors' => [
'{{WRAPPER}} .ai-team-img > img' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
]
]
);
$this->add_responsive_control(
'img_padding',
[
'label' => esc_html__( 'Padding', 'ai-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'selectors' => [
'{{WRAPPER}} .ai-team-img > img' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
]
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'team_img_border',
'label' => esc_html__( 'Border', 'ai-addons' ),
'selector' => '{{WRAPPER}} .ai-team-img > img'
]
);
$this->add_responsive_control(
'image_border_radius',
[
'label' => esc_html__( 'Border Radius', 'ai-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'selectors' => [
'{{WRAPPER}} .ai-team-img > img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
]
]
);
$this->end_controls_section();
// Style Content Section
$this->start_controls_section(
'section_style_content',
[
'label' => __( 'Content', 'ai-addons' ),
'tab' => Controls_Manager::TAB_STYLE,
'condition' => [ 'team_layout' => 'layout-1'],
]
);
$this->add_control(
'font_color',
[
'type' => Controls_Manager::COLOR,
'label' => esc_html__( 'Font Color', 'ai-addons' ),
'default' => '',
'selectors' => [
'{{WRAPPER}} .team-content, {{WRAPPER}} .team-content a' => 'color: {{VALUE}};'
]
]
);
$this->add_responsive_control(
'desc_margin',
[
'label' => esc_html__( 'Margin', 'ai-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'selectors' => [
'{{WRAPPER}} .team-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
]
]
);
$this->add_responsive_control(
'desc_padding',
[
'label' => esc_html__( 'Padding', 'ai-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [
'{{WRAPPER}} .team-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
]
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'team_content_typography',
'selector' => '{{WRAPPER}} .team-content'
]
);
$this->end_controls_section();
// Style Social Icons Section
$this->start_controls_section(
'section_social_style',
[
'label' => __( 'Social Icons', 'ai-addons' ),
'tab' => Controls_Manager::TAB_STYLE
]
);
$this->add_control(
'icon_color',
[
'label' => __( 'Color', 'ai-addons' ),
'type' => Controls_Manager::SELECT,
'default' => 'default',
'options' => [
'default' => __( 'Official Color', 'ai-addons' ),
'custom' => __( 'Custom', 'ai-addons' ),
],
]
);
$this->start_controls_tabs( 'icons_colors' );
$this->start_controls_tab(
'icon_color_normal',
[
'label' => esc_html__( 'Normal', 'ai-addons' ),
]
);
$this->add_control(
'icon_primary_color',
[
'label' => __( 'Background Color', 'ai-addons' ),
'type' => Controls_Manager::COLOR,
'condition' => [
'icon_color' => 'custom',
],
'selectors' => [
'{{WRAPPER}} .elementor-social-icon' => 'background-color: {{VALUE}};',
],
]
);
$this->add_control(
'icon_secondary_color',
[
'label' => __( 'Icon Color', 'ai-addons' ),
'type' => Controls_Manager::COLOR,
'condition' => [
'icon_color' => 'custom',
],
'selectors' => [
'{{WRAPPER}} .elementor-social-icon i' => 'color: {{VALUE}};',
'{{WRAPPER}} .elementor-social-icon svg' => 'fill: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'image_border', // We know this mistake - TODO: 'icon_border' (for hover control condition also)
'selector' => '{{WRAPPER}} .elementor-social-icon',
]
);
$this->add_responsive_control(
'border_radius',
[
'label' => __( 'Border Radius', 'ai-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', '%' ],
'selectors' => [
'{{WRAPPER}} .elementor-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
],
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'icon_color_hover',
[
'label' => esc_html__( 'Hover', 'ai-addons' ),
]
);
$this->add_control(
'icon_primary_hcolor',
[
'label' => __( 'Background Color', 'ai-addons' ),
'type' => Controls_Manager::COLOR,
'condition' => [
'icon_color' => 'custom',
],
'selectors' => [
'{{WRAPPER}} .elementor-social-icon:hover' => 'background-color: {{VALUE}};',
],
]
);
$this->add_control(
'icon_secondary_hcolor',
[
'label' => __( 'Icon Color', 'ai-addons' ),
'type' => Controls_Manager::COLOR,
'condition' => [
'icon_color' => 'custom',
],
'selectors' => [
'{{WRAPPER}} .elementor-social-icon:hover i' => 'color: {{VALUE}};',
'{{WRAPPER}} .elementor-social-icon:hover svg' => 'fill: {{VALUE}};',
],
]
);
$this->add_control(
'hover_border_color',
[
'label' => __( 'Border Color', 'ai-addons' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'condition' => [
'image_border_border!' => '',
],
'selectors' => [
'{{WRAPPER}} .elementor-social-icon:hover' => 'border-color: {{VALUE}};',
],
]
);
$this->add_control(
'hover_border_animation',
[
'label' => esc_html__( 'Hover Animation', 'ai-addons' ),
'type' => Controls_Manager::HOVER_ANIMATION,
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$this->add_responsive_control(
'icon_size',
[
'label' => __( 'Size', 'ai-addons' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 6,
'max' => 300,
],
],
'selectors' => [
'{{WRAPPER}}' => '--icon-size: {{SIZE}}{{UNIT}}',
],
'separator' => 'before',
]
);
$this->add_responsive_control(
'icon_padding',
[
'label' => __( 'Padding', 'ai-addons' ),
'type' => Controls_Manager::SLIDER,
'selectors' => [
'{{WRAPPER}} .elementor-social-icon' => '--icon-padding: {{SIZE}}{{UNIT}}',
],
'default' => [
'unit' => 'px',
],
'tablet_default' => [
'unit' => 'px',
],
'mobile_default' => [
'unit' => 'px',
],
'range' => [
'px' => [
'min' => 0,
'max' => 100,
],
],
]
);
$this->add_responsive_control(
'icon_spacing',
[
'label' => __( 'Spacing', 'ai-addons' ),
'type' => Controls_Manager::SLIDER,
'range' => [
'px' => [
'min' => 0,
'max' => 100,
],
],
'default' => [
'size' => 5,
],
'selectors' => [
'{{WRAPPER}} .ai-social-icons > li > a' => 'margin-left: {{SIZE}}{{UNIT}}; margin-right: {{SIZE}}{{UNIT}}',
'{{WRAPPER}} .ai-social-icons' => 'margin-left: -{{SIZE}}{{UNIT}}; margin-right: -{{SIZE}}{{UNIT}}',
],
]
);
$this->add_responsive_control(
'icon_margin',
[
'label' => esc_html__( 'Margin', 'ai-addons' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [
'{{WRAPPER}} .ai-social-icons > li' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
]
]
);
$this->end_controls_section();
}
protected function render() {
$settings = $this->get_settings_for_display();
$this->_settings = $settings;
extract( $settings );
$parent_class = isset( $layout ) ? 'team-' . $layout : 'team-default';
$this->add_render_attribute( 'ai-widget-wrapper', 'class', 'team-elementor-widget team-wrapper' );
$this->add_render_attribute( 'ai-widget-wrapper', 'class', esc_attr( $parent_class ) );
?>