[ 'title' => 'Facebook', 'icon' => 'fab fa-facebook-f', 'color' => '#1877f2', ], 'twitter' => [ 'title' => 'Twitter', 'icon' => 'fab fa-twitter', 'color' => '#1da1f2', ], 'instagram' => [ 'title' => 'Instagram', 'icon' => 'fab fa-instagram', 'color' => '#e4405f', ], 'linkedin' => [ 'title' => 'LinkedIn', 'icon' => 'fab fa-linkedin-in', 'color' => '#0077b5', ], 'youtube' => [ 'title' => 'YouTube', 'icon' => 'fab fa-youtube', 'color' => '#ff0000', ], 'pinterest' => [ 'title' => 'Pinterest', 'icon' => 'fab fa-pinterest-p', 'color' => '#bd081c', ], 'tiktok' => [ 'title' => 'TikTok', 'icon' => 'fab fa-tiktok', 'color' => '#000000', ], 'whatsapp' => [ 'title' => 'WhatsApp', 'icon' => 'fab fa-whatsapp', 'color' => '#25d366', ], 'telegram' => [ 'title' => 'Telegram', 'icon' => 'fab fa-telegram-plane', 'color' => '#0088cc', ], 'snapchat' => [ 'title' => 'Snapchat', 'icon' => 'fab fa-snapchat-ghost', 'color' => '#fffc00', ], 'reddit' => [ 'title' => 'Reddit', 'icon' => 'fab fa-reddit-alien', 'color' => '#ff4500', ], 'github' => [ 'title' => 'GitHub', 'icon' => 'fab fa-github', 'color' => '#333333', ], 'dribbble' => [ 'title' => 'Dribbble', 'icon' => 'fab fa-dribbble', 'color' => '#ea4c89', ], 'behance' => [ 'title' => 'Behance', 'icon' => 'fab fa-behance', 'color' => '#1769ff', ], 'vimeo' => [ 'title' => 'Vimeo', 'icon' => 'fab fa-vimeo-v', 'color' => '#1ab7ea', ], 'slack' => [ 'title' => 'Slack', 'icon' => 'fab fa-slack', 'color' => '#4a154b', ], 'discord' => [ 'title' => 'Discord', 'icon' => 'fab fa-discord', 'color' => '#5865f2', ], 'skype' => [ 'title' => 'Skype', 'icon' => 'fab fa-skype', 'color' => '#00aff0', ], 'spotify' => [ 'title' => 'Spotify', 'icon' => 'fab fa-spotify', 'color' => '#1db954', ], 'twitch' => [ 'title' => 'Twitch', 'icon' => 'fab fa-twitch', 'color' => '#9146ff', ], ]; } /** * Register widget controls. */ protected function register_controls() { $this->register_content_controls(); $this->register_style_controls(); } /** * Register content controls. */ private function register_content_controls() { // Social Icons Section $this->start_controls_section( 'section_social_icons', [ 'label' => esc_html__('Social Icons', 'advanced-widget-kit-for-elementor'), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $repeater = new \Elementor\Repeater(); $repeater->add_control( 'social_network', [ 'label' => esc_html__('Social Network', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'facebook', 'options' => $this->get_social_network_options(), ] ); $repeater->add_control( 'custom_icon', [ 'label' => esc_html__('Custom Icon', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::ICONS, 'fa4compatibility' => 'icon', 'skin' => 'inline', 'label_block' => false, ] ); $repeater->add_control( 'link', [ 'label' => esc_html__('Link', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::URL, 'placeholder' => esc_html__('https://your-link.com', 'advanced-widget-kit-for-elementor'), 'dynamic' => [ 'active' => true, ], ] ); $repeater->add_control( 'label', [ 'label' => esc_html__('Label', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::TEXT, 'placeholder' => esc_html__('Follow us', 'advanced-widget-kit-for-elementor'), 'dynamic' => [ 'active' => true, ], ] ); $repeater->add_control( 'custom_colors_heading', [ 'label' => esc_html__('Custom Colors', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::HEADING, 'separator' => 'before', ] ); $repeater->add_control( 'use_custom_colors', [ 'label' => esc_html__('Use Custom Colors', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => esc_html__('Yes', 'advanced-widget-kit-for-elementor'), 'label_off' => esc_html__('No', 'advanced-widget-kit-for-elementor'), 'return_value' => 'yes', 'default' => 'no', ] ); $repeater->add_control( 'custom_icon_color', [ 'label' => esc_html__('Icon Color', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#ffffff', 'condition' => [ 'use_custom_colors' => 'yes', ], 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}} .awke-social-icon i' => 'color: {{VALUE}};', '{{WRAPPER}} {{CURRENT_ITEM}} .awke-social-icon svg' => 'fill: {{VALUE}};', ], ] ); $repeater->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'custom_background', 'label' => esc_html__('Background', 'advanced-widget-kit-for-elementor'), 'types' => ['classic', 'gradient'], 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}} .awke-social-icon', 'condition' => [ 'use_custom_colors' => 'yes', ], ] ); $repeater->add_control( 'custom_hover_icon_color', [ 'label' => esc_html__('Hover Icon Color', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::COLOR, 'condition' => [ 'use_custom_colors' => 'yes', ], 'selectors' => [ '{{WRAPPER}} {{CURRENT_ITEM}} .awke-social-icon:hover i' => 'color: {{VALUE}};', '{{WRAPPER}} {{CURRENT_ITEM}} .awke-social-icon:hover svg' => 'fill: {{VALUE}};', ], ] ); $repeater->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'custom_hover_background', 'label' => esc_html__('Hover Background', 'advanced-widget-kit-for-elementor'), 'types' => ['classic', 'gradient'], 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}} .awke-social-icon:hover', 'condition' => [ 'use_custom_colors' => 'yes', ], ] ); $repeater->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'custom_border', 'label' => esc_html__('Border', 'advanced-widget-kit-for-elementor'), 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}} .awke-social-icon', 'condition' => [ 'use_custom_colors' => 'yes', ], ] ); $repeater->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'custom_box_shadow', 'label' => esc_html__('Box Shadow', 'advanced-widget-kit-for-elementor'), 'selector' => '{{WRAPPER}} {{CURRENT_ITEM}} .awke-social-icon', 'condition' => [ 'use_custom_colors' => 'yes', ], ] ); $this->add_control( 'social_icons', [ 'label' => esc_html__('Social Icons', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'social_network' => 'facebook', 'link' => ['url' => 'https://facebook.com/'], ], [ 'social_network' => 'twitter', 'link' => ['url' => 'https://twitter.com/'], ], [ 'social_network' => 'instagram', 'link' => ['url' => 'https://instagram.com/'], ], ], 'title_field' => '{{{ social_network.charAt(0).toUpperCase() + social_network.slice(1) }}}', ] ); $this->end_controls_section(); // Layout Settings $this->start_controls_section( 'section_layout', [ 'label' => esc_html__('Layout Settings', 'advanced-widget-kit-for-elementor'), 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'layout', [ 'label' => esc_html__('Layout', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'horizontal', 'options' => [ 'horizontal' => esc_html__('Horizontal', 'advanced-widget-kit-for-elementor'), 'vertical' => esc_html__('Vertical', 'advanced-widget-kit-for-elementor'), 'grid' => esc_html__('Grid', 'advanced-widget-kit-for-elementor'), ], ] ); $this->add_responsive_control( 'columns', [ 'label' => esc_html__('Columns', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => '3', 'options' => [ '1' => '1', '2' => '2', '3' => '3', '4' => '4', '5' => '5', '6' => '6', ], 'condition' => [ 'layout' => 'grid', ], 'selectors' => [ '{{WRAPPER}} .awke-social-icons-wrapper.awke-layout-grid' => 'grid-template-columns: repeat({{VALUE}}, 1fr);', ], ] ); $this->add_control( 'no_background', [ 'label' => esc_html__('No Background', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => esc_html__('Yes', 'advanced-widget-kit-for-elementor'), 'label_off' => esc_html__('No', 'advanced-widget-kit-for-elementor'), 'return_value' => 'yes', 'default' => 'no', 'description' => esc_html__('Display icons without background color or shape', 'advanced-widget-kit-for-elementor'), ] ); $this->add_control( 'icon_shape', [ 'label' => esc_html__('Icon Shape', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'circle', 'options' => [ 'default' => esc_html__('Default', 'advanced-widget-kit-for-elementor'), 'circle' => esc_html__('Circle', 'advanced-widget-kit-for-elementor'), 'square' => esc_html__('Square', 'advanced-widget-kit-for-elementor'), 'rounded' => esc_html__('Rounded Square', 'advanced-widget-kit-for-elementor'), ], 'condition' => [ 'no_background!' => 'yes', ], ] ); $this->add_responsive_control( 'alignment', [ 'label' => esc_html__('Alignment', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::CHOOSE, 'options' => [ 'left' => [ 'title' => esc_html__('Left', 'advanced-widget-kit-for-elementor'), 'icon' => 'eicon-text-align-left', ], 'center' => [ 'title' => esc_html__('Center', 'advanced-widget-kit-for-elementor'), 'icon' => 'eicon-text-align-center', ], 'right' => [ 'title' => esc_html__('Right', 'advanced-widget-kit-for-elementor'), 'icon' => 'eicon-text-align-right', ], 'justify' => [ 'title' => esc_html__('Justified', 'advanced-widget-kit-for-elementor'), 'icon' => 'eicon-text-align-justify', ], ], 'default' => 'center', 'selectors_dictionary' => [ 'left' => 'flex-start', 'center' => 'center', 'right' => 'flex-end', 'justify' => 'space-between', ], 'selectors' => [ '{{WRAPPER}} .awke-social-icons-wrapper.awke-layout-horizontal' => 'justify-content: {{VALUE}};', '{{WRAPPER}} .awke-social-icons-wrapper.awke-layout-vertical' => 'align-items: {{VALUE}};', '{{WRAPPER}} .awke-social-icons-wrapper.awke-layout-grid' => 'justify-items: {{VALUE}};', ], ] ); $this->add_control( 'show_labels', [ 'label' => esc_html__('Show Labels', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::SWITCHER, 'label_on' => esc_html__('Yes', 'advanced-widget-kit-for-elementor'), 'label_off' => esc_html__('No', 'advanced-widget-kit-for-elementor'), 'return_value' => 'yes', 'default' => 'no', ] ); $this->end_controls_section(); } /** * Register style controls. */ private function register_style_controls() { // Icon Style Section $this->start_controls_section( 'section_icon_style', [ 'label' => esc_html__('Icons', 'advanced-widget-kit-for-elementor'), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'icon_size', [ 'label' => esc_html__('Icon Size', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px', 'em', 'rem'], 'range' => [ 'px' => [ 'min' => 10, 'max' => 100, 'step' => 1, ], 'em' => [ 'min' => 0.5, 'max' => 5, 'step' => 0.1, ], ], 'default' => [ 'unit' => 'px', 'size' => 20, ], 'selectors' => [ '{{WRAPPER}} .awke-social-icon i' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .awke-social-icon svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'icon_padding', [ 'label' => esc_html__('Icon Padding', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px', 'em'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 50, 'step' => 1, ], ], 'default' => [ 'unit' => 'px', 'size' => 15, ], 'selectors' => [ '{{WRAPPER}} .awke-social-icon' => 'padding: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'icon_spacing', [ 'label' => esc_html__('Icon Spacing', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px', 'em'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 50, 'step' => 1, ], ], 'default' => [ 'unit' => 'px', 'size' => 10, ], 'selectors' => [ '{{WRAPPER}} .awke-social-icons-wrapper.awke-layout-horizontal' => 'gap: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .awke-social-icons-wrapper.awke-layout-vertical' => 'gap: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .awke-social-icons-wrapper.awke-layout-grid' => 'gap: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'color_scheme', [ 'label' => esc_html__('Color Scheme', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'brand', 'options' => [ 'brand' => esc_html__('Brand Colors', 'advanced-widget-kit-for-elementor'), 'custom' => esc_html__('Custom Colors', 'advanced-widget-kit-for-elementor'), ], ] ); $this->start_controls_tabs('icon_style_tabs'); // Normal State $this->start_controls_tab( 'icon_style_normal', [ 'label' => esc_html__('Normal', 'advanced-widget-kit-for-elementor'), ] ); $this->add_control( 'icon_color', [ 'label' => esc_html__('Icon Color', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .awke-social-icon i' => 'color: {{VALUE}};', '{{WRAPPER}} .awke-social-icon svg' => 'fill: {{VALUE}};', ], 'condition' => [ 'color_scheme' => 'custom', ], ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'icon_background', 'label' => esc_html__('Background', 'advanced-widget-kit-for-elementor'), 'types' => ['classic', 'gradient'], 'selector' => '{{WRAPPER}} .awke-social-icon', 'condition' => [ 'color_scheme' => 'custom', ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'icon_border', 'label' => esc_html__('Border', 'advanced-widget-kit-for-elementor'), 'selector' => '{{WRAPPER}} .awke-social-icon', ] ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'icon_box_shadow', 'label' => esc_html__('Box Shadow', 'advanced-widget-kit-for-elementor'), 'selector' => '{{WRAPPER}} .awke-social-icon', ] ); $this->end_controls_tab(); // Hover State $this->start_controls_tab( 'icon_style_hover', [ 'label' => esc_html__('Hover', 'advanced-widget-kit-for-elementor'), ] ); $this->add_control( 'hover_effect', [ 'label' => esc_html__('Hover Effect', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'lift', 'options' => [ 'none' => esc_html__('None', 'advanced-widget-kit-for-elementor'), 'lift' => esc_html__('Lift', 'advanced-widget-kit-for-elementor'), 'scale' => esc_html__('Scale', 'advanced-widget-kit-for-elementor'), 'rotate' => esc_html__('Rotate', 'advanced-widget-kit-for-elementor'), 'bounce' => esc_html__('Bounce', 'advanced-widget-kit-for-elementor'), 'pulse' => esc_html__('Pulse', 'advanced-widget-kit-for-elementor'), 'grow' => esc_html__('Grow', 'advanced-widget-kit-for-elementor'), ], ] ); $this->add_control( 'icon_hover_color', [ 'label' => esc_html__('Icon Color', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .awke-social-icon:hover i' => 'color: {{VALUE}};', '{{WRAPPER}} .awke-social-icon:hover svg' => 'fill: {{VALUE}};', ], 'condition' => [ 'color_scheme' => 'custom', ], ] ); $this->add_group_control( \Elementor\Group_Control_Background::get_type(), [ 'name' => 'icon_hover_background', 'label' => esc_html__('Background', 'advanced-widget-kit-for-elementor'), 'types' => ['classic', 'gradient'], 'selector' => '{{WRAPPER}} .awke-social-icon:hover', 'condition' => [ 'color_scheme' => 'custom', ], ] ); $this->add_control( 'icon_hover_border_color', [ 'label' => esc_html__('Border Color', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .awke-social-icon:hover' => 'border-color: {{VALUE}};', ], 'condition' => [ 'icon_border_border!' => '', ], ] ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'icon_hover_box_shadow', 'label' => esc_html__('Box Shadow', 'advanced-widget-kit-for-elementor'), 'selector' => '{{WRAPPER}} .awke-social-icon:hover', ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_responsive_control( 'icon_border_radius', [ 'label' => esc_html__('Border Radius', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => ['px', '%'], 'separator' => 'before', 'selectors' => [ '{{WRAPPER}} .awke-social-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); // Label Style Section $this->start_controls_section( 'section_label_style', [ 'label' => esc_html__('Labels', 'advanced-widget-kit-for-elementor'), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'condition' => [ 'show_labels' => 'yes', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'label_typography', 'label' => esc_html__('Typography', 'advanced-widget-kit-for-elementor'), 'selector' => '{{WRAPPER}} .awke-social-label', ] ); $this->add_control( 'label_color', [ 'label' => esc_html__('Color', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#333333', 'selectors' => [ '{{WRAPPER}} .awke-social-label' => 'color: {{VALUE}};', ], ] ); $this->add_control( 'label_hover_color', [ 'label' => esc_html__('Hover Color', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .awke-social-item:hover .awke-social-label' => 'color: {{VALUE}};', ], ] ); $this->add_responsive_control( 'label_spacing', [ 'label' => esc_html__('Label Spacing', 'advanced-widget-kit-for-elementor'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px', 'em'], 'range' => [ 'px' => [ 'min' => 0, 'max' => 30, 'step' => 1, ], ], 'default' => [ 'unit' => 'px', 'size' => 8, ], 'selectors' => [ '{{WRAPPER}} .awke-social-label' => 'margin-left: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); } /** * Get social network options for select control. */ private function get_social_network_options() { $networks = $this->get_social_networks(); $options = []; foreach ($networks as $key => $network) { $options[$key] = $network['title']; } return $options; } /** * Render widget output on the frontend. */ protected function render() { $settings = $this->get_settings_for_display(); $social_networks = $this->get_social_networks(); $this->add_render_attribute('container', 'class', 'awke-social-icons-container'); $wrapper_classes = [ 'awke-social-icons-wrapper', 'awke-layout-' . $settings['layout'], ]; if ($settings['no_background'] === 'yes') { $wrapper_classes[] = 'awke-no-background'; } else { $wrapper_classes[] = 'awke-shape-' . $settings['icon_shape']; } $this->add_render_attribute('wrapper', 'class', $wrapper_classes); ?>