lementor-pro' ), 'description' => esc_html__( 'Description', 'elementor-pro' ), ], 'condition' => [ 'skin!' => 'slideshow', 'overlay' => 'text', ], ] ); $this->add_control( 'icon', [ 'label' => esc_html__( 'Icon', 'elementor-pro' ), 'type' => Controls_Manager::CHOOSE, 'default' => 'search-plus', 'options' => [ 'search-plus' => [ 'icon' => 'eicon-search-bold', ], 'plus-circle' => [ 'icon' => 'eicon-plus-circle', ], 'eye' => [ 'icon' => 'eicon-preview-medium', ], 'link' => [ 'icon' => 'eicon-link', ], ], 'condition' => [ 'skin!' => 'slideshow', 'overlay' => 'icon', ], ] ); $this->add_control( 'overlay_animation', [ 'label' => esc_html__( 'Animation', 'elementor-pro' ), 'type' => Controls_Manager::SELECT, 'default' => 'fade', 'options' => [ 'fade' => 'Fade', 'slide-up' => 'Slide Up', 'slide-down' => 'Slide Down', 'slide-right' => 'Slide Right', 'slide-left' => 'Slide Left', 'zoom-in' => 'Zoom In', ], 'condition' => [ 'skin!' => 'slideshow', 'overlay!' => '', ], ] ); $this->end_injection(); $this->start_injection( [ 'type' => 'section', 'of' => 'section_navigation', ] ); $this->start_controls_section( 'section_overlay', [ 'label' => esc_html__( 'Overlay', 'elementor-pro' ), 'tab' => Controls_Manager::TAB_STYLE, 'condition' => [ 'skin!' => 'slideshow', 'overlay!' => '', ], ] ); $this->add_control( 'overlay_background_color', [ 'label' => esc_html__( 'Background Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-carousel-image-overlay' => 'background-color: {{VALUE}};', ], ] ); $this->add_control( 'overlay_color', [ 'label' => esc_html__( 'Text Color', 'elementor-pro' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-carousel-image-overlay' => '--e-carousel-image-overlay-color: {{VALUE}};', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'caption_typography', 'global' => [ 'default' => Global_Typography::TYPOGRAPHY_ACCENT, ], 'selector' => '{{WRAPPER}} .elementor-carousel-image-overlay', 'condition' => [ 'overlay' => 'text', ], ] ); $this->add_control( 'icon_size', [ 'label' => esc_html__( 'Icon Size', 'elementor-pro' ), 'type' => Controls_Manager::SLIDER, 'selectors' => [ '{{WRAPPER}} .elementor-carousel-image-overlay' => '--e-carousel-image-overlay-icon-size: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'overlay' => 'icon', ], ] ); $this->end_controls_section(); $this->end_injection(); // Slideshow $this->start_injection( [ 'of' => 'effect', ] ); $this->add_responsive_control( 'slideshow_height', [ 'type' => Controls_Manager::SLIDER, 'label' => esc_html__( 'Height', 'elementor-pro' ), 'range' => [ 'px' => [ 'min' => 20, 'max' => 1000, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-main-swiper' => 'height: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'skin' => 'slideshow', ], ] ); $this->add_control( 'thumbs_title', [ 'label' => esc_html__( 'Thumbnails', 'elementor-pro' ), 'type' => Controls_Manager::HEADING, 'condition' => [ 'skin' => 'slideshow', ], ] ); $this->end_injection(); $this->start_injection( [ 'of' => 'slides_per_view', ] ); $this->add_control( 'thumbs_ratio', [ 'label' => esc_html__( 'Ratio', 'elementor-pro' ), 'type' => Controls_Manager::SELECT, 'default' => '219', 'options' => [ '169' => '16:9', '219' => '21:9', '43' => '4:3', '11' => '1:1', ], 'prefix_class' => 'elementor-aspect-ratio-', 'condition' => [ 'skin' => 'slideshow', ], ] ); $this->add_control( 'centered_slides', [ 'label' => esc_html__( 'Centered Slides', 'elementor-pro' ), 'type' => Controls_Manager::SWITCHER, 'condition' => [ 'skin' => 'slideshow', ], 'frontend_available' => true, ] ); $this->end_injection(); $this->start_injection( [ 'of' => 'slides_per_view', ] ); $slides_per_view = range( 1, 10 ); $slides_per_view = array_combine( $slides_per_view, $slides_per_view ); $this->add_responsive_control( 'slideshow_slides_per_view', [ 'type' => Controls_Manager::SELECT, 'label' => esc_html__( 'Slides Per View', 'elementor-pro' ), 'options' => [ '' => esc_html__( 'Default', 'elementor-pro' ) ] + $slides_per_view, 'condition' => [ 'skin' => 'slideshow', ], 'frontend_available' => true, ] ); $this->end_injection(); } private function update_controls() { $carousel_controls = [ 'slides_to_scroll', 'pagination', 'heading_pagination', 'pagination_size', 'pagination_position', 'pagination_color', ]; $carousel_responsive_controls = [ 'width', 'height', 'slides_per_view', ]; foreach ( $carousel_controls as $control_id ) { $this->update_control( $control_id, [ 'condition' => [ 'skin!' => 'slideshow', ], ], [ 'recursive' => true ] ); } foreach ( $carousel_responsive_controls as $control_id ) { $this->update_responsive_control( $control_id, [ 'condition' => [ 'skin!' => 'slideshow', ], ], [ 'recursive' => true ] ); } $this->update_responsive_control( 'space_between', [ 'selectors' => [ '{{WRAPPER}}.elementor-skin-slideshow .elementor-main-swiper' => 'margin-bottom: {{SIZE}}{{UNIT}}', ], 'render_type' => 'ui', ] ); $this->update_control( 'effect', [ 'condition' => [ 'skin!' => 'coverflow', ], ] ); } public function get_group_name() { return 'carousel'; } private function render_overlay_icon( $icon_name ) { $icon_value = 'fas fa-' . $icon_name; $icon = [ 'library' => 'fa-solid', 'value' => $icon_value, ]; Icons_Manager::render_icon( $icon ); } }