<?php
namespace Elementor;

/**
 * Elementor Widget
 * @package Geroz
 * @since 1.0.0
 */ 
 
class Home4_Aboutme 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 'geroz-home4-aboutme-widget';
	}

	/**
	 * Get widget title.
	 * Retrieve button widget title.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return string Widget title.
	 */
	public function get_title() {
		return esc_html__( 'Home 4 About Me', 'geroz-core' );
	}

	/**
	 * Get widget icon.
	 * Retrieve button widget icon.
	 *
	 * @since  1.0.0
	 * @access public
	 * @return string Widget icon.
	 */
	public function get_icon() {
		return 'eicon-flash';
	}

	/**
	 * 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 ['geroz_widgets'];
    }
	
	/**
	 * 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(
			'home4-aboutme-content',
			[
				'label' => esc_html__( 'About Me Content', 'geroz-core' ),
			]
		);	

		$this->add_control(
			'subtitle',
			[
				'label' => esc_html__( 'Subtitle', 'geroz-core' ),
				'type' => Controls_Manager::TEXT,
				'default' => esc_html__( 'About Me', 'geroz-core' ),
				'placeholder' => esc_html__( 'Type your subtitle here', 'geroz-core' ),
			]
		);

		$this->add_control(
			'title',
			[
				'label' => esc_html__( 'Title', 'geroz-core' ),
				'type' => Controls_Manager::TEXTAREA,
				'default' => esc_html__( 'I am a Web Designer', 'geroz-core' ),
				'placeholder' => esc_html__( 'Type your title here', 'geroz-core' ),
			]
		);

		$this->add_control(
			'text',
			[
				'label' => esc_html__( 'Text', 'geroz-core' ),
				'type' => Controls_Manager::TEXTAREA,
				'default' => esc_html__( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.', 'geroz-core' ),
				'placeholder' => esc_html__( 'Type your text here', 'geroz-core' ),
			]
		);


		$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');
		?>


	   <section class="about-wrapper about-1 style-2 section-padding ">
			<div class="about-arrow">
				<svg width="241" height="116" viewBox="0 0 241 116" fill="none" xmlns="http://www.w3.org/2000/svg">
					<path class="arrow-path"
						d="M2.40711 115.742C6.50746 36.6323 90.1951 -41.7371 112.306 36.697C126.105 85.6461 56.5141 32.8646 105.438 8.61389C144.577 -10.7866 206.595 20.1372 232.711 38.0243L207.256 41.9069C216.708 42.7768 236.174 43.9054 238.429 41.4607C240.683 39.0159 225.657 25.7998 217.862 19.4972"
						stroke="currentColor" stroke-opacity="0.54" stroke-width="3" />
				</svg>
			</div>
			<div class="container">
				<div class="row">
					<div class="col-xl-3 col-lg-3">
						<div class="section-title">
							<div class="sub-title">
								<div class="dot"></div> <span><?php echo $settings['subtitle'];?></span>
							</div>
						</div>
					</div>
					<div class="col-xl-8 col-lg-8 col-12">
						<div class="about-content">
							<h3 class="title has_text_move_anim"> <?php echo $settings['title'];?></h3>
							<p class="text mt-lg-5 pt-4 has_text_move_anim">
								<?php echo $settings['text'];?>
							</p>
						</div>
					</div>
				</div>
			</div>
		</section>

             
		<?php 
	}


}

Plugin::instance()->widgets_manager->register_widget_type(new Home4_Aboutme());