D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
etb1lp46s9ed
/
public_html
/
lendeasy.site
/
wp-content
/
plugins
/
rosano-plugin
/
elementor
/
Filename :
banner.php
back
Copy
<?php namespace ROSANOPLUGIN\Element; use Elementor\Controls_Manager; use Elementor\Controls_Stack; use Elementor\Group_Control_Typography; use Elementor\Group_Control_Border; use Elementor\Repeater; use Elementor\Widget_Base; use Elementor\Utils; use Elementor\Group_Control_Text_Shadow; use \Elementor\Group_Control_Box_Shadow; use \Elementor\Group_Control_Background; use \Elementor\Group_Control_Image_Size; use Elementor\Plugin; /** * Elementor button widget. * Elementor widget that displays a button with the ability to control every * aspect of the button design. * * @since 1.0.0 */ class Banner extends Widget_Base { /** * Get widget name. * Retrieve button widget name. * * @since 1.0.0 * @access public * @return string Widget name. */ public function get_name() { return 'rosano_banner'; } /** * Get widget title. * Retrieve button widget title. * * @since 1.0.0 * @access public * @return string Widget title. */ public function get_title() { return esc_html__( 'Rosano Banner', 'rosano' ); } /** * Get widget icon. * Retrieve button widget icon. * * @since 1.0.0 * @access public * @return string Widget icon. */ public function get_icon() { return 'eicon-banner'; } public function get_categories() { return [ 'rosano' ]; } public function get_script_depends() { wp_register_script( 'banner-slider', YT_URL . 'assets/js/banner-carousel.js', [ 'elementor-frontend' ], '1.0.0', true ); return [ 'banner-slider' ]; } /** * Register button widget controls. * Adds different input fields to allow the user to change and customize the widget settings. * * @since 1.0.0 * @access protected */ protected function register_controls() { $this->start_controls_section( 'banner', [ 'label' => esc_html__( 'Banner', 'rosano' ), ] ); $this->add_control( 'layout_control', [ 'label' => __( 'Template Layout', 'rosano' ), 'type' => 'elementor-layout-control', 'default' => '1', 'options' => [ 'one' => [ 'label' => esc_html__('Layout 1', 'rosano' ), 'image' => get_template_directory_uri() . '/assets/images/redux/layout/banner/banner-01.png' ], 'two' => [ 'label' => esc_html__('Layout 2', 'rosano' ), 'image' => get_template_directory_uri() . '/assets/images/redux/layout/banner/banner-02.png' ], ], ] ); $this->add_control( 'show_shape_images', [ 'label' => esc_html__( 'Show Shape Images', 'rosano' ), 'type' => Controls_Manager::SWITCHER, 'condition' => [ 'layout_control' => ['one', 'two'], ], 'label_on' => esc_html__( 'On', 'rosano' ), 'label_off' => esc_html__( 'Off', 'rosano' ), 'return_value' => 'yes', 'default' => 'no', ] ); //Banner SLide Repeater $repeater = new Repeater(); $repeater->add_control( 'banner_image', [ 'label' => __( 'Banner Image', 'rosano' ), 'type' => Controls_Manager::MEDIA, 'default' => ['url' => Utils::get_placeholder_image_src(),], ] ); $repeater->add_control( 'sub_title', [ 'label' => __( 'Sub Title ', 'rosano' ), 'label_block' => true, 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'Enter your Sub Title', 'rosano' ), ] ); $repeater->add_control( 'title', [ 'label' => __( 'Title', 'rosano' ), 'type' => Controls_Manager::TEXTAREA, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'Enter your Title', 'rosano' ), ] ); $repeater->add_control( 'text', [ 'label' => __( 'Description', 'rosano' ), 'type' => Controls_Manager::TEXTAREA, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'Enter your Description', 'rosano' ), ] ); $repeater->add_control( 'btn_title', [ 'label' => __( 'Button Title 01', 'rosano' ), 'label_block' => true, 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'Enter your Button Title', 'rosano' ), ] ); $repeater->add_control( 'btn_link', [ 'label' => __( 'External Url 01', 'rosano' ), 'type' => Controls_Manager::URL, 'placeholder' => __( 'https://your-link.com', 'plugin-domain' ), 'show_external' => true, 'default' => [ 'url' => '', 'is_external' => true, 'nofollow' => true, ], ] ); $repeater->add_control( 'btn_title2', [ 'label' => __( 'Button Title 02', 'rosano' ), 'label_block' => true, 'type' => Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'placeholder' => __( 'Enter your Button Title', 'rosano' ), ] ); $repeater->add_control( 'btn_link2', [ 'label' => __( 'External Url 02', 'rosano' ), 'type' => Controls_Manager::URL, 'placeholder' => __( 'https://your-link.com', 'plugin-domain' ), 'show_external' => true, 'default' => [ 'url' => '', 'is_external' => true, 'nofollow' => true, ], ] ); $this->add_control( 'slide', [ 'label' => __('Add Slide Item', 'rosano'), 'type' => Controls_Manager::REPEATER, 'fields' => $repeater->get_controls(), ] ); $this->end_controls_section(); /**Swiper Setting Start**/ $this->start_controls_section( 'swiper_carousel', [ 'label' => esc_html__( 'Swiper Carousel Setting', 'cleanex' ) ] ); $this->add_control( 'loop', [ 'label' => __( 'Loop?', 'cleanex' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'cleanex' ), 'label_off' => __( 'Hide', 'cleanex' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_responsive_control( 'items_show', [ 'label' => esc_html__( 'No. of Items', 'cleanex' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'min' => 1, 'max' => 100, 'default' => 1, ] ); $this->add_responsive_control( 'image_item_gap', [ 'label' => __( 'Item Gap', 'cleanex' ), 'type' => Controls_Manager::NUMBER, 'min' => 1, 'max' => 100, 'default' => 0, ] ); $this->add_control( 'effect', [ 'label' => esc_html__( 'Slide Effect', 'rosano' ), 'label_block' => true, 'type' => Controls_Manager::SELECT, 'default' => 'one', 'options' => array( 'one' => esc_html__( 'Fade', 'rosano'), 'two' => esc_html__( 'Slide', 'rosano'), ), ] ); $this->add_control( 'speed', [ 'label' => esc_html__( 'Speed', 'rosano' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'placeholder' => esc_html__( 'Slide Speed', 'rosano' ), 'default' => esc_html__( '2000', 'rosano' ), ] ); $this->add_control( 'delay', [ 'label' => esc_html__( 'Delay Time', 'rosano' ), 'type' => Controls_Manager::TEXT, 'label_block' => true, 'placeholder' => esc_html__( 'Delay Time', 'rosano' ), 'default' => esc_html__( '6000', 'rosano' ), ] ); $this->add_control( 'arrows', [ 'label' => __( 'Enable Arrows?', 'cleanex' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'cleanex' ), 'label_off' => __( 'Hide', 'cleanex' ), 'return_value' => 'yes', 'default' => 'yes', ] ); $this->add_control( 'left_arrow_icons', [ 'label' => esc_html__('Enter The Left Arrow icon', 'rosano'), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'icon-next1', 'library' => 'icomoon', ], 'condition' => [ 'arrows' => 'yes', ], ] ); $this->add_control( 'right_arrow_icons', [ 'label' => esc_html__('Enter The Right Arrow icon', 'rosano'), 'type' => \Elementor\Controls_Manager::ICONS, 'default' => [ 'value' => 'icon-next2', 'library' => 'icomoon', ], 'condition' => [ 'arrows' => 'yes', ], ] ); $this->add_control( 'dots', [ 'label' => __( 'Enable Dots?', 'cleanex' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => __( 'Show', 'cleanex' ), 'label_off' => __( 'Hide', 'cleanex' ), 'return_value' => 'yes', 'default' => '', ] ); $this->end_controls_section(); /** Style Tab **/ $this->register_style_background_controls(); } /************************************************************************ Tab Style Start *************************************************************************/ protected function register_style_background_controls() { /**Sub Title Style**/ $this->start_controls_section( 'sub_title_style', [ 'label' => esc_html__('SUB TITLE STYLE SETTING', 'rosano'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'show_sub_title_style', [ 'label' => __( 'ON/OFF Sub Title Style', 'rosano' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'rosano' ), 'label_off' => esc_html__( 'Hide', 'rosano' ), 'return_value' => 'yes', 'default' => 'no', ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'sub_title_bgtype', 'label' => __( 'Sub Title Background', 'rosano' ), 'types' => [ 'classic', 'gradient', 'video' ], 'selector' => '{{WRAPPER}} .main-slider .main-slider-content .sub-title h5', 'condition' => [ 'show_sub_title_style' => 'yes', ] ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'sub_title_typography', 'label' => __('Sub Title Typography', 'rosano'), 'selector' => '{{WRAPPER}} .main-slider .main-slider-content .sub-title h5', 'separator' => 'before', 'condition' => [ 'show_sub_title_style' => 'yes', ] ] ); $this->add_control( 'sub_title_color', [ 'label' => __('Sub Title Color', 'rosano'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .main-slider .main-slider-content .sub-title h5' => 'color: {{VALUE}}' ], 'separator' => 'before', 'condition' => [ 'show_sub_title_style' => 'yes', ] ] ); $this->add_control( 'line_color', [ 'label' => __('Line Color', 'rosano'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .main-slider .main-slider-content .sub-title .border-line' => 'background-color: {{VALUE}}' ], 'separator' => 'before', 'condition' => [ 'show_sub_title_style' => 'yes', ] ] ); $this->end_controls_section(); /**Title Style**/ $this->start_controls_section( 'title_style', [ 'label' => esc_html__('TITLE STYLE SETTING', 'rosano'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'show_title_style', [ 'label' => __( 'ON/OFF Title Style', 'rosano' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'rosano' ), 'label_off' => esc_html__( 'Hide', 'rosano' ), 'return_value' => 'yes', 'default' => 'no', ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'title_bgtype', 'label' => __( 'Title Background', 'rosano' ), 'types' => [ 'classic', 'gradient', 'video' ], 'selector' => '{{WRAPPER}} .main-slider .main-slider-content .big-title h2', 'condition' => [ 'show_title_style' => 'yes', ] ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'title_typography', 'label' => __('Title Typography', 'rosano'), 'selector' => '{{WRAPPER}} .main-slider .main-slider-content .big-title h2', 'separator' => 'before', 'condition' => [ 'show_title_style' => 'yes', ] ] ); $this->add_control( 'title_color', [ 'label' => __('Title Color', 'rosano'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .main-slider .main-slider-content .big-title h2' => 'color: {{VALUE}}' ], 'separator' => 'before', 'condition' => [ 'show_title_style' => 'yes', ] ] ); $this->end_controls_section(); /**Content Style**/ $this->start_controls_section( 'content_style', [ 'label' => esc_html__('CONTENT STYLE SETTING', 'rosano'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'show_content_style', [ 'label' => __( 'ON/OFF Content Style', 'rosano' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'rosano' ), 'label_off' => esc_html__( 'Hide', 'rosano' ), 'return_value' => 'yes', 'default' => 'no', ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'content_bgtype', 'label' => __( 'Content Background', 'rosano' ), 'types' => [ 'classic', 'gradient', 'video' ], 'selector' => '{{WRAPPER}} .main-slider .main-slider-content .text p', 'condition' => [ 'show_content_style' => 'yes', ] ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'content_typography', 'label' => __('Content Typography', 'rosano'), 'selector' => '{{WRAPPER}} .main-slider .main-slider-content .text p', 'separator' => 'before', 'condition' => [ 'show_content_style' => 'yes', ] ] ); $this->add_control( 'content_color', [ 'label' => __('Content Color', 'rosano'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .main-slider .main-slider-content .text p' => 'color: {{VALUE}}' ], 'separator' => 'before', 'condition' => [ 'show_content_style' => 'yes', ] ] ); $this->end_controls_section(); /**Button Style One**/ $this->start_controls_section( 'button_style', [ 'label' => esc_html__('BUTTON STYLE ONE SETTING', 'rosano'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'show_btn_style', [ 'label' => __( 'ON/OFF Button Style', 'rosano' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'rosano' ), 'label_off' => esc_html__( 'Hide', 'rosano' ), 'return_value' => 'yes', 'default' => 'no', ] ); $this->add_control( 'yt_btn_background', [ 'label' => __( 'Button Background', 'rosano' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'show_btn_style' => 'yes', ] ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'btn_bgtype', 'label' => __( 'Button Background', 'rosano' ), 'types' => [ 'classic', 'gradient', 'video' ], 'selector' => '{{WRAPPER}} .rosano-btn1:after', 'condition' => [ 'show_btn_style' => 'yes', ] ] ); $this->add_control( 'hover_background', [ 'label' => __( 'Button Hover Background', 'rosano' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'show_btn_style' => 'yes', ] ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'btn_hover_bg_bgtype', 'label' => __( 'Button Hover Background', 'rosano' ), 'types' => [ 'classic', 'gradient', 'video' ], 'selector' => '{{WRAPPER}} .rosano-btn1:before', 'condition' => [ 'show_btn_style' => 'yes', ] ] ); $this->add_control( 'show_border_radius', [ 'label' => __( 'ON/OFF Button Radius Style', 'rosano' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'rosano' ), 'label_off' => esc_html__( 'Hide', 'rosano' ), 'return_value' => 'yes', 'default' => 'no', 'condition' => [ 'show_btn_style' => 'yes', ] ] ); $this->add_control( 'btn_border_radius', [ 'label' => esc_html__('Border Radius', 'rosano'), 'type' => Controls_Manager::DIMENSIONS, 'separator' => 'before', 'size_units' => ['px'], 'selectors' => [ '{{WRAPPER}} .rosano-btn1' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'show_border_radius' => 'yes', ] ] ); $this->add_control( 'show_border_type', [ 'label' => __( 'ON/OFF Border Style', 'rosano' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'rosano' ), 'label_off' => esc_html__( 'Hide', 'rosano' ), 'return_value' => 'yes', 'default' => 'no', 'condition' => [ 'show_btn_style' => 'yes', ] ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'btn_border_type', 'selector' => '{{WRAPPER}} .rosano-btn1', 'separator' => 'before', 'condition' => [ 'show_border_type' => 'yes', ] ] ); $this->add_control( 'btn_border_hover_color', [ 'label' => __('Button Border Hover Color', 'rosano'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .rosano-btn1:hover' => 'border-color: {{VALUE}}!important', ], 'separator' => 'before', 'condition' => [ 'show_border_type' => 'yes', ] ] ); $this->add_control( 'show_box_shadow', [ 'label' => __( 'ON/OFF Box Shadow Style', 'rosano' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'rosano' ), 'label_off' => esc_html__( 'Hide', 'rosano' ), 'return_value' => 'yes', 'default' => 'no', 'condition' => [ 'show_btn_style' => 'yes', ] ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'border_box_shadow', 'selector' => '{{WRAPPER}} .rosano-btn1', 'separator' => 'before', 'condition' => [ 'show_box_shadow' => 'yes', ] ] ); $this->add_control( 'show_btn_padding', [ 'label' => __( 'ON/OFF Padding Style', 'rosano' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'rosano' ), 'label_off' => esc_html__( 'Hide', 'rosano' ), 'return_value' => 'yes', 'default' => 'no', 'condition' => [ 'show_btn_style' => 'yes', ] ] ); $this->add_responsive_control( 'btn_padding', [ 'label' => __( 'Padding', 'rosano' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .rosano-btn1' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], 'frontend_available' => true, 'condition' => [ 'show_btn_padding' => 'yes', ] ] ); $this->add_control( 'show_typo_color', [ 'label' => __( 'ON/OFF Typography and Color Style', 'rosano' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'rosano' ), 'label_off' => esc_html__( 'Hide', 'rosano' ), 'return_value' => 'yes', 'default' => 'no', 'condition' => [ 'show_btn_style' => 'yes', ] ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'btn_title_typography', 'label' => __('Button Text Typography', 'rosano'), 'selector' => '{{WRAPPER}} .rosano-btn1', 'separator' => 'before', 'condition' => [ 'show_typo_color' => 'yes', ] ] ); $this->add_control( 'btn_title_color', [ 'label' => __('Button Text Color', 'rosano'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .rosano-btn1' => 'color: {{VALUE}}!important', ], 'separator' => 'before', 'condition' => [ 'show_typo_color' => 'yes', ] ] ); $this->add_control( 'btn_title_hover_color', [ 'label' => __('Button Text Hover Color', 'rosano'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .rosano-btn1:hover' => 'color: {{VALUE}}!important', ], 'separator' => 'before', 'condition' => [ 'show_typo_color' => 'yes', ] ] ); $this->end_controls_section(); /**Button Style Two**/ $this->start_controls_section( 'button_style2', [ 'label' => esc_html__('BUTTON STYLE TWO SETTING', 'rosano'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'show_btn_style2', [ 'label' => __( 'ON/OFF Button Style Two', 'rosano' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'rosano' ), 'label_off' => esc_html__( 'Hide', 'rosano' ), 'return_value' => 'yes', 'default' => 'no', ] ); $this->add_control( 'yt_btn_background2', [ 'label' => __( 'Button Background', 'rosano' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'show_btn_style2' => 'yes', ] ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'btn_bgtype2', 'label' => __( 'Button Background', 'rosano' ), 'types' => [ 'classic', 'gradient', 'video' ], 'selector' => '{{WRAPPER}} .rosano-btn2:after', 'condition' => [ 'show_btn_style2' => 'yes', ] ] ); $this->add_control( 'hover_background2', [ 'label' => __( 'Button Hover Background', 'rosano' ), 'type' => Controls_Manager::HEADING, 'separator' => 'before', 'condition' => [ 'show_btn_style2' => 'yes', ] ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'btn_hover_bg_bgtype2', 'label' => __( 'Button Hover Background', 'rosano' ), 'types' => [ 'classic', 'gradient', 'video' ], 'selector' => '{{WRAPPER}} .rosano-btn2:before', 'condition' => [ 'show_btn_style2' => 'yes', ] ] ); $this->add_control( 'show_border_radius2', [ 'label' => __( 'ON/OFF Button Radius Style', 'rosano' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'rosano' ), 'label_off' => esc_html__( 'Hide', 'rosano' ), 'return_value' => 'yes', 'default' => 'no', 'condition' => [ 'show_btn_style2' => 'yes', ] ] ); $this->add_control( 'btn_border_radius2', [ 'label' => esc_html__('Border Radius', 'rosano'), 'type' => Controls_Manager::DIMENSIONS, 'separator' => 'before', 'size_units' => ['px'], 'selectors' => [ '{{WRAPPER}} .rosano-btn2' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'show_border_radius2' => 'yes', ] ] ); $this->add_control( 'show_border_type2', [ 'label' => __( 'ON/OFF Border Style', 'rosano' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'rosano' ), 'label_off' => esc_html__( 'Hide', 'rosano' ), 'return_value' => 'yes', 'default' => 'no', 'condition' => [ 'show_btn_style2' => 'yes', ] ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'btn_border_type2', 'selector' => '{{WRAPPER}} .rosano-btn2', 'separator' => 'before', 'condition' => [ 'show_border_type2' => 'yes', ] ] ); $this->add_control( 'btn_border_hover_color2', [ 'label' => __('Button Border Hover Color', 'rosano'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .rosano-btn2:hover' => 'border-color: {{VALUE}}!important', ], 'separator' => 'before', 'condition' => [ 'show_border_type2' => 'yes', ] ] ); $this->add_control( 'show_box_shadow2', [ 'label' => __( 'ON/OFF Box Shadow Style', 'rosano' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'rosano' ), 'label_off' => esc_html__( 'Hide', 'rosano' ), 'return_value' => 'yes', 'default' => 'no', 'condition' => [ 'show_btn_style2' => 'yes', ] ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'border_box_shadow2', 'selector' => '{{WRAPPER}} .rosano-btn2', 'separator' => 'before', 'condition' => [ 'show_box_shadow2' => 'yes', ] ] ); $this->add_control( 'show_btn_padding2', [ 'label' => __( 'ON/OFF Padding Style', 'rosano' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'rosano' ), 'label_off' => esc_html__( 'Hide', 'rosano' ), 'return_value' => 'yes', 'default' => 'no', 'condition' => [ 'show_btn_style2' => 'yes', ] ] ); $this->add_responsive_control( 'btn_padding2', [ 'label' => __( 'Padding', 'rosano' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em', '%' ], 'selectors' => [ '{{WRAPPER}} .rosano-btn2' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], 'frontend_available' => true, 'condition' => [ 'show_btn_padding2' => 'yes', ] ] ); $this->add_control( 'show_typo_color2', [ 'label' => __( 'ON/OFF Typography and Color Style', 'rosano' ), 'type' => Controls_Manager::SWITCHER, 'label_on' => esc_html__( 'Show', 'rosano' ), 'label_off' => esc_html__( 'Hide', 'rosano' ), 'return_value' => 'yes', 'default' => 'no', 'condition' => [ 'show_btn_style2' => 'yes', ] ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'btn_title_typography2', 'label' => __('Button Text Typography', 'rosano'), 'selector' => '{{WRAPPER}} .rosano-btn2', 'separator' => 'before', 'condition' => [ 'show_typo_color2' => 'yes', ] ] ); $this->add_control( 'btn_title_color2', [ 'label' => __('Button Text Color', 'rosano'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .rosano-btn2' => 'color: {{VALUE}}!important', ], 'separator' => 'before', 'condition' => [ 'show_typo_color2' => 'yes', ] ] ); $this->add_control( 'btn_title_hover_color2', [ 'label' => __('Button Text Hover Color', 'rosano'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .rosano-btn2:hover' => 'color: {{VALUE}}!important', ], 'separator' => 'before', 'condition' => [ 'show_typo_color2' => 'yes', ] ] ); $this->end_controls_section(); } /** * Render button widget output on the frontend. * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * @access protected */ protected function render() { $settings = $this->get_settings_for_display(); $allowed_tags = wp_kses_allowed_html('post'); $layout = $settings[ 'layout_control' ]; $items_show = $settings[ 'items_show' ]; $image_item_gap = $settings[ 'image_item_gap' ]; $effect = $settings[ 'effect' ]; $speed = $settings[ 'speed' ]; $delay = $settings[ 'delay' ]; if($settings['loop'] == 'yes'){ $loop = true; }else{ $loop = false; } ?> <?php if( $layout === 'two' ): ?> <!--Main Slider Start--> <section class="main-slider main-slider-style2 rosano-banner-section" id="banner2"> <?php if($settings[ 'show_shape_images' ]){ ?> <div class="main-slider-style2__left-bg"> <div class="main-slider-style2__shape1"> <img class="rotate-me" src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/shapes/main-slider-style2__shape-1.png" alt="<?php esc_attr_e('Awesome Image', 'rosano');?>"> </div> <div class="main-slider-style2__shape2"> <img class="float-bob-y" src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/shapes/main-slider-style2__shape-2.png" alt="<?php esc_attr_e('Awesome Image', 'rosano');?>"> </div> <div class="main-slider-style2__shape3"> <img class="float-bob-y" src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/shapes/main-slider-style2__shape-3.png" alt="<?php esc_attr_e('Awesome Image', 'rosano');?>"> </div> </div> <?php } ?> <div class="swiper-container thm-swiper__slider banner-slider" data-swiper-options='{"slidesPerView": <?php echo esc_attr( $items_show );?>, "loop": <?php echo esc_attr( $loop );?>, "effect": "<?php echo esc_attr( $effect );?>", "speed": <?php echo esc_attr( $speed );?>, "spaceBetween": <?php echo esc_attr( $image_item_gap );?>, "pagination": {"el": "#main-slider-pagination", "type": "bullets", "clickable": true}, "navigation": {"nextEl": "#main-slider__swiper-button-next", "prevEl": "#main-slider__swiper-button-prev"}, "autoplay": {"delay": <?php echo esc_attr( $delay );?>}}'> <div class="swiper-wrapper"> <?php foreach($settings['slide'] as $key => $item): ?> <!--Start Single Swiper Slide--> <div class="swiper-slide"> <div class="container"> <div class="row"> <div class="col-xl-12"> <div class="main-slider-content"> <div class="main-slider-content__inner"> <?php if($item[ 'sub_title']) {?> <div class="sub-title"> <div class="border-line"></div> <h5><?php echo wp_kses( $item[ 'sub_title'], true );?></h5> </div> <?php } ?> <?php if($item[ 'title']) {?> <div class="big-title"> <h2><?php echo wp_kses( $item[ 'title'], true );?></h2> </div> <?php } ?> <?php if($item[ 'text']) {?> <div class="text"> <p><?php echo wp_kses( $item[ 'text'], true );?></p> </div> <?php } ?> <div class="btn-box"> <?php if($item[ 'btn_link'] and $item[ 'btn_title']){ ?> <a class="btn-one rosano-btn1" href="<?php echo esc_url( $item[ 'btn_link']['url'] );?>"> <span class="txt"> <?php echo wp_kses( $item[ 'btn_title'], true );?> <i class="icon-Vector"></i> </span> </a> <?php } ?> <?php if($item[ 'btn_link2'] and $item[ 'btn_title2']){ ?> <a class="btn-one rosano-btn2" href="<?php echo esc_url( $item[ 'btn_link2']['url'] );?>"> <span class="txt"> <?php echo wp_kses( $item[ 'btn_title2'], true );?> <i class="icon-Vector"></i> </span> </a> <?php } ?> </div> </div> <?php if($item[ 'banner_image' ]['id']){ ?> <div class="img-box"> <div class="inner"> <img src="<?php echo esc_url( wp_get_attachment_url( $item[ 'banner_image' ]['id'] ) );?>" alt="<?php esc_attr_e('Awesome Image', 'rosano');?>"> </div> </div> <?php } ?> </div> </div> </div> </div> </div> <!--End Single Swiper Slide--> <?php endforeach; ?> </div> <?php if( $settings[ 'arrows' ] === 'yes' ){?> <!-- If we need navigation buttons --> <div class="main-slider__nav"> <div class="swiper-button-prev" id="main-slider__swiper-button-next"> <?php if(!empty( $settings[ 'left_arrow_icons' ] )):?> <?php \Elementor\Icons_Manager::render_icon( $settings['left_arrow_icons']); ?> <?php else:?> <i class="icon-next1 left"></i> <?php endif;?> </div> <div class="swiper-button-next" id="main-slider__swiper-button-prev"> <?php if(!empty( $settings[ 'right_arrow_icons' ] )):?> <?php \Elementor\Icons_Manager::render_icon( $settings['right_arrow_icons']); ?> <?php else:?> <i class="icon-next2 right"></i> <?php endif;?> </div> </div> <?php };?> </div> </section> <!--Main Slider End--> <?php else: ?> <!--Main Slider Start--> <section class="main-slider main-slider-style1 rosano-banner-section" id="banner1"> <div class="swiper-container thm-swiper__slider" data-swiper-options='{"slidesPerView": <?php echo esc_attr( $items_show );?>, "loop": <?php echo esc_attr( $loop );?>, "effect": "<?php echo esc_attr( $effect );?>", "speed": <?php echo esc_attr( $speed );?>, "spaceBetween": <?php echo esc_attr( $image_item_gap );?>, "pagination": {"el": "#main-slider-pagination", "type": "bullets", "clickable": true}, "navigation": {"nextEl": "#main-slider__swiper-button-next", "prevEl": "#main-slider__swiper-button-prev"}, "autoplay": {"delay": <?php echo esc_attr( $delay );?>}}'> <div class="swiper-wrapper"> <?php if($settings[ 'show_shape_images' ]){ ?> <div class="main-slider-style1__shape1"></div> <div class="main-slider-style1__shape2"></div> <?php } ?> <?php foreach($settings['slide'] as $key => $item): ?> <!--Start Single Swiper Slide--> <div class="swiper-slide"> <?php if($item[ 'banner_image' ]['id']){ ?> <div class="image-layer" style="background-image: url(<?php echo esc_url( wp_get_attachment_url( $item[ 'banner_image' ]['id'] ) );?>);"> </div> <?php } ?> <div class="container"> <div class="row"> <div class="col-xl-12"> <div class="main-slider-content"> <div class="main-slider-content__inner"> <?php if($item[ 'sub_title']) {?> <div class="sub-title"> <div class="border-line"></div> <h5><?php echo wp_kses( $item[ 'sub_title'], true );?></h5> </div> <?php } ?> <?php if($item[ 'title']) {?> <div class="big-title"> <h2><?php echo wp_kses( $item[ 'title'], true );?></h2> </div> <?php } ?> <?php if($item[ 'text']) {?> <div class="text"> <p><?php echo wp_kses( $item[ 'text'], true );?></p> </div> <?php } ?> <div class="btn-box"> <?php if($item[ 'btn_link'] and $item[ 'btn_title']){ ?> <a class="btn-one rosano-btn1" href="<?php echo esc_url( $item[ 'btn_link']['url'] );?>"> <span class="txt"> <?php echo wp_kses( $item[ 'btn_title'], true );?> <i class="icon-Vector"></i> </span> </a> <?php } ?> <?php if($item[ 'btn_link2'] and $item[ 'btn_title2']){ ?> <a class="btn-one rosano-btn2" href="<?php echo esc_url( $item[ 'btn_link2']['url'] );?>"> <span class="txt"> <?php echo wp_kses( $item[ 'btn_title2'], true );?> <i class="icon-Vector"></i> </span> </a> <?php } ?> </div> </div> </div> </div> </div> </div> </div> <!--End Single Swiper Slide--> <?php endforeach; ?> </div> <?php if( $settings[ 'arrows' ] === 'yes' ){?> <!-- If we need navigation buttons --> <div class="main-slider__nav"> <div class="swiper-button-prev" id="main-slider__swiper-button-next"> <?php if(!empty( $settings[ 'left_arrow_icons' ] )):?> <?php \Elementor\Icons_Manager::render_icon( $settings['left_arrow_icons']); ?> <?php else:?> <i class="icon-next1 left"></i> <?php endif;?> </div> <div class="swiper-button-next" id="main-slider__swiper-button-prev"> <?php if(!empty( $settings[ 'right_arrow_icons' ] )):?> <?php \Elementor\Icons_Manager::render_icon( $settings['right_arrow_icons']); ?> <?php else:?> <i class="icon-next2 right"></i> <?php endif;?> </div> </div> <?php };?> </div> </section> <!--Main Slider End--> <?php endif; } }