PluginProbe ʕ •ᴥ•ʔ
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor / 4.0.1
ElementsKit Elementor Addons – Advanced Widgets & Templates Addons for Elementor v4.0.1
4.0.2 4.0.1 4.0.0 3.10.02 3.10.01 3.9.10 3.9.9 3.9.8 3.9.7 3.9.5 3.9.6 3.9.3 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.2.0 2.2.1 2.2.2 2.2.3 2.2.4 2.3.0 2.3.1 2.3.1.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.4.0 2.5.0 2.5.1 2.5.10 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.2 2.6.3 2.7.0 2.7.2 2.7.3 2.7.4 2.7.5 2.8.0 2.8.1 2.8.5 2.8.6 2.8.7 2.8.8 2.9.0 2.9.1 2.9.2 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.6.0 3.6.1 3.7.0 3.7.1 3.7.2 3.7.3 3.7.4 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8.0 3.8.1 3.8.2 3.9.0 3.9.1 3.9.2 trunk 1.2.6 1.2.7 1.2.9 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.8 1.3.9 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.11 1.5.12 1.5.2 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.0.9.1 2.0.9.2 2.0.9.3
elementskit-lite / widgets / image-box / image-box.php
elementskit-lite / widgets / image-box Last commit date
image-box-handler.php 3 years ago image-box.php 3 weeks ago
image-box.php
1733 lines
1 <?php
2
3 namespace Elementor;
4
5 use \Elementor\ElementsKit_Widget_Image_Box_Handler as Handler;
6 use \ElementsKit_Lite\Modules\Controls\Controls_Manager as ElementsKit_Controls_Manager;
7
8 if ( ! defined( 'ABSPATH' ) ) exit;
9
10 class ElementsKit_Widget_Image_Box extends Widget_Base {
11 use \ElementsKit_Lite\Widgets\Widget_Notice;
12
13 public $base;
14
15 public function get_name() {
16 return Handler::get_name();
17 }
18
19 public function get_title() {
20 return Handler::get_title();
21 }
22
23 public function get_icon() {
24 return Handler::get_icon();
25 }
26
27 public function get_categories() {
28 return Handler::get_categories();
29 }
30
31 public function get_keywords() {
32 return Handler::get_keywords();
33 }
34
35 public function get_help_url() {
36 return 'https://wpmet.com/doc/image-box-2/';
37 }
38
39 public function get_style_depends() {
40 return ['ekit-button','ekit-image-box'];
41 }
42
43 protected function is_dynamic_content(): bool {
44 return false;
45 }
46
47 public function has_widget_inner_wrapper(): bool {
48 return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' );
49 }
50
51 protected function register_controls() {
52
53 // start content section for set Image
54 $this->start_controls_section(
55 'ekit_image_box_section_infoboxwithimage',
56 [
57 'label' => esc_html__( 'Image', 'elementskit-lite' ),
58 ]
59 );
60
61 // Image insert
62 $this->add_control(
63 'ekit_image_box_image',
64 [
65 'label' => esc_html__( 'Choose Image', 'elementskit-lite' ),
66 'type' => Controls_Manager::MEDIA,
67 'dynamic' => [
68 'active' => true,
69 ],
70 'default' => [
71 'url' => Utils::get_placeholder_image_src(),
72 'id' => -1
73 ],
74 ]
75 );
76
77 $this->add_group_control(
78 Group_Control_Image_Size::get_type(),
79 [
80 'name' => 'ekit_image_box_thumbnail',
81 'default' => 'full',
82 'separator' => 'none',
83 ]
84 );
85
86 // simple style
87
88 $this->add_control(
89 'ekit_image_box_style_simple',
90 [
91 'label' => esc_html__( 'Content Area', 'elementskit-lite' ),
92 'type' => Controls_Manager::SELECT,
93 'default' => 'simple-card',
94 'options' => [
95 'simple-card' => esc_html__( 'Simple', 'elementskit-lite' ),
96 'style-modern' => esc_html__( 'Classic Curves', 'elementskit-lite' ),
97 'floating-style' => esc_html__( 'Floating box', 'elementskit-lite' ),
98 'hover-border-bottom' => esc_html__( 'Hover Border', 'elementskit-lite' ),
99 'style-sideline' => esc_html__( 'Side Line', 'elementskit-lite' ),
100 'shadow-line' => esc_html__( 'Shadow line', 'elementskit-lite' ),
101 ],
102 ]
103 );
104
105 $this->add_control(
106 'enable_equal_height',
107 [
108 'label' => esc_html__( 'Equal Height?', 'elementskit-lite' ),
109 'type' => Controls_Manager::SELECT,
110 'options' => [
111 'enable' => esc_html__( 'Enable', 'elementskit-lite' ),
112 'disable' => esc_html__( 'Disable', 'elementskit-lite' ),
113 ],
114 'default' => 'disable',
115 'prefix_class' => 'ekit-equal-height-',
116 // TODO: Remove this line `{{WRAPPER}}.ekit-equal-height-enable > div` condition after the `Optimized Markup` feature is stable
117 'selectors' => [
118 '{{WRAPPER}}.ekit-equal-height-enable,
119 {{WRAPPER}}.ekit-equal-height-enable > div,
120 {{WRAPPER}}.ekit-equal-height-enable .ekit-wid-con,
121 {{WRAPPER}}.ekit-equal-height-enable .ekit-wid-con .elementskit-info-image-box' => 'height: 100%;',
122 ],
123 'condition' => [
124 'ekit_image_box_style_simple!' => 'floating-style'
125 ]
126 ]
127 );
128
129 $this->add_control(
130 'ekit_image_box_enable_link',
131 [
132 'label' => esc_html__( 'Enable Link', 'elementskit-lite' ),
133 'type' => Controls_Manager::SWITCHER,
134 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ),
135 'label_off' => esc_html__( 'No', 'elementskit-lite' ),
136 'return_value' => 'yes',
137 ]
138 );
139
140 $this->add_control(
141 'ekit_image_box_website_link',
142 [
143 'label' => esc_html__( 'Link', 'elementskit-lite' ),
144 'type' => Controls_Manager::URL,
145 'placeholder' => esc_html__( 'https://wpmet.com', 'elementskit-lite' ),
146 'show_external' => true,
147 'condition' => [
148 'ekit_image_box_enable_link' => 'yes'
149 ],
150 'dynamic' => [
151 'active' => true,
152 ],
153 ]
154 );
155
156 // end content section for set Image
157 $this->end_controls_section();
158
159
160 // start content section for image title and sub title
161 $this->start_controls_section(
162 'ekit_image_box_section_for_image_title',
163 [
164 'label' => esc_html__( 'Body', 'elementskit-lite' ),
165 ]
166 );
167
168 $this->add_control(
169 'ekit_image_box_title_text',
170 [
171 'label' => esc_html__( 'Title ', 'elementskit-lite' ),
172 'type' => Controls_Manager::TEXT,
173 'dynamic' => [
174 'active' => true,
175 ],
176 'default' => esc_html__( 'This is the heading', 'elementskit-lite' ),
177 'placeholder' => esc_html__( 'Enter your title', 'elementskit-lite' ),
178 'label_block' => true,
179 'separator' => 'before',
180 ]
181 );
182
183 $this->add_control(
184 'ekit_image_box_front_title_icons__switch',
185 [
186 'label' => esc_html__('Add icon? ', 'elementskit-lite'),
187 'type' => Controls_Manager::SWITCHER,
188 'default' => 'yes',
189 'label_on' =>esc_html__( 'Yes', 'elementskit-lite' ),
190 'label_off' =>esc_html__( 'No', 'elementskit-lite' ),
191 'condition' => [
192 'ekit_image_box_style_simple' => 'floating-style',
193 ]
194 ]
195 );
196
197 $this->add_control(
198 'ekit_image_box_front_title_icons',
199 [
200 'label' => esc_html__( 'Title Icon', 'elementskit-lite' ),
201 'type' => Controls_Manager::ICONS,
202 'fa4compatibility' => 'ekit_image_box_front_title_icon',
203 'default' => [
204 'value' => 'icon icon-review',
205 'library' => 'ekiticons',
206 ],
207 'condition' => [
208 'ekit_image_box_style_simple' => 'floating-style',
209 'ekit_image_box_front_title_icons__switch' => 'yes'
210 ]
211 ]
212 );
213
214 $this->add_control(
215 'ekit_image_box_front_title_icon_position',
216 [
217 'label' => esc_html__( 'Title Icon Position', 'elementskit-lite' ),
218 'type' => Controls_Manager::SELECT,
219 'default' => 'left',
220 'options' => [
221 'left' =>esc_html__( 'Before', 'elementskit-lite' ),
222 'right' =>esc_html__( 'After', 'elementskit-lite' ),
223 ],
224 'condition' => [
225 'ekit_image_box_front_title_icons__switch' => 'yes',
226 'ekit_image_box_style_simple' => 'floating-style',
227 ]
228 ]
229 );
230
231 // title tag
232 $this->add_control(
233 'ekit_image_box_title_size',
234 [
235 'label' => esc_html__( 'Title HTML Tag', 'elementskit-lite' ),
236 'type' => Controls_Manager::SELECT,
237 'options' => [
238 'h1' => 'H1',
239 'h2' => 'H2',
240 'h3' => 'H3',
241 'h4' => 'H4',
242 'h5' => 'H5',
243 'h6' => 'H6',
244 'div' => 'div',
245 'span' => 'span',
246 'p' => 'p',
247 ],
248 'default' => 'h3',
249 ]
250 );
251
252 $this->add_control(
253 'ekit_image_box_description_text',
254 [
255 'label' => esc_html__( 'Description', 'elementskit-lite' ),
256 'type' => Controls_Manager::TEXTAREA,
257 'dynamic' => [
258 'active' => true,
259 ],
260 'default' => esc_html__( 'Click edit to change this text. Lorem ipsum dolor sit amet, cctetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'elementskit-lite' ),
261 'placeholder' => esc_html__( 'Enter your description', 'elementskit-lite' ),
262 'separator' => 'none',
263 'rows' => 10,
264 'show_label' => false,
265 ]
266 );
267
268 // Text aliment
269
270 $this->add_control(
271 'ekit_image_box_content_text_align',
272 [
273 'label' => esc_html__( 'Alignment', 'elementskit-lite' ),
274 'type' => Controls_Manager::CHOOSE,
275 'options' => [
276 'left' => [
277 'title' => esc_html__( 'Left', 'elementskit-lite' ),
278 'icon' => 'eicon-text-align-left',
279 ],
280 'center' => [
281 'title' => esc_html__( 'Center', 'elementskit-lite' ),
282 'icon' => 'eicon-text-align-center',
283 ],
284 'right' => [
285 'title' => esc_html__( 'Right', 'elementskit-lite' ),
286 'icon' => 'eicon-text-align-right',
287 ],
288 ],
289 'default' => 'center',
290 'toggle' => true,
291 ]
292 );
293
294 // end content section for image title and sub title
295 $this->end_controls_section();
296
297 // start content section for button
298 // Section Button
299
300 $this->start_controls_section(
301 'ekit_image_box_section_button',
302 [
303 'label' => esc_html__( 'Button', 'elementskit-lite' ),
304 ]
305 );
306 $this->add_control(
307 'ekit_image_box_enable_btn',
308 [
309 'label' => esc_html__( 'Enable Button', 'elementskit-lite' ),
310 'type' => Controls_Manager::SWITCHER,
311 'default' => 'yes',
312 'separator' => 'before',
313 ]
314 );
315 $this->add_control(
316 'ekit_image_box_btn_text',
317 [
318 'label' =>esc_html__( 'Label', 'elementskit-lite' ),
319 'type' => Controls_Manager::TEXT,
320 'default' =>esc_html__( 'Learn more ', 'elementskit-lite' ),
321 'placeholder' =>esc_html__( 'Learn more ', 'elementskit-lite' ),
322 'dynamic' => [
323 'active' => true,
324 ],
325 'condition' => [
326 'ekit_image_box_enable_btn' => 'yes',
327 ]
328 ]
329 );
330
331
332 $this->add_control(
333 'ekit_image_box_btn_url',
334 [
335 'label' =>esc_html__( 'URL', 'elementskit-lite' ),
336 'type' => Controls_Manager::URL,
337 'placeholder' =>esc_url('https://wpmet.com'),
338 'default' => [
339 'url' => '#',
340 ],
341 'dynamic' => [
342 'active' => true,
343 ],
344 'condition' => [
345 'ekit_image_box_enable_btn' => 'yes',
346 ]
347 ]
348 );
349 $this->add_control(
350 'ekit_image_box_icons__switch',
351 [
352 'label' => esc_html__('Add icon? ', 'elementskit-lite'),
353 'type' => Controls_Manager::SWITCHER,
354 'default' => 'yes',
355 'label_on' =>esc_html__( 'Yes', 'elementskit-lite' ),
356 'label_off' =>esc_html__( 'No', 'elementskit-lite' ),
357 'condition' => [
358 'ekit_image_box_enable_btn' => 'yes',
359 ]
360 ]
361 );
362 $this->add_control(
363 'ekit_image_box_icons',
364 [
365 'label' =>esc_html__( 'Icon', 'elementskit-lite' ),
366 'type' => Controls_Manager::ICONS,
367 'fa4compatibility' => 'ekit_image_box_icon',
368 'default' => [
369 'value' => '',
370 ],
371 'label_block' => true,
372 'condition' => [
373 'ekit_image_box_enable_btn' => 'yes',
374 'ekit_image_box_icons__switch' => 'yes'
375 ]
376 ]
377 );
378 $this->add_control(
379 'ekit_image_box_icon_align',
380 [
381 'label' =>esc_html__( 'Icon Position', 'elementskit-lite' ),
382 'type' => Controls_Manager::SELECT,
383 'default' => 'left',
384 'options' => [
385 'left' =>esc_html__( 'Before', 'elementskit-lite' ),
386 'right' =>esc_html__( 'After', 'elementskit-lite' ),
387 ],
388 'condition' => [
389 'ekit_image_box_icons__switch' => 'yes',
390 'ekit_image_box_enable_btn' => 'yes',
391 ],
392 ]
393 );
394 // end content section for button
395 $this->end_controls_section();
396
397 // start style section here
398
399
400 // start floating box style
401 $this->start_controls_section(
402 'ekit_image_box_image_floating_box',
403 [
404 'label' => esc_html__( 'Floating Style', 'elementskit-lite' ),
405 'tab' => Controls_Manager::TAB_STYLE,
406 'condition' => [
407 'ekit_image_box_style_simple' => 'floating-style',
408 ]
409 ]
410 );
411
412 $this->start_controls_tabs(
413 'ekit_image_box_image_floating_box_heights'
414 );
415
416 $this->start_controls_tab(
417 'ekit_image_box_image_floating_box_normal_height_tab',
418 [
419 'label' => esc_html__( 'Normal', 'elementskit-lite' ),
420 ]
421 );
422
423 $this->add_responsive_control(
424 'ekit_image_box_image_floating_box_height',
425 [
426 'label' => esc_html__( 'Height', 'elementskit-lite' ),
427 'type' => Controls_Manager::SLIDER,
428 'size_units' => [ 'px' ],
429 'range' => [
430 'px' => [
431 'min' => 0,
432 'max' => 500,
433 'step' => 1,
434 ],
435 ],
436 'default' => [
437 'unit' => 'px',
438 'size' => 90,
439 ],
440 'selectors' => [
441 '{{WRAPPER}} .elementskit-info-image-box.floating-style .elementskit-box-body' => 'height: {{SIZE}}{{UNIT}};',
442 ],
443 ]
444 );
445
446 $this->add_responsive_control(
447 'ekit_image_box_image_floating_box_icon_color',
448 [
449 'label' => esc_html__( 'Icon Color', 'elementskit-lite' ),
450 'type' => Controls_Manager::COLOR,
451 'selectors' => [
452 '{{WRAPPER}} .elementskit-info-image-box.floating-style .elementskit-box-body .elementskit-info-box-title > i ' => 'color: {{VALUE}};',
453 '{{WRAPPER}} .elementskit-info-image-box.floating-style .elementskit-box-body .elementskit-info-box-title > svg' => 'fill: {{VALUE}};',
454 ],
455 ]
456 );
457
458 $this->end_controls_tab();
459
460 $this->start_controls_tab(
461 'ekit_image_box_image_floating_box_hover_height_tab',
462 [
463 'label' => esc_html__( 'Hover', 'elementskit-lite' ),
464 ]
465 );
466
467 $this->add_responsive_control(
468 'ekit_image_box_image_floating_box_hover_height',
469 [
470 'label' => esc_html__( 'Hover Height', 'elementskit-lite' ),
471 'type' => Controls_Manager::SLIDER,
472 'size_units' => [ 'px' ],
473 'range' => [
474 'px' => [
475 'min' => 0,
476 'max' => 1000,
477 'step' => 1,
478 ],
479 ],
480 'default' => [
481 'unit' => 'px',
482 'size' => 185,
483 ],
484 'selectors' => [
485 '{{WRAPPER}} .elementskit-info-image-box.floating-style:hover .elementskit-box-body' => 'height: {{SIZE}}{{UNIT}};',
486 ],
487 ]
488 );
489
490 $this->add_responsive_control(
491 'ekit_image_box_image_floating_box_icon_color_hover',
492 [
493 'label' => esc_html__( 'Icon Color', 'elementskit-lite' ),
494 'type' => Controls_Manager::COLOR,
495 'selectors' => [
496 '{{WRAPPER}} .elementskit-info-image-box.floating-style:hover .elementskit-box-body .elementskit-info-box-title > i ' => 'color: {{VALUE}}',
497 '{{WRAPPER}} .elementskit-info-image-box.floating-style:hover .elementskit-box-body .elementskit-info-box-title > svg' => 'fill: {{VALUE}};',
498 ],
499 ]
500 );
501
502 $this->end_controls_tab();
503
504 $this->end_controls_tabs();
505
506 $this->add_control(
507 'ekit_image_box_image_floating_box_tab_separetor',
508 [
509 'type' => Controls_Manager::DIVIDER,
510 'style' => 'thick',
511 ]
512 );
513
514 $this->add_responsive_control(
515 'ekit_image_box_image_floating_box_icon_font_size',
516 [
517 'label' => esc_html__( 'Icon Font Size', 'elementskit-lite' ),
518 'type' => Controls_Manager::SLIDER,
519 'size_units' => [ 'px' ],
520 'range' => [
521 'px' => [
522 'min' => 0,
523 'max' => 200,
524 'step' => 1,
525 ],
526 ],
527 'default' => [
528 'unit' => 'px',
529 'size' => 26,
530 ],
531 'selectors' => [
532 '{{WRAPPER}} .elementskit-info-image-box.floating-style .elementskit-box-body .elementskit-info-box-title > i' => 'font-size: {{SIZE}}{{UNIT}};',
533 '{{WRAPPER}} .elementskit-info-image-box.floating-style .elementskit-box-body .elementskit-info-box-title > svg' => 'max-width: {{SIZE}}{{UNIT}};',
534 ],
535 ]
536 );
537
538
539 $this->add_responsive_control(
540 'ekit_image_box_image_floating_box_margin_top',
541 [
542 'label' => esc_html__( 'Margin Top', 'elementskit-lite' ),
543 'type' => Controls_Manager::SLIDER,
544 'size_units' => [ 'px' ],
545 'range' => [
546 'px' => [
547 'min' => -100,
548 'max' => 100,
549 'step' => 1,
550 ],
551 ],
552 'default' => [
553 'unit' => 'px',
554 'size' => -40,
555 ],
556 'selectors' => [
557 '{{WRAPPER}} .elementskit-info-image-box.floating-style .elementskit-box-body' => 'margin-top: {{SIZE}}{{UNIT}};',
558 ],
559 ]
560 );
561
562 $this->add_responsive_control(
563 'ekit_image_box_image_floating_box_width',
564 [
565 'label' => esc_html__( 'Width', 'elementskit-lite' ),
566 'type' => Controls_Manager::SLIDER,
567 'size_units' => [ '%' ],
568 'range' => [
569 'px' => [
570 'min' => 0,
571 'max' => 100,
572 'step' => 1,
573 ],
574 ],
575 'default' => [
576 'unit' => '%',
577 'size' => 90,
578 ],
579 'selectors' => [
580 '{{WRAPPER}} .elementskit-info-image-box.floating-style .elementskit-box-body' => 'width: {{SIZE}}{{UNIT}};',
581 ],
582 ]
583 );
584
585 $this->add_group_control(
586 Group_Control_Background::get_type(),
587 [
588 'name' => 'ekit_image_box_image_floating_box_background',
589 'label' => esc_html__( 'Background', 'elementskit-lite' ),
590 'types' => [ 'classic', 'gradient' ],
591 'selector' => '{{WRAPPER}} .elementskit-info-image-box.floating-style .elementskit-box-body, {{WRAPPER}} .elementskit-info-image-box.floating-style .elementskit-box-body::before, {{WRAPPER}} .elementskit-info-image-box.floating-style .elementskit-box-body::after',
592 ]
593 );
594
595 $this->add_group_control(
596 Group_Control_Box_Shadow::get_type(),
597 [
598 'name' => 'ekit_image_box_image_floating_box_shadow',
599 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ),
600 'selector' => '{{WRAPPER}} .elementskit-info-image-box.floating-style .elementskit-box-body, {{WRAPPER}} .elementskit-info-image-box.floating-style .elementskit-box-body::before, {{WRAPPER}} .elementskit-info-image-box.floating-style .elementskit-box-body::after',
601 ]
602 );
603
604 $this->end_controls_section();
605
606 // start classic curves style
607 $this->start_controls_section(
608 'ekit_image_box_image_classic_curves',
609 [
610 'label' => esc_html__( 'Classic Curves', 'elementskit-lite' ),
611 'tab' => Controls_Manager::TAB_STYLE,
612 'condition' => [
613 'ekit_image_box_style_simple' => 'style-modern',
614 ]
615 ]
616 );
617
618 $this->add_responsive_control(
619 'ekit_image_box_image_classic_curves_width',
620 [
621 'label' => esc_html__( 'Width', 'elementskit-lite' ),
622 'type' => Controls_Manager::SLIDER,
623 'size_units' => [ '%' ],
624 'range' => [
625 'px' => [
626 'min' => 0,
627 'max' => 100,
628 'step' => 1,
629 ],
630 ],
631 'default' => [
632 'unit' => '%',
633 'size' => 100,
634 ],
635 'selectors' => [
636 '{{WRAPPER}} .elementskit-info-image-box.style-modern .elementskit-box-body' => 'width: {{SIZE}}{{UNIT}};',
637 ],
638 ]
639 );
640
641 $this->add_responsive_control(
642 'ekit_image_box_image_classic_curves_margin',
643 [
644 'label' => esc_html__( 'Margin', 'elementskit-lite' ),
645 'type' => Controls_Manager::SLIDER,
646 'size_units' => [ 'px' ],
647 'range' => [
648 'px' => [
649 'min' => -100,
650 'max' => 100,
651 'step' => 1,
652 ],
653 ],
654 'default' => [
655 'unit' => 'px',
656 'size' => -20,
657 ],
658 'selectors' => [
659 '{{WRAPPER}} .elementskit-info-image-box.style-modern .elementskit-box-body' => 'margin-top: {{SIZE}}{{UNIT}};',
660 ],
661 ]
662 );
663
664 $this->end_controls_section();
665
666 // start border bottom hover style
667 $this->start_controls_section(
668 'ekit_image_box_border_bottom_hover',
669 [
670 'label' => esc_html__( 'Hover Border Bottom', 'elementskit-lite' ),
671 'tab' => Controls_Manager::TAB_STYLE,
672 'condition' => [
673 'ekit_image_box_style_simple' => 'hover-border-bottom',
674 ]
675 ]
676 );
677
678 $this->add_responsive_control(
679 'ekit_image_box_border_hover_height',
680 [
681 'label' => esc_html__( 'Border Bottom Height', 'elementskit-lite' ),
682 'type' => Controls_Manager::SLIDER,
683 'size_units' => [ 'px' ],
684 'range' => [
685 'px' => [
686 'min' => 0,
687 'max' => 100,
688 'step' => 1,
689 ],
690 ],
691 'default' => [
692 'unit' => 'px',
693 'size' => 3,
694 ],
695 'selectors' => [
696 '{{WRAPPER}} .elementskit-info-image-box.hover-border-bottom .elementskit-box-body::before' => 'height: {{SIZE}}{{UNIT}};',
697 ],
698 'condition' => [
699 'ekit_image_box_style_simple' => 'hover-border-bottom',
700 ]
701 ]
702 );
703
704 $this->add_group_control(
705 Group_Control_Background::get_type(),
706 [
707 'name' => 'ekit_image_box_border_hover_background',
708 'label' => esc_html__( 'Background', 'elementskit-lite' ),
709 'types' => [ 'classic', 'gradient' ],
710 'selector' => '{{WRAPPER}} .elementskit-info-image-box.hover-border-bottom .elementskit-box-body::before',
711 'condition' => [
712 'ekit_image_box_style_simple' => 'hover-border-bottom',
713 ]
714 ]
715 );
716
717 $this->add_control(
718 'ekit_image_box_border_hover_background_direction',
719 [
720 'label' => esc_html__( 'Hover Direction', 'elementskit-lite' ),
721 'type' => Controls_Manager::CHOOSE,
722 'options' => [
723 'hover_from_left' => [
724 'title' => esc_html__( 'From Left', 'elementskit-lite' ),
725 'icon' => 'fa fa-caret-right',
726 ],
727 'hover_from_center' => [
728 'title' => esc_html__( 'From Center', 'elementskit-lite' ),
729 'icon' => 'fa fa-align-center',
730 ],
731 'hover_from_right' => [
732 'title' => esc_html__( 'From Right', 'elementskit-lite' ),
733 'icon' => 'fa fa-caret-left',
734 ],
735 ],
736 'default' => 'hover_from_right',
737 'toggle' => true,
738 'condition' => [
739 'ekit_image_box_style_simple' => 'hover-border-bottom',
740 ]
741 ]
742 );
743
744 $this->end_controls_section();
745
746 // start side line style
747 $this->start_controls_section(
748 'ekit_image_box_image_side_line',
749 [
750 'label' => esc_html__( 'Side Line', 'elementskit-lite' ),
751 'tab' => Controls_Manager::TAB_STYLE,
752 'condition' => [
753 'ekit_image_box_style_simple' => 'style-sideline',
754 ]
755 ]
756 );
757
758 $this->add_responsive_control(
759 'ekit_image_box_image_side_line_border_width',
760 [
761 'label' => esc_html__( 'Border Width', 'elementskit-lite' ),
762 'type' => Controls_Manager::SLIDER,
763 'size_units' => [ 'px' ],
764 'range' => [
765 'px' => [
766 'min' => 0,
767 'max' => 20,
768 'step' => 1,
769 ],
770 ],
771 'default' => [
772 'unit' => 'px',
773 'size' => 3,
774 ],
775 'selectors' => [
776 '{{WRAPPER}} .ekit-image-box-body-inner' => 'border-width: {{SIZE}}{{UNIT}}',
777 ],
778 ]
779 );
780
781 $this->add_responsive_control(
782 'ekit_image_box_image_side_line_border_type',
783 [
784 'label' => esc_html__( 'Border Type', 'elementskit-lite' ),
785 'type' => Controls_Manager::SELECT,
786 'default' => 'solid',
787 'options' => [
788 'none' =>esc_html__( 'None', 'elementskit-lite' ),
789 'solid' =>esc_html__( 'Solid', 'elementskit-lite' ),
790 'double' =>esc_html__( 'Double', 'elementskit-lite' ),
791 'dotted' =>esc_html__( 'Dotted', 'elementskit-lite' ),
792 'dashed' =>esc_html__( 'Dashed', 'elementskit-lite' ),
793
794 ],
795 'selectors' => [
796 '{{WRAPPER}} .ekit-image-box-body-inner' => 'border-style: {{VALUE}}',
797 ],
798 ]
799 );
800
801 $this->start_controls_tabs(
802 'side_line_tabs'
803 );
804 $this->start_controls_tab(
805 'side_line_normal',
806 [
807 'label' => esc_html__( 'Normal', 'elementskit-lite' ),
808 ]
809 );
810 $this->add_responsive_control(
811 'ekit_image_box_image_side_line_border',
812 [
813 'label' => esc_html__( 'Border Color', 'elementskit-lite' ),
814 'type' => Controls_Manager::COLOR,
815 'selectors' => [
816 '{{WRAPPER}} .ekit-image-box-body-inner' => 'border-color: {{VALUE}};',
817 ],
818 ]
819 );
820 $this->end_controls_tab();
821
822 $this->start_controls_tab(
823 'side_line_hover',
824 [
825 'label' => esc_html__( 'Hover', 'elementskit-lite' ),
826 ]
827 );
828 $this->add_responsive_control(
829 'side_line_hover_color',
830 [
831 'label' => esc_html__( 'Border Color', 'elementskit-lite' ),
832 'type' => Controls_Manager::COLOR,
833 'selectors' => [
834 '{{WRAPPER}}:hover .ekit-image-box-body-inner' => 'border-color: {{VALUE}};',
835 ],
836 ]
837 );
838 $this->end_controls_tab();
839 $this->end_controls_tabs();
840
841 $this->end_controls_section();
842
843 // start line shadow style
844 $this->start_controls_section(
845 'ekit_image_box_image_shadow_line',
846 [
847 'label' => esc_html__( 'Shadow Line', 'elementskit-lite' ),
848 'tab' => Controls_Manager::TAB_STYLE,
849 'condition' => [
850 'ekit_image_box_style_simple' => 'shadow-line',
851 ]
852 ]
853 );
854
855 $this->start_controls_tabs(
856 'ekit_image_box_image_shadow_line_tabs'
857 );
858
859 $this->start_controls_tab(
860 'ekit_image_box_image_shadow_line_left_tab',
861 [
862 'label' => esc_html__( 'Left Line', 'elementskit-lite' ),
863 ]
864 );
865
866 $this->add_responsive_control(
867 'ekit_image_box_image_shadow_left_line_width',
868 [
869 'label' => esc_html__( 'Width', 'elementskit-lite' ),
870 'type' => Controls_Manager::SLIDER,
871 'size_units' => [ 'px' ],
872 'range' => [
873 'px' => [
874 'min' => 0,
875 'max' => 100,
876 'step' => 1,
877 ],
878 ],
879 'default' => [
880 'unit' => 'px',
881 'size' => 10,
882 ],
883 'selectors' => [
884 '{{WRAPPER}} .elementskit-info-image-box.shadow-line .elementskit-box-body::before' => 'width: {{SIZE}}{{UNIT}};',
885 ],
886 ]
887 );
888
889 $this->add_group_control(
890 Group_Control_Box_Shadow::get_type(),
891 [
892 'name' => 'ekit_image_box_image_shadow_left_line_shadow',
893 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ),
894 'selector' => '{{WRAPPER}} .elementskit-info-image-box.shadow-line .elementskit-box-body::before',
895 ]
896 );
897
898 $this->add_group_control(
899 Group_Control_Background::get_type(),
900 [
901 'name' => 'ekit_image_box_image_shadow_left_line_background',
902 'label' => esc_html__( 'Background', 'elementskit-lite' ),
903 'types' => [ 'classic', 'gradient' ],
904 'selector' => '{{WRAPPER}} .elementskit-info-image-box.shadow-line .elementskit-box-body::before',
905 ]
906 );
907
908 $this->end_controls_tab();
909
910 // right line
911 $this->start_controls_tab(
912 'ekit_image_box_image_shadow_line_right_tab',
913 [
914 'label' => esc_html__( 'Right Line', 'elementskit-lite' ),
915 ]
916 );
917
918 $this->add_responsive_control(
919 'ekit_image_box_image_shadow_right_line_width',
920 [
921 'label' => esc_html__( 'Width', 'elementskit-lite' ),
922 'type' => Controls_Manager::SLIDER,
923 'size_units' => [ 'px' ],
924 'range' => [
925 'px' => [
926 'min' => 0,
927 'max' => 100,
928 'step' => 1,
929 ],
930 ],
931 'default' => [
932 'unit' => 'px',
933 'size' => 10,
934 ],
935 'selectors' => [
936 '{{WRAPPER}} .elementskit-info-image-box.shadow-line .elementskit-box-body::after' => 'width: {{SIZE}}{{UNIT}};',
937 ],
938 ]
939 );
940
941 $this->add_group_control(
942 Group_Control_Box_Shadow::get_type(),
943 [
944 'name' => 'ekit_image_box_image_shadow_right_line_shadow',
945 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ),
946 'selector' => '{{WRAPPER}} .elementskit-info-image-box.shadow-line .elementskit-box-body::after',
947 ]
948 );
949
950 $this->add_group_control(
951 Group_Control_Background::get_type(),
952 [
953 'name' => 'ekit_image_box_image_shadow_right_line_background',
954 'label' => esc_html__( 'Background', 'elementskit-lite' ),
955 'types' => [ 'classic', 'gradient' ],
956 'selector' => '{{WRAPPER}} .elementskit-info-image-box.shadow-line .elementskit-box-body::after',
957 ]
958 );
959
960 $this->end_controls_tab();
961
962 $this->end_controls_tabs();
963
964 $this->end_controls_section();
965
966
967 // start image section style
968 $this->start_controls_section(
969 'ekit_image_box_image_section',
970 [
971 'label' => esc_html__( 'Image', 'elementskit-lite' ),
972 'tab' => Controls_Manager::TAB_STYLE,
973 ]
974 );
975
976 $this->add_responsive_control(
977 'ekit_image_box_border_radius',
978 [
979 'label' => esc_html__( 'Border radius', 'elementskit-lite' ),
980 'type' => Controls_Manager::DIMENSIONS,
981 'size_units' => [ 'px', '%', 'em' ],
982 'selectors' => [
983 '{{WRAPPER}} .elementskit-box-header' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
984 '{{WRAPPER}} .elementskit-box-header img' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
985 ],
986 ]
987 );
988
989 $this->add_responsive_control(
990 'ekit_image_box_padding',
991 [
992 'label' => esc_html__( 'Padding', 'elementskit-lite' ),
993 'type' => Controls_Manager::DIMENSIONS,
994 'size_units' => [ 'px', '%', 'em' ],
995 'selectors' => [
996 '{{WRAPPER}} .elementskit-box-header img' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
997 ],
998 ]
999 );
1000
1001 $this->start_controls_tabs(
1002 'ekit_image_box_style_tabs_image'
1003 );
1004
1005 $this->start_controls_tab(
1006 'ekit_image_box_style_normal_tab_image',
1007 [
1008 'label' => esc_html__( 'Normal', 'elementskit-lite' ),
1009 ]
1010 );
1011
1012 $this->add_responsive_control(
1013 'ekit_image_box_image_opacity',
1014 [
1015 'label' => esc_html__( 'Image opacity', 'elementskit-lite' ),
1016 'type' => Controls_Manager::SLIDER,
1017 'size_units' => [ 'px' ],
1018 'range' => [
1019 'px' => [
1020 'min' => 0,
1021 'max' => 1,
1022 'step' => .01,
1023 ],
1024 ],
1025 'default' => [
1026 'unit' => 'px',
1027 'size' => 1,
1028 ],
1029 'selectors' => [
1030 '{{WRAPPER}} .elementskit-info-image-box .elementskit-box-header img' => 'opacity: {{SIZE}};',
1031 '{{WRAPPER}} .elementskit-info-image-box.elementskit-thumb-card > img' => 'opacity: {{SIZE}};',
1032 ],
1033 ]
1034 );
1035
1036
1037 $this->end_controls_tab();
1038
1039 $this->start_controls_tab(
1040 'ekit_image_box_style_hover_tab_image',
1041 [
1042 'label' => esc_html__( 'Hover', 'elementskit-lite' ),
1043 ]
1044 );
1045
1046 $this->add_responsive_control(
1047 'ekit_image_box_image_opacity_hover',
1048 [
1049 'label' => esc_html__( 'Image opacity', 'elementskit-lite' ),
1050 'type' => Controls_Manager::SLIDER,
1051 'size_units' => [ 'px' ],
1052 'range' => [
1053 'px' => [
1054 'min' => 0,
1055 'max' => 1,
1056 'step' => .01,
1057 ],
1058 ],
1059 'default' => [
1060 'unit' => 'px',
1061 'size' => 1,
1062 ],
1063 'selectors' => [
1064 '{{WRAPPER}} .elementskit-info-image-box:hover .elementskit-box-header img' => 'opacity: {{SIZE}};',
1065 '{{WRAPPER}} .elementskit-info-image-box.elementskit-thumb-card:hover > img' => 'opacity: {{SIZE}};',
1066 ],
1067 ]
1068 );
1069
1070 $this->add_responsive_control(
1071 'ekit_image_box_image_scale_on_hover',
1072 [
1073 'label' => esc_html__( 'Image Scale on Hover', 'elementskit-lite' ),
1074 'type' => Controls_Manager::SLIDER,
1075 'size_units' => [ 'px' ],
1076 'range' => [
1077 'px' => [
1078 'min' => 1,
1079 'max' => 2,
1080 'step' => .1,
1081 ],
1082 ],
1083 'default' => [
1084 'unit' => 'px',
1085 'size' => 1.1,
1086 ],
1087 'selectors' => [
1088 '{{WRAPPER}} .elementskit-info-image-box:hover .elementskit-box-header img' => 'transform: scale({{SIZE}});',
1089 '{{WRAPPER}} .elementskit-info-image-box.elementskit-thumb-card:hover > img' => 'transform: scale({{SIZE}});',
1090 ],
1091 ]
1092 );
1093
1094 $this->end_controls_tab();
1095
1096 $this->end_controls_tabs();
1097
1098 $this->end_controls_section();
1099 //end image section style
1100
1101 // start body style section
1102 $this->start_controls_section(
1103 'ekit_image_box_style_body_section',
1104 [
1105 'label' => esc_html__( 'Body', 'elementskit-lite' ),
1106 'tab' => Controls_Manager::TAB_STYLE,
1107 ]
1108 );
1109
1110 $this->add_control(
1111 'ekit_imagebox_genaral_border_heading_title',
1112 [
1113 'label' => esc_html__( 'General', 'elementskit-lite' ),
1114 'type' => Controls_Manager::HEADING,
1115 ]
1116 );
1117 $this->add_group_control(
1118 Group_Control_Border::get_type(),
1119 [
1120 'name' => 'ekit_imagebox_container_border_group',
1121 'label' => esc_html__( 'Border', 'elementskit-lite' ),
1122 'selector' => '{{WRAPPER}} .elementskit-info-image-box .elementskit-box-body',
1123 ]
1124 );
1125
1126 $this->add_responsive_control(
1127 'body_radius',
1128 [
1129 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ),
1130 'type' => Controls_Manager::DIMENSIONS,
1131 'size_units' => [ 'px', '%', 'em' ],
1132 'selectors' => [
1133 '{{WRAPPER}} .ekit-image-box-body, {{WRAPPER}} .ekit-image-box-body:before, {{WRAPPER}} .ekit-image-box-body:after' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1134 ],
1135 ]
1136 );
1137
1138 $this->add_group_control(
1139 Group_Control_Background::get_type(),
1140 [
1141 'name' => 'ekit_imagebox_container_background',
1142 'label' => esc_html__( 'Background', 'elementskit-lite' ),
1143 'types' => [ 'classic', 'gradient' ],
1144 'selector' => '{{WRAPPER}} .elementskit-info-image-box .elementskit-box-body',
1145 ]
1146 );
1147
1148 $this->add_responsive_control(
1149 'ekit_imagebox_container_spacing',
1150 [
1151 'label' => esc_html__( 'Padding', 'elementskit-lite' ),
1152 'type' => Controls_Manager::DIMENSIONS,
1153 'size_units' => [ 'px', '%', 'em' ],
1154 'selectors' => [
1155 '{{WRAPPER}} .elementskit-info-image-box .elementskit-box-body' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1156 ],
1157 ]
1158 );
1159
1160 $this->add_group_control(
1161 Group_Control_Box_Shadow::get_type(),
1162 [
1163 'name' => 'ekit_image_box_shadow_group',
1164 'selector' => '{{WRAPPER}} .elementskit-info-image-box .elementskit-box-body',
1165 ]
1166 );
1167
1168 // title
1169 $this->add_control(
1170 'ekit_imagebox_title_border_heading_title',
1171 [
1172 'label' => esc_html__( 'Title', 'elementskit-lite' ),
1173 'type' => Controls_Manager::HEADING,
1174 'separator' => 'before',
1175 ]
1176 );
1177
1178 $this->add_responsive_control(
1179 'ekit_image_box_title_bottom_space',
1180 [
1181 'label' => esc_html__( 'Spacing', 'elementskit-lite' ),
1182 'type' => Controls_Manager::DIMENSIONS,
1183 'size_units' => [ 'px', '%', 'em' ],
1184 'default' => [
1185 'top' => '0',
1186 'right' => '0',
1187 'bottom' => '20',
1188 'left' => '0',
1189 'unit' => 'px',
1190 'isLinked' => 'true',
1191 ],
1192 'selectors' => [
1193 '{{WRAPPER}} .elementskit-info-image-box .elementskit-info-box-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1194 ],
1195 ]
1196 );
1197
1198 $this->add_group_control(
1199 Group_Control_Typography::get_type(),
1200 [
1201 'name' => 'ekit_image_box_title_typography',
1202 'label' => esc_html__( 'Typography', 'elementskit-lite' ),
1203 'selector' => '{{WRAPPER}} .elementskit-info-image-box .elementskit-box-content :is(.elementskit-info-box-title, .elementskit-info-box-title a )',
1204 ]
1205 );
1206
1207 $this->start_controls_tabs('ekit_image_box_style_heading_tabs');
1208
1209 $this->start_controls_tab(
1210 'ekit_image_box_style_normal_tab',
1211 [
1212 'label' => esc_html__( 'Normal', 'elementskit-lite' ),
1213 ]
1214 );
1215
1216 $this->add_responsive_control(
1217 'ekit_image_box_heading_color',
1218 [
1219 'label' => esc_html__( 'Color', 'elementskit-lite' ),
1220 'type' => Controls_Manager::COLOR,
1221 'selectors' => [
1222 '{{WRAPPER}} .elementskit-info-image-box .elementskit-info-box-title ' => 'color: {{VALUE}};',
1223 '{{WRAPPER}} .elementskit-info-image-box .elementskit-info-box-title a' => 'color: {{VALUE}};',
1224 '{{WRAPPER}} .elementskit-info-image-box .elementskit-info-box-title svg' => 'fill: {{VALUE}};'
1225 ],
1226 ]
1227 );
1228
1229 $this->end_controls_tab();
1230
1231 $this->start_controls_tab(
1232 'ekit_image_box_style_hover_tab',
1233 [
1234 'label' => esc_html__( 'Hover', 'elementskit-lite' ),
1235 ]
1236 );
1237
1238 $this->add_responsive_control(
1239 'ekit_image_box_heading_color_hover',
1240 [
1241 'label' => esc_html__( 'Color (Hover)', 'elementskit-lite' ),
1242 'type' => Controls_Manager::COLOR,
1243 'selectors' => [
1244 '{{WRAPPER}} .elementskit-info-image-box:hover .elementskit-info-box-title ' => 'color: {{VALUE}}',
1245 '{{WRAPPER}} .elementskit-info-image-box:hover .elementskit-info-box-title a' => 'color: {{VALUE}}',
1246 '{{WRAPPER}} .elementskit-info-image-box:hover .elementskit-info-box-title svg' => 'fill: {{VALUE}};'
1247 ],
1248 ]
1249 );
1250
1251 $this->end_controls_tab();
1252
1253 $this->end_controls_tabs();
1254
1255 // sub Description
1256 $this->add_control(
1257 'ekit_imagebox_description_border_heading_title',
1258 [
1259 'label' => esc_html__( 'Description', 'elementskit-lite' ),
1260 'type' => Controls_Manager::HEADING,
1261 'separator' => 'before',
1262 ]
1263 );
1264
1265 $this->add_responsive_control(
1266 'ekit_image_box_title_bottom_space_description',
1267 [
1268 'label' => esc_html__( 'Spacing', 'elementskit-lite' ),
1269 'type' => Controls_Manager::DIMENSIONS,
1270 'size_units' => [ 'px', '%', 'em' ],
1271 'default' => [
1272 'top' => '0',
1273 'right' => '0',
1274 'bottom' => '14',
1275 'left' => '0',
1276 'unit' => 'px',
1277 'isLinked' => 'true',
1278 ],
1279 'selectors' => [
1280 '{{WRAPPER}} .elementskit-info-image-box .elementskit-box-style-content' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1281 ],
1282 ]
1283 );
1284
1285 $this->add_group_control(
1286 Group_Control_Typography::get_type(),
1287 [
1288 'name' => 'ekit_image_box_title_typography_description',
1289 'label' => esc_html__( 'Typography', 'elementskit-lite' ),
1290 'selector' => '{{WRAPPER}} .elementskit-info-image-box .elementskit-box-style-content',
1291 ]
1292 );
1293
1294 $this->start_controls_tabs('ekit_image_box_style_description_tabs');
1295
1296 $this->start_controls_tab(
1297 'ekit_image_box_style_normal_tab_description',
1298 [
1299 'label' => esc_html__( 'Normal', 'elementskit-lite' ),
1300 ]
1301 );
1302
1303 $this->add_responsive_control(
1304 'ekit_image_box_heading_color_description',
1305 [
1306 'label' => esc_html__( 'Color', 'elementskit-lite' ),
1307 'type' => Controls_Manager::COLOR,
1308 'selectors' => [
1309 '{{WRAPPER}} .elementskit-info-image-box .elementskit-box-style-content' => 'color: {{VALUE}}',
1310 ],
1311 ]
1312 );
1313
1314 $this->end_controls_tab();
1315
1316 $this->start_controls_tab(
1317 'ekit_image_box_style_hover_tab_description',
1318 [
1319 'label' => esc_html__( 'Hover', 'elementskit-lite' ),
1320 ]
1321 );
1322
1323 $this->add_responsive_control(
1324 'ekit_image_box_heading_color_hover_description',
1325 [
1326 'label' => esc_html__( 'Color (Hover)', 'elementskit-lite' ),
1327 'type' => Controls_Manager::COLOR,
1328 'selectors' => [
1329 '{{WRAPPER}} .elementskit-info-image-box:hover .elementskit-box-style-content ' => 'color: {{VALUE}}',
1330 ],
1331 ]
1332 );
1333
1334 $this->end_controls_tab();
1335
1336 $this->end_controls_tabs();
1337
1338 $this->end_controls_section();
1339
1340 // start style csetion for button
1341 // Button
1342
1343 $this->start_controls_section(
1344 'ekit_image_box_section_style',
1345 [
1346 'label' => esc_html__( 'Button', 'elementskit-lite' ),
1347 'tab' => Controls_Manager::TAB_STYLE,
1348 'condition' => [
1349 'ekit_image_box_enable_btn' => 'yes',
1350 ]
1351 ]
1352 );
1353 $this->add_responsive_control(
1354 'ekit_image_box_text_padding',
1355 [
1356 'label' =>esc_html__( 'Padding', 'elementskit-lite' ),
1357 'type' => Controls_Manager::DIMENSIONS,
1358 'size_units' => [ 'px', 'em', '%' ],
1359 'selectors' => [
1360 '{{WRAPPER}} .elementskit-info-image-box .elementskit-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1361 ],
1362 ]
1363 );
1364
1365 $this->add_group_control(
1366 Group_Control_Typography::get_type(),
1367 [
1368 'name' => 'ekit_image_box_typography_group',
1369 'label' =>esc_html__( 'Typography', 'elementskit-lite' ),
1370 'selector' => '{{WRAPPER}} .elementskit-info-image-box .elementskit-btn',
1371 ]
1372 );
1373 $this->add_responsive_control(
1374 'ekit_image_box_btn_icon_font_size',
1375 array(
1376 'label' => esc_html__( 'Icon Font Size', 'elementskit-lite' ),
1377 'type' => Controls_Manager::SLIDER,
1378 'size_units' => array(
1379 'px', 'em', 'rem',
1380 ),
1381 'range' => array(
1382 'px' => array(
1383 'min' => 1,
1384 'max' => 100,
1385 ),
1386 ),
1387 'selectors' => array(
1388 '{{WRAPPER}} .elementskit-info-image-box .elementskit-btn i' => 'font-size: {{SIZE}}{{UNIT}};',
1389 '{{WRAPPER}} .elementskit-info-image-box .elementskit-btn svg' => 'max-width: {{SIZE}}{{UNIT}};',
1390 ),
1391 )
1392 );
1393 $this->start_controls_tabs( 'tabs_button_style' );
1394
1395 $this->start_controls_tab(
1396 'ekit_image_box_tab_button_normal',
1397 [
1398 'label' => esc_html__( 'Normal', 'elementskit-lite' ),
1399 ]
1400 );
1401
1402 $this->add_responsive_control(
1403 'ekit_image_box_button_text_color',
1404 [
1405 'label' => esc_html__( 'Text Color', 'elementskit-lite' ),
1406 'type' => Controls_Manager::COLOR,
1407 'default' => '',
1408 'selectors' => [
1409 '{{WRAPPER}} .elementskit-info-image-box .elementskit-btn' => 'color: {{VALUE}};',
1410 '{{WRAPPER}} .elementskit-info-image-box .elementskit-btn svg' => 'fill: {{VALUE}};',
1411 ],
1412 ]
1413 );
1414
1415 $this->add_group_control(
1416 Group_Control_Background::get_type(),
1417 [
1418 'name' => 'ekit_image_box_btn_background_group',
1419 'label' => esc_html__( 'Background', 'elementskit-lite' ),
1420 'types' => [ 'classic', 'gradient' ],
1421 'selector' => '{{WRAPPER}} .elementskit-info-image-box .elementskit-btn',
1422 ]
1423 );
1424
1425 $this->add_group_control(
1426 Group_Control_Border::get_type(),
1427 [
1428 'name' => 'ekit_image_box_button_border_color_group',
1429 'label' => esc_html__( 'Border', 'elementskit-lite' ),
1430 'selector' => '{{WRAPPER}} .elementskit-info-image-box .elementskit-btn',
1431 ]
1432 );
1433 $this->add_responsive_control(
1434 'ekit_image_box_btn_border_radius',
1435 [
1436 'label' =>esc_html__( 'Border Radius', 'elementskit-lite' ),
1437 'type' => Controls_Manager::DIMENSIONS,
1438 'size_units' => [ 'px'],
1439 'default' => [
1440 'top' => '',
1441 'right' => '',
1442 'bottom' => '' ,
1443 'left' => '',
1444 ],
1445 'selectors' => [
1446 '{{WRAPPER}} .elementskit-info-image-box .elementskit-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1447 ],
1448 ]
1449 );
1450 $this->add_group_control(
1451 Group_Control_Box_Shadow::get_type(),
1452 [
1453 'name' => 'ekit_image_box_button_box_shadow',
1454 'selector' => '{{WRAPPER}} .elementskit-info-image-box .elementskit-btn',
1455 ]
1456 );
1457
1458 $this->end_controls_tab();
1459
1460 $this->start_controls_tab(
1461 'ekit_image_box_tab_button_hover',
1462 [
1463 'label' => esc_html__( 'Hover', 'elementskit-lite' ),
1464 ]
1465 );
1466
1467 $this->add_responsive_control(
1468 'ekit_image_box_btn_hover_color',
1469 [
1470 'label' => esc_html__( 'Text Color', 'elementskit-lite' ),
1471 'type' => Controls_Manager::COLOR,
1472 'selectors' => [
1473 '{{WRAPPER}} .elementskit-info-image-box .elementskit-btn:hover' => 'color: {{VALUE}};',
1474 '{{WRAPPER}} .elementskit-info-image-box .elementskit-btn:hover svg' => 'fill: {{VALUE}};',
1475 ],
1476 ]
1477 );
1478
1479 $this->add_group_control(
1480 Group_Control_Background::get_type(),
1481 [
1482 'name' => 'ekit_image_box_btn_background_hover_group',
1483 'label' => esc_html__( 'Background', 'elementskit-lite' ),
1484 'types' => [ 'classic', 'gradient' ],
1485 'selector' => '{{WRAPPER}} .elementskit-info-image-box .elementskit-btn:hover',
1486 ]
1487 );
1488
1489 $this->add_group_control(
1490 Group_Control_Border::get_type(),
1491 [
1492 'name' => 'ekit_image_box_button_border_hv_color_group',
1493 'label' => esc_html__( 'Border', 'elementskit-lite' ),
1494 'selector' => '{{WRAPPER}} .elementskit-info-image-box .elementskit-btn:hover',
1495 ]
1496 );
1497 $this->add_responsive_control(
1498 'ekit_image_box_btn_hover_border_radius',
1499 [
1500 'label' =>esc_html__( 'Border Radius', 'elementskit-lite' ),
1501 'type' => Controls_Manager::DIMENSIONS,
1502 'size_units' => [ 'px'],
1503 'default' => [
1504 'top' => '',
1505 'right' => '',
1506 'bottom' => '' ,
1507 'left' => '',
1508 ],
1509 'selectors' => [
1510 '{{WRAPPER}} .elementskit-info-image-box .elementskit-btn:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1511 ],
1512 ]
1513 );
1514 $this->add_group_control(
1515 Group_Control_Box_Shadow::get_type(),
1516 [
1517 'name' => 'ekit_image_box_button_box_shadow_hover_group',
1518 'selector' => '{{WRAPPER}} .elementskit-info-image-box .elementskit-btn:hover',
1519 ]
1520 );
1521
1522
1523 $this->end_controls_tab();
1524
1525 $this->end_controls_tabs();
1526
1527
1528 $this->end_controls_section();
1529
1530 // end style section for buttun
1531
1532 $this->insert_pro_message();
1533 }
1534
1535 protected function render( ) {
1536 echo '<div class="ekit-wid-con" >';
1537 $this->render_raw();
1538 echo '</div>';
1539 }
1540
1541 protected function render_raw( ) {
1542
1543 $settings = $this->get_settings_for_display();
1544
1545 // Data Sanitization/Escaping
1546 $options_ekit_image_box_title_size = array_keys([
1547 'h1' => 'H1',
1548 'h2' => 'H2',
1549 'h3' => 'H3',
1550 'h4' => 'H4',
1551 'h5' => 'H5',
1552 'h6' => 'H6',
1553 'div' => 'div',
1554 'span' => 'span',
1555 'p' => 'p',
1556 ]);
1557
1558 $ekit_image_box_content_text_align_value_escape = \ElementsKit_Lite\Utils::esc_options($settings['ekit_image_box_content_text_align'], ['left', 'center', 'right'], 'center');
1559
1560 // Wrapper settion
1561
1562 $this->add_render_attribute('wrapper', 'class', 'elementskit-info-image-box ekit-image-box');
1563 $this->add_render_attribute('wrapper', 'class', 'text-' . $ekit_image_box_content_text_align_value_escape);
1564
1565
1566 if ($settings['ekit_image_box_style_simple'] == 'hover-border-bottom') {
1567
1568 $this->add_render_attribute('wrapper', 'class', $settings['ekit_image_box_border_hover_background_direction']);
1569 }
1570 $this->add_render_attribute('wrapper', 'class', $settings['ekit_image_box_style_simple']);
1571
1572
1573
1574 // Image section
1575 $image_html = '';
1576 if (!empty($settings['ekit_image_box_image']['url'])) {
1577
1578 $this->add_render_attribute('image', 'src', $settings['ekit_image_box_image']['url']);
1579 $this->add_render_attribute('image', 'alt', Control_Media::get_image_alt($settings['ekit_image_box_image']));
1580 $this->add_render_attribute('image', 'title', Control_Media::get_image_title($settings['ekit_image_box_image']));
1581
1582 $image_html = Group_Control_Image_Size::get_attachment_image_html( $settings, 'ekit_image_box_thumbnail', 'ekit_image_box_image' );
1583 }
1584
1585 // Button
1586 $btn_text = $settings['ekit_image_box_btn_text'];
1587
1588
1589 if ( ! empty( $settings['ekit_image_box_btn_url']['url'] ) ) {
1590 $this->add_link_attributes( 'button-2', $settings['ekit_image_box_btn_url'] );
1591 }
1592
1593 $image_pos = 'image-box-img-' . $ekit_image_box_content_text_align_value_escape;
1594 ?>
1595
1596 <div <?php echo ($this->get_render_attribute_string('wrapper')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Already escaped by elementor ?> >
1597
1598 <?php if($settings['ekit_image_box_enable_link'] == 'yes' && isset($settings['ekit_image_box_website_link']['url'])) {
1599 $this->add_link_attributes( 'button', $settings['ekit_image_box_website_link'] );
1600
1601 echo "<a ". $this->get_render_attribute_string( 'button' ) .">"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Already escaped by elementor
1602 }
1603 ?>
1604
1605 <div class="elementskit-box-header <?php echo esc_attr($image_pos); ?>">
1606
1607 <?php echo wp_kses($image_html, \ElementsKit_Lite\Utils::get_kses_array()); ?>
1608
1609 </div>
1610 <?php if($settings['ekit_image_box_enable_link'] == 'yes' && isset($settings['ekit_image_box_website_link']['url'])) {
1611 echo "</a>";
1612 } ?>
1613
1614 <div class="elementskit-box-body ekit-image-box-body">
1615 <div class="elementskit-box-content ekit-image-box-body-inner">
1616 <?php
1617 if ($settings['ekit_image_box_title_text'] != '') :
1618 $ekit_image_box_title_size_esc = \Elementor\Utils::validate_html_tag( $settings['ekit_image_box_title_size'] );
1619 ?>
1620 <<?php echo esc_attr($ekit_image_box_title_size_esc); ?> class="elementskit-info-box-title">
1621
1622 <?php if(($settings['ekit_image_box_front_title_icons'] != '') && ($settings['ekit_image_box_front_title_icon_position'] == 'left') && ($settings['ekit_image_box_style_simple'] == 'floating-style')) : ?>
1623
1624 <?php
1625 // new icon
1626 $migrated = isset( $settings['__fa4_migrated']['ekit_image_box_front_title_icons'] );
1627 // Check if its a new widget without previously selected icon using the old Icon control
1628 $is_new = empty( $settings['ekit_image_box_front_title_icon'] );
1629 if ( $is_new || $migrated ) {
1630 // new icon
1631 Icons_Manager::render_icon( $settings['ekit_image_box_front_title_icons'], [ 'aria-hidden' => 'true' ] );
1632 } else {
1633 ?>
1634 <i class="<?php echo esc_attr($settings['ekit_image_box_front_title_icon']); ?>" aria-hidden="true"></i>
1635 <?php
1636 }
1637 ?>
1638
1639 <?php endif;
1640 echo wp_kses($settings['ekit_image_box_title_text'], \ElementsKit_Lite\Utils::get_kses_array());
1641 ?>
1642
1643 <?php if(($settings['ekit_image_box_front_title_icons'] != '') && ($settings['ekit_image_box_front_title_icon_position'] == 'right') && ($settings['ekit_image_box_style_simple'] == 'floating-style')) : ?>
1644
1645 <?php
1646 // new icon
1647 $migrated = isset( $settings['__fa4_migrated']['ekit_image_box_front_title_icons'] );
1648 // Check if its a new widget without previously selected icon using the old Icon control
1649 $is_new = empty( $settings['ekit_image_box_front_title_icon'] );
1650 if ( $is_new || $migrated ) {
1651 // new icon
1652 Icons_Manager::render_icon( $settings['ekit_image_box_front_title_icons'], [ 'aria-hidden' => 'true' ] );
1653 } else {
1654 ?>
1655 <i class="<?php echo esc_attr($settings['ekit_image_box_front_title_icon']); ?>" aria-hidden="true"></i>
1656 <?php
1657 }
1658 ?>
1659
1660 <?php endif; ?>
1661
1662 </<?php echo esc_attr($ekit_image_box_title_size_esc); ?>>
1663 <?php
1664 endif;
1665 ?>
1666 <?php if ($settings['ekit_image_box_description_text'] != '') { ?>
1667 <div class="elementskit-box-style-content">
1668 <?php
1669 echo wp_kses($settings['ekit_image_box_description_text'], \ElementsKit_Lite\Utils::get_kses_array())
1670 ?>
1671 </div>
1672 <?php }; ?>
1673 </div>
1674
1675 <?php if($settings['ekit_image_box_enable_btn'] == 'yes') : ?>
1676 <div class="elementskit-box-footer">
1677 <div class="box-footer">
1678 <div class="btn-wraper">
1679 <?php if($settings['ekit_image_box_icon_align'] == 'right'): ?>
1680 <a <?php echo $this->get_render_attribute_string( 'button-2' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Already escaped by elementor ?> class="elementskit-btn whitespace--normal">
1681 <?php echo esc_html( $btn_text ); ?>
1682
1683 <?php
1684 // new icon
1685 $migrated = isset( $settings['__fa4_migrated']['ekit_image_box_icons'] );
1686 // Check if its a new widget without previously selected icon using the old Icon control
1687 $is_new = empty( $settings['ekit_image_box_icon'] );
1688 if ( $is_new || $migrated ) {
1689 // new icon
1690 Icons_Manager::render_icon( $settings['ekit_image_box_icons'], [ 'aria-hidden' => 'true' ] );
1691 } else {
1692 ?>
1693 <i class="<?php echo esc_attr($settings['ekit_image_box_icon']); ?>" aria-hidden="true"></i>
1694 <?php
1695 }
1696 ?>
1697
1698 </a>
1699 <?php elseif ($settings['ekit_image_box_icon_align'] == 'left') : ?>
1700 <a <?php echo $this->get_render_attribute_string( 'button-2' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Already escaped by elementor?> class="elementskit-btn whitespace--normal">
1701
1702 <?php
1703 // new icon
1704 $migrated = isset( $settings['__fa4_migrated']['ekit_image_box_icons'] );
1705 // Check if its a new widget without previously selected icon using the old Icon control
1706 $is_new = empty( $settings['ekit_image_box_icon'] );
1707 if ( $is_new || $migrated ) {
1708 // new icon
1709 Icons_Manager::render_icon( $settings['ekit_image_box_icons'], [ 'aria-hidden' => 'true' ] );
1710 } else {
1711 ?>
1712 <i class="<?php echo esc_attr($settings['ekit_image_box_icon']); ?>" aria-hidden="true"></i>
1713 <?php
1714 }
1715 ?>
1716
1717 <?php echo esc_html( $btn_text ); ?>
1718 </a>
1719 <?php else : ?>
1720 <a <?php echo $this->get_render_attribute_string( 'button-2' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Already escaped by elementor ?> class="elementskit-btn whitespace--normal">
1721 <?php echo esc_html( $btn_text ); ?>
1722 </a>
1723 <?php endif; ?>
1724 </div>
1725 </div>
1726 </div>
1727 <?php endif; ?>
1728 </div>
1729 </div>
1730 <?php
1731 }
1732 }
1733