489 lines
16 KiB
PHP
489 lines
16 KiB
PHP
<?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 About_Us 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_about_us';
|
|
}
|
|
|
|
/**
|
|
* 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 About Us', 'thinkai' );
|
|
}
|
|
|
|
/**
|
|
* Get widget icon.
|
|
* Retrieve button widget icon.
|
|
*
|
|
* @since 1.0.0
|
|
* @access public
|
|
* @return string Widget icon.
|
|
*/
|
|
public function get_icon() {
|
|
return 'eicon-gallery-grid';
|
|
}
|
|
|
|
/**
|
|
* 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( 'curved-script', YT_URL . 'assets/js/banner.js', [ 'elementor-frontend' ], '1.0.0', true );
|
|
return [ '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(
|
|
'about_us',
|
|
[
|
|
'label' => esc_html__( 'Thinkai About Us', 'thinkai' ),
|
|
]
|
|
);
|
|
|
|
//Layout
|
|
$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'),
|
|
),
|
|
]
|
|
);
|
|
|
|
//show_particles
|
|
$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' => '2',
|
|
],
|
|
]
|
|
);
|
|
//features_list
|
|
$this->add_control(
|
|
'features_list',
|
|
[
|
|
'label' => __( 'Feature List', 'thinkai' ),
|
|
'label_block' => true,
|
|
'type' => Controls_Manager::TEXTAREA,
|
|
'dynamic' => [
|
|
'active' => true,
|
|
],
|
|
'placeholder' => __( 'Enter your List', 'thinkai' ),
|
|
'condition' => [
|
|
'layout_control' => '2',
|
|
],
|
|
]
|
|
);
|
|
//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' => '1',
|
|
],
|
|
]
|
|
);
|
|
|
|
//Feature img
|
|
$this->add_control(
|
|
'feature_img',
|
|
[
|
|
'label' => __( 'Feature Image', 'thinkai' ),
|
|
'type' => Controls_Manager::MEDIA,
|
|
'default' => ['url' => Utils::get_placeholder_image_src(),],
|
|
'condition' => [
|
|
'layout_control' => '2'
|
|
],
|
|
]
|
|
);
|
|
|
|
//show_Round Text
|
|
$this->add_control(
|
|
'show_round_text',
|
|
[
|
|
'label' => esc_html__( 'Enable Round Text', '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' => '2',
|
|
],
|
|
]
|
|
);
|
|
$this->add_control(
|
|
'round_text_v1',
|
|
[
|
|
'label' => __( 'Round Text V1', 'thinkai' ),
|
|
'label_block' => true,
|
|
'type' => Controls_Manager::TEXT,
|
|
'dynamic' => [
|
|
'active' => true,
|
|
],
|
|
'default' => esc_html__( 'AI-Driven Visual Wonders', 'thinkai' ),
|
|
'condition' => [
|
|
'layout_control' => '2',
|
|
'show_round_text' => 'yes',
|
|
],
|
|
]
|
|
);
|
|
$this->add_control(
|
|
'round_text_v2',
|
|
[
|
|
'label' => __( 'Round Text V2', 'thinkai' ),
|
|
'label_block' => true,
|
|
'type' => Controls_Manager::TEXT,
|
|
'dynamic' => [
|
|
'active' => true,
|
|
],
|
|
'default' => esc_html__( 'AI-Driven Visual Wonders', 'thinkai' ),
|
|
'condition' => [
|
|
'layout_control' => '2',
|
|
'show_round_text' => 'yes',
|
|
],
|
|
]
|
|
);
|
|
|
|
//Sub Title
|
|
$this->add_control(
|
|
'subtitle',
|
|
[
|
|
'label' => __( 'Sub Title', 'thinkai' ),
|
|
'label_block' => true,
|
|
'type' => Controls_Manager::TEXT,
|
|
'dynamic' => [
|
|
'active' => true,
|
|
],
|
|
'default' => esc_html__( '[ ABOUT THINKAI ]', 'thinkai' ),
|
|
'condition' => [
|
|
'layout_control' => ['1','2']
|
|
],
|
|
]
|
|
);
|
|
|
|
//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' => ['1','2']
|
|
],
|
|
]
|
|
);
|
|
|
|
|
|
|
|
//Banner Carousel Repeater
|
|
$repeater = new Repeater();
|
|
$repeater->add_control(
|
|
'tab_title',
|
|
[
|
|
'label' => __( 'Title', 'thinkai' ),
|
|
'type' => Controls_Manager::TEXT,
|
|
'label_block' => true,
|
|
'dynamic' => [
|
|
'active' => true,
|
|
],
|
|
'placeholder' => __( 'Enter your title', 'thinkai' ),
|
|
]
|
|
);
|
|
//Text
|
|
$repeater->add_control(
|
|
'tab_text',
|
|
[
|
|
'label' => __( 'Description', 'thinkai' ),
|
|
'label_block' => true,
|
|
'type' => Controls_Manager::TEXTAREA,
|
|
'dynamic' => [
|
|
'active' => true,
|
|
],
|
|
'placeholder' => __( 'Enter your Description', 'thinkai' ),
|
|
]
|
|
);
|
|
//Feature img
|
|
$repeater->add_control(
|
|
'feature_image',
|
|
[
|
|
'label' => __( 'Feature Image', 'thinkai' ),
|
|
'type' => Controls_Manager::MEDIA,
|
|
'default' => ['url' => Utils::get_placeholder_image_src(),],
|
|
]
|
|
);
|
|
$this->add_control(
|
|
'tabs',
|
|
[
|
|
'label' => __('Add Tabs Item', 'thinkai'),
|
|
'type' => Controls_Manager::REPEATER,
|
|
'fields' => $repeater->get_controls(),
|
|
'title_field' => '{{{ tab_title }}}',
|
|
'condition' => [
|
|
'layout_control' => '1'
|
|
],
|
|
'default' => [
|
|
[
|
|
'tab_title' => esc_html__( 'Our Experience', 'thinkai' ),
|
|
'tab_text' => esc_html__( 'Repudiated and annoyances accepted the wise man therefore always holds in these matters to this principle of selection he rejects pleasures to secure other greater pleasures or else he endures.', 'thinkai' ),
|
|
],
|
|
[
|
|
'tab_title' => esc_html__( 'Our Leadership', 'thinkai' ),
|
|
'tab_text' => esc_html__( 'Repudiated and annoyances accepted the wise man therefore always holds in these matters to this principle of selection he rejects pleasures to secure other greater pleasures or else he endures.', 'thinkai' ),
|
|
],
|
|
[
|
|
'tab_title' => esc_html__( 'Impact &Commitment', 'thinkai' ),
|
|
'tab_text' => esc_html__( 'Repudiated and annoyances accepted the wise man therefore always holds in these matters to this principle of selection he rejects pleasures to secure other greater pleasures or else he endures.', 'thinkai' ),
|
|
],
|
|
],
|
|
]
|
|
);
|
|
$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');
|
|
?>
|
|
|
|
<?php if($settings['layout_control'] == '2') :?>
|
|
|
|
<!--Start Intro Style1-->
|
|
<section class="Intro-style1">
|
|
<?php if($settings['show_particles'] == 'yes'){ ?>
|
|
<div id="particles-js"></div>
|
|
<?php } ?>
|
|
|
|
<div class="Intro-style1__bg" <?php if($settings['feature_img']){ ?>style="background-image: url(<?php echo esc_url(wp_get_attachment_url($settings['feature_img']['id'])); ?>);"<?php } ?>>
|
|
|
|
<?php if($settings['show_round_text'] == 'yes'){ ?>
|
|
<div class="about-round-text-box">
|
|
<?php if($settings['round_text_v1']){ ?>
|
|
<div class="about-round-text1">
|
|
<?php echo wp_kses($settings['round_text_v1'], true); ?>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if($settings['round_text_v2']){ ?>
|
|
<div class="about-round-text2">
|
|
<?php echo wp_kses($settings['round_text_v2'], true); ?>
|
|
</div>
|
|
<?php } ?>
|
|
<div class="overlay-logo">
|
|
<span class="icon-thm-logo1"></span>
|
|
</div>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
$features_list = $settings['features_list'];
|
|
if(!empty($features_list)){
|
|
$features_list = explode("\n", ($features_list));
|
|
?>
|
|
<!--Start Scrolling Text Style6-->
|
|
<div class="scrolling-text-style6">
|
|
<div class="inner">
|
|
<ul class="clearfix marquee_mode">
|
|
<?php foreach($features_list as $features): ?>
|
|
<li data-hover="<?php echo wp_kses($features, true); ?>">
|
|
<?php echo wp_kses($features, true); ?>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if($settings['subtitle'] || $settings['title']){ ?>
|
|
<!--End Scrolling Text Style6-->
|
|
<div class="container">
|
|
<div class="intro-style1__content">
|
|
<div class="sec-title sec-title-animation animation-style3">
|
|
<?php if($settings['subtitle']){ ?>
|
|
<div class="sub-title">
|
|
<h4><?php echo wp_kses($settings['subtitle'], true); ?></h4>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if($settings['title']){ ?>
|
|
<h2 class="title-animation">
|
|
<?php echo wp_kses($settings['title'], true); ?>
|
|
</h2>
|
|
<?php } ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php } ?>
|
|
</section>
|
|
<!--End Intro Style1-->
|
|
|
|
<?php else: ?>
|
|
|
|
<!--Start About Style4-->
|
|
<section class="about-style4">
|
|
<div class="container">
|
|
<div class="about-style4__tab">
|
|
|
|
<div class="row">
|
|
|
|
<!--Start About Style4 Content-->
|
|
<div class="col-xl-6">
|
|
<div class="about-style4__content">
|
|
<?php if($settings['shape_img']){ ?>
|
|
<div class="shape1">
|
|
<img src="<?php echo esc_url(wp_get_attachment_url($settings['shape_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php if($settings['subtitle'] || $settings['title']){ ?>
|
|
<div class="sec-title sec-title-animation animation-style2">
|
|
<?php if($settings['subtitle']){ ?>
|
|
<div class="sub-title">
|
|
<h4><?php echo wp_kses($settings['subtitle'], true); ?></h4>
|
|
</div>
|
|
<?php } ?>
|
|
<?php if($settings['title']){ ?>
|
|
<h2 class="title-animation">
|
|
<?php echo wp_kses($settings['title'], true); ?>
|
|
</h2>
|
|
<?php } ?>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
|
|
<div class="about-style4-tab__button">
|
|
<ul class="tabs-button-box clearfix">
|
|
<?php
|
|
foreach($settings['tabs'] as $key => $items):
|
|
?>
|
|
<li data-tab="#experience<?php echo esc_attr($key); ?>" class="tab-btn-item <?php if($key == 0) echo 'active-btn-item'; ?>">
|
|
<span><?php echo wp_kses($items['tab_title'], true); ?></span>
|
|
</li>
|
|
<?php endforeach; ?>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!--End About Style4 Content-->
|
|
|
|
<!--Start About Style4 Img-->
|
|
<div class="col-xl-6">
|
|
<div class="tabs-content-box">
|
|
<?php
|
|
foreach($settings['tabs'] as $key => $items):
|
|
?>
|
|
<!--Tab-->
|
|
<div class="tab-content-box-item <?php if($key == 0) echo 'tab-content-box-item-active'; ?>" id="experience<?php echo esc_attr($key); ?>">
|
|
<div class="about-style4-tab-content-box-item">
|
|
<div class="about-style4__img">
|
|
<div class="title-box">
|
|
<h2><?php echo wp_kses($items['tab_title'], true); ?></h2>
|
|
<p>
|
|
<?php echo wp_kses($items['tab_text'], true); ?>
|
|
</p>
|
|
</div>
|
|
<div class="about-style4__img1">
|
|
<img src="<?php echo esc_url(wp_get_attachment_url($items['feature_image']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</div>
|
|
<!--End About Style4 Img-->
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<!--End About Style4-->
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php
|
|
}
|
|
}
|