start_controls_section( 'section_title', [ 'label' => __( 'Photo Gallery', 'addonnest' ), ] ); $this->add_control( 'photogallery', [ 'label' => esc_html__( 'Add Images', 'addonnest' ), 'type' => \Elementor\Controls_Manager::GALLERY, 'default' => [], 'show_label' => false, 'dynamic' => [ 'active' => true, ], ] ); $this->add_control( 'gallery_column', [ 'label' => __( 'Number of Column', 'addonnest' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 4, 'options' => [ '12' => __( 'One Column', 'addonnest' ), '6' => __( 'Two Column', 'addonnest' ), '4' => __( 'Three Column', 'addonnest' ), '3' => __( 'Four Column', 'addonnest' ), ], ] ); $this->add_responsive_control( 'photo_gallery_height', [ 'label' => __('Image Height', 'addonnest'), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => ['px'], 'default' => [ 'size' => 200, ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 1000, ], ], 'selectors' => [ '{{WRAPPER}} .addonnest-photo-gallery .popup-image' => 'height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'gallery_border', [ 'label' => esc_html__( 'Border Radius', 'addonnest' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .addonnest-photo-gallery .popup-image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_control( 'image_overlay_color', [ 'label' => __( 'Background Overlay', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .addonnest-photo-gallery .popup-image:before' => 'background: {{VALUE}};', ], ] ); $this->add_control( 'image_overlay_hover_color', [ 'label' => __( 'Background Hover Color', 'addonnest' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .addonnest-photo-gallery .popup-image:hover:before' => 'background: {{VALUE}};', ], ] ); $this->end_controls_section(); } protected function render( ) { $settings = $this->get_settings(); $gallery_column = $settings['gallery_column']; if ( empty( $settings['photogallery'] ) ) { return; } ?> widgets_manager->register_widget_type( new AddonNest_Widget_Photo_Gallery() );