Custom_JS.php
1 year ago
Hover_Effect.php
1 year ago
Image_Masking.php
2 months ago
Liquid_Glass_Effect.php
5 months ago
Post_Duplicator.php
2 months ago
Promotion.php
9 months ago
Reading_Progress.php
5 months ago
Scroll_to_Top.php
5 months ago
Table_of_Content.php
2 weeks ago
Vertical_Text_Orientation.php
7 months ago
Wrapper_Link.php
2 months ago
index.php
3 years ago
Liquid_Glass_Effect.php
681 lines
| 1 | <?php |
| 2 | |
| 3 | namespace Essential_Addons_Elementor\Extensions; |
| 4 | |
| 5 | use Elementor\Controls_Manager; |
| 6 | use Essential_Addons_Elementor\Traits\Helper as HelperTrait; |
| 7 | |
| 8 | if (! defined('ABSPATH')) { |
| 9 | exit; |
| 10 | } |
| 11 | |
| 12 | class Liquid_Glass_Effect |
| 13 | { |
| 14 | use HelperTrait; |
| 15 | /** |
| 16 | * Initialize hooks |
| 17 | */ |
| 18 | public function __construct() |
| 19 | { |
| 20 | add_action('elementor/element/container/section_layout/after_section_end', [$this, 'register_controls']); |
| 21 | add_action('elementor/element/column/section_advanced/after_section_end', [$this, 'register_controls']); |
| 22 | add_action('elementor/element/section/section_advanced/after_section_end', [$this, 'register_controls']); |
| 23 | add_action('elementor/element/common/_section_style/after_section_end', [$this, 'register_controls']); |
| 24 | add_action('elementor/frontend/before_render', [$this, 'before_render'], 100); |
| 25 | add_filter('elementor/widget/render_content', [$this, 'eael_liquid_glass_effect_svg_render'], 10, 2); |
| 26 | |
| 27 | // Add support for containers |
| 28 | add_action('elementor/frontend/container/after_render', [$this, 'eael_liquid_glass_effect_container_svg_render'], 10); |
| 29 | } |
| 30 | |
| 31 | public function eael_liquid_glass_effect_bg_color_effect($element, $effect, $default_bg_color) |
| 32 | { |
| 33 | $element->add_control( |
| 34 | 'eael_liquid_glass_effect_bg_color_' . $effect, |
| 35 | [ |
| 36 | 'label' => esc_html__('Background Color', 'essential-addons-for-elementor-lite'), |
| 37 | 'type' => Controls_Manager::COLOR, |
| 38 | 'default' => $default_bg_color, |
| 39 | 'selectors' => [ |
| 40 | '{{WRAPPER}}.eael_liquid_glass-' . $effect => 'background-color: {{VALUE}}', |
| 41 | ], |
| 42 | 'condition' => [ |
| 43 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 44 | 'eael_liquid_glass_effect' => $effect, |
| 45 | ], |
| 46 | ] |
| 47 | ); |
| 48 | } |
| 49 | |
| 50 | public function eael_liquid_glass_effect_backdrop_filter($element, $effect, $default_size) |
| 51 | { |
| 52 | $element->add_control( |
| 53 | 'eael_liquid_glass_effect_backdrop_filter_' . $effect, |
| 54 | [ |
| 55 | 'label' => esc_html__('Backdrop Filter', 'essential-addons-for-elementor-lite'), |
| 56 | 'type' => Controls_Manager::SLIDER, |
| 57 | 'range' => [ |
| 58 | 'px' => [ |
| 59 | 'min' => 0, |
| 60 | 'max' => 50, |
| 61 | 'step' => 1, |
| 62 | ], |
| 63 | ], |
| 64 | 'default' => [ |
| 65 | 'size' => $default_size, |
| 66 | ], |
| 67 | 'selectors' => [ |
| 68 | '{{WRAPPER}}.eael_liquid_glass-' . $effect => 'backdrop-filter: blur({{SIZE}}px)', |
| 69 | ], |
| 70 | 'condition' => [ |
| 71 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 72 | 'eael_liquid_glass_effect' => $effect, |
| 73 | ], |
| 74 | ] |
| 75 | ); |
| 76 | } |
| 77 | |
| 78 | public function eael_liquid_glass_effect_border($element, $effect, $default_color, $condition) |
| 79 | { |
| 80 | $element->add_group_control( |
| 81 | \Elementor\Group_Control_Border::get_type(), |
| 82 | [ |
| 83 | 'name' => 'eael_liquid_glass_border_' . $effect, |
| 84 | 'fields_options' => [ |
| 85 | 'border' => [ |
| 86 | 'default' => 'solid', |
| 87 | ], |
| 88 | 'width' => [ |
| 89 | 'default' => [ |
| 90 | 'top' => '1', |
| 91 | 'right' => '1', |
| 92 | 'bottom' => '1', |
| 93 | 'left' => '1', |
| 94 | 'isLinked' => false, |
| 95 | ], |
| 96 | ], |
| 97 | 'color' => [ |
| 98 | 'default' => $default_color, |
| 99 | ], |
| 100 | ], |
| 101 | 'selector' => '{{WRAPPER}}.eael_liquid_glass_shadow-' . $effect, |
| 102 | 'condition' => [ |
| 103 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 104 | 'eael_liquid_glass_border_distortion!' => 'yes', |
| 105 | 'eael_liquid_glass_shadow_effect' => $effect, |
| 106 | 'eael_liquid_glass_effect' => $condition, |
| 107 | ], |
| 108 | ] |
| 109 | ); |
| 110 | } |
| 111 | |
| 112 | public function eael_liquid_glass_effect_border_radius($element, $effect, $default_radius, $condition) |
| 113 | { |
| 114 | $element->add_control( |
| 115 | 'eael_liquid_glass_border_radius_' . $effect, |
| 116 | [ |
| 117 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 118 | 'type' => Controls_Manager::DIMENSIONS, |
| 119 | 'size_units' => ['px', '%', 'rem', 'custom'], |
| 120 | 'default' => $default_radius, |
| 121 | 'selectors' => [ |
| 122 | '{{WRAPPER}}.eael_liquid_glass_shadow-' . $effect => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 123 | ], |
| 124 | 'condition' => [ |
| 125 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 126 | 'eael_liquid_glass_border_distortion!' => 'yes', |
| 127 | 'eael_liquid_glass_shadow_effect' => $effect, |
| 128 | 'eael_liquid_glass_effect' => $condition, |
| 129 | ], |
| 130 | ] |
| 131 | ); |
| 132 | } |
| 133 | |
| 134 | public function eael_liquid_glass_effect_box_shadow($element, $effect, $default_shadow, $condition) |
| 135 | { |
| 136 | $element->add_group_control( |
| 137 | \Elementor\Group_Control_Box_Shadow::get_type(), |
| 138 | [ |
| 139 | 'name' => 'eael_liquid_glass_shadow_' . $effect, |
| 140 | 'fields_options' => [ |
| 141 | 'box_shadow_type' => ['default' => 'yes'], |
| 142 | 'box_shadow' => [ |
| 143 | 'default' => $default_shadow, |
| 144 | ], |
| 145 | ], |
| 146 | 'selector' => '{{WRAPPER}}.eael_liquid_glass_shadow-' . $effect, |
| 147 | 'condition' => [ |
| 148 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 149 | 'eael_liquid_glass_border_distortion!' => 'yes', |
| 150 | 'eael_liquid_glass_shadow_effect' => $effect, |
| 151 | 'eael_liquid_glass_effect' => $condition, |
| 152 | ], |
| 153 | ] |
| 154 | ); |
| 155 | } |
| 156 | |
| 157 | /** |
| 158 | * Summary of teaser_template |
| 159 | */ |
| 160 | public function teaser_template($texts) |
| 161 | { |
| 162 | $html = '<div class="ea-nerd-box"> |
| 163 | <div class="ea-nerd-box-message">' . $texts['messages'] . '</div> |
| 164 | <a class="ea-nerd-box-link elementor-button elementor-button-default" href="https://wpdeveloper.com/upgrade/ea-pro" target="_blank"> |
| 165 | ' . __('Upgrade to EA PRO', 'essential-addons-for-elementor-lite') . ' |
| 166 | </a> |
| 167 | </div>'; |
| 168 | |
| 169 | return $html; |
| 170 | } |
| 171 | |
| 172 | public function eael_pro_lock_icon() |
| 173 | { |
| 174 | if (!apply_filters('eael/pro_enabled', false)) { |
| 175 | $html = '<span class="e-control-motion-effects-promotion__lock-wrapper"><i class="eicon-lock"></i></span>'; |
| 176 | return $html; |
| 177 | } |
| 178 | return; |
| 179 | } |
| 180 | |
| 181 | public function register_controls($element) |
| 182 | { |
| 183 | $element->start_controls_section( |
| 184 | 'eael_liquid_glass_effect_section', |
| 185 | [ |
| 186 | 'label' => __('<i class="eaicon-logo"></i> Liquid Glass Effects', 'essential-addons-for-elementor-lite'), |
| 187 | 'tab' => Controls_Manager::TAB_ADVANCED |
| 188 | ] |
| 189 | ); |
| 190 | |
| 191 | $element->add_control( |
| 192 | 'eael_liquid_glass_effect_switch', |
| 193 | [ |
| 194 | 'label' => __('Enable Liquid Glass Effects', 'essential-addons-for-elementor-lite'), |
| 195 | 'type' => Controls_Manager::SWITCHER, |
| 196 | 'return_value' => 'yes', |
| 197 | ] |
| 198 | ); |
| 199 | |
| 200 | $element->add_control( |
| 201 | 'eael_liquid_glass_effect_notice', |
| 202 | [ |
| 203 | 'type' => Controls_Manager::ALERT, |
| 204 | 'alert_type' => 'info', |
| 205 | 'content' => esc_html__('Liquid glass effect is only visible when a semi-transparent background color is applied.', 'essential-addons-for-elementor-lite') . '<a href="https://essential-addons.com/docs/ea-liquid-glass-effects/" target="_blank">' . esc_html__('Learn More', 'essential-addons-for-elementor-lite') . '</a>', |
| 206 | 'condition' => [ |
| 207 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 208 | ] |
| 209 | ] |
| 210 | ); |
| 211 | |
| 212 | $eael_liquid_glass_effect = apply_filters( |
| 213 | 'eael_liquid_glass_effect_filter', |
| 214 | [ |
| 215 | 'styles' => [ |
| 216 | 'effect1' => esc_html__('Heavy Frost', 'essential-addons-for-elementor-lite'), |
| 217 | 'effect2' => esc_html__('Soft Mist', 'essential-addons-for-elementor-lite'), |
| 218 | 'effect3' => esc_html__('Glass Frost', 'essential-addons-for-elementor-lite'), |
| 219 | 'effect4' => esc_html__('Light Frost', 'essential-addons-for-elementor-lite'), |
| 220 | 'effect5' => esc_html__('Grain Frost', 'essential-addons-for-elementor-lite'), |
| 221 | 'effect6' => esc_html__('Fine Frost', 'essential-addons-for-elementor-lite'), |
| 222 | ], |
| 223 | ] |
| 224 | ); |
| 225 | |
| 226 | $element->add_control( |
| 227 | 'eael_liquid_glass_effect', |
| 228 | [ |
| 229 | 'label' => esc_html__('Liquid Glass Presets', 'essential-addons-for-elementor-lite'), |
| 230 | 'type' => Controls_Manager::CHOOSE, |
| 231 | 'label_block' => true, |
| 232 | 'options' => [ |
| 233 | 'effect1' => [ |
| 234 | 'title' => esc_html($eael_liquid_glass_effect['styles']['effect1']), |
| 235 | 'text' => esc_html($eael_liquid_glass_effect['styles']['effect1']), |
| 236 | ], |
| 237 | 'effect2' => [ |
| 238 | 'title' => esc_html($eael_liquid_glass_effect['styles']['effect2']), |
| 239 | 'text' => esc_html($eael_liquid_glass_effect['styles']['effect2']), |
| 240 | ], |
| 241 | 'effect3' => [ |
| 242 | 'title' => esc_html($eael_liquid_glass_effect['styles']['effect3']), |
| 243 | 'text' => esc_html($eael_liquid_glass_effect['styles']['effect3']) . $this->eael_pro_lock_icon(), |
| 244 | ], |
| 245 | 'effect4' => [ |
| 246 | 'title' => esc_html($eael_liquid_glass_effect['styles']['effect4']), |
| 247 | 'text' => esc_html($eael_liquid_glass_effect['styles']['effect4']) . $this->eael_pro_lock_icon(), |
| 248 | ], |
| 249 | 'effect5' => [ |
| 250 | 'title' => esc_html($eael_liquid_glass_effect['styles']['effect5']), |
| 251 | 'text' => esc_html($eael_liquid_glass_effect['styles']['effect5']) . $this->eael_pro_lock_icon(), |
| 252 | ], |
| 253 | 'effect6' => [ |
| 254 | 'title' => esc_html($eael_liquid_glass_effect['styles']['effect6']), |
| 255 | 'text' => esc_html($eael_liquid_glass_effect['styles']['effect6']) . $this->eael_pro_lock_icon(), |
| 256 | ], |
| 257 | ], |
| 258 | 'prefix_class' => 'eael_liquid_glass-', |
| 259 | 'condition' => [ |
| 260 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 261 | ], |
| 262 | 'default' => 'effect1', |
| 263 | 'multiline' => true, |
| 264 | ] |
| 265 | ); |
| 266 | |
| 267 | |
| 268 | if (!apply_filters('eael/pro_enabled', false)) { |
| 269 | $element->add_control( |
| 270 | 'eael_liquid_glass_effect_pro_alert', |
| 271 | [ |
| 272 | 'type' => Controls_Manager::RAW_HTML, |
| 273 | 'raw' => $this->teaser_template([ |
| 274 | 'messages' => __("To use this Liquid glass preset, Upgrade to Essential Addons Pro", 'essential-addons-for-elementor-lite'), |
| 275 | ]), |
| 276 | 'condition' => [ |
| 277 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 278 | 'eael_liquid_glass_effect' => ['effect3', 'effect4', 'effect5', 'effect6'], |
| 279 | ] |
| 280 | ] |
| 281 | ); |
| 282 | } else { |
| 283 | $element->add_control( |
| 284 | 'eael_liquid_glass_effect_settings', |
| 285 | [ |
| 286 | 'label' => esc_html__('Liquid Glass Settings', 'essential-addons-for-elementor-lite'), |
| 287 | 'type' => Controls_Manager::HEADING, |
| 288 | 'separator' => 'before', |
| 289 | 'condition' => [ |
| 290 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 291 | ] |
| 292 | ] |
| 293 | ); |
| 294 | } |
| 295 | |
| 296 | // Background Color Controls |
| 297 | $this->eael_liquid_glass_effect_bg_color_effect($element, 'effect1', '#FFFFFF1F'); |
| 298 | $this->eael_liquid_glass_effect_bg_color_effect($element, 'effect2', '#FFFFFF1F'); |
| 299 | |
| 300 | // Background Color Controls for Pro |
| 301 | do_action('eael_liquid_glass_effect_bg_color_effect4', $element, 'effect4', ''); |
| 302 | do_action('eael_liquid_glass_effect_bg_color_effect5', $element, 'effect5', ''); |
| 303 | do_action('eael_liquid_glass_effect_bg_color_effect6', $element, 'effect6', ''); |
| 304 | |
| 305 | // Backdrop Filter Controls |
| 306 | $this->eael_liquid_glass_effect_backdrop_filter($element, 'effect1', 24); |
| 307 | $this->eael_liquid_glass_effect_backdrop_filter($element, 'effect2', 20); |
| 308 | |
| 309 | // Brightness Effect Controls |
| 310 | $element->add_control( |
| 311 | 'eael_liquid_glass_effect_brightness_effect2', |
| 312 | [ |
| 313 | 'label' => esc_html__('Brightness', 'essential-addons-for-elementor-lite'), |
| 314 | 'type' => Controls_Manager::SLIDER, |
| 315 | 'range' => [ |
| 316 | 'px' => [ |
| 317 | 'min' => 0, |
| 318 | 'max' => 5, |
| 319 | 'step' => .1, |
| 320 | ], |
| 321 | ], |
| 322 | 'default' => [ |
| 323 | 'size' => 1, |
| 324 | ], |
| 325 | 'selectors' => [ |
| 326 | '{{WRAPPER}}.eael_liquid_glass-effect2' => 'backdrop-filter: blur({{eael_liquid_glass_effect_backdrop_filter_effect2.SIZE}}px) brightness({{SIZE}});', |
| 327 | ], |
| 328 | 'condition' => [ |
| 329 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 330 | 'eael_liquid_glass_effect' => 'effect2', |
| 331 | ] |
| 332 | ] |
| 333 | ); |
| 334 | |
| 335 | // Backdrop Filter Controls for Pro |
| 336 | do_action('eael_liquid_glass_effect_blur_effect3', $element, 'effect3', 0); |
| 337 | do_action('eael_liquid_glass_effect_saturate_effect3', $element, 'effect3', 100); |
| 338 | do_action('eael_liquid_glass_effect_border_radius_effect3', $element, 'effect3', '24px'); |
| 339 | |
| 340 | do_action('eael_liquid_glass_effect_backdrop_filter_effect4', $element, 'effect4', 5); |
| 341 | do_action('eael_liquid_glass_effect_backdrop_filter_effect5', $element, 'effect5', ''); |
| 342 | do_action('eael_liquid_glass_effect_backdrop_filter_effect6', $element, 'effect6', 7); |
| 343 | |
| 344 | // Noise Distortion Settings (Pro) |
| 345 | do_action('eael_liquid_glass_effect_noise_action', $element); |
| 346 | |
| 347 | if (!apply_filters('eael/pro_enabled', false)) { |
| 348 | $element->add_control( |
| 349 | 'eael_liquid_glass_border_distortion', |
| 350 | [ |
| 351 | 'label' => esc_html__('Enable Border Distortion', 'essential-addons-for-elementor-lite'), |
| 352 | 'type' => Controls_Manager::SWITCHER, |
| 353 | 'label_on' => esc_html__('On', 'essential-addons-for-elementor-lite'), |
| 354 | 'label_off' => esc_html__('Off', 'essential-addons-for-elementor-lite'), |
| 355 | 'return_value' => 'yes', |
| 356 | 'prefix_class' => 'eael_liquid_glass_border_distortion_', |
| 357 | 'condition' => [ |
| 358 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 359 | 'eael_liquid_glass_effect' => ['effect1', 'effect2'], |
| 360 | ], |
| 361 | ] |
| 362 | ); |
| 363 | |
| 364 | $element->add_control( |
| 365 | 'eael_liquid_glass_border_radious_distortion', |
| 366 | [ |
| 367 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 368 | 'type' => Controls_Manager::DIMENSIONS, |
| 369 | 'size_units' => ['px', '%', 'em', 'rem', 'custom'], |
| 370 | 'default' => [ |
| 371 | 'top' => 24, |
| 372 | 'right' => 24, |
| 373 | 'bottom' => 24, |
| 374 | 'left' => 24, |
| 375 | 'unit' => 'px', |
| 376 | 'isLinked' => true, |
| 377 | ], |
| 378 | 'selectors' => [ |
| 379 | '{{WRAPPER}}.eael_liquid_glass_border_distortion_yes' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 380 | ], |
| 381 | 'condition' => [ |
| 382 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 383 | 'eael_liquid_glass_border_distortion' => 'yes', |
| 384 | 'eael_liquid_glass_effect' => ['effect1', 'effect2'], |
| 385 | ], |
| 386 | ] |
| 387 | ); |
| 388 | |
| 389 | $element->add_control( |
| 390 | 'eael_liquid_glass_shadow_effect', |
| 391 | [ |
| 392 | 'label' => esc_html__('Shadow Effects', 'essential-addons-for-elementor-lite'), |
| 393 | 'type' => Controls_Manager::SELECT2, |
| 394 | 'default' => 'effect1', |
| 395 | 'separator' => 'before', |
| 396 | 'options' => [ |
| 397 | '' => esc_html__('None', 'essential-addons-for-elementor-lite'), |
| 398 | 'effect1' => esc_html__('Effect 1', 'essential-addons-for-elementor-lite'), |
| 399 | 'effect2' => esc_html__('Effect 2', 'essential-addons-for-elementor-lite'), |
| 400 | 'effect3' => esc_html__('Effect 3', 'essential-addons-for-elementor-lite'), |
| 401 | 'effect4' => esc_html__('Effect 4', 'essential-addons-for-elementor-lite'), |
| 402 | ], |
| 403 | 'prefix_class' => 'eael_liquid_glass_shadow-', |
| 404 | 'condition' => [ |
| 405 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 406 | 'eael_liquid_glass_border_distortion!' => 'yes', |
| 407 | 'eael_liquid_glass_effect' => ['effect1', 'effect2'], |
| 408 | ] |
| 409 | ] |
| 410 | ); |
| 411 | |
| 412 | $element->add_control( |
| 413 | 'eael_liquid_glass_shadow_inner', |
| 414 | [ |
| 415 | 'label' => esc_html__('Shadow Settings', 'essential-addons-for-elementor-lite'), |
| 416 | 'type' => Controls_Manager::HEADING, |
| 417 | 'separator' => 'before', |
| 418 | 'condition' => [ |
| 419 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 420 | 'eael_liquid_glass_shadow_effect!' => '', |
| 421 | 'eael_liquid_glass_border_distortion!' => 'yes', |
| 422 | 'eael_liquid_glass_effect' => ['effect1', 'effect2'], |
| 423 | ], |
| 424 | ] |
| 425 | ); |
| 426 | |
| 427 | // Add border effect for Liquid Glass Effects |
| 428 | $this->eael_liquid_glass_effect_border($element, 'effect1', '#FFFFFF1F', ['effect1', 'effect2']); |
| 429 | $this->eael_liquid_glass_effect_border($element, 'effect2', '#FFFFFF1F', ['effect1', 'effect2']); |
| 430 | $this->eael_liquid_glass_effect_border($element, 'effect3', '#FFFFFF1F', ['effect1', 'effect2']); |
| 431 | $this->eael_liquid_glass_effect_border($element, 'effect4', '#AAAAAA1A', ['effect1', 'effect2']); |
| 432 | |
| 433 | // Add border radius effect for Liquid Glass Effects |
| 434 | $this->eael_liquid_glass_effect_border_radius($element, 'effect1', [ |
| 435 | 'top' => 24, |
| 436 | 'right' => 24, |
| 437 | 'bottom' => 24, |
| 438 | 'left' => 24, |
| 439 | 'unit' => 'px', |
| 440 | 'isLinked' => true, |
| 441 | ], ['effect1', 'effect2']); |
| 442 | |
| 443 | $this->eael_liquid_glass_effect_border_radius($element, 'effect2', [ |
| 444 | 'top' => 16, |
| 445 | 'right' => 16, |
| 446 | 'bottom' => 16, |
| 447 | 'left' => 16, |
| 448 | 'unit' => 'px', |
| 449 | 'isLinked' => true, |
| 450 | ], ['effect1', 'effect2']); |
| 451 | |
| 452 | $this->eael_liquid_glass_effect_border_radius($element, 'effect3', [ |
| 453 | 'top' => 8, |
| 454 | 'right' => 8, |
| 455 | 'bottom' => 8, |
| 456 | 'left' => 8, |
| 457 | 'unit' => 'px', |
| 458 | 'isLinked' => true, |
| 459 | ], ['effect1', 'effect2']); |
| 460 | |
| 461 | $this->eael_liquid_glass_effect_border_radius($element, 'effect4', [ |
| 462 | 'top' => 24, |
| 463 | 'right' => 24, |
| 464 | 'bottom' => 24, |
| 465 | 'left' => 24, |
| 466 | 'unit' => 'px', |
| 467 | 'isLinked' => true, |
| 468 | ], ['effect1', 'effect2']); |
| 469 | |
| 470 | // Add box shadow effect for Liquid Glass Effects |
| 471 | $this->eael_liquid_glass_effect_box_shadow($element, 'effect1', [ |
| 472 | 'color' => 'rgba(0,0,0,0.78)', |
| 473 | 'horizontal' => 0, |
| 474 | 'vertical' => 19, |
| 475 | 'blur' => 26, |
| 476 | 'spread' => 1, |
| 477 | ], ['effect1', 'effect2']); |
| 478 | |
| 479 | $this->eael_liquid_glass_effect_box_shadow($element, 'effect2', [ |
| 480 | 'color' => '#383C65', |
| 481 | 'horizontal' => 0, |
| 482 | 'vertical' => 0, |
| 483 | 'blur' => 33, |
| 484 | 'spread' => -2, |
| 485 | ], ['effect1', 'effect2']); |
| 486 | |
| 487 | $this->eael_liquid_glass_effect_box_shadow($element, 'effect3', [ |
| 488 | 'color' => 'rgba(255, 255, 255, 0.4)', |
| 489 | 'horizontal' => 1, |
| 490 | 'vertical' => 1, |
| 491 | 'blur' => 10, |
| 492 | 'spread' => 5, |
| 493 | ], ['effect1', 'effect2']); |
| 494 | |
| 495 | $this->eael_liquid_glass_effect_box_shadow($element, 'effect4', [ |
| 496 | 'color' => '#00000040', |
| 497 | 'horizontal' => 0, |
| 498 | 'vertical' => 9, |
| 499 | 'blur' => 21, |
| 500 | 'spread' => 0, |
| 501 | ], ['effect1', 'effect2']); |
| 502 | } else { |
| 503 | $element->add_control( |
| 504 | 'eael_liquid_glass_border_distortion', |
| 505 | [ |
| 506 | 'label' => esc_html__('Enable Border Distortion', 'essential-addons-for-elementor-lite'), |
| 507 | 'type' => Controls_Manager::SWITCHER, |
| 508 | 'label_on' => esc_html__('On', 'essential-addons-for-elementor-lite'), |
| 509 | 'label_off' => esc_html__('Off', 'essential-addons-for-elementor-lite'), |
| 510 | 'return_value' => 'yes', |
| 511 | 'prefix_class' => 'eael_liquid_glass_border_distortion_', |
| 512 | 'condition' => [ |
| 513 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 514 | 'eael_liquid_glass_effect' => ['effect1', 'effect2', 'effect4', 'effect5', 'effect6'], |
| 515 | ], |
| 516 | ] |
| 517 | ); |
| 518 | |
| 519 | $element->add_control( |
| 520 | 'eael_liquid_glass_border_radious_distortion', |
| 521 | [ |
| 522 | 'label' => esc_html__('Border Radius', 'essential-addons-for-elementor-lite'), |
| 523 | 'type' => Controls_Manager::DIMENSIONS, |
| 524 | 'size_units' => ['px', '%', 'em', 'rem', 'custom'], |
| 525 | 'default' => [ |
| 526 | 'top' => 24, |
| 527 | 'right' => 24, |
| 528 | 'bottom' => 24, |
| 529 | 'left' => 24, |
| 530 | 'unit' => 'px', |
| 531 | 'isLinked' => true, |
| 532 | ], |
| 533 | 'selectors' => [ |
| 534 | '{{WRAPPER}}.eael_liquid_glass_border_distortion_yes' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 535 | ], |
| 536 | 'condition' => [ |
| 537 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 538 | 'eael_liquid_glass_border_distortion' => 'yes', |
| 539 | 'eael_liquid_glass_effect' => ['effect1', 'effect2', 'effect4', 'effect5', 'effect6'], |
| 540 | ], |
| 541 | ] |
| 542 | ); |
| 543 | |
| 544 | $element->add_control( |
| 545 | 'eael_liquid_glass_shadow_effect', |
| 546 | [ |
| 547 | 'label' => esc_html__('Shadow Effects', 'essential-addons-for-elementor-lite'), |
| 548 | 'type' => Controls_Manager::SELECT2, |
| 549 | 'default' => 'effect1', |
| 550 | 'separator' => 'before', |
| 551 | 'options' => [ |
| 552 | '' => esc_html__('None', 'essential-addons-for-elementor-lite'), |
| 553 | 'effect1' => esc_html__('Effect 1', 'essential-addons-for-elementor-lite'), |
| 554 | 'effect2' => esc_html__('Effect 2', 'essential-addons-for-elementor-lite'), |
| 555 | 'effect3' => esc_html__('Effect 3', 'essential-addons-for-elementor-lite'), |
| 556 | 'effect4' => esc_html__('Effect 4', 'essential-addons-for-elementor-lite'), |
| 557 | ], |
| 558 | 'prefix_class' => 'eael_liquid_glass_shadow-', |
| 559 | 'condition' => [ |
| 560 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 561 | 'eael_liquid_glass_border_distortion!' => 'yes', |
| 562 | 'eael_liquid_glass_effect' => ['effect1', 'effect2', 'effect4', 'effect5', 'effect6'], |
| 563 | ] |
| 564 | ] |
| 565 | ); |
| 566 | |
| 567 | $element->add_control( |
| 568 | 'eael_liquid_glass_shadow_inner', |
| 569 | [ |
| 570 | 'label' => esc_html__('Shadow Settings', 'essential-addons-for-elementor-lite'), |
| 571 | 'type' => Controls_Manager::HEADING, |
| 572 | 'separator' => 'before', |
| 573 | 'condition' => [ |
| 574 | 'eael_liquid_glass_effect_switch' => 'yes', |
| 575 | 'eael_liquid_glass_shadow_effect!' => '', |
| 576 | 'eael_liquid_glass_border_distortion!' => 'yes', |
| 577 | 'eael_liquid_glass_effect' => ['effect1', 'effect2', 'effect4', 'effect5', 'effect6'], |
| 578 | ], |
| 579 | ] |
| 580 | ); |
| 581 | |
| 582 | // Add border effect for Liquid Glass Effects |
| 583 | $this->eael_liquid_glass_effect_border($element, 'effect1', '#FFFFFF1F', ['effect1', 'effect2', 'effect4', 'effect5', 'effect6']); |
| 584 | $this->eael_liquid_glass_effect_border($element, 'effect2', '#FFFFFF1F', ['effect1', 'effect2', 'effect4', 'effect5', 'effect6']); |
| 585 | $this->eael_liquid_glass_effect_border($element, 'effect3', '#FFFFFF1F', ['effect1', 'effect2', 'effect4', 'effect5', 'effect6']); |
| 586 | $this->eael_liquid_glass_effect_border($element, 'effect4', '#AAAAAA1A', ['effect1', 'effect2', 'effect4', 'effect5', 'effect6']); |
| 587 | |
| 588 | // Add border radius effect for Liquid Glass Effects |
| 589 | $this->eael_liquid_glass_effect_border_radius($element, 'effect1', [ |
| 590 | 'top' => 24, |
| 591 | 'right' => 24, |
| 592 | 'bottom' => 24, |
| 593 | 'left' => 24, |
| 594 | 'unit' => 'px', |
| 595 | 'isLinked' => true, |
| 596 | ], ['effect1', 'effect2', 'effect4', 'effect5', 'effect6']); |
| 597 | |
| 598 | $this->eael_liquid_glass_effect_border_radius($element, 'effect2', [ |
| 599 | 'top' => 16, |
| 600 | 'right' => 16, |
| 601 | 'bottom' => 16, |
| 602 | 'left' => 16, |
| 603 | 'unit' => 'px', |
| 604 | 'isLinked' => true, |
| 605 | ], ['effect1', 'effect2', 'effect4', 'effect5', 'effect6']); |
| 606 | |
| 607 | $this->eael_liquid_glass_effect_border_radius($element, 'effect3', [ |
| 608 | 'top' => 8, |
| 609 | 'right' => 8, |
| 610 | 'bottom' => 8, |
| 611 | 'left' => 8, |
| 612 | 'unit' => 'px', |
| 613 | 'isLinked' => true, |
| 614 | ], ['effect1', 'effect2', 'effect4', 'effect5', 'effect6']); |
| 615 | |
| 616 | $this->eael_liquid_glass_effect_border_radius($element, 'effect4', [ |
| 617 | 'top' => 24, |
| 618 | 'right' => 24, |
| 619 | 'bottom' => 24, |
| 620 | 'left' => 24, |
| 621 | 'unit' => 'px', |
| 622 | 'isLinked' => true, |
| 623 | ], ['effect1', 'effect2', 'effect4', 'effect5', 'effect6']); |
| 624 | |
| 625 | // Add box shadow effect for Liquid Glass Effects |
| 626 | $this->eael_liquid_glass_effect_box_shadow($element, 'effect1', [ |
| 627 | 'color' => 'rgba(0,0,0,0.78)', |
| 628 | 'horizontal' => 0, |
| 629 | 'vertical' => 19, |
| 630 | 'blur' => 26, |
| 631 | 'spread' => 1, |
| 632 | ], ['effect1', 'effect2', 'effect4', 'effect5', 'effect6']); |
| 633 | |
| 634 | $this->eael_liquid_glass_effect_box_shadow($element, 'effect2', [ |
| 635 | 'color' => '#383C65', |
| 636 | 'horizontal' => 0, |
| 637 | 'vertical' => 0, |
| 638 | 'blur' => 33, |
| 639 | 'spread' => -2, |
| 640 | ], ['effect1', 'effect2', 'effect4', 'effect5', 'effect6']); |
| 641 | |
| 642 | $this->eael_liquid_glass_effect_box_shadow($element, 'effect3', [ |
| 643 | 'color' => 'rgba(255, 255, 255, 0.4)', |
| 644 | 'horizontal' => 1, |
| 645 | 'vertical' => 1, |
| 646 | 'blur' => 10, |
| 647 | 'spread' => 5, |
| 648 | ], ['effect1', 'effect2', 'effect4', 'effect5', 'effect6']); |
| 649 | |
| 650 | $this->eael_liquid_glass_effect_box_shadow($element, 'effect4', [ |
| 651 | 'color' => '#00000040', |
| 652 | 'horizontal' => 0, |
| 653 | 'vertical' => 9, |
| 654 | 'blur' => 21, |
| 655 | 'spread' => 0, |
| 656 | ], ['effect1', 'effect2', 'effect4', 'effect5', 'effect6']); |
| 657 | } |
| 658 | |
| 659 | $element->end_controls_section(); |
| 660 | } |
| 661 | |
| 662 | public function before_render($element) |
| 663 | { |
| 664 | $settings = $element->get_settings_for_display(); |
| 665 | } |
| 666 | |
| 667 | public function eael_liquid_glass_effect_svg_render($content, $element) |
| 668 | { |
| 669 | $settings = $element->get_settings_for_display(); |
| 670 | do_action('eael_liquid_glass_effect_svg_pro', $element, $settings); |
| 671 | |
| 672 | return $content; |
| 673 | } |
| 674 | |
| 675 | public function eael_liquid_glass_effect_container_svg_render($element) |
| 676 | { |
| 677 | $settings = $element->get_settings_for_display(); |
| 678 | do_action('eael_liquid_glass_effect_svg_pro', $element, $settings); |
| 679 | } |
| 680 | } |
| 681 |