first commit

This commit is contained in:
2024-07-31 13:12:38 +07:00
commit b4e8cbe182
10213 changed files with 3125839 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="project_masonry.php" server="ftp.wp1.themevibrant.com/newwp/thinkai/wp-content/" local="133596421685277385" remote="133596241200000000" Dst="0" />
<file name="banner.php" server="ftp.wp1.themevibrant.com/newwp/thinkai/wp-content/" local="133596464655841436" remote="133596284400000000" Dst="0" />
<file name="blog_list_view.php" server="ftp.wp1.themevibrant.com/newwp/thinkai/wp-content/" local="133596468071767503" remote="133596288000000000" Dst="0" />
</dwsync>

View File

@@ -0,0 +1,488 @@
<?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
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,295 @@
<?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 Blog_Carousel 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_blog_carousel';
}
/**
* 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 Blog Carousel', '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( 'blog-carousel-script', YT_URL . 'assets/js/feature-carousel.js', [ 'elementor-frontend' ], '1.0.0', true );
return [ 'blog-carousel-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(
'blog_carousel',
[
'label' => esc_html__( 'Thinkai Blog Carousel', 'thinkai' ),
]
);
//Author
$this->add_control(
'author',
[
'label' => esc_html__( 'Show Author', 'thinkai' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'thinkai' ),
'label_off' => esc_html__( 'Off', 'thinkai' ),
'return_value' => 'yes',
'default' => 'yes',
]
);
//Date
$this->add_control(
'date',
[
'label' => esc_html__( 'Show Date', 'thinkai' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'thinkai' ),
'label_off' => esc_html__( 'Off', 'thinkai' ),
'return_value' => 'yes',
'default' => 'yes',
]
);
//category
$this->add_control(
'category',
[
'label' => esc_html__( 'Show category', 'thinkai' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'thinkai' ),
'label_off' => esc_html__( 'Off', 'thinkai' ),
'return_value' => 'yes',
'default' => 'yes',
]
);
$this->add_control(
'query_number',
[
'label' => esc_html__( 'Number of post', 'thinkai' ),
'type' => Controls_Manager::NUMBER,
'default' => 3,
'min' => 1,
'max' => 100,
'step' => 1,
]
);
$this->add_control(
'query_orderby',
[
'label' => esc_html__( 'Order By', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'date',
'options' => array(
'date' => esc_html__( 'Date', 'thinkai' ),
'title' => esc_html__( 'Title', 'thinkai' ),
'menu_order' => esc_html__( 'Menu Order', 'thinkai' ),
'rand' => esc_html__( 'Random', 'thinkai' ),
),
]
);
$this->add_control(
'query_order',
[
'label' => esc_html__( 'Order', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'DESC',
'options' => array(
'DESC' => esc_html__( 'DESC', 'thinkai' ),
'ASC' => esc_html__( 'ASC', 'thinkai' ),
),
]
);
$this->add_control(
'query_category',
[
'type' => Controls_Manager::SELECT,
'label' => esc_html__('Category', 'thinkai'),
'label_block' => true,
'multiple' => true,
'options' => get_blog_categories()
]
);
$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');
$category = $settings[ 'category' ];
$date = $settings[ 'date' ];
$author = $settings[ 'author' ];
$paged = get_query_var('paged');
$paged = thinkai_set($_REQUEST, 'paged') ? esc_attr($_REQUEST['paged']) : $paged;
$this->add_render_attribute( 'wrapper', 'class', 'templatepath-thinkai' );
$argst = array(
'post_type' => 'post',
'posts_per_page' => thinkai_set( $settings, 'query_number' ),
'orderby' => thinkai_set( $settings, 'query_orderby' ),
'order' => thinkai_set( $settings, 'query_order' ),
'paged' => $paged
);
if( thinkai_set( $settings, 'query_category' ) ) $args['category_name'] = thinkai_set( $settings, 'query_category' );
$query = new \WP_Query( $argst );
if ( $query->have_posts() )
{ ?>
<!--Start Blog Style2-->
<section class="blog-style2 p-0 m-0">
<div class="container">
<div class="owl-carousel owl-theme thm-owl__carousel blog-style2__carousel" data-owl-options='{
"loop": true,
"autoplay": false,
"margin": 30,
"nav": false,
"dots": false,
"smartSpeed": 500,
"autoplayTimeout": 10000,
"navText": ["<span class=\"left icon-right-arrow-4\"></span>","<span class=\"right icon-right-arrow-4\"></span>"],
"responsive": {
"0": {
"items": 1
},
"768": {
"items": 1
},
"992": {
"items": 2
},
"1200": {
"items": 3
}
}
}'>
<?php
global $post;
while ( $query->have_posts() ) : $query->the_post();
$post_thumbnail_id = get_post_thumbnail_id($post->ID);
$post_thumbnail_url = wp_get_attachment_url($post_thumbnail_id);
?>
<!--Start Single Blog Style2-->
<div class="blog-style2-single-outer-box hover-background-active">
<div class="blog-style2__single">
<div class="blog-style2__single-title">
<h3><a href="<?php echo esc_url( get_the_permalink( get_the_id() ) );?>"><?php the_title(); ?></a></h3>
</div>
<?php if( $category == 'yes' && has_category() ){?>
<div class="blog-style2__single-category">
<span><?php the_category(' ');?></span>
</div>
<?php } ?>
<div class="blog-style2__single-post">
<?php if( $author == 'yes' || $date == 'yes' ){ ?>
<div class="author-box">
<?php if( $author == 'yes'){?><h5><a href="<?php echo esc_url(get_author_posts_url( get_the_author_meta('ID') )); ?>"><?php the_author(); ?></a></h5><?php } ?>
<?php if( $date == 'yes' ){?><p><?php echo get_the_date(''); ?></p><?php } ?>
</div>
<?php } ?>
<div class="btn-box">
<a href="<?php echo esc_url( get_the_permalink( get_the_id() ) );?>">
<span class="icon-right-arrow1"></span>
</a>
</div>
</div>
<?php if($post_thumbnail_url){ ?>
<div class="blog-style2__single-overlay">
<div class="blog-style2__single-overlay__bg" data-src="<?php echo esc_url($post_thumbnail_url); ?>"></div>
</div>
<?php } ?>
</div>
</div>
<!--End Single Blog Style2-->
<?php endwhile; ?>
</div>
</div>
</section>
<!--End Blog Style2-->
<?php }
wp_reset_postdata();
}
}

View File

@@ -0,0 +1,454 @@
<?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 Blog_Grid 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_blog_grid';
}
/**
* 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 Blog Grid', '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' ];
}
/**
* 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(
'blog_grid',
[
'label' => esc_html__( 'Thinkai Blog Grid', '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'),
),
]
);
//Author
$this->add_control(
'author',
[
'label' => esc_html__( 'Show Author', 'thinkai' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'thinkai' ),
'label_off' => esc_html__( 'Off', 'thinkai' ),
'return_value' => 'yes',
'default' => 'yes',
]
);
//Date
$this->add_control(
'date',
[
'label' => esc_html__( 'Show Date', 'thinkai' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'thinkai' ),
'label_off' => esc_html__( 'Off', 'thinkai' ),
'return_value' => 'yes',
'default' => 'yes',
]
);
//category
$this->add_control(
'category',
[
'label' => esc_html__( 'Show category', 'thinkai' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'thinkai' ),
'label_off' => esc_html__( 'Off', 'thinkai' ),
'return_value' => 'yes',
'default' => 'yes',
]
);
$this->add_control(
'query_number',
[
'label' => esc_html__( 'Number of post', 'thinkai' ),
'type' => Controls_Manager::NUMBER,
'default' => 3,
'min' => 1,
'max' => 100,
'step' => 1,
]
);
$this->add_control(
'query_orderby',
[
'label' => esc_html__( 'Order By', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'date',
'options' => array(
'date' => esc_html__( 'Date', 'thinkai' ),
'title' => esc_html__( 'Title', 'thinkai' ),
'menu_order' => esc_html__( 'Menu Order', 'thinkai' ),
'rand' => esc_html__( 'Random', 'thinkai' ),
),
]
);
$this->add_control(
'query_order',
[
'label' => esc_html__( 'Order', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'DESC',
'options' => array(
'DESC' => esc_html__( 'DESC', 'thinkai' ),
'ASC' => esc_html__( 'ASC', 'thinkai' ),
),
]
);
$this->add_control(
'query_category',
[
'type' => Controls_Manager::SELECT,
'label' => esc_html__('Category', 'thinkai'),
'label_block' => true,
'multiple' => true,
'options' => get_blog_categories()
]
);
//Pagination
$this->add_control(
'show_pagination',
[
'label' => __( 'Enable/Disable Pagination Style', 'thinkai' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Show', 'thinkai' ),
'label_off' => __( 'Hide', 'thinkai' ),
'return_value' => 'yes',
'default' => 'no',
'condition' => ['layout_control' => ['1','3'] ],
]
);
$this->end_controls_section();
/**Grid Setting Start**/
$this->start_controls_section(
'grid',
[
'label' => esc_html__( 'Grid Setting', 'thinkai' ),
]
);
$this->add_control(
'col_grid',
[
'label' => esc_html__( 'Choose Column', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'three',
'options' => array(
'one' => esc_html__( 'One Column Grid ', 'thinkai'),
'two' => esc_html__( 'Two Column Grid', 'thinkai' ),
'three' => esc_html__( 'Three Column Grid', 'thinkai' ),
'four' => esc_html__( 'Four Column Grid', 'thinkai' ),
'five' => esc_html__( 'Six Column Grid', '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');
$layout = $settings[ 'layout_control' ];
$grid_col = $settings['col_grid'];
if( $grid_col == 'one' ){
$classes = 'col-xl-12 col-lg-12 col-md-12 col-sm-12';
}elseif( $grid_col == 'two' ){
$classes = 'col-xl-6 col-lg-6 col-md-12 col-sm-12';
}elseif( $grid_col == 'four' ){
$classes = 'col-xl-3 col-lg-3 col-md-12 col-sm-12';
}elseif( $grid_col == 'five' ){
$classes = 'col-xl-2 col-lg-2 col-md-12 col-sm-12';
}else{
$classes = 'col-xl-4 col-lg-4 col-md-12 col-sm-12';
};
$category = $settings[ 'category' ];
$date = $settings[ 'date' ];
$author = $settings[ 'author' ];
$paged = get_query_var('paged');
$paged = thinkai_set($_REQUEST, 'paged') ? esc_attr($_REQUEST['paged']) : $paged;
$this->add_render_attribute( 'wrapper', 'class', 'templatepath-thinkai' );
$argst = array(
'post_type' => 'post',
'posts_per_page' => thinkai_set( $settings, 'query_number' ),
'orderby' => thinkai_set( $settings, 'query_orderby' ),
'order' => thinkai_set( $settings, 'query_order' ),
'paged' => $paged
);
if( thinkai_set( $settings, 'query_category' ) ) $args['category_name'] = thinkai_set( $settings, 'query_category' );
$query = new \WP_Query( $argst );
if ( $query->have_posts() )
{ ?>
<?php if( $layout == 3 ): ?>
<!--Start Blog Page Two-->
<section class="blog-page-two p-0 m-0">
<div class="row">
<?php
global $post;
while ( $query->have_posts() ) : $query->the_post();
$post_thumbnail_id = get_post_thumbnail_id($post->ID);
$post_thumbnail_url = wp_get_attachment_url($post_thumbnail_id);
?>
<!--Start Single Blog Style2-->
<div class="<?php echo esc_attr( $classes );?>">
<div class="blog-style2-single-outer-box hover-background-active">
<div class="blog-style2__single">
<div class="blog-style2__single-title">
<h3><a href="<?php echo esc_url( get_the_permalink( get_the_id() ) );?>"><?php the_title(); ?></a> </h3>
</div>
<?php if( $category == 'yes' && has_category() ){?>
<div class="blog-style2__single-category">
<span><?php the_category(' ');?></span>
</div>
<?php } ?>
<div class="blog-style2__single-post">
<?php if( $author == 'yes' || $date == 'yes' ){ ?>
<div class="author-box">
<?php if( $author == 'yes'){?><h5><a href="<?php echo esc_url(get_author_posts_url( get_the_author_meta('ID') )); ?>"><?php the_author(); ?></a></h5><?php } ?>
<?php if( $date == 'yes' ){?><p><?php echo get_the_date(''); ?></p><?php } ?>
</div>
<?php } ?>
<div class="btn-box">
<a href="<?php echo esc_url( get_the_permalink( get_the_id() ) );?>">
<span class="icon-right-arrow1"></span>
</a>
</div>
</div>
<?php if($post_thumbnail_url){ ?>
<div class="blog-style2__single-overlay">
<div class="blog-style2__single-overlay__bg" data-src="<?php echo esc_url($post_thumbnail_url); ?>"></div>
</div>
<?php } ?>
</div>
</div>
</div>
<!--End Single Blog Style2-->
<?php endwhile; ?>
</div>
<?php if($settings['show_pagination']){ ?>
<div class="styled-pagination-style2 clearfix">
<?php thinkai_the_pagination2(array('total'=>$query->max_num_pages, 'next_text' => 'Next Page <i class="icon-right-arrow1 right"></i> ', 'prev_text' => '<i class="icon-left-arrow1 left"></i> Prev Page')); ?>
</div>
<?php } ?>
</section>
<!--End Blog Page Two-->
<?php elseif( $layout == 2 ): ?>
<!--Start Blog Style1-->
<section class="blog-style1 p-0 m-0">
<div class="row">
<?php
while ( $query->have_posts() ) : $query->the_post();
?>
<!--Start Blog Style1 Single-->
<div class="<?php echo esc_attr( $classes );?>">
<div class="blog-style1__single blog-style1__single--style2">
<?php if(has_post_thumbnail()){ ?>
<div class="blog-style1__single-img">
<?php the_post_thumbnail('thinkai_370x320'); ?>
</div>
<?php } ?>
<div class="blog-style1__single-content">
<div class="blog-style1__single-content-top">
<?php if( $author == 'yes' || $date == 'yes' ){ ?>
<div class="text-box">
<?php if( $author == 'yes'){?><h4><?php the_author(); ?></h4><?php } ?>
<?php if( $date == 'yes' ){?><p><?php echo get_the_date(''); ?></p><?php } ?>
</div>
<?php } ?>
<div class="btn-box">
<a href="<?php echo esc_url( get_the_permalink( get_the_id() ) );?>"><span class="icon-right-arrow1"></span></a>
</div>
</div>
<h2>
<a href="<?php echo esc_url( get_the_permalink( get_the_id() ) );?>">
<?php the_title(); ?>
</a>
</h2>
<?php if( $category == 'yes' && has_category() ){?>
<div class="category-box">
<?php the_category(' ');?>
</div>
<?php } ?>
</div>
</div>
</div>
<!--End Blog Style1 Single-->
<?php endwhile; ?>
</div>
</section>
<!--End Blog Style1-->
<?php else: ?>
<!--Start Blog Style1-->
<section class="blog-style1 p-0 m-0">
<div class="row">
<?php
while ( $query->have_posts() ) : $query->the_post();
?>
<!--Start Blog Style1 Single-->
<div class="<?php echo esc_attr( $classes );?>">
<div class="blog-style1__single">
<?php if(has_post_thumbnail()){ ?>
<div class="blog-style1__single-img">
<?php the_post_thumbnail('thinkai_370x320'); ?>
</div>
<?php } ?>
<div class="blog-style1__single-content">
<div class="blog-style1__single-content-top">
<?php if( $author == 'yes' || $date == 'yes' ){ ?>
<div class="text-box">
<?php if( $author == 'yes'){?><h4><?php the_author(); ?></h4><?php } ?>
<?php if( $date == 'yes' ){?><p><?php echo get_the_date(''); ?></p><?php } ?>
</div>
<?php } ?>
<div class="btn-box">
<a href="<?php echo esc_url( get_the_permalink( get_the_id() ) );?>"><span class="icon-right-arrow1"></span></a>
</div>
</div>
<h2>
<a href="<?php echo esc_url( get_the_permalink( get_the_id() ) );?>">
<?php the_title(); ?>
</a>
</h2>
<?php if( $category == 'yes' && has_category() ){?>
<div class="category-box">
<?php the_category(' ');?>
</div>
<?php } ?>
</div>
</div>
</div>
<!--End Blog Style1 Single-->
<?php endwhile; ?>
<?php if($settings['show_pagination']){ ?>
<div class="styled-pagination-style2 clearfix">
<?php thinkai_the_pagination2(array('total'=>$query->max_num_pages, 'next_text' => 'Next Page <i class="icon-right-arrow1 right"></i> ', 'prev_text' => '<i class="icon-left-arrow1 left"></i> Prev Page')); ?>
</div>
<?php } ?>
</div>
</section>
<!--End Blog Style1-->
<?php endif; ?>
<?php }
wp_reset_postdata();
}
}

View File

@@ -0,0 +1,273 @@
<?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 Blog_List_View 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_blog_list_view';
}
/**
* 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 Blog List View', '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' ];
}
/**
* 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(
'blog_list_view',
[
'label' => esc_html__( 'Thinkai Blog List View', 'thinkai' ),
]
);
//Author
$this->add_control(
'author',
[
'label' => esc_html__( 'Show Author', 'thinkai' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'thinkai' ),
'label_off' => esc_html__( 'Off', 'thinkai' ),
'return_value' => 'yes',
'default' => 'yes',
]
);
//Date
$this->add_control(
'date',
[
'label' => esc_html__( 'Show Date', 'thinkai' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'thinkai' ),
'label_off' => esc_html__( 'Off', 'thinkai' ),
'return_value' => 'yes',
'default' => 'yes',
]
);
//category
$this->add_control(
'category',
[
'label' => esc_html__( 'Show category', 'thinkai' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'thinkai' ),
'label_off' => esc_html__( 'Off', 'thinkai' ),
'return_value' => 'yes',
'default' => 'yes',
]
);
$this->add_control(
'query_number',
[
'label' => esc_html__( 'Number of post', 'thinkai' ),
'type' => Controls_Manager::NUMBER,
'default' => 3,
'min' => 1,
'max' => 100,
'step' => 1,
]
);
$this->add_control(
'query_orderby',
[
'label' => esc_html__( 'Order By', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'date',
'options' => array(
'date' => esc_html__( 'Date', 'thinkai' ),
'title' => esc_html__( 'Title', 'thinkai' ),
'menu_order' => esc_html__( 'Menu Order', 'thinkai' ),
'rand' => esc_html__( 'Random', 'thinkai' ),
),
]
);
$this->add_control(
'query_order',
[
'label' => esc_html__( 'Order', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'DESC',
'options' => array(
'DESC' => esc_html__( 'DESC', 'thinkai' ),
'ASC' => esc_html__( 'ASC', 'thinkai' ),
),
]
);
$this->add_control(
'query_category',
[
'type' => Controls_Manager::SELECT,
'label' => esc_html__('Category', 'thinkai'),
'label_block' => true,
'multiple' => true,
'options' => get_blog_categories()
]
);
$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');
$category = $settings[ 'category' ];
$date = $settings[ 'date' ];
$author = $settings[ 'author' ];
$paged = get_query_var('paged');
$paged = thinkai_set($_REQUEST, 'paged') ? esc_attr($_REQUEST['paged']) : $paged;
$this->add_render_attribute( 'wrapper', 'class', 'templatepath-thinkai' );
$argst = array(
'post_type' => 'post',
'posts_per_page' => thinkai_set( $settings, 'query_number' ),
'orderby' => thinkai_set( $settings, 'query_orderby' ),
'order' => thinkai_set( $settings, 'query_order' ),
'paged' => $paged
);
if( thinkai_set( $settings, 'query_category' ) ) $args['category_name'] = thinkai_set( $settings, 'query_category' );
$query = new \WP_Query( $argst );
if ( $query->have_posts() )
{ ?>
<!--Start Blog Page Four-->
<section class="blog-page-four p-0 m-0">
<div class="blog-page-four__content">
<?php
while ( $query->have_posts() ) : $query->the_post();
?>
<!--Start Single Blog Style3-->
<div class="blog-style3__single">
<div class="row align-items-center">
<?php if(has_post_thumbnail()){ ?>
<div class="col-xl-6">
<div class="blog-style3__single-img">
<?php the_post_thumbnail('thinkai_360x290'); ?>
<a href="<?php echo esc_url( get_the_permalink( get_the_id() ) );?>"><span class="fa fa-link"></span></a>
</div>
</div>
<?php } ?>
<div class="col-xl-6">
<div class="blog-style3__single-content">
<?php if( $category == 'yes' && has_category() ){?>
<div class="category-box">
<?php the_category(' ');?>
</div>
<?php } ?>
<h3>
<a href="<?php echo esc_url( get_the_permalink( get_the_id() ) );?>">
<?php the_title(); ?>
</a>
</h3>
<div class="blog-style3__single-content-bottom">
<?php if( $author == 'yes' || $date == 'yes' ){ ?>
<div class="text-box">
<?php if( $author == 'yes'){?><h5><?php the_author(); ?></h5><?php } ?>
<?php if( $date == 'yes' ){?><p><?php echo get_the_date(''); ?></p><?php } ?>
</div>
<?php } ?>
<div class="btn-box">
<a href="<?php echo esc_url( get_the_permalink( get_the_id() ) );?>">
<span class="icon-right-arrow1"></span>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!--End Single Blog Style3-->
<?php endwhile; ?>
</div>
</section>
<!--End Blog Page Four-->
<?php }
wp_reset_postdata();
}
}

View File

@@ -0,0 +1,442 @@
<?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_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 Button 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_button';
}
/**
* 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 Button', 'thinkai' );
}
/**
* Get widget icon.
* Retrieve button widget icon.
*
* @since 1.0.0
* @access public
* @return string Widget icon.
*/
public function get_icon() {
return 'eicon-button';
}
/**
* 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' ];
}
/**
* 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(
'button',
[
'label' => esc_html__( 'Thinkai Button', 'thinkai' ),
]
);
$this->add_control(
'btn_style',
[
'label' => esc_html__( 'Choose Button 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' ),
),
]
);
$this->add_control(
'btn_title',
[
'label' => __( 'Button Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Button Title Here', 'thinkai' ),
]
);
$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'),
),
]
);
$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' => [
'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' => [
'link_option' => 'page'
]
]
);
$this->end_controls_section();
/**Button Style**/
$this->start_controls_section(
'button_style',
[
'label' => esc_html__('Button Style Setting', 'thinkai'),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'general_align',
[
'label' => esc_html__( 'Alignment', 'thinkai' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => esc_html__( 'Left', 'thinkai' ),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => esc_html__( 'Center', 'thinkai' ),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => esc_html__( 'Right', 'thinkai' ),
'icon' => 'eicon-text-align-right',
],
],
'default' => '',
'selectors' => [
'{{WRAPPER}} .yt-btn' => 'text-align: {{VALUE}}',
],
]
);
$this->start_controls_tabs( 'thinkai_tabs_btn' );
$this->start_controls_tab(
'thinkai_tab_btn_normal',
[
'label' => __( 'Normal', 'thinkai' ),
]
);
$this->add_responsive_control(
'btn_width_size',
[
'label' => __( 'Width', 'thinkai' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px', 'em', '%', 'custom' ],
'range' => [
'px' => [
'min' => 0,
'max' => 500,
],
'%' => [
'min' => 0,
'max' => 100,
],
],
'selectors' => [
'{{WRAPPER}} .thinkai-btn' => 'width: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'btn_height_size',
[
'label' => __( 'Height', 'thinkai' ),
'type' => Controls_Manager::SLIDER,
'size_units' => [ 'px', 'em', '%', 'custom' ],
'range' => [
'px' => [
'min' => 0,
'max' => 500,
],
'%' => [
'min' => 0,
'max' => 100,
],
],
'selectors' => [
'{{WRAPPER}} .thinkai-btn' => 'height: {{SIZE}}{{UNIT}};',
],
]
);
$this->add_responsive_control(
'btn_margin',
[
'label' => __( 'Margin', 'thinkai' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [
'{{WRAPPER}} .thinkai-btn' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'frontend_available' => true,
]
);
$this->add_responsive_control(
'btn_padding',
[
'label' => __( 'Padding', 'thinkai' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => [ 'px', 'em', '%' ],
'selectors' => [
'{{WRAPPER}} .thinkai-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'frontend_available' => true,
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'btn_border_type',
'selector' =>
'{{WRAPPER}} .thinkai-btn',
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'border_box_shadow',
'selector' =>
'{{WRAPPER}} .thinkai-btn',
'separator' => 'before',
]
);
$this->add_control(
'btn_border_radius',
[
'label' => esc_html__('Border Radius', 'thinkai'),
'type' => Controls_Manager::DIMENSIONS,
'separator' => 'before',
'size_units' => ['px'],
'selectors' => [
'{{WRAPPER}} .thinkai-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'btn_title_typography',
'label' => __('Button Text Typography', 'thinkai'),
'selector' =>
'{{WRAPPER}} .thinkai-btn',
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'btn_title_bg_color',
'label' => __( 'Button Background Color', 'thinkai' ),
'types' => [ 'classic', 'gradient' ],
'selector' =>
'{{WRAPPER}} .thinkai-btn:before,
{{WRAPPER}} .thinkai-btn',
]
);
$this->add_control(
'btn_title_color',
[
'label' => __('Button Text Color', 'thinkai'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .thinkai-btn' => 'color: {{VALUE}}!important',
'{{WRAPPER}} .thinkai-btn span' => 'color: {{VALUE}}!important',
],
'separator' => 'before',
]
);
$this->end_controls_tab();
$this->start_controls_tab(
'thinkai_tab_btn_hover',
[
'label' => __( 'Hover', 'thinkai' ),
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'btn_hover_bg_bgtype',
'label' => __( 'Button Hover Background', 'thinkai' ),
'types' => [ 'classic', 'gradient' ],
'selector' =>
'{{WRAPPER}} .thinkai-btn:hover:before,
{{WRAPPER}} .thinkai-btn:hover',
]
);
$this->add_control(
'btn_border_color',
[
'label' => __('Button Border Color', 'thinkai'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .thinkai-btn:hover' => 'border-color: {{VALUE}}!important',
],
'separator' => 'before',
]
);
$this->add_control(
'btn_title_hover_color',
[
'label' => __('Button Text Hover Color', 'thinkai'),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .thinkai-btn:hover' => 'color: {{VALUE}} !important',
'{{WRAPPER}} .thinkai-btn:hover span' => 'color: {{VALUE}} !important',
],
'separator' => 'before',
]
);
$this->end_controls_tab();
$this->end_controls_tabs();
$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');
$btn_style = $settings[ 'btn_style' ];
$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"' : '';
}
?>
<?php if($btn_style == '4'): ?>
<div class="ai-voices-style1__top p-0 m-0">
<div class="btn-box yt-btn">
<a class="btn-one thinkai-btn" 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['btn_title'], true);?></span>
</a>
</div>
</div>
<?php elseif($btn_style == '3'): ?>
<div class="about-style3__right-content thinkai-br p-0 m-0">
<div class="btn-box yt-btn p-0 m-0">
<a href="<?php echo esc_url( $mount_link );?>" <?php if( $page == 'extranal' ) echo esc_attr( $target );?> <?php if( $page == 'extranal' ) echo esc_attr( $nofollow );?> class="thinkai-btn"><span class="icon-right-arrow1"></span> <?php echo wp_kses($settings['btn_title'], true);?></a>
</div>
</div>
<?php elseif($btn_style == '2'): ?>
<div class="project-style1__btn-box yt-btn">
<a class="btn-one thinkai-btn" 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['btn_title'], true);?></span>
</a>
</div>
<?php else: ?>
<div class="yt-btn about-style1__content-box-inner">
<div class="btn-box p-0 m-0">
<a class="thinkai-btn" 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['btn_title'], true);?></a>
</div>
</div>
<?php endif;
}
}

View File

@@ -0,0 +1,404 @@
<?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\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 Clients_Carousel 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_clients_Carousel';
}
/**
* 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 Clients Carousel', '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( 'clients-script', YT_URL . 'assets/js/feature-carousel.js', [ 'elementor-frontend' ], '1.0.0', true );
return [ 'clients-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(
'clients_carousel',
[
'label' => esc_html__('Thinkai Clients Carousel', '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'),
'3' => esc_html__( 'Style Three ', 'thinkai'),
),
]
);
//Title
$this->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Title', 'thinkai' ),
]
);
//Our Feature Table
$repeater = new Repeater();
$repeater->add_control(
'client_img',
[
'label' => __('Client Image', 'thinkai'),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
$repeater->add_control(
'client_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,
],
]
);
$this->add_control(
'clients',
[
'label' => __('Add Clients Item', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'condition' => [
'layout_control' => ['1','2']
]
]
);
$this->end_controls_section();
//Title Style
$this->start_controls_section(
'title_style',
[
'label' => esc_html__( 'Title Style Settings', 'thinkai' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'title__margin',
[
'label' => esc_html__( 'Margin', 'thinkai' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .te-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'separator' => 'before',
]
);
$this->add_responsive_control(
'title_padding',
[
'label' => esc_html__( 'Padding', 'thinkai' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .te-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'title_bgtype',
'label' => __( 'Background', 'thinkai' ),
'types' => [ 'classic', 'gradient' ],
'selector' => '{{WRAPPER}} .partner-style2 .title-box .inner',
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'title_border_type',
'selector' =>
'{{WRAPPER}} .te-title',
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'title_border_box_shadow',
'selector' =>
'{{WRAPPER}} .te-title',
'separator' => 'before',
]
);
$this->add_control(
'title_border_radius',
[
'label' => esc_html__('Border Radius', 'thinkai'),
'type' => Controls_Manager::DIMENSIONS,
'separator' => 'before',
'size_units' => ['px'],
'selectors' => [
'{{WRAPPER}} .te-title' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
]
);
$this->add_control(
'title_color',
[
'label' => esc_html__( 'Text Color', 'thinkai' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .te-title' => 'color: {{VALUE}} !important;',
'{{WRAPPER}} .te-title a' => 'color: {{VALUE}} !important;',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'label' => __('Typography', 'thinkai'),
'selector' => '{{WRAPPER}} .te-title',
]
);
$this->add_group_control(
Group_Control_Text_Shadow::get_type(),
[
'name' => 'title_text_shadow',
'selector' => '{{WRAPPER}} .te-title',
]
);
$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 Partner style3-->
<section class="partner-style2 partner-style2--style3 p-0 m-0">
<div class="auto-container">
<?php if($settings['title']){ ?>
<div class="title-box text-center">
<div class="inner">
<h3 class="te-title"><?php echo wp_kses($settings['title'], true); ?></h3>
</div>
</div>
<?php } ?>
<div class="partner-style2__inner">
<div class="owl-carousel owl-theme thm-owl__carousel partner-carousel" data-owl-options='{
"loop": true,
"autoplay": true,
"margin": 0,
"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
},
"550": {
"items": 2
},
"768": {
"items": 3
},
"992": {
"items": 4
},
"1300": {
"items": 5
},
"1700": {
"items": 6
}
}
}'>
<?php foreach ($settings['clients'] as $item):?>
<!--Start Single Partner Logo Box-->
<div class="single-partner-logo-box-style2">
<a href="<?php echo esc_url($item['client_link']['url']); ?>"><img src="<?php echo esc_url(wp_get_attachment_url($item['client_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>"></a>
</div>
<!--End Single Partner Logo Box-->
<?php endforeach; ?>
</div>
</div>
</div>
</section>
<!--End Partner style3-->
<?php else: ?>
<!--Start Partner style2-->
<section class="partner-style2 p-0 m-0">
<div class="auto-container">
<?php if($settings['title']){ ?>
<div class="title-box text-center">
<div class="inner">
<h3><?php echo wp_kses($settings['title'], true); ?></h3>
</div>
</div>
<?php } ?>
<div class="partner-style2__inner">
<div class="owl-carousel owl-theme thm-owl__carousel partner-carousel" data-owl-options='{
"loop": true,
"autoplay": true,
"margin": 0,
"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
},
"550": {
"items": 2
},
"768": {
"items": 3
},
"992": {
"items": 4
},
"1300": {
"items": 5
},
"1700": {
"items": 6
}
}
}'>
<?php foreach ($settings['clients'] as $item):?>
<!--Start Single Partner Logo Box-->
<div class="single-partner-logo-box-style2">
<a href="<?php echo esc_url($item['client_link']['url']); ?>"><img src="<?php echo esc_url(wp_get_attachment_url($item['client_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>"></a>
</div>
<!--End Single Partner Logo Box-->
<?php endforeach; ?>
</div>
</div>
</div>
</section>
<!--End Partner style2-->
<?php endif; ?>
<?php
}
}

View File

@@ -0,0 +1,215 @@
<?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 Coming_Soon 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_coming_soon';
}
/**
* 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 Coming Soon', '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( 'counter-script', YT_URL . 'assets/js/cm-counter.js', [ 'elementor-frontend' ], '1.0.0', true );
return [ 'counter-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(
'coming_soon',
[
'label' => esc_html__( 'Thinkai Coming Soon', 'thinkai' ),
]
);
//BG img
$this->add_control(
'bg_image',
[
'label' => __( 'BG Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
//Title
$this->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'We are Coming Soon...', 'thinkai' ),
]
);
//Counter Value
$this->add_control(
'counter_value',
[
'label' => __( 'Coming Soon Counter Value', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( '2025/12/31', 'thinkai' ),
]
);
//text
$this->add_control(
'text',
[
'label' => __( 'Description', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Enter You Description', 'thinkai' ),
]
);
//MailChimp Form Url
$this->add_control(
'mailchimp_form_url_v2',
[
'label' => __( 'Maichimp Form Url', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( '[mc4wp_form id=44]', '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');
?>
<!--Start Coming Soon page Style1-->
<section class="coming-soon-page-style1 full-height">
<?php if($settings['bg_image']){ ?><div class="coming-soon-page-style1__bg" style="background-image: url('<?php echo esc_url(wp_get_attachment_url($settings['bg_image']['id'])); ?>');"></div><?php } ?>
<div class="coming-soon-page-style1__content">
<div class="inner">
<?php if($settings['title']){ ?><div class="big-title"><?php echo wp_kses($settings['title'], true); ?></div><?php } ?>
<?php if($settings['counter_value']){ ?>
<div class="timer-box clearfix">
<div class="countdown-timer">
<div class="default-coundown">
<div class="box">
<div class="countdown time-countdown-two" data-countdown-time="<?php echo wp_kses($settings['counter_value'], true); ?>"></div>
</div>
</div>
</div>
</div>
<?php } ?>
<?php if($settings['text']){ ?>
<div class="text">
<p>
<?php echo wp_kses($settings['text'], true); ?>
</p>
</div>
<?php } ?>
<?php if($settings['mailchimp_form_url_v2']){ ?>
<div class="subscribe-box-style1">
<div class="subscribe-form" >
<?php echo do_shortcode($settings['mailchimp_form_url_v2']); ?>
</div>
</div>
<?php } ?>
</div>
</div>
</section>
<!--End Coming Soon page Style1-->
<?php
}
}

View File

@@ -0,0 +1,262 @@
<?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 Contact_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_contact_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 Contact 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-form-horizontal';
}
/**
* 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' ];
}
/**
* 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(
'contact_us',
[
'label' => esc_html__( 'Thinkai Contact Us', 'thinkai' ),
]
);
//Shape img
$this->add_control(
'shape_img',
[
'label' => __( 'Shape Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
//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',
]
);
//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' ),
]
);
//Feature img
$this->add_control(
'feature_img',
[
'label' => __( 'Feature Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
//Sub Title
$this->add_control(
'subtitle',
[
'label' => __( 'Sub Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( '[ SEND A MESSAGE ]', 'thinkai' ),
]
);
//Title
$this->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your title', 'thinkai' ),
]
);
//Form Array
$this->add_control(
'cf7_shortocde',
[
'label' => esc_html__('Select Contact Form 7', 'thinkai'),
'type' => Controls_Manager::SELECT,
'label_block' => true,
'options' => get_contact_form_7_list(),
]
);
$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');
?>
<!--Start Main Contact Form -->
<section class="main-contact-form">
<?php if($settings['shape_img']){ ?>
<div class="main-contact-form__shape1">
<img class="float-bob-y" src="<?php echo esc_url(wp_get_attachment_url($settings['shape_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<?php } ?>
<?php if($settings['show_particles']){ ?>
<div id="particles-js"></div>
<?php } ?>
<?php
$features_list = $settings['features_list'];
if(!empty($features_list)){
$features_list = explode("\n", ($features_list));
?>
<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 } ?>
<div class="container">
<div class="row">
<?php if($settings['feature_img']){ ?>
<div class="col-xl-6 col-lg-5">
<div class="main-contact-form__img-box">
<div class="inner">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['feature_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
</div>
</div>
<?php } ?>
<div class="col-xl-6 col-lg-7">
<div class="main-contact-form__inner">
<?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 } ?>
<?php if($settings['cf7_shortocde']){ ?>
<div class="contact-form">
<div id="contact-form" class="default-form2">
<?php echo do_shortcode('[contact-form-7 id="'.esc_attr($settings['cf7_shortocde']).'"]'); ?>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
</section>
<!--End Main Contact Form-->
<?php
}
}

View File

@@ -0,0 +1,186 @@
<?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_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 Dashboard_Image 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_dashboard_image';
}
/**
* 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 Dashboard Image', 'thinkai' );
}
/**
* Get widget icon.
* Retrieve button widget icon.
*
* @since 1.0.0
* @access public
* @return string Widget icon.
*/
public function get_icon() {
return 'eicon-image-hotspot';
}
/**
* 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' ];
}
/**
* 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(
'dashboard_image',
[
'label' => esc_html__( 'Thinkai Dashboard Image', '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'),
),
]
);
//Shape Image
$this->add_control(
'shape_image_v1',
[
'label' => esc_html__( 'Left Side Shape Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
]
);
//Shape Image
$this->add_control(
'shape_image_v2',
[
'label' => esc_html__( 'Right Side Shape Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
]
);
$this->add_control(
'dashboard_img',
[
'label' => esc_html__( 'Dashboard Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
'condition' => [
'layout_control' => ['1']
]
]
);
$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'] == '3') :?>
<?php elseif($settings['layout_control'] == '2') :?>
<?php else: ?>
<!--Start Dashboard Style1-->
<section class="dashboard-style1">
<?php if($settings['shape_image_v1']){ ?>
<div class="dashboard-style1__shape1">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['shape_image_v1']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<?php } ?>
<?php if($settings['shape_image_v2']){ ?>
<div class="dashboard-style1__shape2">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['shape_image_v2']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<?php } ?>
<?php if($settings['dashboard_img']){ ?>
<div class="container">
<div class="dashboard-style1__content">
<div class="dashboard-style1__bg" style="background-image: url(<?php echo esc_url(wp_get_attachment_url($settings['dashboard_img']['id'])); ?>);"></div>
</div>
</div>
<?php } ?>
</section>
<!--End Dashboard Style1-->
<?php endif; ?>
<?php
}
}

View File

@@ -0,0 +1,95 @@
<?php
namespace THINKAIPLUGIN\Element;
class Elementor {
static $widgets = array(
//Home Page One
'banner',
'hero_title',
'service_card',
'feature_carousel',
'marquee_text',
'float_image',
'button',
'funfacts',
'project_masonry',
'testimonial_carousel',
'faqs',
'blog_grid',
//Home Page Two
'clients_carousel',
'newsletter',
'icon_box',
'dashboard_image',
'wave_image',
'trending_voices',
'our_cases',
'about_us',
'google_review',
'testimonial_review',
'feature_services',
'pricing_plan',
'insta_gallery',
//Home Page Five
'video_banner',
'project_card',
'video_tabs',
'blog_carousel',
'team_grid',
'coming_soon',
'blog_list_view',
'contact_us',
);
static function init() {
add_action( 'elementor/init', array( __CLASS__, 'loader' ) );
add_action( 'elementor/elements/categories_registered', array( __CLASS__, 'register_cats' ) );
}
static function loader() {
foreach ( self::$widgets as $widget ) {
$file = THINKAIPLUGIN_PLUGIN_PATH . '/elementor/' . $widget . '.php';
if ( file_exists( $file ) ) {
require_once $file;
}
add_action( 'elementor/widgets/widgets_registered', array( __CLASS__, 'register' ) );
}
}
static function register( $elemntor ) {
foreach ( self::$widgets as $widget ) {
$class = '\\THINKAIPLUGIN\\Element\\' . ucwords( $widget );
if ( class_exists( $class ) ) {
$elemntor->register_widget_type( new $class );
}
}
}
static function register_cats( $elements_manager ) {
$elements_manager->add_category(
'thinkai',
[
'title' => esc_html__( 'Thinkai', 'thinkai' ),
'icon' => 'fa fa-plug',
]
);
$elements_manager->add_category(
'templatepath',
[
'title' => esc_html__( 'Template Path', 'thinkai' ),
'icon' => 'fa fa-plug',
]
);
}
}
Elementor::init();

View File

@@ -0,0 +1,433 @@
<?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 Faqs 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_faqs';
}
/**
* 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 Faqs', 'thinkai' );
}
/**
* Get widget icon.
* Retrieve button widget icon.
*
* @since 1.0.0
* @access public
* @return string Widget icon.
*/
public function get_icon() {
return 'eicon-accordion';
}
/**
* 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' ];
}
/**
* 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(
'faqs',
[
'label' => esc_html__( 'Thinkai Faqs', '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'),
'5' => esc_html__( 'Style Five ', 'thinkai'),
),
]
);
//BG Image
$this->add_control(
'bg_img',
[
'label' => __( 'BG Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
'condition' => [
'layout_control' => ['1','2']
]
]
);
//BG Shadow Image
$this->add_control(
'bg_shadow_img',
[
'label' => __( 'BG Shadow Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
'condition' => [
'layout_control' => '2'
]
]
);
//Switcher
$this->add_control(
'show_title_area',
[
'label' => esc_html__( 'Enable Title Section', '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','2']
]
]
);
//Sub Title
$this->add_control(
'subtitle',
[
'label' => __( 'Sub Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( '[ FAQS ],', 'thinkai' ),
'condition' => [
'layout_control' => ['1','2'],
'show_title_area' => 'yes'
]
]
);
//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'],
'show_title_area' => 'yes'
]
]
);
//Faqs Repeater
$repeater = new Repeater();
$repeater->add_control(
'faqs_title',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Title', 'thinkai' ),
]
);
$repeater->add_control(
'faqs_text',
[
'label' => __( 'Description', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Description', 'thinkai' ),
]
);
$this->add_control(
'faq',
[
'label' => __('Add faq Item', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '{{{ faqs_title }}}',
'condition' => [
'layout_control' => ['1','2','3','4','5']
]
]
);
$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'] == '5') :?>
<div class="universal-image-generator p-0 m-0">
<ul class="accordion-box-style2 p-0 m-0">
<?php
foreach($settings['faq'] as $key => $item):
?>
<!--Start single accordion box-->
<li class="accordion accordion-block acc-accordion">
<div class="accord-btn acc-accord-btn <?php if($key == 0) echo 'active'; ?>">
<h4><?php echo wp_kses($item['faqs_title'], true);?></h4>
<div class="icon-box">
<span class="icon-right-arrow"></span>
</div>
</div>
<div class="accord-content acc-accord-content <?php if($key == 0) echo 'collapsed'; ?>">
<p>
<?php echo wp_kses($item['faqs_text'], true);?>
</p>
</div>
</li>
<!--End single accordion box-->
<?php endforeach; ?>
</ul>
</div>
<?php elseif($settings['layout_control'] == '4') :?>
<!--Start Faq Page One-->
<section class="faq-page-one p-0 m-0">
<div class="faq-style1__content">
<div class="faq-content-box">
<ul class="accordion-box-style1 style2">
<?php
foreach($settings['faq'] as $key => $item):
?>
<!--Start single accordion box-->
<li class="accordion accordion-block acc-accordion">
<div class="accord-btn acc-accord-btn">
<h4>
<?php echo wp_kses($item['faqs_title'], true);?>
</h4>
</div>
<div class="accord-content acc-accord-content">
<p>
<?php echo wp_kses($item['faqs_text'], true);?>
</p>
</div>
</li>
<!--End single accordion box-->
<?php endforeach; ?>
</ul>
</div>
</div>
</section>
<!--End Faq Page One-->
<?php elseif($settings['layout_control'] == '3') :?>
<!--Start Faq Page One-->
<section class="faq-page-one p-0 m-0">
<div class="faq-style1__content">
<div class="faq-content-box">
<ul class="accordion-box-style1">
<?php
foreach($settings['faq'] as $key => $item):
?>
<!--Start single accordion box-->
<li class="accordion accordion-block acc-accordion">
<div class="accord-btn acc-accord-btn">
<h4>
<?php echo wp_kses($item['faqs_title'], true);?>
</h4>
</div>
<div class="accord-content acc-accord-content">
<p>
<?php echo wp_kses($item['faqs_text'], true);?>
</p>
</div>
</li>
<!--End single accordion box-->
<?php endforeach; ?>
</ul>
</div>
</div>
</section>
<!--End Faq Page One-->
<?php elseif($settings['layout_control'] == '2') :?>
<!--Start Faq Style1-->
<section class="faq-style1 faq-style1--style2">
<?php if($settings['bg_img']){ ?>
<div class="faq-style1__bg float-bob-x"
style="background-image: url(<?php echo esc_url(wp_get_attachment_url($settings['bg_img']['id'])); ?>);">
</div>
<?php } ?>
<?php if($settings['bg_shadow_img']){ ?>
<div class="faq-style1--style2__shadow wow slideInRight animated" data-wow-delay="300ms" data-wow-duration="1500ms">
<img class="zoominout" src="<?php echo esc_url(wp_get_attachment_url($settings['bg_shadow_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<?php } ?>
<div class="container">
<div class="faq-style1__content">
<div class="faq-content-box">
<?php if($settings['show_title_area'] == 'yes'){ ?>
<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 } ?>
<ul class="accordion-box-style1 accordion-box-style1--instyle2">
<?php
foreach($settings['faq'] as $key => $item):
?>
<!--Start single accordion box-->
<li class="accordion accordion-block acc-accordion wow fadeInRight animated" data-wow-delay="300ms" data-wow-duration="1500ms">
<div class="accord-btn acc-accord-btn <?php if($key == 0 ) echo 'active'; ?>">
<h4>
<?php echo wp_kses($item['faqs_title'], true);?>
</h4>
</div>
<div class="accord-content acc-accord-content <?php if($key == 0 ) echo 'collapsed'; ?>">
<p>
<?php echo wp_kses($item['faqs_text'], true);?>
</p>
</div>
</li>
<!--End single accordion box-->
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
</section>
<!--End Faq Style1-->
<?php else: ?>
<!--Start Faq Style1-->
<section class="faq-style1">
<?php if($settings['bg_img']){ ?>
<div class="faq-style1__bg float-bob-x"
style="background-image: url(<?php echo esc_url(wp_get_attachment_url($settings['bg_img']['id'])); ?>);">
</div>
<?php } ?>
<div class="container">
<div class="faq-style1__content">
<div class="faq-content-box">
<?php if($settings['show_title_area'] == 'yes'){ ?>
<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 } ?>
<ul class="accordion-box-style1">
<?php
foreach($settings['faq'] as $key => $item):
?>
<!--Start single accordion box-->
<li class="accordion accordion-block acc-accordion">
<div class="accord-btn acc-accord-btn <?php if($key == 0 ) echo 'active'; ?>">
<h4>
<?php echo wp_kses($item['faqs_title'], true);?>
</h4>
</div>
<div class="accord-content acc-accord-content <?php if($key == 0 ) echo 'collapsed'; ?>">
<p>
<?php echo wp_kses($item['faqs_text'], true);?>
</p>
</div>
</li>
<!--End single accordion box-->
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
</section>
<!--End Faq Style1-->
<?php endif; ?>
<?php
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,616 @@
<?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 Feature_Services 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_feature_services';
}
/**
* 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 Feature Services', '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' ];
}
/**
* 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(
'feature_services',
[
'label' => esc_html__( 'Thinkai Feature Services', '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'),
),
]
);
//Vertical Client Carousel Repeater
$repeater = new Repeater();
$repeater->add_control(
'shape_image',
[
'label' => esc_html__( 'BG Shape Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
]
);
$repeater->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Title', 'thinkai' ),
]
);
//Link
$repeater->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'),
),
]
);
$repeater->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' => [
'link_option' => 'extranal'
]
]
);
$repeater->add_control(
'page_select',
[
'label' => esc_html__( 'Select Page', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT2,
'default' => 'extranal',
'options' => thinkai_page_list(),
'condition' => [
'link_option' => 'page'
]
]
);
//Icons
$repeater->add_control(
'icon',
[
'label' => esc_html__('Enter The icons', 'thinkai'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-medal',
'library' => 'solid',
],
]
);
//text
$repeater->add_control(
'text',
[
'label' => __( 'Text', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Text', 'thinkai' ),
]
);
$this->add_control(
'feature',
[
'label' => __('Add Slide Item', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '{{{ title }}}',
'condition' => [
'layout_control' => '1',
]
]
);
//Vertical Client Carousel Repeater
$repeater = new Repeater();
$repeater->add_control(
'bg_shape_image',
[
'label' => esc_html__( 'BG Shape Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
]
);
$repeater->add_control(
'feature_image',
[
'label' => esc_html__( 'Feature Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
]
);
$repeater->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Title', 'thinkai' ),
]
);
//text
$repeater->add_control(
'text',
[
'label' => __( 'Text', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Text', 'thinkai' ),
]
);
//Button Title
$repeater->add_control(
'btn_title',
[
'label' => __( 'Button Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Button Title', 'thinkai' ),
]
);
//Link
$repeater->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'),
),
]
);
$repeater->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' => [
'link_option' => 'extranal'
]
]
);
$repeater->add_control(
'page_select',
[
'label' => esc_html__( 'Select Page', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT2,
'default' => 'extranal',
'options' => thinkai_page_list(),
'condition' => [
'link_option' => 'page'
]
]
);
$this->add_control(
'feature_v2',
[
'label' => __('Add Magic Item', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '{{{ title }}}',
'condition' => [
'layout_control' => '2',
],
'default' => [
[
'title' => esc_html__( 'Live Action', 'thinkai' ),
'text' => esc_html__( 'Holds in these matters this principle...', 'thinkai' ),
'btn_title' => esc_html__( 'Read More', 'thinkai' ),
'link' => esc_html__( '#', 'thinkai' ),
],
[
'title' => esc_html__( 'Motion Graphics', 'thinkai' ),
'text' => esc_html__( 'Obligations of business it frequently...', 'thinkai' ),
'btn_title' => esc_html__( 'Read More', 'thinkai' ),
'link' => esc_html__( '#', 'thinkai' ),
],
[
'title' => esc_html__( 'Cartoon', 'thinkai' ),
'text' => esc_html__( 'Holds in these matters this principle...', 'thinkai' ),
'btn_title' => esc_html__( 'Read More', 'thinkai' ),
'link' => esc_html__( '#', 'thinkai' ),
],
],
]
);
$this->end_controls_section();
/************************************************************************
Tab Style Start
*************************************************************************/
//Title Style
$this->start_controls_section(
'title_style',
[
'label' => esc_html__( 'Title Style Settings', 'thinkai' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'title__margin',
[
'label' => esc_html__( 'Margin', 'thinkai' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .te-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'separator' => 'before',
]
);
$this->add_responsive_control(
'title_padding',
[
'label' => esc_html__( 'Padding', 'thinkai' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .te-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'separator' => 'before',
]
);
$this->add_control(
'title_color',
[
'label' => esc_html__( 'Text Color', 'thinkai' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .te-title' => 'color: {{VALUE}} !important;',
'{{WRAPPER}} .te-title a' => 'color: {{VALUE}} !important;',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'label' => __('Typography', 'thinkai'),
'selector' => '{{WRAPPER}} .te-title,
{{WRAPPER}} .te-title a',
]
);
$this->add_group_control(
Group_Control_Text_Stroke::get_type(),
[
'name' => 'title_text_stroke',
'selector' => '{{WRAPPER}} .te-title',
]
);
$this->add_group_control(
Group_Control_Text_Shadow::get_type(),
[
'name' => 'title_text_shadow',
'selector' => '{{WRAPPER}} .te-title',
]
);
$this->end_controls_section();
//Text Style
$this->start_controls_section(
'text_style',
[
'label' => esc_html__( 'Text Style Settings', 'thinkai' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'text__margin',
[
'label' => esc_html__( 'Margin', 'thinkai' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .te-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'separator' => 'before',
]
);
$this->add_responsive_control(
'text_padding',
[
'label' => esc_html__( 'Padding', 'thinkai' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .te-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'separator' => 'before',
]
);
$this->add_control(
'text_color',
[
'label' => esc_html__( 'Text Color', 'thinkai' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .te-text' => 'color: {{VALUE}} !important;',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'text_typography',
'label' => __('Typography', 'thinkai'),
'selector' => '{{WRAPPER}} .te-text',
]
);
$this->add_group_control(
Group_Control_Text_Stroke::get_type(),
[
'name' => 'text_text_stroke',
'selector' => '{{WRAPPER}} .te-text',
]
);
$this->add_group_control(
Group_Control_Text_Shadow::get_type(),
[
'name' => 'text_text_shadow',
'selector' => '{{WRAPPER}} .te-text',
]
);
$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 == '2') : ?>
<!--Start Video Types Style1-->
<section class="video-types-style1 p-0 m-0">
<div class="container">
<ul class="row">
<?php
foreach ( $settings['feature_v2'] as $key => $item ) {
$page = $item['link_option'];
$page_select = $item[ 'page_select' ];
$ext_url = $item[ '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 Video Types Style1 Single-->
<li class="col-xl-4 col-lg-4">
<div class="video-types-style1__single">
<div class="video-types-style1__single-img-box">
<div class="video-types-style1__single-img-box__bg float-bob-y"
style="background-image: url(<?php echo esc_url(wp_get_attachment_url($item['bg_shape_image']['id'])); ?>);">
</div>
<div class="inner">
<img src="<?php echo esc_url(wp_get_attachment_url($item['feature_image']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
</div>
<div class="video-types-style1__single-content-box">
<div class="title-box">
<h3 class="te-title"><a href="<?php echo esc_url( $mount_link );?>" <?php if( $page == 'extranal' ) echo esc_attr( $target );?> <?php if( $page == 'extranal' ) echo esc_attr( $nofollow );?>><?php echo wp_kses($item['title'], true); ?></a></h3>
<p class="te-text"><?php echo wp_kses($item['text'], true); ?></p>
</div>
<div class="btn-box">
<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($item['btn_title'], true); ?>
</a>
</div>
</div>
</div>
</li>
<!--End Video Types Style1 Single-->
<?php } ?>
</ul>
</div>
</section>
<!--End Video Types Style1-->
<?php else: ?>
<!--Start Features Style3-->
<section class="features-style3 p-0 m-0">
<div class="container">
<ul class="features-style3__inner">
<?php
foreach ( $settings['feature'] as $key => $item ) {
$icon = $item['icon'];
$page = $item['link_option'];
$page_select = $item[ 'page_select' ];
$ext_url = $item[ '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"' : '';
}
?>
<!--Single Features Style3-->
<li>
<div class="features-style3__single">
<div class="title-box">
<h3 class="te-title"><a href="<?php echo esc_url( $mount_link );?>" <?php if( $page == 'extranal' ) echo esc_attr( $target );?> <?php if( $page == 'extranal' ) echo esc_attr( $nofollow );?>><?php echo wp_kses($item['title'], true); ?></a></h3>
</div>
<?php if($icon || $item['shape_image']){ ?>
<div class="icon-box text-center">
<?php
$icon = str_replace( "icon ", "", $item['icon']);
if( !empty( $icon ) ):?>
<?php \Elementor\Icons_Manager::render_icon( $icon ); ?>
<?php else:?>
<span class="icon-standard"></span>
<?php endif;?>
<?php if($item['shape_image']){ ?>
<div class="icon-box__shape1">
<img src="<?php echo esc_url(wp_get_attachment_url($item['shape_image']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<?php } ?>
</div>
<?php } ?>
<div class="text">
<p class="te-text"><?php echo wp_kses($item['text'], true); ?></p>
</div>
</div>
</li>
<!--End Features Style3-->
<?php } ?>
</ul>
</div>
</section>
<!--End Features Style3-->
<?php endif; ?>
<?php
}
}

View File

@@ -0,0 +1,247 @@
<?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_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 Float_Image 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_float_image';
}
/**
* 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 Float Image', 'thinkai' );
}
/**
* Get widget icon.
* Retrieve button widget icon.
*
* @since 1.0.0
* @access public
* @return string Widget icon.
*/
public function get_icon() {
return 'eicon-image-hotspot';
}
/**
* 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' ];
}
/**
* 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(
'float_image',
[
'label' => esc_html__( 'Float Image', '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'),
'5' => esc_html__( 'Style Five ', 'thinkai'),
'6' => esc_html__( 'Style Six ', 'thinkai'),
),
]
);
//Curved Title
$this->add_control(
'curved_title',
[
'label' => __( 'Curved Text', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Making ai image is safe & easy with thinkai', 'thinkai' ),
'condition' => [
'layout_control' => '1'
]
]
);
$this->add_control(
'bg_shape_image',
[
'label' => esc_html__( 'BG Shape Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
'condition' => [
'layout_control' => '3',
]
]
);
$this->add_control(
'feature_image',
[
'label' => esc_html__( 'Feature Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
'condition' => [
'layout_control' => ['1','2','3','4','5','6']
]
]
);
//Description
$this->add_control(
'founded_text',
[
'label' => __( 'Founded Text', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( '2010 founded', 'thinkai' ),
'condition' => [
'layout_control' => '1'
]
]
);
$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'] == '6') :?>
<div class="service-details__img-box p-0 m-0">
<div class="single-img-box p-0 m-0">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['feature_image']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
</div>
<?php elseif($settings['layout_control'] == '5') :?>
<div class="Intro-style2__img js-tilt">
<div class="inner">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['feature_image']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
</div>
<?php elseif($settings['layout_control'] == '4') :?>
<div class="about-style5__img-box">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['feature_image']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<?php elseif($settings['layout_control'] == '3') :?>
<div class="about-style2__dashboard">
<div class="shape1">
<img class="float-bob-x" src="<?php echo esc_url(wp_get_attachment_url($settings['bg_shape_image']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<div class="inner">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['feature_image']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
</div>
<?php elseif($settings['layout_control'] == '2') :?>
<div class="about-style1__content-box-inner">
<div class="img-box">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['feature_image']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
</div>
<?php else: ?>
<div class="about-style1__img-box">
<?php if($settings['curved_title']){ ?>
<div class="round-text">
<div class="curved-circle">
<?php echo wp_kses($settings['curved_title'], true); ?>
</div>
</div>
<?php } ?>
<?php if($settings['feature_image']){ ?>
<div class="inner">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['feature_image']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<?php } ?>
<?php if($settings['founded_text']){ ?>
<div class="text-box">
<p><?php echo wp_kses($settings['founded_text'], true); ?></p>
<div class="round"></div>
</div>
<?php } ?>
</div>
<?php endif; ?>
<?php
}
}

View File

@@ -0,0 +1,392 @@
<?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 Funfacts 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_funfacts';
}
/**
* 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 Funfacts', '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' ];
}
/**
* 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(
'funfacts',
[
'label' => esc_html__( 'Thinkai Funfacts', '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'),
),
]
);
//Banner Carousel Repeater
$repeater = new Repeater();
$repeater->add_control(
'counter_value',
[
'label' => __( 'Counter Value', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Counter Value', 'thinkai' ),
]
);
$repeater->add_control(
'currency_unit',
[
'label' => __( 'Currency Unit', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Counter Value', 'thinkai' ),
]
);
//Text
$repeater->add_control(
'text',
[
'label' => __( 'Description', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Description', 'thinkai' ),
]
);
//Title
$repeater->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Title', 'thinkai' ),
]
);
$this->add_control(
'funfact',
[
'label' => __('Add Funfact Item', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'condition' => [
'layout_control' => '1'
],
'title_field' => '{{{ title }}}',
'default' => [
[
'counter_value' => esc_html__( '4.8', 'thinkai' ),
'currency_unit' => esc_html__( 'Million', 'thinkai' ),
'text' => esc_html__( 'Worldwide Users of<br> ThinkAi', 'thinkai' ),
'title' => esc_html__( 'Fun Numbers', 'thinkai' ),
],
[
'counter_value' => esc_html__( '174', 'thinkai' ),
'currency_unit' => esc_html__( 'User Territory', 'thinkai' ),
'text' => esc_html__( 'Worldwide Users of<br> ThinkAi', 'thinkai' ),
'title' => esc_html__( 'Fun Numbers', 'thinkai' ),
],
[
'counter_value' => esc_html__( '236', 'thinkai' ),
'currency_unit' => esc_html__( 'Million', 'thinkai' ),
'text' => esc_html__( 'Images Generated in<br> Last Year', 'thinkai' ),
'title' => esc_html__( 'Fun Numbers', 'thinkai' ),
],
],
]
);
//Banner Carousel Repeater
$repeater = new Repeater();
//Title
$repeater->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Title', 'thinkai' ),
]
);
//Text
$repeater->add_control(
'text',
[
'label' => __( 'Description', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Description', 'thinkai' ),
]
);
$repeater->add_control(
'counter_value',
[
'label' => __( 'Counter Value', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Counter Value', 'thinkai' ),
]
);
$repeater->add_control(
'currency_unit',
[
'label' => __( 'Currency Unit', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Counter Value', 'thinkai' ),
]
);
//Select Box
$repeater->add_control(
'style_two',
[
'label' => esc_html__( 'Choose Style', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'two',
'options' => array(
'one' => esc_html__( 'Sec Style ', 'thinkai'),
'two' => esc_html__( 'Percent Style ', 'thinkai'),
),
]
);
$this->add_control(
'funfact_v2',
[
'label' => __('Add Funfact Item', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'condition' => [
'layout_control' => '2'
],
'title_field' => '{{{ title }}}',
'default' => [
[
'title' => esc_html__( 'Savings Potential', 'thinkai' ),
'text' => esc_html__( 'We can help businesses reduce customer <br> service costs.', 'thinkai' ),
'counter_value' => esc_html__( '25', 'thinkai' ),
'currency_unit' => esc_html__( '%', 'thinkai' ),
],
[
'title' => esc_html__( 'Quick Responses', 'thinkai' ),
'text' => esc_html__( 'ThinkAi Provide immediate responses to <br> customer queries.', 'thinkai' ),
'counter_value' => esc_html__( '0.4', 'thinkai' ),
'currency_unit' => esc_html__( 'Sec', 'thinkai' ),
],
[
'title' => esc_html__( 'Business Adoption', 'thinkai' ),
'text' => esc_html__( 'Businesses are projected to use ThinkAi <br> in some capacity.', 'thinkai' ),
'counter_value' => esc_html__( '80', 'thinkai' ),
'currency_unit' => esc_html__( '%', '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 Fact Counter Style2-->
<section class="fact-counter-style2 p-0 m-0">
<div class="container">
<ul class="row">
<?php
foreach($settings['funfact_v2'] as $key => $items):
?>
<!--Start Fact Counter Style2 Single-->
<li class="col-xl-4 col-lg-4 wow fadeInUp" data-wow-delay=".2s">
<div class="fact-counter-style2__single text-center">
<div class="round-box"></div>
<h3><?php echo wp_kses($items['title'], true);?></h3>
<p><?php echo wp_kses($items['text'], true);?></p>
<div class="counter-box">
<h2><span class="odometer" data-count="<?php echo esc_attr($items['counter_value']);?>"></span>
<span class="<?php if($items['style_two'] == 'two') echo 'percent'; else echo 'sec'; ?>"><?php echo wp_kses($items['currency_unit'], true);?></span></h2>
</div>
</div>
</li>
<!--End Fact Counter Style2 Single-->
<?php endforeach; ?>
</ul>
</div>
</section>
<!--End Fact Counter Style2-->
<?php else: ?>
<!--Start Fact Counter Style1-->
<section class="fact-counter-style1">
<div class="container">
<div class="row">
<div class="col-xl-12">
<div class="fact-counter-style1__content">
<ul class="clearfix">
<?php
$count = 1;
foreach($settings['funfact'] as $key => $items):
if($count % 2) {
?>
<!--Start Single Fact Counter-->
<li class="single-fact-counter wow fadeInRight" data-wow-delay="100ms"
data-wow-duration="2500ms">
<div class="counting">
<h2 class="odometer te-count" data-count="<?php echo esc_attr($items['counter_value']);?>"><?php echo esc_attr($items['counter_value']);?></h2>
<p class="te-currency"><?php echo wp_kses($items['currency_unit'], true);?></p>
</div>
<div class="text">
<p class="te-text"><?php echo wp_kses($items['text'], true);?></p>
<div class="dot"></div>
</div>
<div class="big-title te-title" data-hover="Fun Numbers">
<?php echo wp_kses($items['title'], true);?>
</div>
</li>
<!--End Single Fact Counter-->
<?php } else { ?>
<!--Start Single Fact Counter-->
<li class="single-fact-counter wow fadeInLeft" data-wow-delay="200ms"
data-wow-duration="2500ms">
<div class="text">
<p class="te-text"><?php echo wp_kses($items['text'], true);?></p>
<div class="dot"></div>
</div>
<div class="counting">
<h2 class="odometer te-count" data-count="<?php echo esc_attr($items['counter_value']);?>"><?php echo esc_attr($items['counter_value']);?></h2>
<p class="te-currency"><?php echo wp_kses($items['currency_unit'], true);?></p>
</div>
<div class="big-title te-title"><?php echo wp_kses($items['title'], true);?></div>
</li>
<!--End Single Fact Counter-->
<?php } $count++; endforeach; ?>
</ul>
</div>
</div>
</div>
</div>
</section>
<!--End Fact Counter Style1-->
<?php endif; ?>
<?php
}
}

View File

@@ -0,0 +1,222 @@
<?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 Google_Review 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_google_review';
}
/**
* 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 Google Review', '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' ];
}
/**
* 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(
'google_review',
[
'label' => esc_html__( 'Thinkai Google Review', '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'),
),
]
);
//Review Title
$this->add_control(
'review_title',
[
'label' => __( 'Review Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Google Reviews', 'thinkai' ),
]
);
//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'),
),
]
);
//Total Title
$this->add_control(
'total_rating',
[
'label' => __( 'Total Rating Average', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( '4.9/5.0', 'thinkai' ),
]
);
//rating_description
$this->add_control(
'rating_description',
[
'label' => __( 'Description', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( '(from 20k reviews)', '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');
$layout = $settings[ 'layout_control' ];
?>
<?php if($layout == '2') : ?>
<?php else: ?>
<!--Start Google Reviews Style1-->
<section class="google-reviews-style1">
<div class="container">
<div class="google-reviews-style1__inner">
<?php if($settings['review_title']){ ?>
<div class="google-reviews">
<div class="icon-box">
<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">
<p><?php echo wp_kses($settings['review_title'], true); ?></p>
</div>
</div>
<?php } ?>
<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>
<div class="text-box">
<h2><?php echo wp_kses($settings['total_rating'], true); ?> <span> <?php echo wp_kses($settings['rating_description'], true); ?></span></h2>
</div>
</div>
</div>
</section>
<!--End Google Reviews Style1-->
<?php endif; ?>
<?php
}
}

View File

@@ -0,0 +1,601 @@
<?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_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 Hero_Title 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_hero_title';
}
/**
* 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 Hero Title', 'thinkai' );
}
/**
* Get widget icon.
* Retrieve button widget icon.
*
* @since 1.0.0
* @access public
* @return string Widget icon.
*/
public function get_icon() {
return 'eicon-site-identity';
}
/**
* 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' ];
}
/**
* 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(
'hero_title',
[
'label' => esc_html__( 'Thinkai Hero Title', 'thinkai' ),
]
);
//General Align
$this->add_responsive_control(
'general_align',
[
'label' => esc_html__( 'Alignment', 'thinkai' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'left' => [
'title' => esc_html__( 'Left', 'thinkai' ),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => esc_html__( 'Center', 'thinkai' ),
'icon' => 'eicon-text-align-center',
],
'right' => [
'title' => esc_html__( 'Right', 'thinkai' ),
'icon' => 'eicon-text-align-right',
],
],
'default' => '',
'selectors' => [
'{{WRAPPER}} .thinkai-title-section' => 'text-align: {{VALUE}};'
],
]
);
$this->add_control(
'subtitle_show',
[
'label' => esc_html__( 'Enable Small Title', 'thinkai' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'thinkai' ),
'label_off' => esc_html__( 'Off', 'thinkai' ),
'return_value' => 'yes',
'default' => 'no',
]
);
$this->add_control(
'subtitle',
[
'label' => esc_html__( 'Small Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'placeholder' => esc_html__( 'Enter your small title', 'thinkai' ),
'default' => esc_html__( 'Add Your Sub Heading Text Here', 'thinkai' ),
'condition' => [ 'subtitle_show' => 'yes' ]
]
);
$this->add_control(
'small_title_tag',
[
'label' => esc_html__( 'Small Title HTML Tag', 'thinkai' ),
'type' => Controls_Manager::SELECT,
'options' => [
'h1' => 'H1',
'h2' => 'H2',
'h3' => 'H3',
'h4' => 'H4',
'h5' => 'H5',
'h6' => 'H6',
'div' => 'div',
'span' => 'span',
'p' => 'p',
],
'default' => 'h4',
'condition' => [ 'subtitle_show' => 'yes' ]
]
);
$this->add_control(
'title_show',
[
'label' => esc_html__( 'Enable Title', 'thinkai' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'thinkai' ),
'label_off' => esc_html__( 'Off', 'thinkai' ),
'return_value' => 'yes',
'default' => 'no',
]
);
$this->add_control(
'title',
[
'label' => esc_html__( 'Title', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'placeholder' => esc_html__( 'Enter your title', 'thinkai' ),
'default' => esc_html__( 'Add Your Heading Text Here', 'thinkai' ),
'condition' => [ 'title_show' => 'yes' ]
]
);
$this->add_control(
'title_size',
[
'label' => esc_html__( 'Size', 'thinkai' ),
'type' => Controls_Manager::SELECT,
'default' => 'default',
'options' => [
'default' => esc_html__( 'Default', 'thinkai' ),
'small' => esc_html__( 'Small', 'thinkai' ),
'medium' => esc_html__( 'Medium', 'thinkai' ),
'large' => esc_html__( 'Large', 'thinkai' ),
'xl' => esc_html__( 'XL', 'thinkai' ),
'xxl' => esc_html__( 'XXL', 'thinkai' ),
],
'condition' => [ 'title_show' => 'yes' ]
]
);
$this->add_control(
'title_tag',
[
'label' => esc_html__( 'Title HTML Tag', 'thinkai' ),
'type' => Controls_Manager::SELECT,
'options' => [
'h1' => 'H1',
'h2' => 'H2',
'h3' => 'H3',
'h4' => 'H4',
'h5' => 'H5',
'h6' => 'H6',
'div' => 'div',
'span' => 'span',
'p' => 'p',
],
'default' => 'h2',
'condition' => [ 'title_show' => 'yes' ]
]
);
$this->add_control(
'text_show',
[
'label' => esc_html__( 'Enable Text', 'thinkai' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => esc_html__( 'On', 'thinkai' ),
'label_off' => esc_html__( 'Off', 'thinkai' ),
'return_value' => 'yes',
'default' => 'no',
]
);
$this->add_control(
'text',
[
'label' => esc_html__( 'Text', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'placeholder' => esc_html__( 'Enter your Text', 'thinkai' ),
'default' => esc_html__( 'There are many variations of passages of lorem ipsum available the majority have suffered alteration in some form by injected humour. Duis aute irure dolor lipsum is simply free text available in the local markets in reprehenderit.', 'thinkai' ),
'condition' => [ 'text_show' => 'yes' ]
]
);
$this->end_controls_section();
//General Style
$this->start_controls_section(
'general_style',
[
'label' => esc_html__( 'General Setting', 'thinkai' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'general_margin',
[
'label' => esc_html__( 'Margin', 'thinkai' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .thinkai-title-section' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'separator' => 'before',
]
);
$this->add_responsive_control(
'general_padding',
[
'label' => esc_html__( 'Padding', 'thinkai' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .thinkai-title-section' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'general_bgtype',
'label' => __( 'Background', 'thinkai' ),
'types' => [ 'classic', 'gradient' ],
'selector' => '{{WRAPPER}} .thinkai-title-section',
]
);
$this->end_controls_section();
//Small Title Style
$this->start_controls_section(
'small_title_style',
[
'label' => esc_html__( 'Small Title Style Settings', 'thinkai' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'small_title__margin',
[
'label' => esc_html__( 'Margin', 'thinkai' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .te-subtitle' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'separator' => 'before',
]
);
$this->add_responsive_control(
'small_title_padding',
[
'label' => esc_html__( 'Padding', 'thinkai' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .te-subtitle' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'small_title_bgtype',
'label' => __( 'Background', 'thinkai' ),
'types' => [ 'classic', 'gradient' ],
'selector' => '{{WRAPPER}} .te-subtitle',
]
);
$this->add_control(
'small_title_color',
[
'label' => esc_html__( 'Text Color', 'thinkai' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .te-subtitle' => 'color: {{VALUE}} !important;',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'small_title_typography',
'label' => __('Typography', 'thinkai'),
'selector' => '{{WRAPPER}} .te-subtitle',
]
);
$this->add_group_control(
Group_Control_Text_Stroke::get_type(),
[
'name' => 'small_title_text_stroke',
'selector' => '{{WRAPPER}} .te-subtitle',
]
);
$this->add_group_control(
Group_Control_Text_Shadow::get_type(),
[
'name' => 'small_title_text_shadow',
'selector' => '{{WRAPPER}} .te-subtitle',
]
);
$this->end_controls_section();
//Title Style
$this->start_controls_section(
'title_style',
[
'label' => esc_html__( 'Title Style Settings', 'thinkai' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'title__margin',
[
'label' => esc_html__( 'Margin', 'thinkai' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .te-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'separator' => 'before',
]
);
$this->add_responsive_control(
'title_padding',
[
'label' => esc_html__( 'Padding', 'thinkai' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .te-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Background::get_type(),
[
'name' => 'title_bgtype',
'label' => __( 'Background', 'thinkai' ),
'types' => [ 'classic', 'gradient' ],
'selector' => '{{WRAPPER}} .te-title',
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'title_border_type',
'selector' =>
'{{WRAPPER}} .te-title',
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'title_border_box_shadow',
'selector' =>
'{{WRAPPER}} .te-title',
'separator' => 'before',
]
);
$this->add_control(
'title_border_radius',
[
'label' => esc_html__('Border Radius', 'thinkai'),
'type' => Controls_Manager::DIMENSIONS,
'separator' => 'before',
'size_units' => ['px'],
'selectors' => [
'{{WRAPPER}} .te-title' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
]
);
$this->add_control(
'title_color',
[
'label' => esc_html__( 'Text Color', 'thinkai' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .te-title' => 'color: {{VALUE}} !important;',
'{{WRAPPER}} .te-title a' => 'color: {{VALUE}} !important;',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'label' => __('Typography', 'thinkai'),
'selector' => '{{WRAPPER}} .te-title',
]
);
$this->add_group_control(
Group_Control_Text_Stroke::get_type(),
[
'name' => 'title_text_stroke',
'selector' => '{{WRAPPER}} .te-title',
]
);
$this->add_group_control(
Group_Control_Text_Shadow::get_type(),
[
'name' => 'title_text_shadow',
'selector' => '{{WRAPPER}} .te-title',
]
);
$this->end_controls_section();
//Text Style
$this->start_controls_section(
'text_style',
[
'label' => esc_html__( 'Text Style Settings', 'thinkai' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_responsive_control(
'text__margin',
[
'label' => esc_html__( 'Margin', 'thinkai' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .te-text' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'separator' => 'before',
]
);
$this->add_responsive_control(
'text_padding',
[
'label' => esc_html__( 'Padding', 'thinkai' ),
'type' => Controls_Manager::DIMENSIONS,
'size_units' => ['px', '%', 'em'],
'selectors' => [
'{{WRAPPER}} .te-text' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Border::get_type(),
[
'name' => 'text_border_type',
'selector' =>
'{{WRAPPER}} .te-text',
'separator' => 'before',
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'text_border_box_shadow',
'selector' =>
'{{WRAPPER}} .te-text',
'separator' => 'before',
]
);
$this->add_control(
'text_border_radius',
[
'label' => esc_html__('Border Radius', 'thinkai'),
'type' => Controls_Manager::DIMENSIONS,
'separator' => 'before',
'size_units' => ['px'],
'selectors' => [
'{{WRAPPER}} .te-text' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}} !important;',
],
]
);
$this->add_control(
'text_color',
[
'label' => esc_html__( 'Text Color', 'thinkai' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .te-text' => 'color: {{VALUE}} !important;',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'text_typography',
'label' => __('Typography', 'thinkai'),
'selector' => '{{WRAPPER}} .te-text',
]
);
$this->add_group_control(
Group_Control_Text_Shadow::get_type(),
[
'name' => 'text_text_shadow',
'selector' => '{{WRAPPER}} .te-text',
]
);
$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');
$this->add_render_attribute( 'subtitle', 'class', 'te-subtitle' );
$subtitle = $settings['subtitle'];
if( $settings[ 'subtitle_show' ] == 'yes' ){
$subtitle_html = sprintf( '<%1$s %2$s>%3$s</%1$s>', Utils::validate_html_tag( $settings['small_title_tag'] ), $this->get_render_attribute_string( 'subtitle' ), $subtitle );
}
$this->add_render_attribute( 'title', 'class', 'te-title title-animation' );
if ( ! empty( $settings['title_size'] ) ) {
$this->add_render_attribute( 'title', 'class', 'thinkai-size-' . $settings['title_size'] );
}
$title = $settings['title'];
if( $settings[ 'title_show' ] == 'yes' ){
$title_html = sprintf( '<%1$s %2$s>%3$s</%1$s>', Utils::validate_html_tag( $settings['title_tag'] ), $this->get_render_attribute_string( 'title' ), $title );
}
$text = $settings[ 'text' ];
?>
<div class="sec-title thinkai-title-section sec-title-animation animation-style3 p-0 m-0">
<?php if( $settings[ 'subtitle_show' ] === 'yes' ){?>
<div class="sub-title">
<?php echo wp_kses( $subtitle_html, true );?>
</div>
<?php } ?>
<?php if( $settings[ 'title_show' ] === 'yes' ){?>
<?php echo wp_kses( $title_html, true );?>
<?php } ?>
<?php if($text){ ?>
<div class="text-box">
<p class="te-text"><?php echo wp_kses( $text, true );?></p>
</div>
<?php } ?>
</div>
<?php
}
}

View File

@@ -0,0 +1,482 @@
<?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 Icon_Box 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_icon_box';
}
/**
* 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 Icon Box', 'thinkai' );
}
/**
* Get widget icon.
* Retrieve button widget icon.
*
* @since 1.0.0
* @access public
* @return string Widget icon.
*/
public function get_icon() {
return 'eicon-icon-box';
}
/**
* 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' ];
}
/**
* 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(
'icon_box',
[
'label' => esc_html__( 'Thinkai Icon Box', '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 Image
$this->add_control(
'bg_shape_image',
[
'label' => esc_html__( 'BG Shape Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
'condition' => [
'layout_control' => ['2','3']
]
]
);
//Shape Image V2
$this->add_control(
'bg_shape_image_v2',
[
'label' => esc_html__( 'BG Shape Image V2', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
'condition' => [
'layout_control' => '3',
]
]
);
//Icon
$this->add_control(
'icon',
[
'label' => esc_html__('Enter The icons', 'thinkai'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-input',
'library' => 'solid',
],
'condition' => [
'layout_control' => ['1','2','3']
]
]
);
//Icon V2
$this->add_control(
'icon_v2',
[
'label' => esc_html__('Enter The icons', 'thinkai'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-radio-waves',
'library' => 'solid',
],
'condition' => [
'layout_control' => ['1']
]
]
);
//Counter Value
$this->add_control(
'counter_value',
[
'label' => __( 'Counter Value', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( '01', 'thinkai' ),
'condition' => [
'layout_control' => '4',
]
]
);
//Title
$this->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Title', 'thinkai' ),
'condition' => [
'layout_control' => ['2','4']
]
]
);
//Text
$this->add_control(
'text',
[
'label' => __( 'Description', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Desription', 'thinkai' ),
'condition' => [
'layout_control' => ['1','2','3','4']
]
]
);
//Contact Info Text
$this->add_control(
'contact_info_text',
[
'label' => __( 'Contact Info', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Contact Info', 'thinkai' ),
'condition' => [
'layout_control' => '3',
]
]
);
//Button Title
$this->add_control(
'btn_title',
[
'label' => __( 'Button Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Read More', 'thinkai' ),
'condition' => [
'layout_control' => ['1']
]
]
);
$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' => ['1','2','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' => ['1','2','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' => ['1','2','4'],
'link_option' => 'page',
]
]
);
$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'] == '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"' : '';
}
?>
<div class="services-and-applications__single-box text-center">
<div class="static-content">
<div class="number-box">
<span><?php echo wp_kses($settings['counter_value'], true);?></span>
</div>
<div class="title-box">
<h4><?php echo wp_kses($settings['title'], true);?></h4>
</div>
<div class="btn-box">
<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></a>
</div>
</div>
<div class="overlay-content">
<h4><?php echo wp_kses($settings['title'], true);?></h4>
<p><?php echo wp_kses($settings['text'], true);?></p>
<div class="btn-box">
<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></a>
</div>
</div>
</div>
<?php
elseif($settings['layout_control'] == '3') :
$icon = $settings['icon'];
?>
<!--Start Contact Info Style2 -->
<section class="contact-info-style2 p-0 m-0">
<div class="contact-info-style2__single text-center">
<div class="shape-1">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['bg_shape_image']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<div class="shape-2">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['bg_shape_image_v2']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<?php if($icon){ ?>
<div class="icon-box">
<?php
$icon = str_replace( "icon ", "", $settings['icon']);
if( !empty( $icon ) ):?>
<?php \Elementor\Icons_Manager::render_icon( $icon ); ?>
<?php else:?>
<span class="icon-headset"></span>
<?php endif;?>
</div>
<?php } ?>
<div class="text-box">
<p><?php echo wp_kses($settings['text'], true);?></p>
</div>
<div class="phone-number-box">
<h3><?php echo wp_kses($settings['contact_info_text'], true);?></h3>
</div>
</div>
</section>
<?php
elseif($settings['layout_control'] == '2') :
$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"' : '';
}
?>
<div class="features-style2__single text-center">
<div class="icon-box">
<?php if($settings['bg_shape_image']){ ?>
<div class="shape1 float-bob-y">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['bg_shape_image']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<?php } ?>
<?php if($icon){ ?>
<div class="inner">
<?php
$icon = str_replace( "icon ", "", $settings['icon']);
if( !empty( $icon ) ):?>
<?php \Elementor\Icons_Manager::render_icon( $icon ); ?>
<?php else:?>
<span class="icon-voice-detection"></span>
<?php endif;?>
</div>
<?php } ?>
</div>
<div class="content-box">
<h3><a href="<?php echo esc_url( $mount_link );?>" <?php if( $page == 'extranal' ) echo esc_attr( $target );?> <?php if( $page == 'extranal' ) echo esc_attr( $nofollow );?>><?php echo wp_kses($settings['title'], true);?></a></h3>
<p><?php echo wp_kses($settings['text'], true);?></p>
</div>
</div>
<?php
else:
$icon = $settings['icon'];
$icon_v2 = $settings['icon_v2'];
$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"' : '';
}
?>
<div class="about-style3__left-content">
<ul class="clearfix">
<li class="p-0 m-0">
<div class="bottom-content">
<div class="icon-box">
<?php if($icon){ ?>
<?php
$icon = str_replace( "icon ", "", $settings['icon']);
if( !empty( $icon ) ):?>
<?php \Elementor\Icons_Manager::render_icon( $icon ); ?>
<?php else:?>
<span class="icon-input"></span>
<?php endif;?>
<?php } ?>
<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 icon2"></span>
</a>
<?php if($icon_v2){ ?>
<?php
$icon_v2 = str_replace( "icon ", "", $settings['icon_v2']);
if( !empty( $icon_v2 ) ):?>
<?php \Elementor\Icons_Manager::render_icon( $icon_v2 ); ?>
<?php else:?>
<span class="icon-radio-waves"></span>
<?php endif;?>
<?php } ?>
</div>
<div class="text-box">
<p><?php echo wp_kses($settings['text'], true);?></p>
<?php if($settings['btn_title']){ ?>
<div class="btn-box">
<a href="<?php echo esc_url( $mount_link );?>" <?php if( $page == 'extranal' ) echo esc_attr( $target );?> <?php if( $page == 'extranal' ) echo esc_attr( $nofollow );?>><?php echo wp_kses($settings['btn_title'], true);?></a>
</div>
<?php } ?>
</div>
</div>
</li>
</ul>
</div>
<?php endif; ?>
<?php
}
}

View File

@@ -0,0 +1,147 @@
<?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_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 Insta_Gallery 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_insta_gallery';
}
/**
* 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 Insta Gallery', 'thinkai' );
}
/**
* Get widget icon.
* Retrieve button widget icon.
*
* @since 1.0.0
* @access public
* @return string Widget icon.
*/
public function get_icon() {
return 'eicon-image-hotspot';
}
/**
* 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' ];
}
/**
* 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(
'insta_gallery',
[
'label' => esc_html__( 'Insta Gallery', 'thinkai' ),
]
);
//Gallery Image
$repeater = new Repeater();
$repeater->add_control(
'gallery_image',
[
'label' => esc_html__( 'Choose Gallery Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
]
);
$this->add_control(
'gallery',
[
'label' => __('Add Gallery Images', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
]
);
$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');
?>
<!--Start Insta Post style1-->
<section class="insta-post-style1">
<div class="container">
<div class="row">
<?php foreach ($settings['gallery'] as $keys => $items){ ?>
<!--Start Single Insta Post style1-->
<div class="col-xl-2 col-lg-4 col-md-4">
<div class="insta-post-style1__single">
<div class="insta-post-style1__single-img">
<img src="<?php echo esc_url(wp_get_attachment_url($items['gallery_image']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
<div class="overlay-box">
<a href="<?php echo esc_url(wp_get_attachment_url($items['gallery_image']['id'])); ?>" class="lightbox-image" ><span class="icon-arrow-upper-right"></span></a>
</div>
</div>
</div>
</div>
<!--End Single Insta Post style1-->
<?php } ?>
</div>
</div>
</section>
<!--End Insta Post style1-->
<?php
}
}

View File

@@ -0,0 +1,528 @@
<?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 Marquee_Text 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_marquee_text';
}
/**
* 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 Marquee Text', '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' ];
}
/**
* 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(
'marquee_text',
[
'label' => esc_html__( 'Thinkai Marquee Text', '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'),
'5' => esc_html__( 'Style Five ', 'thinkai'),
),
]
);
//Title
$this->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'First Step', 'thinkai' ),
'condition' => [
'layout_control' => '4',
]
]
);
//Monthly Plan Table
$repeater = new Repeater();
$repeater->add_control(
'features_list',
[
'label' => __( 'Feature List', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Feature List', 'thinkai' ),
]
);
$this->add_control(
'list',
[
'label' => __('Add Marquee List', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'condition' => [
'layout_control' => ['1','2','3','5']
]
]
);
//Mailchimp Form Url
$this->add_control(
'mailchimp_form_url',
[
'label' => __( 'MailChimp Form Url', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter MailChimp Form Url', 'thinkai' ),
'condition' => [
'layout_control' => '5',
]
]
);
//Feature List V1
$this->add_control(
'features_list',
[
'label' => __( 'Feature List', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Feature List', 'thinkai' ),
'condition' => [
'layout_control' => '4'
]
]
);
//Marquee Text V2
$this->add_control(
'show_marquee_text_v2',
[
'label' => esc_html__( 'Enable Marque Text V2', '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' => '4',
]
]
);
//Pattern Image
$this->add_control(
'pattern_img_v1',
[
'label' => __( 'Pattern Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
'condition' => [
'show_marquee_text_v2' => 'yes',
'layout_control' => '4',
]
]
);
//Title
$this->add_control(
'title_v2',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Second Step', 'thinkai' ),
'condition' => [
'show_marquee_text_v2' => 'yes',
'layout_control' => '4',
]
]
);
//Feature List V2
$this->add_control(
'features_list_v2',
[
'label' => __( 'Feature List', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Feature List', 'thinkai' ),
'condition' => [
'show_marquee_text_v2' => 'yes',
'layout_control' => '4'
]
]
);
//Marquee Text V3
$this->add_control(
'show_marquee_text_v3',
[
'label' => esc_html__( 'Enable Marque Text V3', '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' => '4',
]
]
);
//Pattern Image
$this->add_control(
'pattern_img_v2',
[
'label' => __( 'Pattern Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
'condition' => [
'show_marquee_text_v3' => 'yes',
'layout_control' => '4',
]
]
);
//Title
$this->add_control(
'title_v3',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Third Step', 'thinkai' ),
'condition' => [
'show_marquee_text_v3' => 'yes',
'layout_control' => '4',
]
]
);
//Feature List V3
$this->add_control(
'features_list_v3',
[
'label' => __( 'Feature List', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Feature List', 'thinkai' ),
'condition' => [
'show_marquee_text_v2' => 'yes',
'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 == '5') : ?>
<!--Start Subscribe Style2-->
<section class="subscribe-style2">
<div class="scrolling-text-style1">
<div class="inner">
<ul class="clearfix marquee_mode">
<?php
foreach ($settings['list'] as $keys => $items){
$features_list = $items['features_list'];
if(!empty($features_list)){
$features_list = explode("\n", ($features_list));
?>
<li class="is-animetion">
<?php foreach($features_list as $features): ?>
<span><?php echo wp_kses($features, true); ?></span>
<?php endforeach; ?>
</li>
<?php } } ?>
</ul>
</div>
</div>
<?php if($settings['mailchimp_form_url']){ ?>
<div class="container">
<div class="subscribe-style2__form">
<div class="newsletter-style1__content">
<?php echo do_shortcode($settings['mailchimp_form_url']); ?>
</div>
</div>
</div>
<?php } ?>
</section>
<!--End Subscribe Style2-->
<?php elseif($layout == '4') : ?>
<!--Start Scrolling Text Style5 -->
<section class="scrolling-text-style5">
<?php if($settings['title']){ ?>
<div class="scrolling-text-style5__title">
<h6><?php echo wp_kses($settings['title'], true); ?></h6>
</div>
<?php } ?>
<?php
$features_list = $settings['features_list'];
if(!empty($features_list)){
$features_list = explode("\n", ($features_list));
?>
<div class="inner">
<ul class="clearfix marquee_mode">
<?php foreach($features_list as $features){ ?>
<li data-hover="<?php echo esc_attr($features); ?>">
<?php echo wp_kses($features, true); ?>
</li>
<?php } ?>
</ul>
</div>
<?php } ?>
<?php if($settings['show_marquee_text_v2'] == 'yes'){ ?>
<?php if($settings['pattern_img_v1']){ ?>
<div class="pattern-box">
<div class="pattern-box__bg" style="background-image: url(<?php echo esc_url(wp_get_attachment_url($settings['pattern_img_v1']['id'])); ?>);"></div>
</div>
<?php } ?>
<?php if($settings['title_v2']){ ?>
<div class="scrolling-text-style5__title scrolling-text-style5__title--style2">
<h6><?php echo wp_kses($settings['title_v2'], true); ?></h6>
</div>
<?php } ?>
<?php
$features_list = $settings['features_list_v2'];
if(!empty($features_list)){
$features_list = explode("\n", ($features_list));
?>
<div class="inner">
<ul class="clearfix marquee_mode-language">
<?php foreach($features_list as $features){ ?>
<li data-hover="<?php echo esc_attr($features); ?>">
<?php echo wp_kses($features, true); ?>
</li>
<?php } ?>
</ul>
</div>
<?php } ?>
<?php } ?>
<?php if($settings['show_marquee_text_v3'] == 'yes'){ ?>
<?php if($settings['pattern_img_v2']){ ?>
<div class="pattern-box">
<div class="pattern-box__bg pattern-box__bg--style2"
style="background-image: url(<?php echo esc_url(wp_get_attachment_url($settings['pattern_img_v2']['id'])); ?>);">
</div>
</div>
<?php } ?>
<?php if($settings['title_v3']){ ?>
<div class="scrolling-text-style5__title scrolling-text-style5__title--style2">
<h6><?php echo wp_kses($settings['title_v3'], true); ?></h6>
</div>
<?php } ?>
<?php
$features_list = $settings['features_list_v3'];
if(!empty($features_list)){
$features_list = explode("\n", ($features_list));
?>
<div class="inner">
<ul class="clearfix marquee_mode">
<?php foreach($features_list as $features){ ?>
<li data-hover="<?php echo esc_attr($features); ?>">
<?php echo wp_kses($features, true); ?>
</li>
<?php } ?>
</ul>
</div>
<?php } ?>
<?php } ?>
</section>
<!--End Scrolling Text Style5 -->
<?php elseif($layout == '3') : ?>
<!--Start Scrolling Text Style1-->
<section class="scrolling-text-style1 scrolling-text-style1--style3">
<div class="inner">
<ul class="clearfix marquee_mode">
<?php
foreach ($settings['list'] as $keys => $items){
$features_list = $items['features_list'];
if(!empty($features_list)){
$features_list = explode("\n", ($features_list));
?>
<li class="is-animetion is-animetion-style3">
<?php foreach($features_list as $features): ?>
<span><?php echo wp_kses($features, true); ?></span>
<?php endforeach; ?>
</li>
<?php } } ?>
</ul>
</div>
</section>
<!--End Scrolling Text Style1-->
<?php elseif($layout == '2') : ?>
<!--Start Scrolling Text Style1-->
<section class="scrolling-text-style1 scrolling-text-style1--style2">
<div class="inner">
<ul class="clearfix marquee_mode">
<?php
foreach ($settings['list'] as $keys => $items){
$features_list = $items['features_list'];
if(!empty($features_list)){
$features_list = explode("\n", ($features_list));
?>
<li class="is-animetion is-animetion-style2">
<?php foreach($features_list as $features): ?>
<span><?php echo wp_kses($features, true); ?></span>
<?php endforeach; ?>
</li>
<?php } } ?>
</ul>
</div>
</section>
<!--End Scrolling Text Style1-->
<?php else: ?>
<!--Start Scrolling Text Style1-->
<section class="scrolling-text-style1">
<div class="inner">
<ul class="clearfix marquee_mode">
<?php
foreach ($settings['list'] as $keys => $items){
$features_list = $items['features_list'];
if(!empty($features_list)){
$features_list = explode("\n", ($features_list));
?>
<li class="is-animetion">
<?php foreach($features_list as $features): ?>
<span><?php echo wp_kses($features, true); ?></span>
<?php endforeach; ?>
</li>
<?php } } ?>
</ul>
</div>
</section>
<!--End Scrolling Text Style1-->
<?php endif; ?>
<?php
}
}

View File

@@ -0,0 +1,265 @@
<?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 Newsletter 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_newsletter';
}
/**
* 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 Newsletter', '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' ];
}
/**
* 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(
'newsletter',
[
'label' => esc_html__( 'Thinkai Newsletter', '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'),
),
]
);
//features_list
$this->add_control(
'features_list',
[
'label' => __( 'Feature List', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Enter Feature List', 'thinkai' ),
]
);
//BG Image
$this->add_control(
'feature_image',
[
'label' => __( 'Feature Image Url', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
//Image Caption
$this->add_control(
'image_caption',
[
'label' => __( 'Image Caption', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( '1.5 Million Subscribers', 'thinkai' ),
]
);
//SubTitle
$this->add_control(
'subtitle',
[
'label' => __( 'Sub Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( '[ NEWSLETTER ]', 'thinkai' ),
]
);
//Title
$this->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Dont miss updates', 'thinkai' ),
]
);
//Text
$this->add_control(
'text',
[
'label' => __( 'Description', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Latest news, AI models & fun memes from the community.', 'thinkai' ),
]
);
//Mailchimp Form Url
$this->add_control(
'mailchimp_form_url',
[
'label' => __( 'MailChimp Form Url', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'MailChimp Form Url', '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');
$layout = $settings[ 'layout_control' ];
?>
<?php if($layout == '2') : ?>
<?php else: ?>
<!--Start Newsletter style1-->
<section class="newsletter-style1">
<?php $features_list = $settings['features_list'];
if(!empty($features_list)){
$features_list = explode("\n", ($features_list));
?>
<!--Start Scrolling Text Style4-->
<div class="scrolling-text-style4">
<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>
<!--End Scrolling Text Style4-->
<?php } ?>
<div class="newsletter-style1__bg"
style="background-image: url(<?php echo esc_url(wp_get_attachment_url($settings['feature_image']['id'])); ?>);">
<div class="text-box"><?php echo wp_kses($settings['image_caption'], true); ?></div>
</div>
<div class="container">
<div class="newsletter-style1__inner clearfix">
<div class="newsletter-style1__content">
<div class="title-box">
<div class="sec-title sec-title-animation animation-style2">
<div class="sub-title">
<h4><?php echo wp_kses($settings['subtitle'], true); ?></h4>
</div>
<h2 class="title-animation"><?php echo wp_kses($settings['title'], true); ?></h2>
</div>
<p><?php echo wp_kses($settings['text'], true); ?></p>
</div>
<?php echo do_shortcode($settings['mailchimp_form_url']); ?>
</div>
</div>
</div>
</section>
<!--End Newsletter style1-->
<?php endif; ?>
<?php
}
}

View File

@@ -0,0 +1,401 @@
<?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 Our_Cases 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_our_cases';
}
/**
* 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 Our Cases', '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' ];
}
/**
* 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(
'our_cases',
[
'label' => esc_html__( 'Thinkai Our Cases', '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'),
),
]
);
//Banner Carousel Repeater
$repeater = new Repeater();
$repeater->add_control(
'author_img',
[
'label' => __( 'Author Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
$repeater->add_control(
'author_subtitle',
[
'label' => __( 'Author Sub Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your subtitle', 'thinkai' ),
]
);
$repeater->add_control(
'author_title',
[
'label' => __( 'Author Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your author title', 'thinkai' ),
]
);
//Icon
$repeater->add_control(
'icon',
[
'label' => esc_html__('Enter The icons', 'thinkai'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-graduation',
'library' => 'solid',
],
]
);
$repeater->add_control(
'category_title',
[
'label' => __( 'Category Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your category title', 'thinkai' ),
]
);
$repeater->add_control(
'category_link',
[
'label' => __( 'Category 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,
],
]
);
//Button Title
$repeater->add_control(
'btn_title',
[
'label' => __( 'Button Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Read More', 'thinkai' ),
]
);
$repeater->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'),
),
]
);
$repeater->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' => [
'link_option' => 'extranal',
]
]
);
$repeater->add_control(
'page_select',
[
'label' => esc_html__( 'Select Page', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT2,
'default' => 'extranal',
'options' => thinkai_page_list(),
'condition' => [
'link_option' => 'page',
]
]
);
$repeater->add_control(
'feature_img',
[
'label' => __( 'Feature Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
//Title
$repeater->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Title', 'thinkai' ),
]
);
$this->add_control(
'cases',
[
'label' => __('Add Case Item', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '{{{ author_title }}}',
'default' => [
[
'author_subtitle' => esc_html__( 'Voice by', 'thinkai' ),
'author_title' => esc_html__( 'Evelyn Scarlett', 'thinkai' ),
'category_title' => esc_html__( 'Education', 'thinkai' ),
'category_link' => esc_html__( '#', 'thinkai' ),
'btn_title' => esc_html__( 'Read More', 'thinkai' ),
'btn_link' => esc_html__( '#', 'thinkai' ),
'title' => esc_html__( 'Create Education Content now Using ThinkAi', 'thinkai' ),
],
[
'author_subtitle' => esc_html__( 'Voice by', 'thinkai' ),
'author_title' => esc_html__( 'Richard Frederick', 'thinkai' ),
'category_title' => esc_html__( 'Youtube Videos', 'thinkai' ),
'category_link' => esc_html__( '#', 'thinkai' ),
'btn_title' => esc_html__( 'Read More', 'thinkai' ),
'btn_link' => esc_html__( '#', 'thinkai' ),
'title' => esc_html__( 'Simplify the Narration Process of your YouTube Videos', 'thinkai' ),
],
[
'author_subtitle' => esc_html__( 'Voice by', 'thinkai' ),
'author_title' => esc_html__( 'Rowan Grayson', 'thinkai' ),
'category_title' => esc_html__( 'Advertisement', 'thinkai' ),
'category_link' => esc_html__( '#', 'thinkai' ),
'btn_title' => esc_html__( 'Read More', 'thinkai' ),
'btn_link' => esc_html__( '#', 'thinkai' ),
'title' => esc_html__( 'Create Engaging & Persuasive Advertisements', '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'] == '3') :?>
<?php elseif($settings['layout_control'] == '2') :?>
<?php else: ?>
<!--Start Cases Style1 -->
<section class="cases-style1 p-0 m-0">
<div class="container">
<ul class="row">
<?php
foreach($settings['cases'] as $key => $items):
$icon = $items['icon'];
$page = $items['link_option'];
$page_select = $items[ 'page_select' ];
$ext_url = $items[ '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 Cases Style1 Single-->
<li class="col-xl-4 col-lg-4">
<div class="cases-style1__single">
<div class="cases-style1__single-inner">
<div class="cases-style1__single-top">
<div class="author-box">
<?php if($items['author_img']){ ?>
<div class="img-box">
<img src="<?php echo esc_url(wp_get_attachment_url($items['author_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<?php } ?>
<div class="text-box">
<p><?php echo wp_kses($items['author_subtitle'], true);?></p>
<h4><?php echo wp_kses($items['author_title'], true);?></h4>
</div>
</div>
<div class="category-box">
<div class="text">
<p>
<?php if($icon){ ?>
<?php
$icon = str_replace( "icon ", "", $items['icon']);
if( !empty( $icon ) ):?>
<?php \Elementor\Icons_Manager::render_icon( $icon ); ?>
<?php else:?>
<span class="icon-graduation"></span>
<?php endif; }?>
<a href="<?php echo esc_url($items['category_link']['url']);?>"><?php echo wp_kses($items['category_title'], true);?></a>
</p>
</div>
<?php ?>
<?php if($items['btn_title']){ ?>
<div class="btn-box">
<a href="<?php echo esc_url( $mount_link );?>" <?php if( $page == 'extranal' ) echo esc_attr( $target );?> <?php if( $page == 'extranal' ) echo esc_attr( $nofollow );?>>
<i class="icon-arrow-upper-right"></i>
<span class="txt"><?php echo wp_kses($items['btn_title'], true);?></span>
</a>
</div>
<?php } ?>
</div>
</div>
<div class="cases-style1__single-img">
<img src="<?php echo esc_url(wp_get_attachment_url($items['feature_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<div class="cases-style1__single-title">
<h2>
<a href="<?php echo esc_url( $mount_link );?>" <?php if( $page == 'extranal' ) echo esc_attr( $target );?> <?php if( $page == 'extranal' ) echo esc_attr( $nofollow );?>><?php echo wp_kses($items['title'], true);?></a>
</h2>
</div>
</div>
</div>
</li>
<!--End Cases Style1 Single-->
<?php endforeach; ?>
</ul>
</div>
</section>
<!--End Cases Style1 -->
<?php endif; ?>
<?php
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,223 @@
<?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 Project_Card 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_project_card';
}
/**
* 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 Project Card', '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' ];
}
/**
* 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(
'project_card',
[
'label' => esc_html__( 'Thinkai Project Card', 'thinkai' ),
]
);
//BG Image
$this->add_control(
'feature_image',
[
'label' => __( 'Feature Image Url', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
//Title
$this->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Image Generator', 'thinkai' ),
]
);
//Text
$this->add_control(
'text',
[
'label' => __( 'Description', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Convert text to image.', 'thinkai' ),
]
);
//External Link
$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'),
),
]
);
$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' => [
'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' => [
'link_option' => 'page'
]
]
);
$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');
$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"' : '';
}
?>
<div class="cases-style3__single">
<div class="cases-style3__single-img">
<div class="inner">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['feature_image']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
<div class="overlay-text-box">
<p>
<?php echo wp_kses($settings['text'], true); ?>
</p>
</div>
</div>
<div class="overlay-box">
<div class="title-box">
<h3><?php echo wp_kses($settings['title'], true); ?></h3>
</div>
<div class="btn-box">
<a class="lightbox-image" data-fancybox="gallery" href="<?php echo esc_url(wp_get_attachment_url($settings['feature_image']['id'])); ?>">
<span class="icon-right-arrow1"></span>
</a>
</div>
</div>
</div>
</div>
<?php
}
}

View File

@@ -0,0 +1,369 @@
<?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 Project_Masonry 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_project_masonry';
}
/**
* 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 Project Masonry', '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' ];
}
/**
* 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(
'project_masonry',
[
'label' => esc_html__( 'Thinkai Project Masonry', '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'),
),
]
);
//Shape Image
$this->add_control(
'shape_image',
[
'label' => esc_html__( 'BG Shape Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
'condition' => [
'layout_control' => '2',
]
]
);
$this->add_control(
'subtitle',
[
'label' => __( 'Sub Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( '[ CASE STUDIES ]', 'thinkai' ),
'condition' => [
'layout_control' => '2',
]
]
);
$this->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Explore latest cases', 'thinkai' ),
'condition' => [
'layout_control' => '2',
]
]
);
$this->add_control(
'query_number',
[
'label' => esc_html__( 'Number of post', 'thinkai' ),
'type' => Controls_Manager::NUMBER,
'default' => 3,
'min' => 1,
'max' => 100,
'step' => 1,
]
);
$this->add_control(
'query_orderby',
[
'label' => esc_html__( 'Order By', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'date',
'options' => array(
'date' => esc_html__( 'Date', 'thinkai' ),
'title' => esc_html__( 'Title', 'thinkai' ),
'menu_order' => esc_html__( 'Menu Order', 'thinkai' ),
'rand' => esc_html__( 'Random', 'thinkai' ),
),
]
);
$this->add_control(
'query_order',
[
'label' => esc_html__( 'Order', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'DESC',
'options' => array(
'DESC' => esc_html__( 'DESC', 'thinkai' ),
'ASC' => esc_html__( 'ASC', 'thinkai' ),
),
]
);
$this->add_control(
'query_category',
[
'type' => Controls_Manager::SELECT,
'label' => esc_html__('Category', 'thinkai'),
'label_block' => true,
'options' => get_project_categories()
]
);
$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' ];
$paged = get_query_var('paged');
$paged = thinkai_set($_REQUEST, 'paged') ? esc_attr($_REQUEST['paged']) : $paged;
$this->add_render_attribute( 'wrapper', 'class', 'templatepath-thinkai' );
$args = array(
'post_type' => 'project',
'posts_per_page' => thinkai_set( $settings, 'query_number' ),
'orderby' => thinkai_set( $settings, 'query_orderby' ),
'order' => thinkai_set( $settings, 'query_order' ),
'paged' => $paged
);
if( thinkai_set( $settings, 'query_category' ) ) $args['project_cat'] = thinkai_set( $settings, 'query_category' );
$query = new \WP_Query( $args );
if ( $query->have_posts() ) {
$dimention = get_post_meta( get_the_id(), 'dimension', true );
?>
<?php if( $layout === '2' ): ?>
<!--Start Case style2-->
<section class="case-style2">
<?php if($settings['shape_image']){ ?>
<div class="case-style2__shape1">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['shape_image']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<?php } ?>
<div class="container">
<?php if($settings['subtitle'] || $settings['title']){ ?>
<div class="sec-title text-center 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="row masonary-layout">
<?php
global $post;
while ( $query->have_posts() ) : $query->the_post();
$term_list = wp_get_post_terms(get_the_id(), 'project_cat', array("fields" => "names"));
$post_thumbnail_id = get_post_thumbnail_id($post->ID);
$post_thumbnail_url = wp_get_attachment_url($post_thumbnail_id);
?>
<!--Start Single Case style2-->
<div class="col-xl-4 col-lg-6 col-md-6">
<div class="case-style2__single <?php if(get_post_meta( get_the_id(), 'dimension', true) == 'extra_height') echo 'height'; else echo ' '?>">
<div class="case-style2__single-img">
<div class="inner">
<?php
$dimention = get_post_meta( get_the_id(), 'dimension', true );
if($dimention == 'extra_height'){
$image_size = 'thinkai_370x370';
} else{
$image_size = 'thinkai_370x270';
} the_post_thumbnail($image_size);
?>
</div>
<div class="case-style2__single-overlay-icon">
<a class="lightbox-image" data-fancybox="gallery" href="<?php echo esc_url($post_thumbnail_url); ?>"><span class="icon-right-arrow1"></span></a>
</div>
</div>
<div class="case-style2__single-content text-center">
<h3><?php the_title(); ?></h3>
<p><?php echo implode( ', ', (array)$term_list );?></p>
</div>
</div>
</div>
<!--End Single Case style2-->
<?php endwhile; ?>
</div>
</div>
</section>
<!--End Case style2-->
<?php else: ?>
<!--Start Project Style1-->
<section class="project-style1 p-0 m-0">
<div class="auto-container">
<div class="project-style1__inner ">
<ul class="clearfix masonry-items-container">
<?php
global $post;
while ( $query->have_posts() ) : $query->the_post();
$term_list = wp_get_post_terms(get_the_id(), 'project_cat', array("fields" => "names"));
$post_thumbnail_id = get_post_thumbnail_id($post->ID);
$post_thumbnail_url = wp_get_attachment_url($post_thumbnail_id);
$ext_link = get_post_meta( get_the_id(), 'project_ext_link', true);
?>
<li class="masonry-item <?php if(get_post_meta( get_the_id(), 'dimension', true) == 'extra_width') echo 'gallery-item width40'; elseif(get_post_meta( get_the_id(), 'dimension', true) == 'extra_height') echo 'gallery-item extra-height'; else echo 'gallery-item'?>">
<div class="project-style1__single">
<div class="project-style1__single-img">
<div class="inner">
<?php
$dimention = get_post_meta( get_the_id(), 'dimension', true );
if($dimention == 'extra_width'){
$image_size = 'thinkai_730x295';
} elseif($dimention == 'extra_height'){
$image_size = 'thinkai_350x620';
} elseif($dimention == 'normal_height'){
$image_size = 'thinkai_350x295';
} else{
$image_size = 'full';
} the_post_thumbnail( $image_size );
?>
<div class="overlay-img">
<?php
$dimention = get_post_meta( get_the_id(), 'dimension', true );
if($dimention == 'extra_width'){
$image_size = 'thinkai_730x295';
} elseif($dimention == 'extra_height'){
$image_size = 'thinkai_350x620';
} elseif($dimention == 'normal_height'){
$image_size = 'thinkai_350x295';
} else{
$image_size = 'full';
} the_post_thumbnail( $image_size );
?>
</div>
<div class="overlay-box">
<a class="lightbox-image" data-fancybox="gallery" href="<?php echo esc_url($post_thumbnail_url); ?>">
<span class="icon-right-arrow1"></span>
</a>
</div>
<div class="text-box">
<div class="icon-box">
<span class="icon-abstract-shape-1"></span>
</div>
<p><?php echo wp_kses( get_post_meta( get_the_id(), 'project_designation', true), true); ?></p>
</div>
</div>
</div>
<div class="project-style1__single-content">
<h3><a href="<?php echo esc_url( $ext_link ); ?>"><?php the_title(); ?></a></h3>
<p><?php echo implode( ', ', (array)$term_list );?></p>
</div>
</div>
</li>
<?php endwhile; ?>
</ul>
</div>
</div>
</section>
<!--Start Project Style1-->
<?php endif; ?>
<?php }
wp_reset_postdata();
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,265 @@
<?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_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 Team_Grid 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_team_grid';
}
/**
* 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 Team Grid', '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' ];
}
/**
* 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(
'team_grid',
[
'label' => esc_html__( 'Thinkai Team Grid', 'thinkai' ),
]
);
$this->add_control(
'col_grid',
[
'label' => esc_html__( 'Choose Column', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'default',
'options' => array(
'default' => esc_html__( 'Default', 'thinkai' ),
'one' => esc_html__( 'One Column Grid ', 'thinkai'),
'two' => esc_html__( 'Two Column Grid', 'thinkai' ),
'three' => esc_html__( 'Three Column Grid', 'thinkai' ),
'four' => esc_html__( 'Four Column Grid', 'thinkai' ),
'five' => esc_html__( 'Six Column Grid', 'thinkai' ),
),
]
);
$this->add_control(
'query_number',
[
'label' => esc_html__( 'Number of post', 'thinkai' ),
'type' => Controls_Manager::NUMBER,
'default' => 5,
'min' => 1,
'max' => 100,
'step' => 1,
]
);
$this->add_control(
'query_orderby',
[
'label' => esc_html__( 'Order By', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'date',
'options' => array(
'date' => esc_html__( 'Date', 'thinkai' ),
'title' => esc_html__( 'Title', 'thinkai' ),
'menu_order' => esc_html__( 'Menu Order', 'thinkai' ),
'rand' => esc_html__( 'Random', 'thinkai' ),
),
]
);
$this->add_control(
'query_order',
[
'label' => esc_html__( 'Order', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'ASC',
'options' => array(
'DESC' => esc_html__( 'DESC', 'thinkai' ),
'ASC' => esc_html__( 'ASC', 'thinkai' ),
),
]
);
$this->add_control(
'query_category',
[
'type' => Controls_Manager::SELECT2,
'label' => esc_html__('Category', 'thinkai'),
'multiple' => true,
'label_block' => true,
'options' => get_team_categories()
]
);
//Button Title
$this->add_control(
'btn_title',
[
'label' => esc_html__( 'Button Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'placeholder' => esc_html__( 'Enter button title', 'thinkai' ),
'default' => esc_html__( 'Read More', 'financer' ),
]
);
$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');
$btn_title = $settings[ 'btn_title' ];
$grid_col = $settings[ 'col_grid' ];
if( $grid_col == 'one' ){
$classes = 'col-xl-12 col-lg-12 col-md-12 col-sm-12';
}elseif( $grid_col == 'two' ){
$classes = 'col-xl-6 col-lg-6 col-md-6 col-sm-12';
}elseif( $grid_col == 'three' ){
$classes = 'col-xl-4 col-lg-4 col-md-6 col-sm-12';
}elseif( $grid_col == 'four' ){
$classes = 'col-xl-3 col-lg-3 col-md-6 col-sm-12';
}elseif( $grid_col == 'five' ){
$classes = 'col-xl-2 col-lg-2 col-md-6 col-sm-12';
}else{
$classes = 'col-xl-4 col-lg-4 col-md-6 col-sm-12';
}
$paged = get_query_var('paged');
$paged = thinkai_set($_REQUEST, 'paged') ? esc_attr($_REQUEST['paged']) : $paged;
$this->add_render_attribute( 'wrapper', 'class', 'templatepath-greenture' );
$args = array(
'post_type' => 'team',
'posts_per_page' => thinkai_set( $settings, 'query_number' ),
'orderby' => thinkai_set( $settings, 'query_orderby' ),
'order' => thinkai_set( $settings, 'query_order' ),
'paged' => $paged
);
if( thinkai_set( $settings, 'query_category' ) ) $args['team_cat'] = thinkai_set( $settings, 'query_category' );
$query = new \WP_Query( $args );
if ( $query->have_posts() )
{ ?>
<!--Start Team Style1 -->
<div class="team-style1 p-0 m-0">
<div class="row">
<?php
while ( $query->have_posts() ) : $query->the_post();
$team_overlay_image = get_post_meta(get_the_id(), 'team_overlay_image', true);
?>
<!--Start Team Style1 Single-->
<div class="<?php echo esc_attr( $classes );?>">
<div class="team-style1__single">
<div class="team-style1__single-img">
<div class="inner">
<?php if( !empty( $team_overlay_image['id']) ){ ?>
<img src="<?php echo (wp_get_attachment_url($team_overlay_image['id']));?>" alt="<?php bloginfo( 'name' ); ?>">
<?php } ?>
<?php the_post_thumbnail('thinkai_370x420'); ?>
<div class="overlay-content">
<h2><a href="<?php echo esc_url( get_the_permalink( get_the_id() ) );?>"><?php the_title(); ?></a></h2>
</div>
<div class="text-box">
<p><?php echo (get_post_meta( get_the_id(), 'designation', true ));?></p>
<div class="btn-box">
<a href="<?php echo esc_url( get_the_permalink( get_the_id() ) );?>"><span class="icon-right-arrow1"></span>
<?php if( !empty( $btn_title ) ):?>
<?php echo wp_kses( $btn_title, true );?>
<?php else:?>
<?php esc_html_e('Read more', 'banqix');?>
<?php endif;?>
</a>
</div>
</div>
<?php
$icons = get_post_meta(get_the_id(), 'social_media_tabs', true); if ($icons) :
?>
<div class="social-links">
<?php
for ( $i=0; $i < count( $icons['select_social_media'] ); $i++ ) {
$social_icon = ( isset( $icons['select_social_media'][$i] ) && !empty( $icons['select_social_media'][$i] ) ) ? $icons['select_social_media'][$i] : '';
$social_link = ( isset( $icons['link_social_media'][$i] ) && !empty( $icons['link_social_media'][$i] ) ) ? $icons['link_social_media'][$i] : '';
?>
<a class="fb" href="<?php echo esc_url($social_link); ?>"><span class="fa-brands fab <?php echo esc_attr(str_replace("fa ", " ", $social_icon)); ?>"></span></a>
<?php } ?>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
<!--End Team Style1 Single-->
<?php endwhile; ?>
</div>
</div>
<!--End Team Style1 -->
<?php }
wp_reset_postdata();
}
}

View File

@@ -0,0 +1,624 @@
<?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 Testimonial_Carousel 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_testimonial_carousel';
}
/**
* 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 Testimonial Carousel', 'thinkai');
}
/**
* Get widget icon.
* Retrieve button widget icon.
*
* @since 1.0.0
* @access public
* @return string Widget icon.
*/
public function get_icon()
{
return 'eicon-testimonial-carousel';
}
/**
* 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( 'testimonial-script', YT_URL . 'assets/js/feature-carousel.js', [ 'elementor-frontend' ], '1.0.0', true );
return [ 'testimonial-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(
'testimonials_carousel',
[
'label' => esc_html__('Thinkai Testimonials Carousel', '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'),
'3' => esc_html__( 'Style Three ', 'thinkai'),
'4' => esc_html__( 'Style Four ', 'thinkai'),
),
]
);
$this->add_control(
'total_ratting',
[
'label' => __( 'Total Ratting', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( '4.9/5.0', 'thinkai' ),
'condition' => [
'layout_control' => '1'
]
]
);
$this->add_control(
'ratting_description',
[
'label' => __( 'Ratting Description', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( '(from 20k reviews)', 'thinkai' ),
'condition' => [
'layout_control' => '1'
]
]
);
$this->add_control(
'text_limit',
[
'label' => esc_html__('Text Limit', 'thinkai'),
'type' => Controls_Manager::NUMBER,
'default' => 3,
'min' => 1,
'max' => 100,
'step' => 1,
]
);
$this->add_control(
'query_number',
[
'label' => esc_html__('Number of post', 'thinkai'),
'type' => Controls_Manager::NUMBER,
'default' => 3,
'min' => 1,
'max' => 100,
'step' => 1,
]
);
$this->add_control(
'query_orderby',
[
'label' => esc_html__('Order By', 'thinkai'),
'type' => Controls_Manager::SELECT,
'default' => 'date',
'options' => array(
'date' => esc_html__('Date', 'thinkai'),
'title' => esc_html__('Title', 'thinkai'),
'menu_order' => esc_html__('Menu Order', 'thinkai'),
'rand' => esc_html__('Random', 'thinkai'),
),
]
);
$this->add_control(
'query_order',
[
'label' => esc_html__('Order', 'thinkai'),
'label_block' => true,
'type' => Controls_Manager::SELECT,
'default' => 'DESC',
'options' => array(
'DESC' => esc_html__('DESC', 'thinkai'),
'ASC' => esc_html__('ASC', 'thinkai'),
),
]
);
$this->add_control(
'query_category',
[
'type' => Controls_Manager::SELECT2,
'label' => esc_html__('Category', 'thinkai'),
'label_block' => true,
'multiple' => true,
'options' => get_testimonials_categories()
]
);
$this->end_controls_section();
//Next Prev Color Style
$this->start_controls_section(
'next_prev_color_style',
[
'label' => esc_html__( 'Next Prev Settings', 'thinkai' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'next_prev_color',
[
'label' => esc_html__( 'Text Color', 'thinkai' ),
'type' => Controls_Manager::COLOR,
'selectors' => [
'{{WRAPPER}} .testimonial-style3__items-nav .swiper-button-next' => 'color: {{VALUE}} !important;',
'{{WRAPPER}} .testimonial-style3__items-nav .swiper-button-prev' => 'color: {{VALUE}} !important;',
],
]
);
$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'];
$paged = thinkai_set($_POST, 'paged') ? esc_attr($_POST['paged']) : 1;
$this->add_render_attribute('wrapper', 'class', 'templatepath-thinkai');
$args = array(
'post_type' => 'testimonials',
'posts_per_page' => thinkai_set($settings, 'query_number'),
'orderby' => thinkai_set($settings, 'query_orderby'),
'order' => thinkai_set($settings, 'query_order'),
'paged' => $paged
);
if (thinkai_set($settings, 'query_category')) {$args['testimonials_cat'] = thinkai_set($settings, 'query_category');
}$query = new \WP_Query($args);
if ($query->have_posts()) {
?>
<?php if($layout == '4') :?>
<!--Start Testimonial Style5-->
<section class="testimonial-style5 p-0 m-0">
<div class="container">
<div class="row">
<div class="col-xl-12">
<div class="testimonial-style5__inner">
<div class="owl-carousel owl-theme thm-owl__carousel testimonial-style5-carousel owl-nav-style-one"
data-owl-options='{
"loop": true,
"autoplay": false,
"margin": 30,
"nav": true,
"dots": false,
"smartSpeed": 500,
"autoplayTimeout": 10000,
"navText": ["<span class=\"left icon-left-arrow\"></span>","<span class=\"right icon-right-arrow\"></span>"],
"responsive": {
"0": {
"items": 1
},
"768": {
"items": 1
},
"992": {
"items": 2
},
"1200": {
"items": 3
}
}
}'>
<?php while ($query->have_posts()) : $query->the_post(); ?>
<!--Start Single Testimonial Style5-->
<div class="testimonial-style5__single">
<div class="overlay-icon">
<span class="icon-straight-quotes"></span>
</div>
<div class="review-box">
<ul>
<?php
$ratting = get_post_meta( get_the_id(), 'testimonial_rating', true );
for ($x = 1; $x <= 5; $x++) {
if($x <= $ratting) echo '<li><span class="fa fa-star"></span></li>'; else echo '<li><span class="fa fa-star-half-alt"></span></li>';
}
?>
</ul>
</div>
<div class="testimonial-style5__single-title">
<h3><a href="<?php echo (get_post_meta(get_the_id(), 'te_ext_link', true)); ?>"><?php the_title(); ?></a></h3>
</div>
<div class="testimonial-style5__single-video">
<a class="video-popup" title="Video Gallery"
href="<?php echo (get_post_meta(get_the_id(), 'te_video_url', true)); ?>">
<span class="icon-play-button-arrowhead"></span>
<?php echo (get_post_meta(get_the_id(), 'te_video_title', true)); ?>
</a>
</div>
<div class="testimonial-style5__single-author-info">
<?php if(has_post_thumbnail()){ ?>
<div class="img-box">
<?php the_post_thumbnail('thinkai_70x70'); ?>
</div>
<?php } ?>
<div class="title-box">
<h3><?php echo(get_post_meta(get_the_id(), 'author_name', true)); ?></h3>
<p><?php echo(get_post_meta(get_the_id(), 'author_designation', true)); ?></p>
</div>
</div>
</div>
<!--End Single Testimonial Style5-->
<?php endwhile; ?>
</div>
</div>
</div>
</div>
</div>
</section>
<!--End Testimonial Style5-->
<?php elseif($layout == '3') :?>
<!--Start Testimonial Style3-->
<section class="testimonial-style3 p-0 m-0">
<div class="container">
<div class="testimonial-style3__inner">
<div class="thm-swiper__slider swiper-container" data-swiper-options='{
"spaceBetween": 0,
"speed": 1500,
"slidesPerView": 1,
"loop": true,
"pagination": {
"el": "#testimonial-style3__items-nav",
"type": "bullets",
"clickable": true
},
"navigation": {
"nextEl": "#testimonial-style3__items-nav__prev",
"prevEl": "#testimonial-style3__items-nav__next"
},
"autoplay": { "delay": 5000 },
"breakpoints": {
"0": {
"spaceBetween": 0,
"slidesPerView": 1
},
"375": {
"spaceBetween": 0,
"slidesPerView": 1
},
"575": {
"spaceBetween": 0,
"slidesPerView": 1
},
"768": {
"spaceBetween": 0,
"slidesPerView": 1
},
"992": {
"spaceBetween": 0,
"slidesPerView": 1
},
"1200": {
"spaceBetween": 0,
"slidesPerView": 1
}
}
}'>
<div class="swiper-wrapper">
<?php while ($query->have_posts()) : $query->the_post(); ?>
<!--Start Testimonial Style3 Single-->
<div class="swiper-slide">
<div class="testimonial-style3__single">
<div class="testimonial-style3__single-content-box text-center">
<div class="title">
<div class="icon-box">
<img src="<?php echo esc_url(get_template_directory_uri()); ?>/assets/images/icon/tastimonial-style-3__icon-happy.png" alt="<?php bloginfo( 'name' ); ?>">
</div>
<h3><?php the_title(); ?></h3>
</div>
<div class="rating-box">
<ul>
<?php
$ratting = get_post_meta( get_the_id(), 'testimonial_rating', true );
for ($x = 1; $x <= 5; $x++) {
if($x <= $ratting) echo '<li><span class="fa fa-star"></span></li>'; else echo '<li><span class="fa fa-star-half-alt"></span></li>';
}
?>
</ul>
</div>
<div class="text">
<p><?php echo wp_kses(wp_trim_words(get_the_content(), $settings['text_limit']), true); ?></p>
</div>
</div>
<div class="customer-info">
<div class="img-box">
<?php the_post_thumbnail('thinkai_70x70'); ?>
</div>
<div class="title-box">
<h3><?php echo(get_post_meta(get_the_id(), 'author_name', true)); ?></h3>
<span><?php echo(get_post_meta(get_the_id(), 'author_designation', true)); ?></span>
</div>
</div>
</div>
</div>
<!--End Testimonial Style3 Single-->
<?php endwhile; ?>
</div>
</div>
<!--End Testimonial Style3 Items -->
<div class="testimonial-style3__items-nav">
<div class="swiper-button-prev" id="testimonial-style3__items-nav__prev">
<i class="icon-left-arrow1 left"></i> <?php esc_html_e('Prev','thinkai'); ?>
</div>
<div class="swiper-button-next" id="testimonial-style3__items-nav__next">
<?php esc_html_e('Next','thinkai'); ?> <i class="icon-right-arrow1 right"></i>
</div>
</div>
</div>
</div>
</section>
<!--End Testimonial Style3-->
<?php elseif($layout == '2') :?>
<!--Start Testimonials Style2 -->
<section class="testimonials-style2 p-0 m-0">
<div class="testimonials-style2__inner">
<div class="owl-carousel owl-theme thm-owl__carousel testimonials-style2__carousel"
data-owl-options='{
"loop": true,
"autoplay": false,
"margin": 30,
"nav": false,
"dots": false,
"smartSpeed": 500,
"autoplayTimeout": 10000,
"navText": ["<span class=\"left icon-right-arrow-4\"></span>","<span class=\"right icon-right-arrow-4\"></span>"],
"responsive": {
"0": {
"items": 1
},
"768": {
"items": 1
},
"992": {
"items": 2
},
"1200": {
"items": 3
}
}
}'>
<?php while ($query->have_posts()) : $query->the_post(); ?>
<!--Start Testimonials Style2 Single-->
<div class="testimonials-style2__single">
<div class="icon-box">
<span class="icon-quote"></span>
</div>
<div class="title-box">
<h3><?php the_title(); ?></h3>
<p><?php echo(get_post_meta(get_the_id(), 'author_designation', true)); ?></p>
</div>
<div class="text-box">
<p><?php echo wp_kses(wp_trim_words(get_the_content(), $settings['text_limit']), true); ?></p>
</div>
<div class="review-box">
<ul>
<?php
$ratting = get_post_meta( get_the_id(), 'testimonial_rating', true );
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>
<div class="author-info-box">
<div class="img-box">
<?php the_post_thumbnail('thinkai_70x70'); ?>
</div>
<div class="date-box">
<h4><?php echo(get_post_meta(get_the_id(), 'review_title', true)); ?></h4>
<p><?php echo(get_post_meta(get_the_id(), 'review_time', true)); ?></p>
</div>
</div>
</div>
<!--End Testimonials Style2 Single-->
<?php endwhile; ?>
</div>
</div>
</section>
<!--End Testimonials Style2 -->
<?php else: ?>
<!--Start Testimonial Style1-->
<section class="testimonial-style1 p-0 m-0">
<div class="container">
<div class="testimonial-style1__inner">
<div class="testimonial-style1__middle-content">
<div class="icon">
<div class="clearfix bshadow0 pbs">
<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>
<div class="review-box">
<ul>
<li>
<i class="icon-rate-star-button"></i>
</li>
<li>
<i class="icon-rate-star-button"></i>
</li>
<li>
<i class="icon-rate-star-button"></i>
</li>
<li>
<i class="icon-rate-star-button"></i>
</li>
<li>
<i class="icon-rate-star-button"></i>
</li>
</ul>
</div>
<div class="text-box">
<h3><?php echo wp_kses($settings['total_ratting'], true); ?></h3>
<p><?php echo wp_kses($settings['ratting_description'], true); ?></p>
</div>
</div>
<div class="owl-carousel owl-theme thm-owl__carousel testimonial-style1__carousel" data-owl-options='{
"loop": true,
"autoplay": false,
"margin": 430,
"nav": false,
"dots": false,
"smartSpeed": 500,
"autoplayTimeout": 10000,
"navText": ["<span class=\"left icon-right-arrow-4\"></span>","<span class=\"right icon-right-arrow-4\"></span>"],
"responsive": {
"0": {
"items": 1
},
"768": {
"items": 1
},
"992": {
"items": 2
},
"1200": {
"items": 2
}
}
}'>
<?php while ($query->have_posts()) : $query->the_post(); ?>
<!--Start Testimonial Style1 Single-->
<div class="testimonial-style1__single">
<div class="icon-box">
<span class="icon-quote-1"></span>
</div>
<div class="text">
<p><?php echo wp_kses(wp_trim_words(get_the_content(), $settings['text_limit']), true); ?></p>
</div>
<div class="author-info">
<h2><?php the_title(); ?></h2>
<p><?php echo(get_post_meta(get_the_id(), 'author_designation', true)); ?></p>
</div>
<div class="testimonial-style1__single-bottom">
<div class="img-box">
<?php the_post_thumbnail('thinkai_70x70'); ?>
</div>
<div class="date-box">
<h4><?php echo(get_post_meta(get_the_id(), 'review_title', true)); ?></h4>
<p><?php echo(get_post_meta(get_the_id(), 'review_time', true)); ?></p>
</div>
</div>
</div>
<!--End Testimonial Style1 Single-->
<?php endwhile; ?>
</div>
</div>
</div>
</section>
<!--End Testimonial Style1-->
<?php endif; ?>
<?php }
wp_reset_postdata();
}
}

View File

@@ -0,0 +1,294 @@
<?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 Testimonial_Review 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_testimonial_review';
}
/**
* 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 Testimonial Review', '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' ];
}
/**
* 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(
'testimonial_review',
[
'label' => esc_html__( 'Thinkai Testimonial Review', 'thinkai' ),
]
);
//Layout Control
$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__( 'Review Slide Left ', 'thinkai'),
'2' => esc_html__( 'Review Slide Right ', 'thinkai'),
),
]
);
//Repeater
$repeater = new Repeater();
$repeater->add_control(
'transparent_title',
[
'label' => __( 'BG Transparent Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your BG Title', 'thinkai' ),
]
);
//Author Image
$repeater->add_control(
'author_image',
[
'label' => __( 'Author Image Url', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
//Title
$repeater->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Title', 'thinkai' ),
]
);
//Designation
$repeater->add_control(
'designation',
[
'label' => __( 'Designation', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Designation', 'thinkai' ),
]
);
//Video Link Option
$repeater->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' ),
),
]
);
$repeater->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' => [
'video_option' => 'src_url'
],
]
);
$repeater->add_control(
'video_source_image',
[
'label' => __( 'Video Source Media', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'media_types' => ['video'],
'condition' => [
'video_option' => 'src_media'
],
]
);
$this->add_control(
'review',
[
'label' => __('Add Review Item', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '{{{ title }}}',
'default' => [
[
'transparent_title' => esc_html__( 'Review', 'thinkai' ),
'title' => esc_html__( 'Boris Elbert', 'thinkai' ),
'designation' => esc_html__( 'Manager, Ovalism Studio', 'thinkai' ),
'video_link' => esc_html__( 'https://www.youtube.com/watch?v=oV74Najm6Nc', 'thinkai' ),
],
[
'transparent_title' => esc_html__( 'Review', 'thinkai' ),
'title' => esc_html__( 'Boris Elbert', 'thinkai' ),
'designation' => esc_html__( 'Manager, Ovalism Studio', 'thinkai' ),
'video_link' => esc_html__( 'https://www.youtube.com/watch?v=oV74Najm6Nc', 'thinkai' ),
],
[
'transparent_title' => esc_html__( 'Review', 'thinkai' ),
'title' => esc_html__( 'Boris Elbert', 'thinkai' ),
'designation' => esc_html__( 'Manager, Ovalism Studio', 'thinkai' ),
'video_link' => esc_html__( 'https://www.youtube.com/watch?v=oV74Najm6Nc', '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');
$layout = $settings[ 'layout_control' ];
?>
<!--Start Testimonials Style4-->
<section class="testimonials-style4 p-0 m-0">
<div class="testimonials-style4__inner <?php if($settings[ 'layout_control' ] == '2') echo 'style2'; ?>">
<ul class="clearfix <?php if($settings[ 'layout_control' ] == '2') echo 'marquee_mode-language'; else echo 'marquee_mode'; ?>">
<?php
foreach ($settings['review'] as $keys => $items){
$video_option = $items[ 'video_option' ];
if( $video_option == 'src_url' ){
$video = $items[ 'video_link' ][ 'url' ];
}elseif( $video_option == 'src_media' ){
$video = $items[ 'video_source_image' ]['url'];
}else{
$video = esc_html__( 'There is no Video', 'thinkai' );
}
?>
<li>
<div class="testimonials-style4__single">
<?php if($items['transparent_title']){ ?>
<div class="big-title">
<h2 data-hover="<?php echo esc_attr($items['transparent_title']); ?>"><?php echo wp_kses($items['transparent_title'], true); ?></h2>
</div>
<?php } ?>
<div class="testimonials-style4__single-img">
<?php if($items['author_image']){ ?>
<div class="inner">
<img src="<?php echo esc_url(wp_get_attachment_url($items['author_image']['id'])); ?>" alt="<?php esc_attr_e('Awesome Image','thinkai'); ?>">
</div>
<?php } ?>
<?php if($video){ ?>
<div class="testimonials-style4__video">
<a class="video-popup" title="Video Gallery" href="<?php echo esc_url( $video );?>">
<span class="icon-play-button-arrowhead"></span>
</a>
</div>
<?php } ?>
</div>
<div class="testimonials-style4__single-text">
<h2><?php echo esc_attr($items['title']); ?></h2>
<p><?php echo esc_attr($items['designation']); ?></p>
</div>
</div>
</li>
<?php } ?>
</ul>
</div>
</section>
<?php
}
}

View File

@@ -0,0 +1,312 @@
<?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 Trending_Voices 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_trending_voices';
}
/**
* 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 Trending Voices', 'thinkai' );
}
/**
* Get widget icon.
* Retrieve button widget icon.
*
* @since 1.0.0
* @access public
* @return string Widget icon.
*/
public function get_icon() {
return 'eicon-icon-box';
}
/**
* 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' ];
}
/**
* 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(
'trending_voices',
[
'label' => esc_html__( 'Thinkai Trending Voices', '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'),
),
]
);
//Icon
$this->add_control(
'icon',
[
'label' => esc_html__('Enter The icons', 'thinkai'),
'type' => \Elementor\Controls_Manager::ICONS,
'default' => [
'value' => 'icon-microphone',
'library' => 'solid',
],
]
);
//Title
$this->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Title', 'thinkai' ),
]
);
//External Link
$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'),
),
]
);
$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' => [
'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' => [
'link_option' => 'page',
]
]
);
//Text
$this->add_control(
'text',
[
'label' => __( 'Description', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Desription', 'thinkai' ),
]
);
//Wave Image
$this->add_control(
'wave_img',
[
'label' => __( 'Wave Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
//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' ),
),
]
);
$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' => [
'video_option' => 'src_url'
],
]
);
$this->add_control(
'video_source_image',
[
'label' => __( 'Video Source Media', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'media_types' => ['video'],
'condition' => [
'video_option' => 'src_media'
],
]
);
$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');
$icon = $settings['icon'];
//Link Code
$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 Code
$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' );
}
?>
<div class="ai-voices-style1__single">
<div class="ai-voices-style1__single-left">
<?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-microphone"></span>
<?php endif;?>
</div>
<?php } ?>
<div class="title">
<h3><a href="<?php echo esc_url( $mount_link );?>" <?php if( $page == 'extranal' ) echo esc_attr( $target );?> <?php if( $page == 'extranal' ) echo esc_attr( $nofollow );?>><?php echo wp_kses($settings['title'], true);?></a></h3>
<p><?php echo wp_kses($settings['text'], true);?></p>
</div>
</div>
<div class="ai-voices-style1__single-right">
<?php if($settings['wave_img']){ ?>
<div class="wave-box">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['wave_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
<?php } ?>
<?php if($video){ ?>
<div class="icon-box">
<a href="<?php echo esc_url( $video );?>" class="icon-play-button-arrowhead"></a>
</div>
<?php } ?>
</div>
</div>
<?php
}
}

View File

@@ -0,0 +1,424 @@
<?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 Video_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_video_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 Video 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-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( 'video-banner-script', YT_URL . 'assets/js/video-banner.js', [ 'elementor-frontend' ], '1.0.0', true );
return [ 'video-banner-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(
'video_banner',
[
'label' => esc_html__( 'Thinkai Video 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'),
),
]
);
$this->add_control(
'video_img',
[
'label' => __( 'Video Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
'condition' => [
'layout_control' => '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' ),
),
]
);
$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' => [
'video_option' => 'src_url'
],
]
);
$this->add_control(
'video_source_image',
[
'label' => __( 'Video Source Media', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'media_types' => ['video'],
'condition' => [
'video_option' => 'src_media'
],
]
);
//Title
$this->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Image Generator', 'thinkai' ),
]
);
//Text
$this->add_control(
'text',
[
'label' => __( 'Description', 'thinkai' ),
'type' => Controls_Manager::TEXTAREA,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Convert text to image.', 'thinkai' ),
'condition' => [
'layout_control' => '1',
],
]
);
//Button Title
$this->add_control(
'btn_title',
[
'label' => __( 'Button Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'dynamic' => [
'active' => true,
],
'default' => esc_html__( 'Try a Template', 'thinkai' ),
'condition' => [
'layout_control' => '1',
],
]
);
$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' => '1',
],
]
);
$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' => '1',
'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' => '1',
'link_option' => 'page'
]
]
);
//Switcher
$this->add_control(
'show_email_info',
[
'label' => esc_html__( 'Enable Email Info', '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',
],
]
);
$this->add_control(
'email_title',
[
'label' => esc_html__( 'Email Title', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'default' => esc_html__( 'Have Question?', 'thinkai' ),
'condition' => [
'layout_control' => '1',
'show_email_info' => 'yes'
]
]
);
$this->add_control(
'email_address',
[
'label' => esc_html__( 'Email Address', 'thinkai' ),
'type' => Controls_Manager::TEXT,
'label_block' => true,
'default' => esc_html__( 'info@example.com', 'thinkai' ),
'condition' => [
'layout_control' => '1',
'show_email_info' => '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' ];
$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' );
}
?>
<?php
if($layout == '2') :
?>
<div class="service-details-video-holder">
<div class="service-details-video-holder__bg"
style="background-image: url(<?php echo esc_url(wp_get_attachment_url($settings['video_img']['id'])); ?>);">
</div>
<?php if($settings['title']){ ?>
<div class="overlay-title">
<h4><?php echo wp_kses($settings['title'], true); ?></h4>
</div>
<?php } ?>
<?php if($video){ ?>
<div class="icon wow zoomIn animated" data-wow-delay="300ms" data-wow-duration="1500ms">
<a class="video-popup" title="Video Gallery"
href="<?php echo esc_url( $video );?>">
<span class="icon-play-button-arrowhead"></span>
</a>
</div>
<?php } ?>
</div>
<?php else:
$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 Video Banner Style1 -->
<div class="video-banner-style1 full-height">
<div class="video-banner-style1__inner">
<?php if($video){ ?>
<div class="media-container" data-top-bottom="transform: translateY(300px);"
data-bottom-top="transform: translateY(-300px);">
<div class="video-holder-wrap fs-wrapper">
<div class="video-container">
<video autoplay playsinline loop muted class="bgvid">
<source src="<?php echo esc_url( $video );?>" type="video/mp4">
</video>
</div>
</div>
</div>
<?php } ?>
<div class="overlay"></div>
<div class="video-banner-style1__content">
<div class="video-banner-style1__content-inner">
<div class="big-title">
<?php if($settings['title']){ ?>
<h2><?php echo wp_kses($settings['title'], true); ?></h2>
<?php } ?>
<?php if($settings['btn_title']){ ?>
<a class="btn1" 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['btn_title'], true);?>
</a>
<?php } ?>
</div>
<?php if($settings['text']){ ?>
<div class="text">
<div class="border-box"></div>
<p><?php echo wp_kses($settings['text'], true); ?></p>
</div>
<?php } ?>
</div>
</div>
<?php if($settings['show_email_info'] == 'yes'){ ?>
<div class="video-banner-style1__content-info">
<div class="video-banner-style1__content-info-inner">
<div class="icon-box">
<span class="icon-email-1"></span>
</div>
<div class="text">
<h5><?php echo wp_kses($settings['email_title'], true); ?></h5>
<a href="mailto:<?php echo esc_attr($settings['email_address']); ?>"><?php echo wp_kses($settings['email_address'], true); ?></a>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
<!-- End Video Banner Style1 -->
<?php endif;
}
}

View File

@@ -0,0 +1,295 @@
<?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 Video_Tabs 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_video_tabs';
}
/**
* 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 Video Tabs', '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' ];
}
/**
* 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(
'video_tabs',
[
'label' => esc_html__( 'Thinkai Video Tabs', 'thinkai' ),
]
);
//BG Image
$this->add_control(
'bg_image',
[
'label' => __( 'BG Image Url', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => ['url' => Utils::get_placeholder_image_src(),],
]
);
//Video Repeater
$repeater = new Repeater();
$repeater->add_control(
'tab_btn_title',
[
'label' => __( 'Tab Button Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Tab BTN Title', 'thinkai' ),
]
);
//title
$repeater->add_control(
'title',
[
'label' => __( 'Title', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXTAREA,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Title', 'thinkai' ),
]
);
//Video Link Option
$repeater->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' ),
),
]
);
$repeater->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' => [
'video_option' => 'src_url'
],
]
);
$repeater->add_control(
'video_source_image',
[
'label' => __( 'Video Source Media', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'media_types' => ['video'],
'condition' => [
'video_option' => 'src_media'
],
]
);
//title
$repeater->add_control(
'video_caption',
[
'label' => __( 'Video Caption', 'thinkai' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'dynamic' => [
'active' => true,
],
'placeholder' => __( 'Enter your Video Caption', 'thinkai' ),
]
);
$this->add_control(
'tabs',
[
'label' => __('Add Video Tab Item', 'thinkai'),
'type' => Controls_Manager::REPEATER,
'fields' => $repeater->get_controls(),
'title_field' => '{{{ tab_btn_title }}}',
'default' => [
[
'tab_btn_title' => esc_html__( 'Frame-by-Frame', 'thinkai' ),
'title' => esc_html__( 'We can help businesses reduce customer <br> service costs.', 'thinkai' ),
'src_url' => esc_html__( 'https://www.youtube.com/watch?v=oV74Najm6Nc', 'thinkai' ),
'video_caption' => esc_html__( 'Watch Demo', 'thinkai' ),
],
[
'tab_btn_title' => esc_html__( 'Backward', 'thinkai' ),
'title' => esc_html__( 'Replay, Redefine, Repeat<br> with ThinkAi video<br> Repeating.', 'thinkai' ),
'src_url' => esc_html__( 'https://www.youtube.com/watch?v=oV74Najm6Nc', 'thinkai' ),
'video_caption' => esc_html__( 'Watch Demo', 'thinkai' ),
],
[
'tab_btn_title' => esc_html__( 'Voice Over', 'thinkai' ),
'title' => esc_html__( 'Replay, Redefine, Repeat<br> with ThinkAi video<br> Repeating.', 'thinkai' ),
'src_url' => esc_html__( 'https://www.youtube.com/watch?v=oV74Najm6Nc', 'thinkai' ),
'video_caption' => esc_html__( 'Watch Demo', 'thinkai' ),
],
[
'tab_btn_title' => esc_html__( 'Screen Record', 'thinkai' ),
'title' => esc_html__( 'Replay, Redefine, Repeat<br> with ThinkAi video<br> Repeating.', 'thinkai' ),
'src_url' => esc_html__( 'https://www.youtube.com/watch?v=oV74Najm6Nc', 'thinkai' ),
'video_caption' => esc_html__( 'Watch Demo', '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');
?>
<!--Start Features Style5-->
<section class="features-style5">
<?php if($settings['bg_image']){ ?>
<div class="features-style5__bg" data-jarallax data-speed="0.1" data-imgPosition="0% 0%"
style="background-image: url(<?php echo esc_url(wp_get_attachment_url($settings['bg_image']['id'])); ?>);"></div>
<?php } ?>
<div class="container">
<div class="features-style5__inner tab-box-style1">
<div class="tabs-content-box">
<?php
foreach($settings['tabs'] as $key => $items){
$video_option = $items[ 'video_option' ];
if( $video_option == 'src_url' ){
$video = $items[ 'video_link' ][ 'url' ];
}elseif( $video_option == 'src_media' ){
$video = $items[ 'video_source_image' ]['url'];
}else{
$video = esc_html__( 'There is no Video', 'thinkai' );
}
?>
<!--Tab-->
<div class="tab-content-box-item <?php if($key == 0) echo 'tab-content-box-item-active'; ?>" id="frame-by-frame<?php echo esc_attr($key); ?>">
<div class="features-style5__content-tab-item">
<div class="video-holder-box-style5 text-center">
<h2><?php echo wp_kses($items['title'], true); ?></h2>
<?php if($video){ ?>
<div class="icon wow zoomIn animated" data-wow-delay="300ms"
data-wow-duration="1500ms">
<a class="video-popup" title="Video Gallery"
href="<?php echo esc_url( $video );?>">
<span class="icon-play-button-arrowhead"></span>
</a>
</div>
<?php } ?>
<h5><?php echo wp_kses($items['video_caption'], true); ?></h5>
</div>
</div>
</div>
<?php } ?>
</div>
<div class="features-style5-tab__button">
<ul class="tabs-button-box clearfix">
<?php
foreach($settings['tabs'] as $key => $items){
?>
<li data-tab="#frame-by-frame<?php echo esc_attr($key); ?>" class="tab-btn-item <?php if($key == 0) echo 'active-btn-item'; ?>">
<span><?php echo wp_kses($items['tab_btn_title'], true); ?></span>
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
</section>
<!--End Features Style5-->
<?php
}
}

View File

@@ -0,0 +1,148 @@
<?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_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 Wave_Image 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_wave_image';
}
/**
* 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 Wave Image', 'thinkai' );
}
/**
* Get widget icon.
* Retrieve button widget icon.
*
* @since 1.0.0
* @access public
* @return string Widget icon.
*/
public function get_icon() {
return 'eicon-image-hotspot';
}
/**
* 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' ];
}
/**
* 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(
'wave_image',
[
'label' => esc_html__( 'Thinkai Wave Image', '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'),
),
]
);
//Wave Img
$this->add_control(
'wave_img',
[
'label' => esc_html__( 'Wave Image', 'thinkai' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
]
);
$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'] == '3') :?>
<?php elseif($settings['layout_control'] == '2') :?>
<?php else: ?>
<!--Start Wave Style1-->
<section class="wave-style1">
<div class="wave-style1__inner float-bob-x">
<img src="<?php echo esc_url(wp_get_attachment_url($settings['wave_img']['id'])); ?>" alt="<?php bloginfo( 'name' ); ?>">
</div>
</section>
<!--End Wave Style1-->
<?php endif; ?>
<?php
}
}