navasena/wp-content/plugins/thinkai-plugin/elementor/banner.php

1646 lines
54 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php namespace THINKAIPLUGIN\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\Group_Control_Text_Stroke;
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 'thinkai_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__( 'Thinkai Banner', 'thinkai' );
}
/**
* Get widget icon.
* Retrieve button widget icon.
*
* @since 1.0.0
* @access public
* @return string Widget icon.
*/
public function get_icon() {
return 'eicon-banner';
}
/**
* Get widget categories.
* Retrieve the list of categories the button widget belongs to.
* Used to determine where to display the widget in the editor.
*
* @since 2.0.0
* @access public
* @return array Widget categories.
*/
public function get_categories() {
return [ 'thinkai' ];
}
public function get_script_depends() {
wp_register_script( 'particles', YT_URL . 'assets/js/particles.min.js', [ 'elementor-frontend' ], '1.0.0', true );
wp_register_script( 'particles-config', YT_URL . 'assets/js/particles-config.js', [ 'elementor-frontend' ], '1.0.0', true );
wp_register_script( 'banner-curved-script', YT_URL . 'assets/js/banner.js', [ 'elementor-frontend' ], '1.0.0', true );
return [ 'particles', 'particles-config', 'banner-curved-script' ];
}
/**
* 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__( 'Thinkai Banner', 'thinkai' ),
]
);
$this->add_control(
'layout_control',
[
'label' => esc_html__( 'Layout Style', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => '1',
'options' => array(
'1' => esc_html__( 'Style One ', 'thinkai'),
'2' => esc_html__( 'Style Two ', 'thinkai'),
'3' => esc_html__( 'Style Three ', 'thinkai'),
'4' => esc_html__( 'Style Four ', 'thinkai'),
),
]
);
//Shape img
$this->add_control(
'shape_img',
[
'label' => __( 'Shape Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
'condition' => [
'layout_control' => ['3','4']
],
]
);
//Shape img
$this->add_control(
'shape_img_v2',
[
'label' => __( 'Shape Image V2', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
'condition' => [
'layout_control' => '4'
],
]
);
//Switcher
$this->add_control(
'show_vector_img',
[
'label' => esc_html__( 'Enable Vector Image', 'thinkai' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'thinkai' ),
'label_off' => esc_html__( 'Off', 'thinkai' ),
'return_value' => 'yes',
'default' => 'no',
'condition' => [
'layout_control' => '3'
],
]
);
//Pattern img
$this->add_control(
'Pattern_img',
[
'label' => __( 'Pattern Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
'condition' => [
'layout_control' => '2'
],
]
);
//Rating
$this->add_control(
'rating',
[
'label' => esc_html__( 'Total Rating', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => '1',
'options' => array(
'1' => esc_html__( 'One Star ', 'thinkai'),
'2' => esc_html__( 'Two Star ', 'thinkai'),
'3' => esc_html__( 'Three Star ', 'thinkai'),
'4' => esc_html__( 'Four Star ', 'thinkai'),
'5' => esc_html__( 'Five Star ', 'thinkai'),
),
'condition' => [
'layout_control' => ['2','3']
],
]
);
//Total Rating
$this->add_control(
'total_rating',
[
'label' => __( 'Total Rating', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( '4.9/5.0', 'thinkai' ),
'condition' => [
'layout_control' => ['2','3']
],
]
);
//Rating Description
$this->add_control(
'rating_description',
[
'label' => __( 'Rating Description', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( '(from 20k reviews)', 'thinkai' ),
'condition' => [
'layout_control' => ['2','3']
],
]
);
//Switcher
$this->add_control(
'show_particles',
[
'label' => esc_html__( 'Enable Particles', 'thinkai' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'thinkai' ),
'label_off' => esc_html__( 'Off', 'thinkai' ),
'return_value' => 'yes',
'default' => 'no',
'condition' => [
'layout_control' => '1'
],
]
);
//Title V1
$this->add_control(
'title_v1',
[
'label' => __( 'Title V1', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Futuristic Services,', 'thinkai' ),
'condition' => [
'layout_control' => '1'
],
]
);
//Video BTN BG Image
$this->add_control(
'video_bg_img',
[
'label' => __( 'Button BG Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
'condition' => [
'layout_control' => '1'
],
]
);
//Video Title
$this->add_control(
'video_title',
[
'label' => __( 'Video Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Watch Demo Video,', 'thinkai' ),
'condition' => [
'layout_control' => ['1','2']
],
]
);
//Video Link Option
$this->add_control(
'video_option',
[
'label' => __( 'Select Video Type', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'src_url',
'options' => array(
'src_url' => esc_html__( 'Source URL', 'thinkai' ),
'src_media' => esc_html__( 'Source Media', 'thinkai' ),
),
'condition' => [
'layout_control' => ['1','2']
],
]
);
$this->add_control(
'video_link',
[
'label' => __( 'Video Source Url', 'thinkai' ),
'type' => Controls_Manager::URL,
'label_block' => true,
'placeholder' => __( 'https://your-link.com', 'thinkai' ),
'show_external' => true,
'default' => [
'url' => '',
],
'condition' => [
'layout_control' => ['1','2'],
'video_option' => 'src_url'
],
]
);
$this->add_control(
'video_source_image',
[
'label' => __( 'Video Source Media', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'media_types' => ['video'],
'condition' => [
'layout_control' => ['1','2'],
'video_option' => 'src_media'
],
]
);
//Title V2
$this->add_control(
'title_v2',
[
'label' => __( 'Title V2', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Transforming Ideas', 'thinkai' ),
'condition' => [
'layout_control' => '1'
],
]
);
//Title V3
$this->add_control(
'title_v3',
[
'label' => __( 'Title V3', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'into Images', 'thinkai' ),
'condition' => [
'layout_control' => '1'
],
]
);
//subTitle
$this->add_control(
'sub_title',
[
'label' => __( 'Sub Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( '[ AI VOICE GENERATOR & TEXT TO SPEECH ]', 'thinkai' ),
'condition' => [
'layout_control' => '3',
],
]
);
//Title
$this->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Title', 'thinkai' ),
'condition' => [
'layout_control' => ['2','3','4']
],
]
);
//Text
$this->add_control(
'text',
[
'label' => __( 'Description', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Description', 'thinkai' ),
'condition' => [
'layout_control' => ['1','2','4']
],
]
);
//Icon
$this->add_control(
'icon',
[
'label' => esc_html__('Enter The icons', 'thinkai'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-performance',
'library' => 'solid',
],
'condition' => [
'layout_control' => '4'
]
]
);
//project Value
$this->add_control(
'total_project_value',
[
'label' => __( 'Total Project Value', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( '2.4', 'thinkai' ),
'condition' => [
'layout_control' => '4',
],
]
);
//Value in Million
$this->add_control(
'value_in_million',
[
'label' => __( 'Value In Million', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Million', 'thinkai' ),
'condition' => [
'layout_control' => '4',
],
]
);
//Project Description
$this->add_control(
'project_description',
[
'label' => __( 'Project Description', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Projects Completed Successfully', 'thinkai' ),
'condition' => [
'layout_control' => '4',
],
]
);
//Curved Switcher
$this->add_control(
'show_curved_circle_area',
[
'label' => esc_html__( 'Enable Curved Circle Area', 'thinkai' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'thinkai' ),
'label_off' => esc_html__( 'Off', 'thinkai' ),
'return_value' => 'yes',
'default' => 'no',
'condition' => [
'layout_control' => '1'
],
]
);
//Carved Text V1
$this->add_control(
'curved_text_v1',
[
'label' => __( 'Curved Title V1', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Generate Your Image', 'thinkai' ),
'condition' => [
'layout_control' => '1',
'show_curved_circle_area' => 'yes'
]
]
);
//Carved Text V2
$this->add_control(
'curved_text_v2',
[
'label' => __( 'Curved Title V2', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Generate Your Image', 'thinkai' ),
'condition' => [
'layout_control' => '1',
'show_curved_circle_area' => 'yes'
]
]
);
$this->add_control(
'curved_link',
[
'label' => __('External Url', 'thinkai'),
'type' => Controls_Manager::URL,
'placeholder' => __('https://your-link.com', 'plugin-domain'),
'show_external' => true,
'default' => [
'url' => '',
'is_external' => true,
'nofollow' => true,
],
'condition' => [
'layout_control' => '1',
'show_curved_circle_area' => 'yes'
]
]
);
//List Title
$this->add_control(
'transparent_title',
[
'label' => __( 'Transparent Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'to Brands', 'thinkai' ),
'condition' => [
'layout_control' => '4',
],
]
);
//Feature List Repeater
$repeater = new Repeater();
$repeater->add_control(
'list_title',
[
'label' => __( 'List Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your List Title', 'thinkai' ),
]
);
$repeater->add_control(
'list_link',
[
'label' => __( 'External Link', 'thinkai' ),
'type' => Controls_Manager::URL,
'label_block' => true,
'placeholder' => __( 'https://your-link.com', 'thinkai' ),
'show_external' => true,
'default' => [
'url' => '',
'is_external' => true,
'nofollow' => true,
],
]
);
$this->add_control(
'list',
[
'label' => __('Add List Item', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '{{{ list_title }}}',
'condition' => [
'layout_control' => ['3','4']
],
'default' => [
[
'list_title' => esc_html__( 'Support 100+ Languages', 'thinkai' ),
'list_link' => esc_html__( '#', 'thinkai' ),
],
[
'list_title' => esc_html__( 'Largest library of voices', 'thinkai' ),
'list_link' => esc_html__( '#', 'thinkai' ),
],
[
'list_title' => esc_html__( 'Multi-Voice Feature', 'thinkai' ),
'list_link' => esc_html__( '#', 'thinkai' ),
],
],
]
);
//Client Title
$this->add_control(
'client_title',
[
'label' => __( 'Client Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'placeholder' => esc_html__( 'Try More Sample', 'thinkai' ),
'condition' => [
'layout_control' => '3'
]
]
);
//Feature Carousel Repeater
$repeater = new Repeater();
$repeater->add_control(
'client_img',
[
'label' => __( 'Choose clients Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
$this->add_control(
'author_img',
[
'label' => __('Add Clients Item', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'condition' => [
'layout_control' => '3'
]
]
);
$this->add_control(
'total_value',
[
'label' => __( 'Total Clients', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'placeholder' => esc_html__( '+ 100', 'thinkai' ),
'condition' => [
'layout_control' => '3'
]
]
);
//Button Title
$this->add_control(
'button_title',
[
'label' => __( 'Button Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Get Started Now', 'thinkai' ),
'condition' => [
'layout_control' => ['2','3','4']
]
]
);
//Link Option
$this->add_control(
'link_option',
[
'label' => esc_html__( 'Select link Option', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'extranal',
'options' => array(
'extranal' => esc_html__( 'Extranal ', 'thinkai'),
'page' => esc_html__( 'Page ', 'thinkai'),
),
'condition' => [
'layout_control' => ['2','3','4'],
]
]
);
$this->add_control(
'link',
[
'label' => __( 'External Link', 'thinkai' ),
'type' => Controls_Manager::URL,
'label_block' => true,
'placeholder' => __( 'https://your-link.com', 'thinkai' ),
'show_external' => true,
'default' => [
'url' => '',
'is_external' => true,
'nofollow' => true,
],
'condition' => [
'layout_control' => ['2','3','4'],
'link_option' => 'extranal'
]
]
);
$this->add_control(
'page_select',
[
'label' => esc_html__( 'Select Page', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT2,
'default' => 'extranal',
'options' => thinkai_page_list(),
'condition' => [
'layout_control' => ['2','3','4'],
'link_option' => 'page'
]
]
);
//Button Title V2
$this->add_control(
'button_title_v2',
[
'label' => __( 'Button Title V2', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'How Its Work', 'thinkai' ),
'condition' => [
'layout_control' => '4'
]
]
);
$this->add_control(
'btn_link_v2',
[
'label' => __( 'External Link', 'thinkai' ),
'type' => Controls_Manager::URL,
'label_block' => true,
'placeholder' => __( 'https://your-link.com', 'thinkai' ),
'show_external' => true,
'default' => [
'url' => '',
'is_external' => true,
'nofollow' => true,
],
'condition' => [
'layout_control' => '4'
]
]
);
//Robot Image
$this->add_control(
'robot_img',
[
'label' => __( 'Robot Image Url', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
'condition' => [
'layout_control' => '2',
]
]
);
//Robot Title
$this->add_control(
'robot_title',
[
'label' => __( 'Robot Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Can i help you?', 'thinkai' ),
'condition' => [
'layout_control' => '2',
],
]
);
//Robot Text
$this->add_control(
'robot_text',
[
'label' => __( 'Robot Text', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'I,m an AI-powered chatbot designed to assist and provide information to users.', 'thinkai' ),
'condition' => [
'layout_control' => '2',
],
]
);
//Feature Image
$this->add_control(
'feature_img',
[
'label' => __( 'Feature Image Url', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
'condition' => [
'layout_control' => '2',
]
]
);
//Feature Text
$this->add_control(
'feature_text',
[
'label' => __( 'Description', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Could you tell me more about the ThinkAi?', 'thinkai' ),
'condition' => [
'layout_control' => '2',
],
]
);
//Carousel Images
$this->add_control(
'gallery_img_v1',
[
'label' => __( 'Gallery Carousel Image V1', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
'condition' => [
'layout_control' => ['4']
],
]
);
$this->add_control(
'gallery_img_v2',
[
'label' => __( 'Gallery Carousel Image V2', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
'condition' => [
'layout_control' => ['4']
],
]
);
$this->add_control(
'gallery_img_v3',
[
'label' => __( 'Gallery Carousel Image V3', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
'condition' => [
'layout_control' => ['4']
],
]
);
//Images Repeater
$repeater = new Repeater();
$repeater->add_control(
'gallery_img',
[
'label' => __( 'Gallery Images', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
$this->add_control(
'gallery',
[
'label' => __('Add Gallery Image', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'condition' => [
'layout_control' => ['1']
],
]
);
//Images Repeater V2
$repeater = new Repeater();
$repeater->add_control(
'gallery_img_v2',
[
'label' => __( 'Gallery Images', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
$repeater->add_control(
'gallery_img_v3',
[
'label' => __( 'Gallery Images', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
$this->add_control(
'gallery_v2',
[
'label' => __('Add Gallery Image', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'condition' => [
'layout_control' => '1'
],
]
);
//Images Repeater V3
$repeater = new Repeater();
$repeater->add_control(
'gallery_img_v4',
[
'label' => __( 'Gallery Images', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
$this->add_control(
'gallery_v3',
[
'label' => __('Add Gallery Image', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'condition' => [
'layout_control' => '1'
],
]
);
//Images Repeater V3
$repeater = new Repeater();
$repeater->add_control(
'gallery_img_v5',
[
'label' => __( 'Gallery Images', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
$repeater->add_control(
'gallery_img_v6',
[
'label' => __( 'Gallery Images', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
$this->add_control(
'gallery_v4',
[
'label' => __('Add Gallery Item', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'condition' => [
'layout_control' => '1'
],
]
);
//Author Title
$this->add_control(
'author_title',
[
'label' => __( 'Authror Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'placeholder' => esc_html__( 'Try More Sampl', 'thinkai' ),
'condition' => [
'layout_control' => '3'
]
]
);
//Partner Title
$this->add_control(
'partner_title',
[
'label' => __( 'Partner Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'placeholder' => esc_html__( 'Popular Brand Users', 'thinkai' ),
'condition' => [
'layout_control' => '4'
]
]
);
//Feature Carousel Repeater
$repeater = new Repeater();
$repeater->add_control(
'partner_img',
[
'label' => __( 'Choose Partner Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
$repeater->add_control(
'partner_link',
[
'label' => __( 'Partner Link', 'thinkai' ),
'type' => Controls_Manager::URL,
'label_block' => true,
'placeholder' => __( 'https://your-link.com', 'thinkai' ),
'show_external' => true,
'default' => [
'url' => '',
'is_external' => true,
'nofollow' => true,
],
]
);
$this->add_control(
'partner',
[
'label' => __('Add Partner Item', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'condition' => [
'layout_control' => '4'
]
]
);
$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' ];
?>
<?php
if($layout == '4') :
$icon = $settings['icon'];
$page = $settings['link_option'];
$page_select = $settings[ 'page_select' ];
$ext_url = $settings[ 'link' ];
if( $page == 'page' ){
$mount_link = get_page_link( $page_select );
}else{
$mount_link = $ext_url['url'];
$target = $ext_url['is_external'] ? ' target="_blank"' : '';
$nofollow = $ext_url['nofollow'] ? ' rel="nofollow"' : '';
}
?>
<!--Start Banner Style4-->
<section class="banner-style4">
<?php if($settings['shape_img']){ ?>
<div class="banner-style4__shape1 wow slideInLeft animated" data-wow-delay="700ms"
data-wow-duration="3500ms">
<img class="zoom-fade" src="<?php echo esc_url(wp_get_attachment_url($settings['shape_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<?php } ?>
<?php if($settings['shape_img_v2']){ ?>
<div class="banner-style4__shape2 wow slideInRight animated" data-wow-delay="1000ms"
data-wow-duration="3500ms">
<img class="float-bob-y" src="<?php echo esc_url(wp_get_attachment_url($settings['shape_img_v2']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<?php } ?>
<div class="container">
<div class="banner-style4__inner">
<div class="banner-style4__title sec-title-animation animation-style1">
<?php if($settings['text']){ ?>
<div class="text">
<p><?php echo wp_kses($settings['text'], true); ?></p>
</div>
<?php } ?>
<?php if($settings['title']){ ?>
<h2 class="title-animation">
<?php echo wp_kses($settings['title'], true); ?>
</h2>
<?php } ?>
<div class="banner-style4__fact-box">
<?php if($icon){ ?>
<div class="icon">
<?php
$icon = str_replace( "icon ", "", $settings['icon']);
if( !empty( $icon ) ):?>
<?php \Elementor\Icons_Manager::render_icon( $icon ); ?>
<?php else:?>
<span class="icon-performance"></span>
<?php endif;?>
</div>
<?php } ?>
<div class="counting">
<div class="top">
<h2 class="odometer" data-count="<?php echo esc_attr($settings['total_project_value']);?>"><?php echo esc_attr($settings['total_project_value']);?></h2>
<p><?php echo wp_kses($settings['value_in_million'], true); ?></p>
</div>
<p><?php echo wp_kses($settings['project_description'], true); ?></p>
</div>
</div>
</div>
<div class="banner-style4__content">
<div class="row">
<div class="col-xl-6">
<div class="banner-style4__img-box">
<div class="slider-bg-slide" data-options='{
"delay": 10000,
"transitionDuration": 4000,
"slides":
[
{ "src": "<?php echo esc_url(wp_get_attachment_url($settings['gallery_img_v1']['id'])); ?>" },
{ "src": "<?php echo esc_url(wp_get_attachment_url($settings['gallery_img_v2']['id'])); ?>" },
{ "src": "<?php echo esc_url(wp_get_attachment_url($settings['gallery_img_v3']['id'])); ?>" }
],
"transition": "fade",
"animation": "random",
"animationDuration": "10000",
"timer": false,
"align": "top"
}'>
</div>
<div class="slider-bg-slide-overly"></div>
</div>
</div>
<div class="col-xl-6">
<div class="banner-style4__main-content">
<?php if($settings['transparent_title']){ ?><div class="big-text"><?php echo wp_kses($settings['transparent_title'], true); ?></div><?php } ?>
<ul>
<?php foreach ( $settings['list'] as $key => $item ) { ?>
<li>
<div class="icon"><span class="icon-marble"></span></div>
<a href="<?php echo esc_url($item['list_link']['url']); ?>"><?php echo wp_kses($item['list_title'], true); ?></a>
</li>
<?php } ?>
</ul>
<?php if($settings['button_title'] || $settings['button_title_v2']){ ?>
<div class="btn-box">
<?php if($settings['button_title']){ ?>
<div class="left">
<a class="btn-one" href="<?php echo esc_url( $mount_link );?>" <?php if( $page == 'extranal' ) echo esc_attr( $target );?> <?php if( $page == 'extranal' ) echo esc_attr( $nofollow );?>>
<span class="txt"><i class="icon-invite"></i><?php echo wp_kses($settings['button_title'], true);?></span>
</a>
</div>
<?php } ?>
<?php if($settings['button_title_v2']){ ?>
<div class="right">
<a href="<?php echo esc_url($settings['btn_link_v2']['url']);?>"><span class="icon-right-arrow1"></span><?php echo wp_kses($settings['button_title_v2'], true);?></a>
</div>
<?php } ?>
</div>
<?php } ?>
<div class="banner-style4__brand-box">
<?php if($settings['partner_title']){ ?>
<div class="inner-title">
<h3><?php echo wp_kses($settings['partner_title'], true);?></h3>
</div>
<?php } ?>
<div class="owl-carousel owl-theme thm-owl__carousel partner-carousel"
data-owl-options='{
"loop": true,
"autoplay": true,
"margin": 20,
"nav": false,
"dots": false,
"smartSpeed": 500,
"autoplayTimeout": 10000,
"navText": ["<span class=\"fa fa-angle-left\"></span>","<span class=\"fa fa-angle-right\"></span>"],
"responsive": {
"0": {
"items": 1
},
"768": {
"items": 3
},
"992": {
"items": 4
},
"1200": {
"items": 2
},
"1500": {
"items": 3
}
}
}'>
<?php foreach ($settings['partner'] as $item):?>
<!--Start Single Partner Logo Box-->
<div class="single-partner-logo-box-style2">
<a href="<?php echo esc_url($item['partner_link']['url']); ?>">
<img src="<?php echo esc_url(wp_get_attachment_url($item['partner_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</a>
</div>
<!--End Single Partner Logo Box-->
<?php endforeach; ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<!--End Banner Style4-->
<?php
elseif($layout == '3') :
$page = $settings['link_option'];
$page_select = $settings[ 'page_select' ];
$ext_url = $settings[ 'link' ];
if( $page == 'page' ){
$mount_link = get_page_link( $page_select );
}else{
$mount_link = $ext_url['url'];
$target = $ext_url['is_external'] ? ' target="_blank"' : '';
$nofollow = $ext_url['nofollow'] ? ' rel="nofollow"' : '';
}
?>
<!--Start Banner Style3-->
<section class="banner-style3">
<?php if($settings['shape_img']){ ?>
<div class="banner-style3__big-shape1 float-bob-x">
<img class="" src="<?php echo esc_url(wp_get_attachment_url($settings['shape_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<?php } ?>
<?php if($settings['show_vector_img'] == 'yes'){ ?>
<div class="banner-style3__shape one rotate-me"></div>
<div class="banner-style3__shape two rotate-me"></div>
<div class="banner-style3__shape three rotate-me"></div>
<div class="banner-style3__shape four float-bob"></div>
<div class="banner-style3__shape five rotate-me"></div>
<div class="banner-style3__shape six rotate-me"></div>
<div class="banner-style3__shape seven rotate-me"></div>
<div class="banner-style3__shape eight rotate-me"></div>
<div class="banner-style3__shape nine float-bob"></div>
<?php } ?>
<div class="container">
<div class="banner-style3__inner">
<div class="banner-style3__title text-center sec-title-animation animation-style2">
<p><?php echo wp_kses($settings['sub_title'], true); ?></p>
<h2 class="title-animation"><?php esc_html_e('Text to', 'thinkai'); ?> <span class="icon-radio-waves"></span> <?php echo wp_kses($settings['title'], true); ?></h2>
</div>
<div class="banner-style3__bottom">
<div class="reviews-box-style1">
<div class="icon">
<span class="icon-google"><span class="path1"></span><span class="path2"></span><span
class="path3"></span><span class="path4"></span><span class="path5"></span><span
class="path6"></span></span>
</div>
<div class="text">
<div class="review-box">
<ul>
<?php
$ratting = $settings['rating'];
for ($x = 1; $x <= 5; $x++) {
if($x <= $ratting) echo '<li><i class="fa fa-star"></i></li>'; else echo '<li><i class="fa fa-star-half-alt"></i></li>';
}
?>
</ul>
</div>
<p><span><?php echo wp_kses($settings['total_rating'], true); ?></span> <?php echo wp_kses($settings['rating_description'], true); ?></p>
</div>
</div>
<div class="banner-style3__bottom-list">
<ul class="row">
<?php foreach ( $settings['list'] as $key => $item ) { ?>
<li class="col-xl-6">
<div class="inner">
<div class="icon-box">
<span class="icon-correct"></span>
</div>
<p><a href="<?php echo esc_url($item['list_link']['url']); ?>"><?php echo wp_kses($item['list_title'], true); ?></a></p>
</div>
</li>
<?php } ?>
</ul>
</div>
<div class="banner-style3__bottom-img-box">
<div class="title">
<p><?php echo wp_kses($settings['author_title'], true); ?></p>
</div>
<ul class="clearfix">
<?php foreach ( $settings['author_img'] as $key => $item ) { ?>
<li>
<div class="img-box">
<img src="<?php echo esc_url(wp_get_attachment_url($item['client_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
</li>
<?php } ?>
<?php if($settings['total_value']){ ?>
<li>
<div class="text-box">
<h5><?php echo wp_kses($settings['total_value'], true); ?></h5>
</div>
</li>
<?php } ?>
</ul>
</div>
</div>
<?php if($settings['button_title']){ ?>
<div class="banner-style3__btn">
<a href="<?php echo esc_url( $mount_link );?>" <?php if( $page == 'extranal' ) echo esc_attr( $target );?> <?php if( $page == 'extranal' ) echo esc_attr( $nofollow );?>><span class="icon-right-arrow1"></span> <?php echo wp_kses($settings['button_title'], true); ?></a>
</div>
<?php } ?>
</div>
</div>
</section>
<!--End Banner Style3-->
<?php
elseif($layout == '2') :
$page = $settings['link_option'];
$page_select = $settings[ 'page_select' ];
$ext_url = $settings[ 'link' ];
if( $page == 'page' ){
$mount_link = get_page_link( $page_select );
}else{
$mount_link = $ext_url['url'];
$target = $ext_url['is_external'] ? ' target="_blank"' : '';
$nofollow = $ext_url['nofollow'] ? ' rel="nofollow"' : '';
}
$video_option = $settings[ 'video_option' ];
if( $video_option == 'src_url' ){
$video = $settings[ 'video_link' ][ 'url' ];
}elseif( $video_option == 'src_media' ){
$video = $settings[ 'video_source_image' ]['url'];
}else{
$video = esc_html__( 'There is no Video', 'thinkai' );
}
?>
<section class="banner-style2">
<div class="container">
<div class="banner-style2__inner">
<div class="shape1 float-bob-y"><img src="<?php echo esc_url(wp_get_attachment_url($settings['Pattern_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>"></div>
<div class="banner-style2__content">
<div class="reviews-box-style1">
<div class="icon">
<span class="icon-google"><span class="path1"></span><span class="path2"></span><span class="path3"></span><span class="path4"></span><span class="path5"></span><span class="path6"></span></span>
</div>
<div class="text">
<div class="review-box">
<ul>
<?php
$ratting = $settings['rating'];
for ($x = 1; $x <= 5; $x++) {
if($x <= $ratting) echo '<li><i class="fa fa-star"></i></li>'; else echo '<li><i class="fa fa-star-half-alt"></i></li>';
}
?>
</ul>
</div>
<p><span><?php echo wp_kses($settings['total_rating'], true); ?></span> <?php echo wp_kses($settings['rating_description'], true); ?></p>
</div>
</div>
<div class="big-title sec-title-animation animation-style3">
<h2 class="title-animation"><?php echo wp_kses($settings['title'], true); ?></h2>
</div>
<div class="text-box">
<p><?php echo wp_kses($settings['text'], true); ?></p>
</div>
<div class="btn-box">
<a class="btn-one" href="<?php echo esc_url( $mount_link );?>" <?php if( $page == 'extranal' ) echo esc_attr( $target );?> <?php if( $page == 'extranal' ) echo esc_attr( $nofollow );?>>
<span class="txt"><?php echo wp_kses($settings['button_title'], true); ?></span>
</a>
</div>
</div>
<div class="banner-style2__chatbot">
<ul class="row">
<li class="col-xl-6 col-lg-6 col-md-6">
<div class="banner-style2__chatbot-single-box">
<?php if($settings['robot_img']){ ?>
<div class="img-box">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['robot_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
<div class="icon-box">
<span class="icon-thm-logo1"></span>
</div>
</div>
<?php } ?>
<div class="chatbot-overlay-content">
<ul>
<li>
<p><?php esc_html_e('Hello', 'thinkai'); ?> <span class="icon-happy"><span class="path1"></span><span
class="path2"></span><span class="path3"></span><span
class="path4"></span><span class="path5"></span><span
class="path6"></span><span class="path7"></span><span
class="path8"></span><span class="path9"></span><span
class="path10"></span><span class="path11"></span><span
class="path12"></span><span class="path13"></span></span>
<?php echo wp_kses($settings['robot_title'], true); ?></p>
</li>
<li>
<p><?php echo wp_kses($settings['robot_text'], true); ?></p>
</li>
</ul>
</div>
</div>
</li>
<li class="col-xl-6 col-lg-6 col-md-6">
<div class="banner-style2__chatbot-single-box style2">
<div class="img-box">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['feature_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
<div class="icon-box">
<span class="icon-invite"></span>
</div>
</div>
<div class="chatbot-overlay-content style2">
<ul>
<li>
<p><?php echo wp_kses($settings['feature_text'], true); ?></p>
</li>
</ul>
</div>
</div>
</li>
</ul>
</div>
</div>
<?php if($video){ ?>
<div class="banner-style2__video text-center">
<div class="play-btn">
<a class="video-popup" title="Video Gallery" href="<?php echo esc_url( $video );?>">
<span class="icon-play-button-arrowhead"></span>
</a>
<div class="round-title">
<div class="curved-circle-2"><?php echo wp_kses($settings['video_title'], true);?></div>
<div class="curved-circle-3"><?php echo wp_kses($settings['video_title'], true);?></div>
</div>
</div>
</div>
<?php } ?>
</div>
</section>
<?php
else:
$video_option = $settings[ 'video_option' ];
if( $video_option == 'src_url' ){
$video = $settings[ 'video_link' ][ 'url' ];
}elseif( $video_option == 'src_media' ){
$video = $settings[ 'video_source_image' ]['url'];
}else{
$video = esc_html__( 'There is no Video', 'thinkai' );
}
?>
<!--Start Banner Style1-->
<section class="banner-style1 thinkai-banner">
<?php if($settings['show_particles'] == 'yes'){ ?>
<div id="particles-js"></div>
<div class="particular"></div>
<?php } ?>
<?php if($settings['show_curved_circle_area'] == 'yes'){ ?>
<div class="banner-style1__round-text-box">
<div class="inner">
<div class="banner-style1__curved-circle-top">
<h5>. <?php echo wp_kses($settings['curved_text_v1'], true); ?> .</h5>
</div>
<div class="banner-style1__curved-circle-bottom">
<h5><?php echo wp_kses($settings['curved_text_v2'], true); ?></h5>
</div>
</div>
<?php if($settings['curved_link']){ ?>
<div class="overlay-btn-box">
<a href="<?php echo esc_url($settings['curved_link']['url']); ?>">
<span class="icon-right-arrow1"></span>
</a>
</div>
<?php } ?>
</div>
<?php } ?>
<!--Start Banner Style1 Top Left Box -->
<div class="banner-style1-top-left-box">
<ul>
<?php foreach ( $settings['gallery'] as $key => $item ) { ?>
<li>
<div class="banner-style1__single-img-box">
<img src="<?php echo esc_url(wp_get_attachment_url($item['gallery_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
</li>
<?php } ?>
</ul>
</div>
<!--End Banner Style1 Top Left Box -->
<!--Start Banner Style1 Bottom Left Box-->
<div class="banner-style1-bottom-left-box">
<div class="inner">
<?php foreach ( $settings['gallery_v2'] as $key => $item ) { ?>
<div class="single-box">
<ul>
<li>
<div class="banner-style1__single-img-box">
<img src="<?php echo esc_url(wp_get_attachment_url($item['gallery_img_v2']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
</li>
<li>
<div class="banner-style1__single-img-box">
<img src="<?php echo esc_url(wp_get_attachment_url($item['gallery_img_v3']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
</li>
</ul>
</div>
<?php } ?>
</div>
</div>
<!--End Banner Style1 Bottom Left Box-->
<!--Start Banner Style1 Top Right Box -->
<div class="banner-style1-top-right-box">
<div class="inner clearfix">
<?php foreach ( $settings['gallery_v3'] as $key => $item ) { ?>
<div class="single-box">
<div class="banner-style1__single-img-box">
<img src="<?php echo esc_url(wp_get_attachment_url($item['gallery_img_v4']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
</div>
<?php } ?>
</div>
</div>
<!--Start Banner Style1 Top Right Box -->
<!--Start Banner Style1 Bottom Left Box-->
<div class="banner-style1-bottom-right-box">
<div class="inner">
<?php foreach ( $settings['gallery_v4'] as $key => $item ) { ?>
<div class="single-box">
<ul>
<li>
<div class="banner-style1__single-img-box">
<img src="<?php echo esc_url(wp_get_attachment_url($item['gallery_img_v5']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
</li>
<li>
<div class="banner-style1__single-img-box">
<img src="<?php echo esc_url(wp_get_attachment_url($item['gallery_img_v6']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
</li>
</ul>
</div>
<?php } ?>
</div>
</div>
<!--End Banner Style1 Bottom Left Box-->
<div class="banner-style1__content">
<div class="container">
<div class="banner-style1__content-inner">
<div class="big-title">
<h2><?php echo wp_kses($settings['title_v1'], true);?></h2>
<h2>
<?php if($video){ ?>
<a class="video-popup" title="Video Gallery"
href="<?php echo esc_url( $video );?>">
<span class="icon-play-button-arrowhead play-icon"></span>
<?php echo wp_kses($settings['video_title'], true);?>
<span class="btn-bg"
style="background-image: url(<?php echo esc_url(wp_get_attachment_url($settings['video_bg_img']['id'])); ?>);"></span>
</a>
<?php } ?>
<?php echo wp_kses($settings['title_v2'], true);?>
</h2>
<h2>
<?php echo wp_kses($settings['title_v3'], true);?>
<b><?php echo wp_kses($settings['text'], true);?></b>
</h2>
</div>
</div>
</div>
</div>
</section>
<!--End Banner Style1-->
<?php endif; ?>
<?php
}
}