<?php
namespace Sifency\Traits;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
use Elementor\Controls_Manager;
/**
 * Trait Sifency_Addons_Widget_Config_And_Help
 * This trait handles both Widget Configuration (name, title, icon, etc.)
 * and the Elementor Help Tab controls.
 */
trait Sifency_Addons_Sticky_Stack {
	protected function add_sifency_addons_sticky_stack( $args = array() ) {
		$this->start_controls_section(
			'section_sticky_effect',
			array(
				'label' => 'Sticky Stack Effect',
			)
		);

		$this->add_control(
			'enable_sticky_stack',
			array(
				'label'   => 'Enable Sticky Stack',
				'type'    => Controls_Manager::SWITCHER,
				'default' => 'no',
			)
		);

		$this->add_control(
			'sticky_scale_density',
			array(
				'label'     => 'Scale Density',
				'type'      => Controls_Manager::SLIDER,
				'default'   => array( 'size' => 0.05 ),
				'range'     => array(
					'px' => array(
						'min'  => 0,
						'max'  => 0.2,
						'step' => 0.01,
					),
				),
				'condition' => array( 'enable_sticky_stack' => 'yes' ),
			)
		);

		$this->add_control(
			'sticky_opacity_density',
			array(
				'label'     => 'Opacity Density',
				'type'      => Controls_Manager::SLIDER,
				'default'   => array( 'size' => 0.3 ),
				'range'     => array(
					'px' => array(
						'min'  => 0,
						'max'  => 1,
						'step' => 0.1,
					),
				),
				'condition' => array( 'enable_sticky_stack' => 'yes' ),
			)
		);
		$this->end_controls_section();
	}
}
