start_controls_section( 'section_images', [ 'label' => __( 'Images', 'admore-widgets-suite' ), ] ); $this->add_control( 'images', [ 'label' => __( 'Images', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::GALLERY, 'default' => [], ] ); $this->add_control( 'image_size', [ 'label' => __( 'Image Size', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'large', 'options' => [ 'thumbnail' => __( 'Thumbnail', 'admore-widgets-suite' ), 'medium' => __( 'Medium', 'admore-widgets-suite' ), 'large' => __( 'Large', 'admore-widgets-suite' ), 'full' => __( 'Full', 'admore-widgets-suite' ), ], ] ); $this->add_control( 'link_to', [ 'label' => __( 'Link To', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'none', 'options' => [ 'none' => __( 'None', 'admore-widgets-suite' ), 'file' => __( 'Media File (Lightbox)', 'admore-widgets-suite' ), 'custom'=> __( 'Custom URL', 'admore-widgets-suite' ), ], ] ); $this->end_controls_section(); /* ── Slider Settings ── */ $this->start_controls_section( 'section_slider', [ 'label' => __( 'Carousel Settings', 'admore-widgets-suite' ), ] ); $this->add_responsive_control( 'slides_to_show', [ 'label' => __( 'Slides to Show', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 3, 'tablet_default' => 2, 'mobile_default' => 1, 'min' => 1, 'max' => 6, ] ); $this->add_control( 'slides_gap', [ 'label' => __( 'Gap Between Slides', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 60 ] ], 'default' => [ 'size' => 20 ], ] ); $this->add_control( 'autoplay', [ 'label' => __( 'Autoplay', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'return_value' => 'yes', ] ); $this->add_control( 'autoplay_speed', [ 'label' => __( 'Autoplay Speed (ms)', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 3000, 'min' => 500, 'condition' => [ 'autoplay' => 'yes' ], ] ); $this->add_control( 'pause_on_hover', [ 'label' => __( 'Pause on Hover', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'return_value' => 'yes', 'condition' => [ 'autoplay' => 'yes' ], ] ); $this->add_control( 'loop', [ 'label' => __( 'Infinite Loop', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'return_value' => 'yes', ] ); $this->add_control( 'show_arrows', [ 'label' => __( 'Show Arrows', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'return_value' => 'yes', ] ); $this->add_control( 'show_dots', [ 'label' => __( 'Show Dots', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => 'yes', 'return_value' => 'yes', ] ); $this->add_control( 'effect', [ 'label' => __( 'Effect', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'slide', 'options' => [ 'slide' => __( 'Slide', 'admore-widgets-suite' ), 'fade' => __( 'Fade', 'admore-widgets-suite' ), 'coverflow' => __( 'Coverflow', 'admore-widgets-suite' ), ], ] ); $this->add_control( 'speed', [ 'label' => __( 'Transition Speed (ms)', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => 600, 'min' => 100, ] ); $this->end_controls_section(); /* ── Style: Image ── */ $this->start_controls_section( 'section_style_image', [ 'label' => __( 'Image', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'image_height', [ 'label' => __( 'Image Height', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 100, 'max' => 800 ] ], 'default' => [ 'size' => 280 ], 'selectors' => [ '{{WRAPPER}} .eppro-ic-slide img' => 'height: {{SIZE}}px;' ], ] ); $this->add_control( 'image_fit', [ 'label' => __( 'Object Fit', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'cover', 'options' => [ 'cover'=>'Cover','contain'=>'Contain','fill'=>'Fill','none'=>'None' ], 'selectors' => [ '{{WRAPPER}} .eppro-ic-slide img' => 'object-fit: {{VALUE}};' ], ] ); $this->add_control( 'border_radius', [ 'label' => __( 'Border Radius', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 40 ] ], 'default' => [ 'size' => 8 ], 'selectors' => [ '{{WRAPPER}} .eppro-ic-slide img' => 'border-radius: {{SIZE}}px;' ], ] ); $this->add_control( 'hover_zoom', [ 'label' => __( 'Hover Zoom Effect', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'return_value' => 'yes', 'prefix_class' => 'eppro-ic--zoom-', ] ); $this->add_control( 'show_caption', [ 'label' => __( 'Show Caption Overlay', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => '', 'return_value' => 'yes', 'separator' => 'before', 'description' => __( 'Displays each image attachment caption as an overlay on the slide.', 'admore-widgets-suite' ), ] ); $this->add_control( 'caption_position', [ 'label' => __( 'Caption Position', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => 'bottom', 'options' => [ 'top' => __( 'Top', 'admore-widgets-suite' ), 'bottom' => __( 'Bottom', 'admore-widgets-suite' ), 'center' => __( 'Center', 'admore-widgets-suite' ), ], 'condition' => [ 'show_caption' => 'yes' ], 'prefix_class' => 'eppro-ic--cap-', ] ); $this->add_control( 'caption_bg_color', [ 'label' => __( 'Caption Background', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => 'rgba(0,0,0,0.55)', 'condition' => [ 'show_caption' => 'yes' ], 'selectors' => [ '{{WRAPPER}} .eppro-ic-caption' => 'background-color: {{VALUE}};' ], ] ); $this->add_control( 'caption_color', [ 'label' => __( 'Caption Text Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#ffffff', 'condition' => [ 'show_caption' => 'yes' ], 'selectors' => [ '{{WRAPPER}} .eppro-ic-caption' => 'color: {{VALUE}};' ], ] ); $this->add_control( 'image_overlay_color', [ 'label' => __( 'Hover Overlay Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'separator' => 'before', 'selectors' => [ '{{WRAPPER}} .eppro-ic-slide:hover img' => 'filter: brightness(0.85);', '{{WRAPPER}} .eppro-ic-slide::after' => 'background-color: {{VALUE}};' ], ] ); $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'image_shadow', 'selector' => '{{WRAPPER}} .eppro-ic-slide img', ] ); $this->end_controls_section(); /* ── Style: Navigation ── */ $this->start_controls_section( 'section_style_nav', [ 'label' => __( 'Navigation', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'arrow_color', [ 'label' => __( 'Arrow Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .eppro-ic-arrow' => 'color: {{VALUE}};' ], 'condition' => [ 'show_arrows' => 'yes' ], ] ); $this->add_control( 'arrow_bg', [ 'label' => __( 'Arrow Background', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => 'rgba(0,0,0,.5)', 'selectors' => [ '{{WRAPPER}} .eppro-ic-arrow' => 'background-color: {{VALUE}};' ], 'condition' => [ 'show_arrows' => 'yes' ], ] ); $this->add_control( 'dot_color', [ 'label' => __( 'Dot Color', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'default' => '#7c3aed', 'selectors' => [ '{{WRAPPER}} .swiper-pagination-bullet-active' => 'background: {{VALUE}};', '{{WRAPPER}} .swiper-pagination-bullet' => 'background: {{VALUE}}; opacity:.4;', ], 'condition' => [ 'show_dots' => 'yes' ], ] ); $this->add_control( 'arrow_size', [ 'label' => __( 'Arrow Box Size', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 20, 'max' => 80 ] ], 'default' => [ 'size' => 36 ], 'selectors' => [ '{{WRAPPER}} .eppro-ic-arrow' => 'width: {{SIZE}}px; height: {{SIZE}}px; font-size: {{SIZE}}px;', ], 'condition' => [ 'show_arrows' => 'yes' ], ] ); $this->add_control( 'arrow_border_radius', [ 'label' => __( 'Arrow Border Radius', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'size_units' => [ 'px', '%' ], 'default' => [ 'size' => 50, 'unit' => '%' ], 'selectors' => [ '{{WRAPPER}} .eppro-ic-arrow' => 'border-radius: {{SIZE}}{{UNIT}};' ], 'condition' => [ 'show_arrows' => 'yes' ], ] ); $this->add_control( 'arrow_bg_hover', [ 'label' => __( 'Arrow Hover Background', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-ic-arrow:hover' => 'background-color: {{VALUE}};' ], 'condition' => [ 'show_arrows' => 'yes' ], ] ); // No shadow by default; add one here if wanted. $this->add_group_control( \Elementor\Group_Control_Box_Shadow::get_type(), [ 'name' => 'arrow_box_shadow', 'label' => __( 'Arrow Shadow', 'admore-widgets-suite' ), 'selector' => '{{WRAPPER}} .eppro-ic-arrow', 'condition' => [ 'show_arrows' => 'yes' ], ] ); $this->end_controls_section(); $this->eppro_register_entrance_animation_controls(); } protected function render(): void { $s = $this->get_settings_for_display(); if ( empty( $s['images'] ) ) { echo '
' . esc_html__( 'Image Carousel', 'admore-widgets-suite' ) . '
' . esc_html__( 'Add images in the widget settings to display the carousel.', 'admore-widgets-suite' ) . '