'common', 'action' => '_section_style', ), array( 'element' => 'column', 'action' => 'section_advanced', ), ); // public function get_script_depends() { // return [ // 'jltma-floating-effects', // 'master-addons-scripts' // ]; // } private function add_controls($element, $args) { $element_type = $element->get_type(); $element->add_control( 'jltma_morphing_effects_switch', [ 'label' => __('Morphing Effects', 'master-addons' ), 'type' => Controls_Manager::SWITCHER, 'default' => '', 'label_on' => __('Yes', 'master-addons' ), 'label_off' => __('No', 'master-addons' ), 'return_value' => 'yes', 'frontend_available' => true, 'prefix_class' => 'jltma-morphing-fx-', ] ); $element->add_control( 'jltma_morphing_blob_animation', [ 'label' => esc_html__('Blob Animation', 'master-addons' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'jltma_blob_anim_01' => esc_html__('Effect One', 'master-addons' ), 'animation_svg_02' => esc_html__('Effect Two', 'master-addons' ), 'animation_svg_03' => esc_html__('Effect Three', 'master-addons' ), 'animation_svg_04' => esc_html__('Effect Four', 'master-addons' ), 'animation_svg_05' => esc_html__('Effect Five', 'master-addons' ), ], 'default' => 'animation_svg_02', 'frontend_available' => true, 'prefix_class' => '', 'condition' => [ 'jltma_morphing_effects_switch' => 'yes' ] ] ); $element->add_control( 'jltma_morphing_blob_type', [ 'label' => esc_html__('Blob Type', 'master-addons' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'color' => esc_html__('Color', 'master-addons' ), 'gradient' => esc_html__('Gradient', 'master-addons' ), 'lottie' => esc_html__('Lottie', 'master-addons' ) ], 'default' => 'gradient', 'condition' => [ 'jltma_morphing_effects_switch' => 'yes' ] ] ); $element->start_controls_tabs('jltma_morphing_effects_tabs'); $element->start_controls_tab( 'jltma_morphing_effects_normal', [ 'label' => esc_html__('Normal', 'master-addons' ), 'condition' => [ 'jltma_morphing_effects_switch' => 'yes' ] ] ); $element->add_control( 'ma_el_dual_heading_icon_color', [ 'label' => esc_html__('Background Color', 'master-addons' ), 'type' => Controls_Manager::COLOR, 'default' => '#4b00e7', 'selectors' => [ '{{WRAPPER}}.jltma_blob_anim_01, {{WRAPPER}}.animation_svg_02, {{WRAPPER}}.animation_svg_03, {{WRAPPER}}.animation_svg_04' => 'background: {{VALUE}};', ], 'condition' => [ 'jltma_morphing_blob_type' => 'color', 'jltma_morphing_effects_switch' => 'yes' ], ] ); $element->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'jltma_morphing_effects_background', 'types' => ['gradient'], 'frontend_available' => true, 'selectors' => [ '{{WRAPPER}}.jltma_blob_anim_01', '{{WRAPPER}}.animation_svg_02', '{{WRAPPER}}.animation_svg_03', '{{WRAPPER}}.animation_svg_04', ], 'condition' => [ 'jltma_morphing_blob_type' => 'gradient', 'jltma_morphing_effects_switch' => 'yes' ], ] ); $element->add_control( 'jltma_morphing_blob_blend_mode', [ 'label' => esc_html__('Blend Mode', 'master-addons' ), 'type' => Controls_Manager::SELECT, 'options' => [ 'normal' => 'Normal', 'color' => 'Color', 'multiply' => 'Multiply', 'screen' => 'Screen', 'overlay' => 'Overlay', 'darken' => 'Darken', 'lighten' => 'Lighten', 'color-dodge' => 'Color Dodge', 'color-burn' => 'Color Burn', 'hard-light' => 'Hard Light', 'soft-light' => 'Soft Light', 'difference' => 'Difference', 'exclusion' => 'Exclusion', 'hue' => 'Hue', 'saturation' => 'Saturation', 'luminosity' => 'Luminosity', ], 'default' => 'multiply', 'frontend_available' => true, 'separator' => 'before', 'selectors' => [ '{{WRAPPER}}' => 'mix-blend-mode: {{VALUE}};', ], 'condition' => [ 'jltma_morphing_effects_switch' => 'yes' ] ] ); $element->add_responsive_control( 'jltma_morphing_effects_width', [ 'label' => esc_html__('Width', 'master-addons' ), 'type' => Controls_Manager::SLIDER, // 'default' => [ // 'size' => '100', // ], 'range' => [ 'px' => [ 'min' => 100, 'max' => 2000, 'step' => 2, ], ], 'selectors' => [ '{{WRAPPER}}.jltma_blob_anim_01, {{WRAPPER}}.animation_svg_02, {{WRAPPER}}.animation_svg_03, {{WRAPPER}}.animation_svg_04' => 'width: {{SIZE}}{{UNIT}} !important;', ], 'condition' => [ 'jltma_morphing_effects_switch' => 'yes' ] ] ); $element->add_responsive_control( 'jltma_morphing_effects_height', [ 'label' => esc_html__('Height', 'master-addons' ), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 100, 'max' => 1000, 'step' => 2, ], ], 'selectors' => [ '{{WRAPPER}}.jltma_blob_anim_01, {{WRAPPER}}.animation_svg_02, {{WRAPPER}}.animation_svg_03, {{WRAPPER}}.animation_svg_04' => 'height: {{SIZE}}{{UNIT}} !important;' ], 'condition' => [ 'jltma_morphing_effects_switch' => 'yes' ] ] ); $element->add_group_control( Group_Control_Css_Filter::get_type(), [ 'name' => 'jltma_morphing_effects_filters', 'selector' => '{{WRAPPER}}', 'condition' => [ 'jltma_morphing_effects_switch' => 'yes' ] ] ); $element->add_group_control( JLTMA_Transition::get_type(), [ 'name' => 'jltma_morphing_effects_transition', 'selector' => '{{WRAPPER}}', 'condition' => [ 'jltma_morphing_effects_switch' => 'yes' ] ] ); // $element->add_control( // 'jltma_morphing_effects_transition_duration', // [ // 'label' => esc_html__( 'Transition Duration', 'master-addons' ), // 'type' => Controls_Manager::SLIDER, // 'range' => [ // 'px' => [ // 'step' => 100, // 'min' => 0, // 'max' => 10000, // ], // ], // 'default' => [ // 'size' => '400', // ], // 'selectors' => [ // '{{WRAPPER}} .elementor-widget' => 'transition: all {{SIZE}}ms;', // ], // ] // ); $element->end_controls_tab(); $element->start_controls_tab( 'jltma_morphing_effects_hover', [ 'label' => esc_html__('Hover', 'master-addons' ), 'condition' => [ 'jltma_morphing_effects_switch' => 'yes' ] ] ); $element->add_group_control( Group_Control_Css_Filter::get_type(), [ 'name' => 'jltma_morphing_effects_filters_hover', 'selector' => '{{WRAPPER}}:hover', 'condition' => [ 'jltma_morphing_effects_switch' => 'yes' ] ] ); $element->add_group_control( JLTMA_Transition::get_type(), [ 'name' => 'jltma_morphing_effects_hover_transition', 'selector' => '{{WRAPPER}}', ] ); // $element->add_control( // 'jltma_morphing_effects_transition_hover_duration', // [ // 'label' => esc_html__( 'Transition Duration', 'master-addons' ), // 'type' => Controls_Manager::SLIDER, // 'range' => [ // 'px' => [ // 'step' => 100, // 'min' => 0, // 'max' => 10000, // ], // ], // 'default' => [ // 'size' => '400', // ], // 'selectors' => [ // '{{WRAPPER}}:hover' => 'transition: all {{SIZE}}ms;', // ], // ] // ); $element->end_controls_tab(); $element->end_controls_tabs(); } protected function add_actions() { // Activate controls for widgets add_action('elementor/element/common/jltma_section_morphing_effects_advanced/before_section_end', function ($element, $args) { $this->add_controls($element, $args); }, 10, 2); // add_filter('elementor/widget/print_template', array($this, 'jltma_morphing_print_template'), 11, 2); add_action('elementor/widget/render_content', array($this, 'jltma_morphing_render_template'), 11, 2); } public function jltma_morphing_print_template($content, $widget) { if (!$content) return ''; $settings = $widget->get_settings_for_display(); $id_item = $widget->get_id(); $svg_shape = ""; if ($settings['jltma_morphing_blob_animation'] == "animation_svg_05") { $svg_shape = ' '; } // $content = "<# if ( '' !== settings.jltma_morphing_effects_switch ) { #>
" . $content . "
<# } else { #>" . $content . "<# } #>"; $content = "<# if ( '' !== settings.jltma_morphing_effects_switch ) { #>
" . $svg_shape . '
' . $content . "
<# } else { #>" . $content . "<# } #>"; return $content; } public function jltma_morphing_render_template($content, $widget) { $settings = $widget->get_settings_for_display(); if (isset($settings['jltma_morphing_effects_switch']) && $settings['jltma_morphing_effects_switch'] == 'yes') { $this->_enqueue_alles(); if (\Elementor\Plugin::$instance->editor->is_edit_mode()) { } $item_id = $widget->get_id(); // $svg_shape = ""; // $svg_shape_end = ""; // if($settings['jltma_morphing_blob_animation'] == "animation_svg_05"){ // $svg_shape .= ''; // } if ($settings['jltma_morphing_blob_animation'] == "animation_svg_05") { // $svg_shape_end .= ""; // $content = '
// // // // // // // // //

'. $content .'

//
'; // $content = '
' . $content . '
'; // $content .= '
// // // // // //
'; // } $content = '
' . $content . '
'; $content .= '

' . $content . '

'; } //
// // // //
} return $content; } public static function get_instance() { if (!self::$instance) { self::$instance = new self; } return self::$instance; } } }