Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/bdthemes-element-pack/modules/grid-line/module.php

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php
2 +
3 + namespace ElementPack\Modules\GridLine;
4 +
5 + use Elementor\Controls_Manager;
6 + use ElementPack\Base\Element_Pack_Module_Base;
7 +
8 + if (!defined('ABSPATH')) exit; // Exit if accessed directly
9 +
10 + class Module extends Element_Pack_Module_Base {
11 +
12 + public function __construct() {
13 + parent::__construct();
14 + $this->add_actions();
15 + }
16 +
17 + public function get_name() {
18 + return 'bdt-grid-line';
19 + }
20 +
21 + public function register_controls($section) {
22 +
23 + $section->start_controls_section(
24 + 'element_pack_grid_line_section',
25 + [
26 + 'tab' => Controls_Manager::TAB_SETTINGS,
27 + 'label' => BDTEP_CP . esc_html__('Grid Line', 'bdthemes-element-pack'),
28 + ]
29 + );
30 +
31 + $section->add_control(
32 + 'ep_grid_line_enable',
33 + [
34 + 'label' => esc_html__('Grid Line?', 'bdthemes-element-pack'),
35 + 'type' => Controls_Manager::SWITCHER,
36 + 'render_type' => 'template',
37 + ]
38 + );
39 +
40 + $section->add_control(
41 + 'ep_grid_line_line_color',
42 + [
43 + 'label' => esc_html__('Line Color', 'bdthemes-element-pack'),
44 + 'type' => Controls_Manager::COLOR,
45 + 'condition' => [
46 + 'ep_grid_line_enable' => 'yes'
47 + ],
48 + 'selectors' => [
49 + '{{WRAPPER}}' => '--ep-grid-line-color: {{VALUE}}',
50 + ],
51 + ]
52 + );
53 +
54 + $section->add_control(
55 + 'ep_grid_line_column_color',
56 + [
57 + 'label' => esc_html__('Column Color', 'bdthemes-element-pack'),
58 + 'type' => Controls_Manager::COLOR,
59 + 'condition' => [
60 + 'ep_grid_line_enable' => 'yes'
61 + ],
62 + 'selectors' => [
63 + '{{WRAPPER}}' => '--ep-grid-line-column-color: {{VALUE}}',
64 + ],
65 + ]
66 + );
67 +
68 +
69 + $section->add_responsive_control(
70 + 'ep_grid_line_columns',
71 + [
72 + 'label' => esc_html__('Columns', 'bdthemes-element-pack'),
73 + 'type' => Controls_Manager::NUMBER,
74 + 'min' => 1,
75 + 'max' => 12,
76 + 'step' => 1,
77 + 'devices' => ['desktop', 'tablet', 'mobile'],
78 + 'desktop_default' => 12,
79 + 'tablet_default' => 12,
80 + 'mobile_default' => 12,
81 + 'render_type' => 'none',
82 + 'condition' => [
83 + 'ep_grid_line_enable' => 'yes'
84 + ],
85 + 'selectors' => ['{{WRAPPER}}' => '--ep-grid-line-columns: {{VALUE}}']
86 + ]
87 + );
88 +
89 +
90 + $section->add_control(
91 + 'ep_grid_line_outline',
92 + [
93 + 'label' => esc_html__('Outline', 'bdthemes-element-pack'),
94 + 'type' => Controls_Manager::SWITCHER,
95 + 'render_type' => 'none',
96 + 'condition' => [
97 + 'ep_grid_line_enable' => 'yes'
98 + ],
99 + 'selectors' => ['body::before' => 'outline: var(--ep-grid-line-width, 1px) solid var(--ep-grid-line-color, #eee)']
100 + ]
101 + );
102 +
103 + $section->add_responsive_control(
104 + 'ep_grid_line_max_width',
105 + [
106 + 'label' => esc_html__('Max Width', 'bdthemes-element-pack'),
107 + 'type' => Controls_Manager::SLIDER,
108 + 'size_units' => ['px', 'em', '%'],
109 + 'range' => [
110 + 'px' => [
111 + 'min' => 0,
112 + 'max' => 3800,
113 + ],
114 + '%' => [
115 + 'min' => 0,
116 + 'max' => 100,
117 + ],
118 + ],
119 + 'devices' => ['desktop', 'tablet', 'mobile'],
120 + 'render_type' => 'none',
121 + 'condition' => [
122 + 'ep_grid_line_enable' => 'yes'
123 + ],
124 + 'selectors' => ['{{WRAPPER}}' => '--ep-grid-line-max-width: {{SIZE}}{{UNIT}}']
125 + ]
126 + );
127 +
128 + $section->add_responsive_control(
129 + 'ep_grid_line_line_width',
130 + [
131 + 'label' => esc_html__('Line Width', 'bdthemes-element-pack'),
132 + 'type' => Controls_Manager::SLIDER,
133 + 'size_units' => ['px', 'em', '%'],
134 + 'range' => [
135 + 'px' => [
136 + 'min' => 1,
137 + 'max' => 200,
138 + ],
139 + '%' => [
140 + 'min' => 1,
141 + 'max' => 100,
142 + ],
143 + ],
144 + 'default' => [
145 + 'unit' => 'px',
146 + 'size' => 1,
147 + ],
148 + 'render_type' => 'none',
149 + 'devices' => ['desktop', 'tablet', 'mobile'],
150 + 'condition' => [
151 + 'ep_grid_line_enable' => 'yes'
152 + ],
153 + 'selectors' => ['{{WRAPPER}}' => '--ep-grid-line-width: {{SIZE}}{{UNIT}}']
154 + ]
155 + );
156 +
157 + $section->add_control(
158 + 'ep_grid_line_direction',
159 + [
160 + 'label' => esc_html__('Line Direction (deg)', 'bdthemes-element-pack'),
161 + 'type' => Controls_Manager::SLIDER,
162 + 'range' => [
163 + 'px' => [
164 + 'min' => -360,
165 + 'max' => 360,
166 + 'step' => 15,
167 + ],
168 + ],
169 + 'render_type' => 'none',
170 + 'condition' => [
171 + 'ep_grid_line_enable' => 'yes'
172 + ],
173 + 'selectors' => [
174 + '{{WRAPPER}}' => '--ep-grid-line-direction: {{SIZE}}deg;',
175 + ],
176 + ]
177 + );
178 +
179 + $section->add_control(
180 + 'ep_grid_line_z_index',
181 + [
182 + 'label' => esc_html__('Z-index', 'bdthemes-element-pack'),
183 + 'type' => Controls_Manager::NUMBER,
184 + 'min' => 0,
185 + 'max' => 9999,
186 + 'render_type' => 'none',
187 + 'condition' => [
188 + 'ep_grid_line_enable' => 'yes'
189 + ],
190 + 'selectors' => [
191 + '{{WRAPPER}}' => '--ep-grid-line-z-index: {{VALUE}};',
192 + ],
193 + ]
194 + );
195 +
196 + // $section->add_control(
197 + // 'ep_grid_line_animation',
198 + // [
199 + // 'label' => esc_html__('Entrance Animation', 'bdthemes-element-pack'),
200 + // 'type' => Controls_Manager::SWITCHER,
201 + // 'condition' => [
202 + // 'ep_grid_line_enable' => 'yes'
203 + // ],
204 + // 'selectors' => [
205 + // 'body:before' => 'animation-name: ep-grid-line-animation-top-to-bottom; animation-duration: 4s;',
206 + // ],
207 + // ]
208 + // );
209 +
210 + $section->add_control(
211 + 'ep_grid_line_output',
212 + [
213 + 'type' => Controls_Manager::HIDDEN,
214 + 'default' => '1',
215 + 'selectors' => [
216 + 'body' => 'position: relative;',
217 + 'body::before' => '
218 + content : "";
219 + position : absolute;
220 + top : 0;
221 + right : 0;
222 + bottom : 0;
223 + left : 0;
224 + margin-right : auto;
225 + margin-left : auto;
226 + pointer-events: none;
227 + z-index : var(--ep-grid-line-z-index, 0);
228 + min-height : 100vh;
229 +
230 + width : calc(100% - (2 * 0px));
231 + max-width : var(--ep-grid-line-max-width, 100%);
232 + background-size : calc(100% + var(--ep-grid-line-width, 1px)) 100%;
233 + background-image: repeating-linear-gradient(var(--ep-grid-line-direction, 90deg), var(--ep-grid-line-column-color, transparent), var(--ep-grid-line-column-color, transparent) calc((100% / var(--ep-grid-line-columns, 12)) - var(--ep-grid-line-width, 1px)), var(--ep-grid-line-color, #eee) calc((100% / var(--ep-grid-line-columns, 12)) - var(--ep-grid-line-width, 1px)), var(--ep-grid-line-color, #eee) calc(100% / var(--ep-grid-line-columns, 12)));'
234 +
235 + ],
236 + 'condition' => [
237 + 'ep_grid_line_enable' => 'yes'
238 + ]
239 + ]
240 + );
241 +
242 + $section->end_controls_section();
243 + }
244 +
245 + protected function add_actions() {
246 +
247 + add_action('elementor/documents/register_controls', [$this, 'register_controls'], 1, 1);
248 + }
249 + }
250 +