start_controls_section( 'section_content', [ 'label' => esc_html__( 'Content', 'nighty' ), ] ); $this->add_control( 'template', [ 'label' => esc_html__( 'Template', 'nighty' ), 'type' => Controls_Manager::SELECT, 'default' => 'template2', 'options' => [ 'template1' => esc_html__('Template 1', 'nighty'), 'template2' => esc_html__('Template 2', 'nighty'), 'template3' => esc_html__('Template 3', 'nighty'), ] ] ); $this->add_control( 'background_text', [ 'label' => esc_html__( 'Background Text', 'nighty' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => esc_html__( 'Upcoming', 'nighty' ), 'placeholder' => esc_html__( 'Type your text here', 'nighty' ), 'condition' => [ 'template' => 'template2', ] ] ); $repeater = new \Elementor\Repeater(); $repeater->add_control( 'link', [ 'label' => esc_html__( 'Simple Link', 'nighty' ), 'type' => \Elementor\Controls_Manager::URL, 'placeholder' => esc_html__( 'https://your-link.com', 'nighty' ), 'description' => esc_html__( 'Redirect to a link instead of popup image or video', 'nighty' ), 'options' => [ 'url', 'is_external', 'nofollow' ], 'default' => [ 'url' => '', 'is_external' => false, 'nofollow' => false, ], ] ); $repeater->add_control( 'image', [ 'label' => esc_html__( 'Image', 'nighty' ), 'type' => \Elementor\Controls_Manager::MEDIA, 'default' => [ 'url' => Utils::get_placeholder_image_src(), ], ] ); $repeater->add_control( 'icon', [ 'label' => esc_html__( 'Icon', 'nighty' ), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'fab fa-instagram', 'library' => 'all', ], ] ); $repeater->add_control( 'video_link', [ 'label' => esc_html__( 'Embed Video Link', 'nighty' ), 'type' => \Elementor\Controls_Manager::URL, 'description' => esc_html__( 'https://www.youtube.com/watch?v=MLpWrANjFbI', 'nighty' ), 'options' => [ 'url', 'is_external', 'nofollow' ], 'default' => [ 'url' => '', 'is_external' => false, 'nofollow' => false, ], ] ); $repeater->add_control( 'title', [ 'label' => esc_html__( 'Title', 'nighty' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => esc_html__( 'Concert Event', 'nighty' ), ] ); $repeater->add_control( 'description', [ 'label' => esc_html__( 'Description', 'nighty' ), 'type' => \Elementor\Controls_Manager::TEXT, 'default' => esc_html__( 'Club', 'nighty' ), ] ); $this->add_control( 'items', [ 'label' => esc_html__( 'Items', 'nighty' ), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), 'default' => [ [ 'title' => esc_html__('Concert Event', 'nighty'), ], [ 'title' => esc_html__('Feature Events', 'nighty'), ], [ 'title' => esc_html__('Holiday Events', 'nighty'), ], [ 'title' => esc_html__('Weekend Events', 'nighty'), ], ], 'title_field' => '{{{ title }}}', ] ); $this->end_controls_section(); $this->start_controls_section( 'background_text_section', [ 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'label' => esc_html__( 'Background Text', 'nighty' ), 'condition' => [ 'template' => 'template2', ], ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'background_text_typography', 'selector' => '{{WRAPPER}} .ova-gallery-event.template2 .background-text', ] ); $this->add_responsive_control( 'background_text_position_bottom', [ 'label' => esc_html__( 'Botom', 'nighty' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 500, 'step' => 1, ] ], 'selectors' => [ '{{WRAPPER}} .ova-gallery-event.template2 .background-text' => 'bottom: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'background_text_position_left', [ 'label' => esc_html__( 'Left', 'nighty' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 500, 'step' => 1, ] ], 'selectors' => [ '{{WRAPPER}} .ova-gallery-event.template2 .background-text' => 'left: {{SIZE}}{{UNIT}};', ], ] ); $this->end_controls_section(); $this->start_controls_section( 'wrap_title_section', [ 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'label' => esc_html__( 'Wrap Title', 'nighty' ), ] ); $this->add_responsive_control( 'wrap_title_min_width', [ 'label' => esc_html__( 'Min Width', 'nighty' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 500, 'step' => 1, ], '%' => [ 'min' => 0, 'max' => 100, ], ], 'selectors' => [ '{{WRAPPER}} .ova-gallery-event .wrap-content .item .content .wrap-title' => 'min-width: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'wrap_title_background_color', [ 'label' => esc_html__( 'Background Color', 'nighty' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-gallery-event .wrap-content .item .content .wrap-title ' => 'background-color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'wrap_title_padding', [ 'label' => esc_html__( 'Padding', 'nighty' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'selectors' => [ '{{WRAPPER}} .ova-gallery-event .wrap-content .item .content .wrap-title ' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'wrap_title_margin', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'selectors' => [ '{{WRAPPER}} .ova-gallery-event .wrap-content .item .content .wrap-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); $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' => 100, 'step' => 1, ] ], 'selectors' => [ '{{WRAPPER}} .ova-gallery-event .wrap-content .item .content .wrap-title .icon i' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .ova-gallery-event .wrap-content .item .content .wrap-title .icon svg' => 'width: {{SIZE}}{{UNIT}};height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_control( 'icon_color', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-gallery-event .wrap-content .item .content .wrap-title .icon i' => 'color : {{VALUE}};', '{{WRAPPER}} .ova-gallery-event .wrap-content .item .content .wrap-title .icon svg path' => 'fill : {{VALUE}};' ], ] ); $this->add_responsive_control( 'icon_margin', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .ova-gallery-event .wrap-content .item .content .wrap-title .icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); // End Icon Style Tab $this->start_controls_section( 'title_section', [ 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'label' => esc_html__( 'Title', 'nighty' ), ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'selector' => '{{WRAPPER}} .ova-gallery-event .wrap-content .item .content .wrap-title .title', ] ); $this->add_control( 'title_color', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-gallery-event .wrap-content .item .content .wrap-title .title' => 'color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'title_margin', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'selectors' => [ '{{WRAPPER}} .ova-gallery-event .wrap-content .item .content .wrap-title .title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); /**************************** END SECTION TITLE *********************/ $this->start_controls_section( 'description_section', [ 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'label' => esc_html__( 'Description', 'nighty' ), ] ); $this->add_group_control( \Elementor\Group_Control_Typography::get_type(), [ 'name' => 'description_typography', 'selector' => '{{WRAPPER}} .ova-gallery-event .wrap-content .item .content .description', ] ); $this->add_control( 'description_color', [ 'label' => esc_html__( 'Color', 'nighty' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-gallery-event .wrap-content .item .content .description' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'description_background_color', [ 'label' => esc_html__( 'Background Color', 'nighty' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .ova-gallery-event .wrap-content .item .content .description' => 'background-color: {{VALUE}}', ], ] ); $this->add_responsive_control( 'description_padding', [ 'label' => esc_html__( 'Padding', 'nighty' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'selectors' => [ '{{WRAPPER}} .ova-gallery-event .wrap-content .item .content .description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'description_margin', [ 'label' => esc_html__( 'Margin', 'nighty' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'selectors' => [ '{{WRAPPER}} .ova-gallery-event .wrap-content .item .content .description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); /**************************** END SECTION DESCRIPTION *********************/ $this->start_controls_section( 'image_section', [ 'tab' => \Elementor\Controls_Manager::TAB_STYLE, 'label' => esc_html__( 'Image', 'nighty' ), 'condition' => [ 'template' => 'template1', ], ] ); $this->add_group_control( \Elementor\Group_Control_Css_Filter::get_type(), [ 'name' => 'custom_css_filters', 'label' => esc_html__( 'Image Hover Filter', 'nighty' ), 'selector' => '{{WRAPPER}} .ova-gallery-event .wrap-content .item:hover img', ], ); $this->end_controls_section(); } // Render Template Here protected function render() { $settings = $this->get_settings(); $template = $settings['template']; $items = $settings['items']; $background_text = $settings['background_text']; $data_gallery_video = array(); ?>
register( new Nighty_Elementor_Gallery_Event() );