| @@ -596,8 +596,14 @@ | ||
| 596 | 596 | 'fields_options' => [ |
| 597 | 597 | 'background' => [ |
| 598 | 598 | 'frontend_available' => true, |
| 599 | 599 | ], |
| 600 | + 'image' => [ | |
| 601 | + 'background_lazyload' => [ | |
| 602 | + 'active' => true, | |
| 603 | + 'keys' => [ 'background_image', 'url' ], | |
| 604 | + ], | |
| 605 | + ], | |
| 600 | 606 | ], |
| 601 | 607 | ] |
| 602 | 608 | ); |
| 603 | 609 | |
| @@ -628,16 +634,13 @@ | ||
| 628 | 634 | 'type' => Controls_Manager::SLIDER, |
| 629 | 635 | 'default' => [ |
| 630 | 636 | 'size' => 0.3, |
| 631 | 637 | ], |
| 632 | - 'range' => [ | |
| 633 | - 'px' => [ | |
| 634 | - 'max' => 3, | |
| 635 | - 'step' => 0.1, | |
| 636 | - ], | |
| 637 | - ], | |
| 638 | 638 | 'render_type' => 'ui', |
| 639 | 639 | 'separator' => 'before', |
| 640 | + 'selectors' => [ | |
| 641 | + '{{WRAPPER}}' => '--background-transition: {{SIZE}}s;', | |
| 642 | + ], | |
| 640 | 643 | ] |
| 641 | 644 | ); |
| 642 | 645 | |
| 643 | 646 | $this->end_controls_tab(); |
| @@ -686,13 +689,19 @@ | ||
| 686 | 689 | // Hack to set the `::before` content in order to render it only when there is a background overlay. |
| 687 | 690 | $background_overlay_selector => '--background-overlay: \'\';', |
| 688 | 691 | ], |
| 689 | 692 | ], |
| 693 | + 'image' => [ | |
| 694 | + 'background_lazyload' => [ | |
| 695 | + 'active' => true, | |
| 696 | + 'keys' => [ 'background_overlay', 'url' ], | |
| 697 | + ], | |
| 698 | + ], | |
| 690 | 699 | ], |
| 691 | 700 | ] |
| 692 | 701 | ); |
| 693 | 702 | |
| 694 | - $this->add_control( | |
| 703 | + $this->add_responsive_control( | |
| 695 | 704 | 'background_overlay_opacity', |
| 696 | 705 | [ |
| 697 | 706 | 'label' => esc_html__( 'Opacity', 'elementor' ), |
| 698 | 707 | 'type' => Controls_Manager::SLIDER, |
| @@ -804,9 +813,9 @@ | ||
| 804 | 813 | ], |
| 805 | 814 | ] |
| 806 | 815 | ); |
| 807 | 816 | |
| 808 | - $this->add_control( | |
| 817 | + $this->add_responsive_control( | |
| 809 | 818 | 'background_overlay_hover_opacity', |
| 810 | 819 | [ |
| 811 | 820 | 'label' => esc_html__( 'Opacity', 'elementor' ), |
| 812 | 821 | 'type' => Controls_Manager::SLIDER, |
| @@ -849,9 +858,9 @@ | ||
| 849 | 858 | ], |
| 850 | 859 | 'render_type' => 'ui', |
| 851 | 860 | 'separator' => 'before', |
| 852 | 861 | 'selectors' => [ |
| 853 | - '{{WRAPPER}}' => '--overlay-transition: {{SIZE}}s;', | |
| 862 | + '{{WRAPPER}}, {{WRAPPER}}::before' => '--overlay-transition: {{SIZE}}s;', | |
| 854 | 863 | ], |
| 855 | 864 | ] |
| 856 | 865 | ); |
| 857 | 866 | |
| @@ -984,10 +993,9 @@ | ||
| 984 | 993 | ], |
| 985 | 994 | ], |
| 986 | 995 | ], |
| 987 | 996 | 'selectors' => [ |
| 988 | - '{{WRAPPER}}' => '--transition: background {{background_hover_transition.SIZE}}s, border {{SIZE}}s, border-radius {{SIZE}}s, box-shadow {{SIZE}}s', | |
| 989 | - '{{WRAPPER}}::before' => '--overlay-transition: background {{background_overlay_hover_transition.SIZE}}s, border-radius {{SIZE}}s, opacity {{background_overlay_hover_transition.SIZE}}s', | |
| 997 | + '{{WRAPPER}}, {{WRAPPER}}::before' => '--border-transition: {{SIZE}}s;', | |
| 990 | 998 | ], |
| 991 | 999 | ] |
| 992 | 1000 | ); |
| 993 | 1001 | |
| @@ -1619,13 +1627,30 @@ | ||
| 1619 | 1627 | $this->register_advanced_controls(); |
| 1620 | 1628 | |
| 1621 | 1629 | $this->register_motion_effects_controls(); |
| 1622 | 1630 | |
| 1631 | + $this->hook_sticky_notice_into_transform_section(); | |
| 1632 | + | |
| 1633 | + $this->register_transform_section( 'con' ); | |
| 1634 | + | |
| 1623 | 1635 | $this->register_responsive_controls(); |
| 1624 | 1636 | |
| 1625 | 1637 | Plugin::$instance->controls_manager->add_custom_attributes_controls( $this ); |
| 1626 | 1638 | |
| 1627 | 1639 | Plugin::$instance->controls_manager->add_custom_css_controls( $this ); |
| 1640 | + } | |
| 1641 | + | |
| 1642 | + protected function hook_sticky_notice_into_transform_section() { | |
| 1643 | + add_action( 'elementor/element/container/_section_transform/after_section_start', function( $container ) { | |
| 1644 | + $container->add_control( | |
| 1645 | + 'transform_sticky_notice', | |
| 1646 | + [ | |
| 1647 | + 'type' => Controls_Manager::RAW_HTML, | |
| 1648 | + 'raw' => esc_html__( 'Note: Avoid applying transform properties on sticky containers. Doing so might cause unexpected results.', 'elementor' ), | |
| 1649 | + 'content_classes' => 'elementor-panel-alert elementor-panel-alert-warning', | |
| 1650 | + ] | |
| 1651 | + ); | |
| 1652 | + } ); | |
| 1628 | 1653 | } |
| 1629 | 1654 | |
| 1630 | 1655 | /** |
| 1631 | 1656 | * Register the Container's controls. |