PluginProbe
King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder / 51.1.36
King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder v51.1.36
51.1.83 51.1.82 51.1.81 51.1.79 51.1.78 51.1.77 51.1.76 51.1.74 51.1.75 51.1.65 51.1.64 51.1.63 trunk 51.1.14 51.1.2 51.1.35 51.1.36 51.1.37 51.1.38 51.1.39 51.1.44 51.1.45 51.1.46 51.1.47 51.1.49 All 37 releases
king-addons / includes / features / Matte_Glass_Background / Matte_Glass_Background.php

Matte_Glass_Background.php in King Addons for Elementor – 80+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce, Mega Menu, Popup Builder 51.1.36, at includes/features/Matte_Glass_Background/Matte_Glass_Background.php

89 lines 3.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php /** @noinspection SpellCheckingInspection, PhpUnused */
2
3 namespace King_Addons;
4
5 use Elementor\Controls_Manager;
6
7 if (!defined('ABSPATH')) {
8 exit; // Exit if accessed directly.
9 }
10
11 class Matte_Glass_Background
12 {
13 private static ?Matte_Glass_Background $_instance = null;
14
15 public static function instance(): Matte_Glass_Background
16 {
17 if (is_null(self::$_instance)) {
18 self::$_instance = new self();
19 }
20 return self::$_instance;
21 }
22
23 public function __construct()
24 {
25 add_action('elementor/element/container/section_layout/after_section_end', [__CLASS__, 'addControls'], 1);
26 add_action('elementor/element/column/section_advanced/after_section_end', [__CLASS__, 'addControls'], 1);
27 add_action('elementor/element/section/section_advanced/after_section_end', [__CLASS__, 'addControls'], 1);
28 add_action('elementor/element/common/_section_style/after_section_end', [__CLASS__, 'addControls'], 1);
29 }
30
31 public static function addControls($section): void
32 {
33 $section->start_controls_section(
34 'kng_glass_bg_section',
35 [
36 'label' => KING_ADDONS_ELEMENTOR_ICON . esc_html__('Matte Glass Background', 'king-addons'),
37 'tab' => Controls_Manager::TAB_ADVANCED
38 ]
39 );
40
41 $section->add_control(
42 'kng_glass_bg_enable',
43 [
44 'label' => esc_html__('Enable Matte Glass Background', 'king-addons'),
45 'type' => Controls_Manager::SWITCHER,
46 'default' => '',
47 'return_value' => 'yes',
48 'label_on' => esc_html__('Yes', 'king-addons'),
49 'label_off' => esc_html__('No', 'king-addons'),
50 'prefix_class' => 'kng-glass-bg-',
51 ]
52 );
53
54 $section->add_control(
55 'kng_glass_bg_blur_value',
56 [
57 'label' => esc_html__('Blur Value', 'king-addons'),
58 'type' => Controls_Manager::NUMBER,
59 'min' => 0,
60 'max' => 100,
61 'step' => 1,
62 'default' => 20,
63 'selectors' => [
64 '{{WRAPPER}}.kng-glass-bg-yes' => 'backdrop-filter: blur({{SIZE}}px); -webkit-backdrop-filter: blur({{SIZE}}px);'
65 ],
66 'condition' => [
67 'kng_glass_bg_enable' => 'yes'
68 ],
69 ]
70 );
71
72 $section->add_control(
73 'kng_glass_bg_color',
74 [
75 'label' => esc_html__('Color', 'king-addons'),
76 'type' => Controls_Manager::COLOR,
77 'default' => 'rgba(0, 0, 0, 0)',
78 'selectors' => [
79 '{{WRAPPER}}.kng-glass-bg-yes' => 'background-color: {{VALUE}};',
80 ],
81 'condition' => [
82 'kng_glass_bg_enable' => 'yes'
83 ],
84 ]
85 );
86
87 $section->end_controls_section();
88 }
89 }