<?php
use Elementor\Controls_Manager;
use Elementor\Element_Base;
use Elementor\Utils;
use Elementor\Group_Control_Box_Shadow;
defined('ABSPATH') || die();
class RS_Exten_GSAP_Setting
{
public function __construct()
{
add_action('elementor/element/section/section_advanced/after_section_end', [$this, 'register_controls'], 10, 1);
add_action('elementor/element/column/section_advanced/after_section_end', [$this, 'register_controls'], 10, 1);
add_action('elementor/element/common/_section_style/after_section_end', [$this, 'register_controls'], 10, 1);
}
public function register_controls(Element_Base $section)
{
$section->start_controls_section(
'rs_exten_gsap_intaraction_section',
[
'label' => 'RS GSAP Intaraction',
'tab' => Controls_Manager::TAB_ADVANCED,
]
);
$section->add_control(
'rs_exten_gsap_panal_notice',
[
'type' => Controls_Manager::RAW_HTML,
'raw' => __('<strong>GSAP Extension</strong> Does not work in Editor page.', 'rsaddon'),
'content_classes' => 'rs-panel-notice',
]
);
$section->add_control(
'rs_exten_gsap_scroll_move_options',
[
'label' => esc_html__( 'Scroll Move Options', 'rsaddon' ),
'type' => Controls_Manager::HEADING,
]
);
$section->add_control(
'rs_exten_gsap_scroll_move',
[
'label' => __('Scroll Move', 'rsaddon'),
'type' => Controls_Manager::SWITCHER,
'default' => 'no',
'return_value' => 'yes',
'render_type' => 'template',
'label_on' => __('Enable', 'rsaddon'),
'label_off' => __('Disable', 'rsaddon'),
'prefix_class' => 'gsap-move-',
]
);
$section->add_control(
'rs_exten_gsap_scroll_move_dir',
[
'label' => esc_html__( 'Direction', 'rsaddon' ),
'type' => Controls_Manager::SELECT,
'default' => 'right',
'options' => [
'top' => esc_html__( 'Top', 'rsaddon' ),
'right' => esc_html__( 'Right', 'rsaddon' ),
'bottom' => esc_html__( 'Bottom', 'rsaddon' ),
'left' => esc_html__( 'Left', 'rsaddon' ),
],
'condition' => [
'rs_exten_gsap_scroll_move' => 'yes'
]
]
);
$section->add_control(
'rs_exten_gsap_scroll_move_top_distance',
[
'label' => esc_html__( 'Distance To Top', 'rsaddon' ),
'type' => Controls_Manager::NUMBER,
'min' => -1000,
'max' => 1000,
'step' => 2,
'prefix_class' => 'up-',
'condition' => [
'rs_exten_gsap_scroll_move' => 'yes',
'rs_exten_gsap_scroll_move_dir' => 'top'
]
]
);
$section->add_control(
'rs_exten_gsap_scroll_move_right_distance',
[
'label' => esc_html__( 'Distance To Right', 'rsaddon' ),
'type' => Controls_Manager::NUMBER,
'min' => -1000,
'max' => 1000,
'step' => 2,
'prefix_class' => 'right-',
'condition' => [
'rs_exten_gsap_scroll_move' => 'yes',
'rs_exten_gsap_scroll_move_dir' => 'right'
]
]
);
$section->add_control(
'rs_exten_gsap_scroll_move_bottom_distance',
[
'label' => esc_html__( 'Distance To Bottom', 'rsaddon' ),
'type' => Controls_Manager::NUMBER,
'min' => -1000,
'max' => 1000,
'step' => 2,
'prefix_class' => 'down-',
'condition' => [
'rs_exten_gsap_scroll_move' => 'yes',
'rs_exten_gsap_scroll_move_dir' => 'bottom'
]
]
);
$section->add_control(
'rs_exten_gsap_scroll_move_left_distance',
[
'label' => esc_html__( 'Distance To Left', 'rsaddon' ),
'type' => Controls_Manager::NUMBER,
'min' => -1000,
'max' => 1000,
'step' => 2,
'prefix_class' => 'left-',
'condition' => [
'rs_exten_gsap_scroll_move' => 'yes',
'rs_exten_gsap_scroll_move_dir' => 'left'
]
]
);
$section->add_control(
'rs_exten_gsap_scroll_move_start_from',
[
'label' => esc_html__( 'Start From (0 to 100)', 'rsaddon' ),
'type' => Controls_Manager::NUMBER,
'min' => -100,
'max' => 100,
'step' => 2,
'prefix_class' => 'start-',
'condition' => [
'rs_exten_gsap_scroll_move' => 'yes',
]
]
);
$section->add_control(
'rs_exten_gsap_scroll_rotate_options',
[
'label' => esc_html__( 'Scroll Rotate Options', 'rsaddon' ),
'type' => Controls_Manager::HEADING,
'separator' => 'before',
]
);
$section->add_control(
'rs_exten_gsap_scroll_rotation',
[
'label' => esc_html__( 'Rotation', 'rsaddon' ),
'type' => Controls_Manager::SELECT,
'default' => '',
'options' => [
'' => esc_html__( 'Not Set', 'rsaddon' ),
'normal' => esc_html__( 'Clockwise', 'rsaddon' ),
'anti' => esc_html__( 'Anti Clockwise', 'rsaddon' ),
],
'prefix_class' => 'gsap-rotate-',
]
);
$section->add_control(
'rs_exten_gsap_scroll_rotation_degree',
[
'label' => esc_html__( 'Degree (0 to 360)', 'rsaddon' ),
'type' => Controls_Manager::NUMBER,
'min' => -1000,
'max' => 1000,
'prefix_class' => 'to-',
'condition' => [
'rs_exten_gsap_scroll_rotation' => ['normal', 'anti'],
]
]
);
$section->end_controls_section();
}
}
new RS_Exten_GSAP_Setting();