start_controls_section( 'eppro_section_advanced_spacing', [ 'label' => __( 'Spacing', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_ADVANCED, ] ); $this->add_responsive_control( 'eppro_margin', [ 'label' => __( 'Margin', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'selectors' => [ '{{WRAPPER}}' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'eppro_padding', [ 'label' => __( 'Padding', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%', 'em', 'rem' ], 'selectors' => [ '{{WRAPPER}}' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->end_controls_section(); // Motion Effects Section $this->start_controls_section( 'eppro_section_advanced_motion', [ 'label' => __( 'Motion Effects', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_ADVANCED, ] ); $this->add_control( 'eppro_entrance_animation', [ 'label' => __( 'Entrance Animation', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::ANIMATION, 'frontend_available' => true, ] ); $this->add_control( 'eppro_animation_duration', [ 'label' => __( 'Animation Duration', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SELECT, 'default' => '', 'options' => [ 'slow' => __( 'Slow', 'admore-widgets-suite' ), '' => __( 'Normal', 'admore-widgets-suite' ), 'fast' => __( 'Fast', 'admore-widgets-suite' ), ], 'condition' => [ 'eppro_entrance_animation!' => '', ], ] ); $this->add_control( 'eppro_animation_delay', [ 'label' => __( 'Animation Delay', 'admore-widgets-suite' ) . ' (ms)', 'type' => \Elementor\Controls_Manager::NUMBER, 'default' => '', 'min' => 0, 'step' => 100, 'condition' => [ 'eppro_entrance_animation!' => '', ], 'selectors' => [ '{{WRAPPER}}' => 'animation-delay: {{VALUE}}ms;', ], ] ); $this->add_control( 'eppro_hover_animation', [ 'label' => __( 'Hover Animation', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::HOVER_ANIMATION, ] ); $this->end_controls_section(); // Advanced Options Section $this->start_controls_section( 'eppro_section_advanced_options', [ 'label' => __( 'Advanced', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_ADVANCED, ] ); $this->add_responsive_control( 'eppro_z_index', [ 'label' => __( 'Z-Index', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::NUMBER, 'selectors' => [ '{{WRAPPER}}' => 'z-index: {{VALUE}};', ], ] ); $this->add_control( 'eppro_css_id', [ 'label' => __( 'CSS ID', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'default' => '', 'title' => __( 'Add your custom id WITHOUT the # key. e.g: my-id', 'admore-widgets-suite' ), 'description' => __( 'Please make sure the ID is unique and not used elsewhere on the page.', 'admore-widgets-suite' ), 'separator' => 'before', ] ); $this->add_control( 'eppro_css_classes', [ 'label' => __( 'CSS Classes', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::TEXT, 'dynamic' => [ 'active' => true, ], 'title' => __( 'Add your custom class WITHOUT the dot. e.g: my-class', 'admore-widgets-suite' ), ] ); $this->end_controls_section(); // Responsive Section $this->start_controls_section( 'eppro_section_advanced_responsive', [ 'label' => __( 'Responsive', 'admore-widgets-suite' ), 'tab' => \Elementor\Controls_Manager::TAB_ADVANCED, ] ); $this->add_control( 'eppro_hide_desktop', [ 'label' => __( 'Hide On Desktop', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => '', 'label_on' => __( 'Hide', 'admore-widgets-suite' ), 'label_off' => __( 'Show', 'admore-widgets-suite' ), 'return_value' => 'hidden-desktop', 'selectors_dictionary' => [ 'hidden-desktop' => 'display: none', ], 'selectors' => [ '{{WRAPPER}}' => '{{VALUE}}', ], ] ); $this->add_control( 'eppro_hide_tablet', [ 'label' => __( 'Hide On Tablet', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => '', 'label_on' => __( 'Hide', 'admore-widgets-suite' ), 'label_off' => __( 'Show', 'admore-widgets-suite' ), 'return_value' => 'hidden-tablet', 'selectors_dictionary' => [ 'hidden-tablet' => 'display: none', ], 'selectors' => [ '{{WRAPPER}}' => '{{VALUE}}', ], ] ); $this->add_control( 'eppro_hide_mobile', [ 'label' => __( 'Hide On Mobile', 'admore-widgets-suite' ), 'type' => \Elementor\Controls_Manager::SWITCHER, 'default' => '', 'label_on' => __( 'Hide', 'admore-widgets-suite' ), 'label_off' => __( 'Show', 'admore-widgets-suite' ), 'return_value' => 'hidden-mobile', 'selectors_dictionary' => [ 'hidden-mobile' => 'display: none', ], 'selectors' => [ '{{WRAPPER}}' => '{{VALUE}}', ], ] ); $this->end_controls_section(); } /** * Apply custom ID and classes to wrapper * Call this in render() method before outputting HTML * * @return array Attributes array for wrapper element */ protected function get_advanced_wrapper_attributes() { $settings = $this->get_settings_for_display(); $attributes = []; // Custom ID if ( ! empty( $settings['eppro_css_id'] ) ) { $attributes['id'] = $settings['eppro_css_id']; } // Custom classes $classes = []; if ( ! empty( $settings['eppro_css_classes'] ) ) { $classes[] = $settings['eppro_css_classes']; } // Entrance animation if ( ! empty( $settings['eppro_entrance_animation'] ) ) { $classes[] = 'elementor-animation-' . $settings['eppro_entrance_animation']; if ( ! empty( $settings['eppro_animation_duration'] ) ) { $classes[] = 'animated-' . $settings['eppro_animation_duration']; } } // Hover animation if ( ! empty( $settings['eppro_hover_animation'] ) ) { $classes[] = 'elementor-animation-' . $settings['eppro_hover_animation']; } // Responsive visibility if ( ! empty( $settings['eppro_hide_desktop'] ) ) { $classes[] = 'eppro-hide-desktop'; } if ( ! empty( $settings['eppro_hide_tablet'] ) ) { $classes[] = 'eppro-hide-tablet'; } if ( ! empty( $settings['eppro_hide_mobile'] ) ) { $classes[] = 'eppro-hide-mobile'; } if ( ! empty( $classes ) ) { $attributes['class'] = implode( ' ', $classes ); } return $attributes; } /** * Print wrapper attributes * Use in render() method: