<?php

/*$endless_addons_floating_enable = (array)get_option('new_settings3');
if( isset( $endless_addons_floating_enable['endless_addons_floating_enable'] ) ) :
    $endless_addons_floating_enable_new = $endless_addons_floating_enable['endless_addons_floating_enable'];
else:
    $endless_addons_floating_enable_new = '';
endif;*/

//if( $endless_addons_floating_enable_new ) :

$this->start_controls_section(
	'_ea_section_floating_effects',
	[
		'label' => __('Floating Effects', 'endless-addons'),
		'tab' => \Elementor\Controls_Manager::TAB_STYLE,
		'condition' => [
            'select_fun_factor_style' => 'style-08',
        ]
	]
);

$this->add_control(
	'ea_floating_fx',
	[
		'label' => __( 'Enable', 'endless-addons' ),
		'type' => \Elementor\Controls_Manager::SWITCHER,
		'return_value' => 'yes',
		'frontend_available' => true,
	]
);

$this->add_control(
	'ea_floating_fx_translate_toggle',
	[
		'label' => __( 'Translate', 'endless-addons' ),
		'type' => \Elementor\Controls_Manager::POPOVER_TOGGLE,
		'return_value' => 'yes',
		'frontend_available' => true,
		'condition' => [
			'ea_floating_fx' => 'yes',
		]
	]
);

$this->start_popover();

$this->add_control(
	'ea_floating_fx_translate_x',
	[
		'label' => __( 'Translate X', 'endless-addons' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'default' => [
			'sizes' => [
				'from' => 0,
				'to' => 5,
			],
			'unit' => 'px',
		],
		'range' => [
			'px' => [
				'min' => -100,
				'max' => 100,
			]
		],
		'labels' => [
			__( 'From', 'endless-addons' ),
			__( 'To', 'endless-addons' ),
		],
		'scales' => 1,
		'handles' => 'range',
		'condition' => [
			'ea_floating_fx_translate_toggle' => 'yes',
			'ea_floating_fx' => 'yes',
		],
		'render_type' => 'none',
		'frontend_available' => true,
	]
);

$this->add_control(
	'ea_floating_fx_translate_y',
	[
		'label' => __( 'Translate Y', 'endless-addons' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'default' => [
			'sizes' => [
				'from' => 0,
				'to' => 5,
			],
			'unit' => 'px',
		],
		'range' => [
			'px' => [
				'min' => -100,
				'max' => 100,
			]
		],
		'labels' => [
			__( 'From', 'endless-addons' ),
			__( 'To', 'endless-addons' ),
		],
		'scales' => 1,
		'handles' => 'range',
		'condition' => [
			'ea_floating_fx_translate_toggle' => 'yes',
			'ea_floating_fx' => 'yes',
		],
		'render_type' => 'none',
		'frontend_available' => true,
	]
);

$this->add_control(
	'ea_floating_fx_translate_duration',
	[
		'label' => __( 'Duration', 'endless-addons' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'size_units' => ['px'],
		'range' => [
			'px' => [
				'min' => 0,
				'max' => 10000,
				'step' => 100
			]
		],
		'default' => [
			'size' => 1000,
		],
		'condition' => [
			'ea_floating_fx_translate_toggle' => 'yes',
			'ea_floating_fx' => 'yes',
		],
		'render_type' => 'none',
		'frontend_available' => true,
	]
);

$this->add_control(
	'ea_floating_fx_translate_delay',
	[
		'label' => __( 'Delay', 'endless-addons' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'size_units' => ['px'],
		'range' => [
			'px' => [
				'min' => 0,
				'max' => 5000,
				'step' => 100
			]
		],
		'condition' => [
			'ea_floating_fx_translate_toggle' => 'yes',
			'ea_floating_fx' => 'yes',
		],
		'render_type' => 'none',
		'frontend_available' => true,
	]
);

$this->end_popover();

$this->add_control(
	'ea_floating_fx_rotate_toggle',
	[
		'label' => __( 'Rotate', 'endless-addons' ),
		'type' => \Elementor\Controls_Manager::POPOVER_TOGGLE,
		'return_value' => 'yes',
		'frontend_available' => true,
		'condition' => [
			'ea_floating_fx' => 'yes',
		]
	]
);

$this->start_popover();

$this->add_control(
	'ea_floating_fx_rotate_x',
	[
		'label' => __( 'Rotate X', 'endless-addons' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'default' => [
			'sizes' => [
				'from' => 0,
				'to' => 45,
			],
			'unit' => 'px',
		],
		'range' => [
			'px' => [
				'min' => -180,
				'max' => 180,
			]
		],
		'labels' => [
			__( 'From', 'endless-addons' ),
			__( 'To', 'endless-addons' ),
		],
		'scales' => 1,
		'handles' => 'range',
		'condition' => [
			'ea_floating_fx_rotate_toggle' => 'yes',
			'ea_floating_fx' => 'yes',
		],
		'render_type' => 'none',
		'frontend_available' => true,
	]
);

$this->add_control(
	'ea_floating_fx_rotate_y',
	[
		'label' => __( 'Rotate Y', 'endless-addons' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'default' => [
			'sizes' => [
				'from' => 0,
				'to' => 45,
			],
			'unit' => 'px',
		],
		'range' => [
			'px' => [
				'min' => -180,
				'max' => 180,
			]
		],
		'labels' => [
			__( 'From', 'endless-addons' ),
			__( 'To', 'endless-addons' ),
		],
		'scales' => 1,
		'handles' => 'range',
		'condition' => [
			'ea_floating_fx_rotate_toggle' => 'yes',
			'ea_floating_fx' => 'yes',
		],
		'render_type' => 'none',
		'frontend_available' => true,
	]
);

$this->add_control(
	'ea_floating_fx_rotate_z',
	[
		'label' => __( 'Rotate Z', 'endless-addons' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'default' => [
			'sizes' => [
				'from' => 0,
				'to' => 45,
			],
			'unit' => 'px',
		],
		'range' => [
			'px' => [
				'min' => -180,
				'max' => 180,
			]
		],
		'labels' => [
			__( 'From', 'endless-addons' ),
			__( 'To', 'endless-addons' ),
		],
		'scales' => 1,
		'handles' => 'range',
		'condition' => [
			'ea_floating_fx_rotate_toggle' => 'yes',
			'ea_floating_fx' => 'yes',
		],
		'render_type' => 'none',
		'frontend_available' => true,
	]
);

$this->add_control(
	'ea_floating_fx_rotate_duration',
	[
		'label' => __( 'Duration', 'endless-addons' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'size_units' => ['px'],
		'range' => [
			'px' => [
				'min' => 0,
				'max' => 10000,
				'step' => 100
			]
		],
		'default' => [
			'size' => 1000,
		],
		'condition' => [
			'ea_floating_fx_rotate_toggle' => 'yes',
			'ea_floating_fx' => 'yes',
		],
		'render_type' => 'none',
		'frontend_available' => true,
	]
);

$this->add_control(
	'ea_floating_fx_rotate_delay',
	[
		'label' => __( 'Delay', 'endless-addons' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'size_units' => ['px'],
		'range' => [
			'px' => [
				'min' => 0,
				'max' => 5000,
				'step' => 100
			]
		],
		'condition' => [
			'ea_floating_fx_rotate_toggle' => 'yes',
			'ea_floating_fx' => 'yes',
		],
		'render_type' => 'none',
		'frontend_available' => true,
	]
);

$this->end_popover();

$this->add_control(
	'ea_floating_fx_scale_toggle',
	[
		'label' => __( 'Scale', 'endless-addons' ),
		'type' => \Elementor\Controls_Manager::POPOVER_TOGGLE,
		'return_value' => 'yes',
		'frontend_available' => true,
		'condition' => [
			'ea_floating_fx' => 'yes',
		]
	]
);

$this->start_popover();

$this->add_control(
	'ea_floating_fx_scale_x',
	[
		'label' => __( 'Scale X', 'endless-addons' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'default' => [
			'sizes' => [
				'from' => 1,
				'to' => 1.2,
			],
			'unit' => 'px',
		],
		'range' => [
			'px' => [
				'min' => 0,
				'max' => 5,
				'step' => .1
			]
		],
		'labels' => [
			__( 'From', 'endless-addons' ),
			__( 'To', 'endless-addons' ),
		],
		'scales' => 1,
		'handles' => 'range',
		'condition' => [
			'ea_floating_fx_scale_toggle' => 'yes',
			'ea_floating_fx' => 'yes',
		],
		'render_type' => 'none',
		'frontend_available' => true,
	]
);

$this->add_control(
	'ea_floating_fx_scale_y',
	[
		'label' => __( 'Scale Y', 'endless-addons' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'default' => [
			'sizes' => [
				'from' => 1,
				'to' => 1.2,
			],
			'unit' => 'px',
		],
		'range' => [
			'px' => [
				'min' => 0,
				'max' => 5,
				'step' => .1
			]
		],
		'labels' => [
			__( 'From', 'endless-addons' ),
			__( 'To', 'endless-addons' ),
		],
		'scales' => 1,
		'handles' => 'range',
		'condition' => [
			'ea_floating_fx_scale_toggle' => 'yes',
			'ea_floating_fx' => 'yes',
		],
		'render_type' => 'none',
		'frontend_available' => true,
	]
);

$this->add_control(
	'ea_floating_fx_scale_duration',
	[
		'label' => __( 'Duration', 'endless-addons' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'size_units' => ['px'],
		'range' => [
			'px' => [
				'min' => 0,
				'max' => 10000,
				'step' => 100
			]
		],
		'default' => [
			'size' => 1000,
		],
		'condition' => [
			'ea_floating_fx_scale_toggle' => 'yes',
			'ea_floating_fx' => 'yes',
		],
		'render_type' => 'none',
		'frontend_available' => true,
	]
);

$this->add_control(
	'ea_floating_fx_scale_delay',
	[
		'label' => __( 'Delay', 'endless-addons' ),
		'type' => \Elementor\Controls_Manager::SLIDER,
		'size_units' => ['px'],
		'range' => [
			'px' => [
				'min' => 0,
				'max' => 5000,
				'step' => 100
			]
		],
		'condition' => [
			'ea_floating_fx_scale_toggle' => 'yes',
			'ea_floating_fx' => 'yes',
		],
		'render_type' => 'none',
		'frontend_available' => true,
	]
);

$this->end_popover();

$this->end_controls_section();

//endif;
