<?php
namespace EcafeAddons\Widgets;

use Elementor\Widget_Base;
use Elementor\Controls_Manager;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

$this->start_controls_section(
	'ecTiltsection',
	array(
		'label' => esc_html__( 'Tilt Effect', 'essential-classy-addons-for-elementor' ),
		'tab'   => Controls_Manager::TAB_CONTENT,
	)
);
$this->add_control(
	'tiltEffect',
	array(
		'label'     => esc_html__( 'Tilt Effect', 'essential-classy-addons-for-elementor' ),
		'type'      => Controls_Manager::SWITCHER,
		'default'   => 'no',
		'label_on'  => esc_html__( 'Show', 'essential-classy-addons-for-elementor' ),
		'label_off' => esc_html__( 'Hide', 'essential-classy-addons-for-elementor' ),
		'separator' => 'before',
	)
);
$this->add_control(
	'tiltrotation',
	array(
		'label'      => esc_html__( 'Max tilt rotation (degrees)', 'essential-classy-addons-for-elementor' ),
		'type'       => Controls_Manager::SLIDER,
		'size_units' => '',
		'range'      => array(
			'' => array(
				'min'  => 1,
				'max'  => 90,
				'step' => 5,
			),
		),
		'default'    => array(
			'unit' => '',
			'size' => 35,
		),
		'condition'  => array(
			'tiltEffect' => 'yes',
		),
	)
);
$this->add_control(
	'transformperspective',
	array(
		'label'      => esc_html__( 'Transform perspective', 'essential-classy-addons-for-elementor' ),
		'type'       => Controls_Manager::SLIDER,
		'size_units' => '',
		'range'      => array(
			'' => array(
				'min'  => 1000,
				'max'  => 5000,
				'step' => 100,
			),
		),
		'default'    => array(
			'unit' => '',
			'size' => 1000,
		),
		'condition'  => array(
			'tiltEffect' => 'yes',
		),
	)
);
$this->add_control(
	'tiltscale',
	array(
		'label'      => esc_html__( 'Scale', 'essential-classy-addons-for-elementor' ),
		'type'       => Controls_Manager::SLIDER,
		'size_units' => '',
		'range'      => array(
			'' => array(
				'min'  => 0,
				'max'  => 2,
				'step' => 0.1,
			),
		),
		'default'    => array(
			'unit' => '',
			'size' => 1,
		),
		'condition'  => array(
			'tiltEffect' => 'yes',
		),
	)
);
$this->add_control(
	'tiltspeed',
	array(
		'label'      => esc_html__( 'Speed', 'essential-classy-addons-for-elementor' ),
		'type'       => Controls_Manager::SLIDER,
		'size_units' => '',
		'range'      => array(
			'' => array(
				'min'  => 100,
				'max'  => 2000,
				'step' => 100,
			),
		),
		'default'    => array(
			'unit' => '',
			'size' => 300,
		),
		'condition'  => array(
			'tiltEffect' => 'yes',
		),
	)
);
$this->add_control(
	'tiltaxis',
	array(
		'label'     => esc_html__( 'Axis', 'essential-classy-addons-for-elementor' ),
		'type'      => Controls_Manager::SELECT,
		'default'   => 'null',
		'options'   => array(
			'null' => esc_html__( 'Default', 'essential-classy-addons-for-elementor' ),
			'x'    => esc_html__( 'Disable Axis Y', 'essential-classy-addons-for-elementor' ),
			'y'    => esc_html__( 'Disable Axis X', 'essential-classy-addons-for-elementor' ),
		),
		'condition' => array(
			'tiltEffect' => 'yes',
		),
	)
);
$this->add_control(
	'tilteasing',
	array(
		'label'     => esc_html__( 'Easing on enter/exit', 'essential-classy-addons-for-elementor' ),
		'type'      => Controls_Manager::TEXTAREA,
		'default'   => 'cubic-bezier(.03,.98,.52,.99)',
		'condition' => array(
			'tiltEffect' => 'yes',
		),
	)
);
$this->end_controls_section();
