start_controls_section( 'section_content', [ 'label' => esc_html__( 'Content', 'nighty' ), ] ); $this->add_control( 'icon', [ 'label' => esc_html__( 'Icon', 'nighty' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'fas fa-comments', 'library' => 'all', ], ] ); $this->add_control( 'label', [ 'label' => esc_html__( 'Label', 'nighty' ), 'type' => \Elementor\Controls_Manager::TEXT, ] ); $repeater = new \Elementor\Repeater(); $repeater->add_control( 'type', [ 'label' => esc_html__( 'Type', 'nighty' ), 'type' => Controls_Manager::SELECT, 'default' => 'email', 'options' => [ 'email' => esc_html__('Email', 'nighty'), 'phone' => esc_html__('Phone', 'nighty'), 'link' => esc_html__('Link', 'nighty'), 'text' => esc_html__('Text', 'nighty'), ] ] ); $repeater->add_control( 'email_label', [ 'label' => esc_html__( 'Email Label', 'nighty' ), 'type' => \Elementor\Controls_Manager::TEXT, 'description' => esc_html__( 'email@company.com', 'nighty' ), 'condition' => [ 'type' => 'email', ] ] ); $repeater->add_control( 'email_address', [ 'label' => esc_html__( 'Email Adress', 'nighty' ), 'type' => \Elementor\Controls_Manager::TEXT, 'description' => esc_html__( 'email@company.com', 'nighty' ), 'condition' => [ 'type' => 'email', ] ] ); $repeater->add_control( 'phone_label', [ 'label' => esc_html__( 'Phone Label', 'nighty' ), 'type' => \Elementor\Controls_Manager::TEXT, 'description' => esc_html__( '+012 (345) 678', 'nighty' ), 'condition' => [ 'type' => 'phone', ] ] ); $repeater->add_control( 'phone_address', [ 'label' => esc_html__( 'Phone Adress', 'nighty' ), 'type' => \Elementor\Controls_Manager::TEXT, 'description' => esc_html__( '+012345678', 'nighty' ), 'condition' => [ 'type' => 'phone', ] ] ); $repeater->add_control( 'link_label', [ 'label' => esc_html__( 'Link Label', 'nighty' ), 'type' => \Elementor\Controls_Manager::TEXT, 'description' => esc_html__( 'https://your-domain.com', 'nighty' ), 'condition' => [ 'type' => 'link', ] ] ); $repeater->add_control( 'link_address', [ 'label' => esc_html__( 'Link Adress', 'nighty' ), 'type' => \Elementor\Controls_Manager::URL, 'description' => esc_html__( 'https://your-domain.com', 'nighty' ), 'condition' => [ 'type' => 'link', ], 'show_external' => false, 'default' => [ 'url' => '#', 'is_external' => false, 'nofollow' => false, ], ] ); $repeater->add_control( 'text', [ 'label' => esc_html__( 'Text', 'nighty' ), 'type' => \Elementor\Controls_Manager::TEXT, 'description' => esc_html__( 'Your text', 'nighty' ), 'condition' => [ 'type' => 'text', ] ] ); $this->add_control( 'items_info', [ 'label' => esc_html__( 'Items Info', 'nighty' ), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'type' => 'email', 'email_label' => esc_html__('email@company.com', 'nighty'), 'email_address' => esc_html__('email@company.com', 'nighty'), ], ], 'title_field' => '{{{ type }}}', ] ); $this->end_controls_section(); // End Content Tab /** * Icon Style Tab */ $this->start_controls_section( 'section_icon_style', [ 'label' => esc_html__( 'Icon', 'nighty' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'icon_size', [ 'label' => esc_html__( 'Size', 'nighty' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 300, 'step' => 1, ] ], 'selectors' => [ '{{WRAPPER}} .ova-contact-info .icon' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .ova-contact-info .icon svg' => 'width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'icon_color', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-contact-info .icon' => 'color : {{VALUE}};', '{{WRAPPER}} .ova-contact-info .icon svg, {{WRAPPER}} .ova-contact-info .icon svg path' => 'fill : {{VALUE}};' ], ] ); $this->add_control( 'icon_background', [ 'label' => esc_html__( 'Background', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-contact-info .icon' => 'background-color : {{VALUE}};', ], ] ); $this->add_responsive_control( 'icon_margin', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-contact-info .icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'icon_padding', [ 'label' => esc_html__( 'Padding', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-contact-info .icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'border_icon', 'label' => esc_html__( 'Border', 'nighty' ), 'selector' => '{{WRAPPER}} .ova-contact-info .icon', ] ); $this->add_responsive_control( 'border_radius_icon', array( 'label' => esc_html__( 'Border Radius', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => array( 'px', '%' ), 'selectors' => array( '{{WRAPPER}} .ova-contact-info .icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ), ) ); $this->end_controls_section(); // End Icon Style Tab /** * Label Style Tab */ $this->start_controls_section( 'section_label_style', [ 'label' => esc_html__( 'Label', 'nighty' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'label_typography', 'selector' => '{{WRAPPER}} .ova-contact-info .contact .label', ] ); $this->add_control( 'label_color', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-contact-info .contact .label' => 'color : {{VALUE}};', ], ] ); $this->add_responsive_control( 'label_margin', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-contact-info .contact .label' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); // End Label Style Tab /** * Info Style Tab */ $this->start_controls_section( 'section_info_style', [ 'label' => esc_html__( 'Info', 'nighty' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'info_typography', 'selector' => '{{WRAPPER}} .ova-contact-info .contact .info .item, {{WRAPPER}} .ova-contact-info .contact .info .item a', ] ); $this->add_control( 'info_color', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-contact-info .contact .info .item' => 'color : {{VALUE}};', '{{WRAPPER}} .ova-contact-info .contact .info .item a' => 'color : {{VALUE}};', ], ] ); $this->add_control( 'info_color_hover', [ 'label' => esc_html__( 'Link Color hover', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-contact-info .contact .info .item a:hover' => 'color : {{VALUE}};', ], ] ); $this->add_responsive_control( 'info_padding', [ 'label' => esc_html__( 'Padding', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-contact-info .contact .info .item' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'info_margin', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-contact-info .contact .info .item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_group_control( \Elementor\Group_Control_Border::get_type(), [ 'name' => 'info_border', 'selector' => '{{WRAPPER}} .ova-contact-info .contact .info .item', ] ); $this->add_responsive_control( 'info_alignment', [ 'label' => esc_html__( 'Alignment', 'nighty' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'flex-start' => [ 'title' => esc_html__( 'Flex start', 'nighty' ), 'icon' => 'eicon-v-align-top', ], 'center' => [ 'title' => esc_html__( 'Center', 'nighty' ), 'icon' => 'eicon-v-align-middle', ], 'end' => [ 'title' => esc_html__( 'End', 'nighty' ), 'icon' => 'eicon-v-align-bottom', ], ], 'selectors' => [ '{{WRAPPER}} .ova-contact-info' => 'align-items: {{VALUE}};', ], ] ); $this->end_controls_section(); // End Label Style Tab } // Render Template Here protected function render() { $settings = $this->get_settings(); $icon = $settings['icon'] ? $settings['icon'] : ''; $label = $settings['label'] ? $settings['label'] : ''; $items_info = $settings['items_info']; ?>
'true' ] ); ?>
register( new Nighty_Elementor_Contact_Info() );