𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/builxejc/public_html/wp-content/plugins/kinsley-plugin/elementor/widgets//intro.php
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* Kinsley Intro Widget.
*
* @since 1.0
*/
class Kinsley_Intro_Widget extends Widget_Base {
public function get_name() {
return 'kinsley-intro';
}
public function get_title() {
return esc_html__( 'Intro', 'kinsley-plugin' );
}
public function get_icon() {
return 'eicon-parallax';
}
public function get_categories() {
return [ 'kinsley-category' ];
}
/**
* Register widget controls.
*
* @since 1.0
*/
protected function register_controls() {
$this->start_controls_section(
'title_tab',
[
'label' => esc_html__( 'Title', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_responsive_control(
'align',
[
'label' => __( 'Alignment', 'kinsley-plugin' ),
'type' => Controls_Manager::CHOOSE,
'options' => [
'flex-start' => [
'title' => __( 'Left', 'kinsley-plugin' ),
'icon' => 'eicon-text-align-left',
],
'center' => [
'title' => __( 'Center', 'kinsley-plugin' ),
'icon' => 'eicon-text-align-center',
],
'flex-end' => [
'title' => __( 'Right', 'kinsley-plugin' ),
'icon' => 'eicon-text-align-right',
],
],
'selectors' => [
'{{WRAPPER}} .knsl-title-frame' => 'align-items: {{VALUE}};',
],
'default' => 'center',
]
);
$this->add_control(
'title',
[
'label' => esc_html__( 'Title', 'kinsley-plugin' ),
'type' => Controls_Manager::TEXTAREA,
'placeholder' => esc_html__( 'Enter title', 'kinsley-plugin' ),
'default' => esc_html__( 'Title', 'kinsley-plugin' ),
]
);
$this->add_control(
'title_tag',
[
'label' => esc_html__( 'Title Tag', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'h1',
'options' => [
'h1' => __( 'H1', 'kinsley-plugin' ),
'h2' => __( 'H2', 'kinsley-plugin' ),
'h3' => __( 'H3', 'kinsley-plugin' ),
'div' => __( 'DIV', 'kinsley-plugin' ),
],
]
);
$this->add_control(
'title_white',
[
'label' => esc_html__( 'Title White', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'no',
'options' => [
'no' => __( 'No', 'kinsley-plugin' ),
'yes' => __( 'Yes', 'kinsley-plugin' ),
],
]
);
$this->add_control(
'description',
[
'label' => esc_html__( 'Description', 'kinsley-plugin' ),
'type' => Controls_Manager::TEXTAREA,
'placeholder' => esc_html__( 'Enter description', 'kinsley-plugin' ),
'default' => esc_html__( 'Description', 'kinsley-plugin' ),
]
);
$this->add_control(
'description_pos',
[
'label' => esc_html__( 'Description Position:', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'default',
'options' => [
'default' => __( 'Default', 'kinsley-plugin' ),
'top' => __( 'Top', 'kinsley-plugin' ),
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'breadcrumbs_tab',
[
'label' => esc_html__( 'Breadcrumbs', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'breadcrumbs',
[
'label' => esc_html__( 'Breadcrumbs', 'kinsley-plugin' ),
'type' => Controls_Manager::SWITCHER,
'label_on' => __( 'Yes', 'kinsley-plugin' ),
'label_off' => __( 'No', 'kinsley-plugin' ),
'return_value' => 'yes',
'default' => 'yes',
]
);
$this->end_controls_section();
$this->start_controls_section(
'background_tab',
[
'label' => esc_html__( 'Background', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'offset_bottom',
[
'label' => esc_html__( 'Padding Bottom:', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'yes',
'options' => [
'no' => __( 'No', 'kinsley-plugin' ),
'yes' => __( 'Yes', 'kinsley-plugin' ),
],
]
);
$this->add_control(
'bg',
[
'label' => esc_html__( 'Background:', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'no',
'options' => [
'no' => __( 'No', 'kinsley-plugin' ),
'yes' => __( 'Yes', 'kinsley-plugin' ),
],
]
);
$this->add_control(
'bg_type',
[
'label' => esc_html__( 'Background Type:', 'kinsley-plugin' ),
'type' => Controls_Manager::SELECT,
'default' => 'image',
'options' => [
'image' => __( 'Image', 'kinsley-plugin' ),
'video' => __( 'Video (mp4)', 'kinsley-plugin' ),
'videoyt' => __( 'Video Youtube', 'kinsley-plugin' ),
],
'condition' => [
'bg' => 'yes'
],
]
);
$this->add_control(
'image', [
'label' => esc_html__( 'Image', 'kinsley-plugin' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => \Elementor\Utils::get_placeholder_image_src(),
],
'condition' => [
'bg' => 'yes',
'bg_type' => 'image'
],
]
);
$this->add_control(
'video', [
'label' => esc_html__( 'Video (link)', 'kinsley-plugin' ),
'label_block' => true,
'type' => Controls_Manager::TEXT,
'placeholder' => esc_html__( '/video.mp4', 'kinsley-plugin' ),
'condition' => [
'bg' => 'yes',
'bg_type' => 'video'
],
]
);
$this->add_control(
'video_yt',
[
'label' => esc_html__( 'Video Youtube (Video ID)', 'onovo-plugin' ),
'type' => Controls_Manager::TEXT,
'placeholder' => esc_html__( 'XHOmBV4js_E', 'onovo-plugin' ),
'default' => '',
'condition' => [
'bg' => 'yes',
'bg_type' => 'videoyt'
],
]
);
$this->add_control(
'params_overlay_opacity',
[
'label' => esc_html__( 'Overlay Opacity', 'kinsley-plugin' ),
'type' => Controls_Manager::NUMBER,
'min' => 0,
'max' => 1,
'step' => 0.1,
'default' => 1,
'condition' => [
'bg' => 'yes'
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'title_styling',
[
'label' => esc_html__( 'Title', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'title_color',
[
'label' => esc_html__( 'Title Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-banner-simple .knsl-title--h' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'label' => esc_html__( 'Title Typography', 'kinsley-plugin' ),
'selector' => '{{WRAPPER}} .knsl-banner-simple .knsl-title--h',
]
);
$this->add_control(
'desc_color',
[
'label' => esc_html__( 'Description Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-banner-simple .knsl-text' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'desc_typography',
'label' => esc_html__( 'Description Typography', 'kinsley-plugin' ),
'selector' => '{{WRAPPER}} .knsl-banner-simple .knsl-text',
]
);
$this->end_controls_section();
$this->start_controls_section(
'breadcrumbs_styling',
[
'label' => esc_html__( 'Breadcrumbs', 'kinsley-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'breadcrumbs_bgcolor',
[
'label' => esc_html__( 'Background Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-breadcrumbs' => 'background-color: {{VALUE}};',
],
]
);
$this->add_control(
'breadcrumbs_link_color',
[
'label' => esc_html__( 'Background Link Color', 'kinsley-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .knsl-breadcrumbs li a' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'breadcrumbs_link_typography',
'label' => esc_html__( 'Background Link Typography', 'kinsley-plugin' ),
'selector' => '{{WRAPPER}} .knsl-breadcrumbs li',
]
);
$this->end_controls_section();
}
/**
* Render widget output on the frontend.
*
* @since 1.0
*/
protected function render() {
$settings = $this->get_settings_for_display();
$this->add_inline_editing_attributes( 'title', 'basic' );
$this->add_inline_editing_attributes( 'description', 'basic' );
$page_id = get_the_ID();
?>
<!-- banner -->
<section class="knsl-banner-simple<?php if ( $settings['offset_bottom'] == 'yes' ) : ?> knsl-transition-bottom<?php endif; ?><?php if ( $settings['title_white'] == 'yes' ) : ?> knsl-banner-white<?php endif; ?>">
<?php kinsley_deco_svg( 'both' ); ?>
<?php if ( $settings['bg'] == 'yes' ) : ?>
<div class="knsl-cover-frame">
<?php if ( $settings['bg_type'] == 'image' ) : ?>
<?php if ( $settings['image'] ) : $image = wp_get_attachment_image_url( $settings['image']['id'], 'kinsley_1920xAuto' ); ?>
<div style="background-image: url('<?php echo esc_url( $image ); ?>');" class="knsl-parallax knsl-banner-slide"></div>
<?php endif; ?>
<?php endif; ?>
<?php if ( $settings['bg_type'] == 'video' ) : ?>
<?php if ( $settings['video'] ) : ?>
<div class="knsl-parallax knsl-banner-slide">
<video autoplay muted loop playsinline><source src="<?php echo esc_url( $settings['video'] ); ?>" type="video/mp4"></video>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ( $settings['bg_type'] == 'videoyt' ) : ?>
<?php if ( $settings['video_yt'] ) : ?>
<div class="knsl-parallax knsl-banner-slide videoyt">
<iframe src="https://www.youtube.com/embed/<?php echo esc_attr( $settings['video_yt'] ); ?>?showinfo=0&controls=0&autoplay=1&mute=1&playsinline=1&loop=1&playlist=<?php echo esc_attr( $settings['video_yt'] );?>" class="hero-videoyt"></iframe>
</div>
<?php endif; ?>
<?php endif; ?>
</div>
<div class="knsl-overlay" style="opacity: <?php echo esc_attr( $settings['params_overlay_opacity'] ); ?>;"></div>
<?php endif; ?>
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="knsl-center knsl-title-frame<?php if ( $settings['description_pos'] == 'top' ) : ?> title-pos-top<?php endif; ?>">
<?php if ( $settings['title'] ) : ?>
<<?php echo esc_attr( $settings['title_tag'] ); ?> class="knsl-title--h knsl-mb-20 knsl-h1-inner">
<span <?php echo $this->get_render_attribute_string( 'title' ); ?>>
<?php echo wp_kses_post( $settings['title'] ); ?>
</span>
</<?php echo esc_attr( $settings['title_tag'] ); ?>>
<?php endif; ?>
<?php if ( $settings['description'] ) : ?>
<p class="knsl-text knsl-mb-30">
<span <?php echo $this->get_render_attribute_string( 'description' ); ?>>
<?php echo wp_kses_post( $settings['description'] ); ?>
</span>
</p>
<?php endif; ?>
<?php if ( $settings['breadcrumbs'] == 'yes' ) : kinsley_breadcrumbs( $page_id ); endif; ?>
</div>
</div>
</div>
</div>
</section>
<!-- banner end -->
<?php
}
}
Plugin::instance()->widgets_manager->register( new Kinsley_Intro_Widget() );