File: /home/parhudrw/roflma.it/wp-content/plugins/lesya-plugin/elementor/widgets/started-2.php
<?php
namespace Elementor;
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
/**
* Lesya Started Widget.
*
* @since 1.0
*/
class Lesya_Started_Two_Widget extends Widget_Base {
public function get_name() {
return 'lesya-two-started';
}
public function get_title() {
return esc_html__( 'Started Two', 'lesya-plugin' );
}
public function get_icon() {
return 'eicon-parallax';
}
public function get_categories() {
return [ 'lesya-category' ];
}
/**
* Register widget controls.
*
* @since 1.0
*/
protected function register_controls() {
$this->start_controls_section(
'content_tab',
[
'label' => esc_html__( 'Content', 'lesya-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'title',
[
'label' => esc_html__( 'Title', 'lesya-plugin' ),
'type' => Controls_Manager::TEXTAREA,
'placeholder' => esc_html__( 'Enter title', 'lesya-plugin' ),
'default' => esc_html__( 'Title', 'lesya-plugin' ),
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'subtitle',
[
'label' => esc_html__( 'Subtitle', 'lesya-plugin' ),
'type' => Controls_Manager::TEXTAREA,
'placeholder' => esc_html__( 'Enter subtitle', 'lesya-plugin' ),
'default' => esc_html__( 'Subtitle', 'lesya-plugin' ),
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'description',
[
'label' => esc_html__( 'Description', 'lesya-plugin' ),
'type' => Controls_Manager::WYSIWYG,
'placeholder' => esc_html__( 'Enter description', 'lesya-plugin' ),
'default' => esc_html__( 'Description', 'lesya-plugin' ),
]
);
$this->add_control(
'button',
[
'label' => esc_html__( 'Button (Text)', 'lesya-plugin' ),
'type' => Controls_Manager::TEXT,
'placeholder' => esc_html__( 'Enter Button Label', 'lesya-plugin' ),
'default' => esc_html__( 'Button', 'lesya-plugin' ),
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'link',
[
'label' => esc_html__( 'Button (URL)', 'lesya-plugin' ),
'label_block' => true,
'type' => Controls_Manager::URL,
'show_external' => true,
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'button-adv',
[
'label' => esc_html__( 'Button Advanced (Text)', 'lesya-plugin' ),
'type' => Controls_Manager::TEXT,
'placeholder' => esc_html__( 'Enter Button Label', 'lesya-plugin' ),
'default' => esc_html__( 'Button', 'lesya-plugin' ),
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'link-adv',
[
'label' => esc_html__( 'Button Advanced (URL)', 'lesya-plugin' ),
'label_block' => true,
'type' => Controls_Manager::URL,
'show_external' => true,
'dynamic' => [
'active' => true,
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'media_tab',
[
'label' => esc_html__( 'Media', 'lesya-plugin' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);
$this->add_control(
'image',
[
'label' => esc_html__( 'Image', 'lesya-plugin' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
'dynamic' => [
'active' => true,
],
]
);
$this->add_control(
'image-circle',
[
'label' => esc_html__( 'Image Circle', 'lesya-plugin' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
]
);
$this->add_control(
'image-shape',
[
'label' => esc_html__( 'Image Shape', 'lesya-plugin' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
]
);
$this->add_control(
'image-shape-2',
[
'label' => esc_html__( 'Image Shape 2', 'lesya-plugin' ),
'type' => Controls_Manager::MEDIA,
'default' => [
'url' => Utils::get_placeholder_image_src(),
],
]
);
$this->end_controls_section();
$this->start_controls_section(
'title_styling',
[
'label' => esc_html__( 'Title', 'lesya-plugin' ),
'tab' => Controls_Manager::TAB_STYLE,
]
);
$this->add_control(
'title_color',
[
'label' => esc_html__( 'Title Color', 'lesya-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .hero-content-two h1' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'title_typography',
'label' => esc_html__( 'Title Typography', 'lesya-plugin' ),
'selector' => '{{WRAPPER}} .hero-content-two h1',
]
);
$this->add_control(
'subtitle_color',
[
'label' => esc_html__( 'Subtitle Color', 'lesya-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .hero-content-two .sub-title' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'subtitle_typography',
'label' => esc_html__( 'Subtitle Typography', 'lesya-plugin' ),
'selector' => '{{WRAPPER}} .hero-content-two .sub-title',
]
);
$this->add_control(
'desc_color',
[
'label' => esc_html__( 'Text Color', 'lesya-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .hero-content-two .list-style-two' => 'color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'desc_typography',
'label' => esc_html__( 'Text Typography', 'lesya-plugin' ),
'selector' => '{{WRAPPER}} .hero-content-two .list-style-two',
]
);
$this->add_control(
'button_color',
[
'label' => esc_html__( 'Button Color', 'lesya-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .hero-content .theme-btn.style-four' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'button_bgcolor',
[
'label' => esc_html__( 'Button BG Color', 'lesya-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .hero-content .theme-btn.style-four' => 'background-color: {{VALUE}};',
],
]
);
$this->add_control(
'button_brcolor',
[
'label' => esc_html__( 'Button Border Color', 'lesya-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .hero-content .theme-btn.style-four' => 'border-color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'button_typography',
'label' => esc_html__( 'Button Typography', 'lesya-plugin' ),
'selector' => '{{WRAPPER}} .hero-content .theme-btn.style-four',
]
);
$this->add_control(
'button2_color',
[
'label' => esc_html__( 'Button 2 Color', 'lesya-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .hero-content .theme-btn.style-five' => 'color: {{VALUE}};',
],
]
);
$this->add_control(
'button2_bgcolor',
[
'label' => esc_html__( 'Button 2 BG Color', 'lesya-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .hero-content .theme-btn.style-five' => 'background-color: {{VALUE}};',
],
]
);
$this->add_control(
'button2_brcolor',
[
'label' => esc_html__( 'Button 2 Border Color', 'lesya-plugin' ),
'type' => Controls_Manager::COLOR,
'default' => '',
'selectors' => [
'{{WRAPPER}} .hero-content .theme-btn.style-five' => 'border-color: {{VALUE}};',
],
]
);
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'button2_typography',
'label' => esc_html__( 'Button 2 Typography', 'lesya-plugin' ),
'selector' => '{{WRAPPER}} .hero-content .theme-btn.style-five',
]
);
$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( 'subtitle', 'basic' );
$this->add_inline_editing_attributes( 'description', 'basic' );
$this->add_inline_editing_attributes( 'button', 'none' );
?>
<!-- Hero 2 Section Start -->
<section class="hero-section-two rel z-1 bg-green">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-7">
<div class="hero-content-two mt-225 mb-170">
<?php if ( $settings['subtitle'] ) : ?>
<span class="sub-title wow fadeInUp delay-0-2s">
<span <?php echo $this->get_render_attribute_string( 'subtitle' ); ?>><?php echo wp_kses_post( $settings['subtitle'] ); ?></span>
</span>
<?php endif; ?>
<?php if ( $settings['title'] ) : ?>
<h1 class="wow fadeInUp delay-0-4s">
<span <?php echo $this->get_render_attribute_string( 'title' ); ?>><?php echo wp_kses_post( $settings['title'] ); ?></span>
</h1>
<?php endif; ?>
<?php if ( $settings['description'] ) : ?>
<div class="list-style-two pt-10 wow fadeInUp delay-0-6s">
<div <?php echo $this->get_render_attribute_string( 'description' ); ?>>
<?php echo wp_kses_post( $settings['description'] ); ?>
</div>
</div>
<?php endif; ?>
<div class="hero-btn mt-15 wow fadeInUp delay-0-8s">
<?php if ( $settings['button'] ) : ?>
<a<?php if ( $settings['link'] ) : ?><?php if ( $settings['link']['is_external'] ) : ?> target="_blank"<?php endif; ?><?php if ( $settings['link']['nofollow'] ) : ?> rel="nofollow"<?php endif; ?> href="<?php echo esc_url( $settings['link']['url'] ); ?>"<?php endif; ?> class="theme-btn mt-15 style-four">
<span <?php echo $this->get_render_attribute_string( 'button' ); ?>>
<?php echo wp_kses_post( $settings['button'] ); ?>
</span>
<i class="fas fa-long-arrow-alt-right"></i>
</a>
<?php endif; ?>
<?php if ( $settings['button-adv'] ) : ?>
<a<?php if ( $settings['link-adv'] ) : ?><?php if ( $settings['link-adv']['is_external'] ) : ?> target="_blank"<?php endif; ?><?php if ( $settings['link-adv']['nofollow'] ) : ?> rel="nofollow"<?php endif; ?> href="<?php echo esc_url( $settings['link-adv']['url'] ); ?>"<?php endif; ?> class="theme-btn mt-15 style-five">
<span <?php echo $this->get_render_attribute_string( 'button-adv' ); ?>>
<?php echo wp_kses_post( $settings['button-adv'] ); ?>
</span>
<i class="fas fa-long-arrow-alt-right"></i>
</a>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
<div class="hero-right-image">
<?php if ( $settings['image-circle'] ) : $image_circle = wp_get_attachment_image_url( $settings['image-circle']['id'], 'full' ); ?>
<img src="<?php echo esc_url( $image_circle ); ?>" alt="<?php echo esc_attr( $settings['title'] ); ?>">
<?php endif; ?>
<?php if ( $settings['image'] ) : $image = wp_get_attachment_image_url( $settings['image']['id'], 'lesya_1920xAuto' ); ?>
<img class="wow fadeInUp delay-0-2s" src="<?php echo esc_url( $image ); ?>" alt="<?php echo esc_attr( $settings['title'] ); ?>">
<?php endif; ?>
</div>
<?php if ( $settings['image-shape'] ) : $image_shape = wp_get_attachment_image_url( $settings['image-shape']['id'], 'full' ); ?>
<div class="hero-green-lear">
<img src="<?php echo esc_url( $image_shape ); ?>" alt="<?php echo esc_attr( $settings['title'] ); ?>">
</div>
<?php endif; ?>
<?php if ( $settings['image-shape-2'] ) : $image_shape_2 = wp_get_attachment_image_url( $settings['image-shape-2']['id'], 'full' ); ?>
<div class="hero-three-shapes">
<img src="<?php echo esc_url( $image_shape_2 ); ?>" alt="<?php echo esc_attr( $settings['title'] ); ?>">
</div>
<?php endif; ?>
</section>
<!-- Hero 2 Section End -->
<?php
}
/**
* Render widget output in the editor.
*
* Written as a Backbone JavaScript template and used to generate the live preview.
*
* @since 1.0.0
* @access protected
*/
/*protected function content_template() { ?>
<?php }*/
}
Plugin::instance()->widgets_manager->register_widget_type( new Lesya_Started_Two_Widget() );