start_controls_section( 'eppro_section_entrance', [ 'label' => EPPRO_Elementor_Helper::panel_label( __( 'Entrance Animation', 'admore-widgets-suite' ) ), 'tab' => \Elementor\Controls_Manager::TAB_ADVANCED, ] ); // "None" is an empty value so prefix_class adds no class to the widget // wrapper (the old 'none' value printed a bare "none" class). Widgets // saved with 'none' keep working and are treated as "no animation". $this->add_control( 'eppro_entrance_animation', [ 'label' => __( 'Animation', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => '', 'options' => [ '' => __( 'None', 'admore-widgets-suite' ), 'eppro-fade-in' => __( 'Fade In', 'admore-widgets-suite' ), 'eppro-fade-in-up' => __( 'Fade In Up', 'admore-widgets-suite' ), 'eppro-fade-in-down'=> __( 'Fade In Down', 'admore-widgets-suite' ), 'eppro-fade-in-left'=> __( 'Fade In Left', 'admore-widgets-suite' ), 'eppro-fade-in-right'=>__( 'Fade In Right', 'admore-widgets-suite' ), 'eppro-zoom-in' => __( 'Zoom In', 'admore-widgets-suite' ), 'eppro-slide-up' => __( 'Slide Up', 'admore-widgets-suite' ), 'eppro-bounce-in' => __( 'Bounce In', 'admore-widgets-suite' ), ], 'prefix_class' => '', ] ); $this->add_control( 'eppro_entrance_duration', [ 'label' => __( 'Duration (ms)', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 200, 'max' => 2000, 'step' => 50 ] ], 'default' => [ 'size' => 600 ], 'selectors' => [ '{{WRAPPER}}' => '--eppro-entrance-duration: {{SIZE}}ms;' ], 'condition' => [ 'eppro_entrance_animation!' => [ '', 'none' ] ], ] ); $this->add_control( 'eppro_entrance_delay', [ 'label' => __( 'Delay (ms)', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 2000, 'step' => 50 ] ], 'default' => [ 'size' => 0 ], 'selectors' => [ '{{WRAPPER}}' => '--eppro-entrance-delay: {{SIZE}}ms;' ], 'condition' => [ 'eppro_entrance_animation!' => [ '', 'none' ] ], ] ); $this->end_controls_section(); } protected function eppro_register_spacing_controls( $selector ) { $this->add_responsive_control( 'eppro_padding', [ 'label' => __( 'Padding', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'selectors' => [ "{{WRAPPER}} {$selector}" => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'eppro_margin', [ 'label' => __( 'Margin', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'selectors' => [ "{{WRAPPER}} {$selector}" => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); } /** * Helper to get all published Elementor templates for SELECT controls. */ protected static function get_elementor_template_options(): array { $options = [ '0' => __( '— Select —', 'admore-widgets-suite' ) ]; $templates = get_posts( [ 'post_type' => 'elementor_library', 'post_status' => 'publish', 'posts_per_page' => -1, 'orderby' => 'title', 'order' => 'ASC', ] ); foreach ( $templates as $t ) { $options[ $t->ID ] = $t->post_title; } return $options; } } endif; // class_exists( 'EPPRO_Base_Widget' )