PluginProbe ʕ •ᴥ•ʔ
Spider Elements – Premium Elementor Widgets & Addons Library / 1.1.0
Spider Elements – Premium Elementor Widgets & Addons Library v1.1.0
trunk 1.0.0 1.1.0 1.5.0 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.7.0 1.8.0 1.9.0
spider-elements / widgets / Icon_box.php
spider-elements / widgets Last commit date
templates 2 years ago Accordion.php 2 years ago Alerts_Box.php 2 years ago Animated_Heading.php 2 years ago Before_after.php 2 years ago Blog_Grid.php 2 years ago Buttons.php 2 years ago Cheat_sheet.php 2 years ago Counter.php 2 years ago Fullscreen_Slider.php 2 years ago Icon_box.php 2 years ago Instagram.php 2 years ago Integrations.php 2 years ago List_Item.php 2 years ago Marquee_Slides.php 2 years ago Pricing_Table_Switcher.php 2 years ago Pricing_Table_Tabs.php 2 years ago Skill_Showcase.php 2 years ago Tabs.php 2 years ago Team_Carousel.php 2 years ago Testimonial.php 2 years ago Timeline.php 2 years ago Video_Playlist.php 2 years ago Video_Popup.php 2 years ago
Icon_box.php
1021 lines
1 <?php
2 /**
3 * Use namespace to avoid conflict
4 */
5
6 namespace SPEL\Widgets;
7
8 use Elementor\Controls_Manager;
9 use Elementor\Group_Control_Text_Shadow;
10 use Elementor\Group_Control_Text_Stroke;
11 use Elementor\Group_Control_Typography;
12 use Elementor\Group_Control_Box_Shadow;
13 use Elementor\Repeater;
14 use Elementor\Widget_Base;
15
16
17 // Exit if accessed directly
18 if ( ! defined( 'ABSPATH' ) ) {
19 exit;
20 }
21
22 /**
23 * Class Dual-button
24 * @package spider\Widgets
25 */
26 class Icon_box extends Widget_Base {
27
28 public function get_name() {
29 return 'spel_icon_box'; // ID of the widget (Don't change this name)
30 }
31
32 public function get_title() {
33 return esc_html__( 'Icon Box', 'spider-elements' );
34 }
35
36 public function get_icon() {
37 return 'eicon-icon-box spel-icon';
38 }
39
40 public function get_keywords() {
41 return [
42 'spider',
43 'spider elements',
44 'icon',
45 'box',
46 'icon-box',
47 'icon box',
48 'card',
49 'img box',
50 'image box',
51 'svg'
52 ];
53 }
54
55 public function get_categories() {
56 return [ 'spider-elements' ];
57 }
58
59 /**
60 * Name: get_style_depends()
61 * Desc: Register the required CSS dependencies for the frontend.
62 */
63 public function get_style_depends() {
64 return [ 'spel-main', 'elegant-icon' ];
65 }
66
67 /**
68 * Name: get_script_depends()
69 * Desc: Register the required JS dependencies for the frontend.
70 */
71 public function get_script_depends() {
72 return [ 'spel-el-widgets', 'spel-script' ];
73 }
74
75
76 /**
77 * Name: register_controls()
78 * Desc: Register controls for these widgets
79 * Params: no params
80 * Return: @void
81 * Since: @1.0.0
82 * Package: @spider-elements
83 * Author: spider-themes
84 */
85 protected function register_controls() {
86 $this->elementor_content_control();
87 $this->elementor_style_control();
88
89 }
90
91
92 /**
93 * Name: elementor_content_control()
94 * Desc: Register the Content Tab output on the Elementor editor.
95 * Params: no params
96 * Return: @void
97 * Since: @1.0.0
98 * Package: @spider-elements
99 * Author: spider-themes
100 */
101 public function elementor_content_control() { //start icon box settings
102
103 //==================== Select Preset Skin ====================//
104 $this->start_controls_section(
105 'counter_preset', [
106 'label' => __( 'Preset Skin', 'spider-elements' ),
107 ]
108 );
109
110 $this->add_control(
111 'style', [
112 'label' => esc_html__( 'Skin', 'spider-elements' ),
113 'type' => Controls_Manager::CHOOSE,
114 'options' => [
115 '1' => [
116 'title' => esc_html__( 'Style 01', 'spider-elements' ),
117 'icon' => 'icon-box1',
118 ],
119 '2' => [
120 'title' => esc_html__( 'Style 02', 'spider-elements' ),
121 'icon' => 'icon-box2',
122 ],
123 ],
124 'toggle' => false,
125 'default' => '1',
126 ]
127 );
128
129 $this->end_controls_section(); // End Preset Skin
130
131
132 //========================== Contents ========================//
133 $this->start_controls_section(
134 'icon_box_content', [
135 'label' => esc_html__( 'Contents', 'spider-elements' ),
136 ]
137 );
138
139 $this->add_control(
140 'i_box_icon',
141 [
142 'label' => esc_html__( 'Icon', 'spider-elements' ),
143 'type' => Controls_Manager::ICONS,
144 'separator' => 'before',
145 'default' => [
146 'value' => 'fas fa-star',
147 'library' => 'fa-solid',
148 ],
149 ]
150 );
151
152
153 $this->add_control(
154 'pro_box_icon',
155 [
156 'label' => esc_html__( 'Pro Feature Icon', 'spider-elements' ),
157 'type' => Controls_Manager::ICONS,
158 'skin' => 'inline',
159 'label_block' => false,
160 'default' => [
161 'value' => 'fas fa-crown',
162 'library' => 'fa-solid',
163 ],
164 'condition' => [
165 'style' => [ '2' ],
166 'style!' => [ '1' ]
167 ],
168 ]
169 );
170
171 $this->add_control(
172 'title', [
173 'label' => esc_html__( 'Title', 'spider-elements' ),
174 'type' => Controls_Manager::TEXT,
175 'default' => esc_html__( '50+ New Feature', 'spider-elements' ),
176 'placeholder' => esc_html__( 'Enter your title', 'spider-elements' ),
177 'label_block' => true,
178 'dynamic' => [
179 'active' => true,
180 ],
181 ]
182 );
183
184 $this->add_control(
185 'description', [
186 'label' => esc_html__( 'Description', 'spider-elements' ),
187 'type' => Controls_Manager::TEXTAREA,
188 'dynamic' => [
189 'active' => true,
190 ],
191 'default' => esc_html__( 'Equipped with 70+ beautiful, vastly customizable addons.', 'spider-elements' ),
192 'placeholder' => esc_html__( 'Enter your description', 'spider-elements' ),
193 'rows' => 5,
194 'condition' => [
195 'style' => [ '1' ],
196 'style!' => [ '2' ]
197 ],
198 ]
199 );
200
201 $this->add_control(
202 'box_link', [
203 'label' => esc_html__( 'Link', 'spider-elements' ),
204 'type' => Controls_Manager::URL,
205 'options' => [ 'url', 'is_external', 'spider-elements' ],
206 'label_block' => true,
207 'dynamic' => [
208 'active' => true,
209 ],
210 // 'default' => [
211 // 'url' => '#',
212 // 'is_external' => true,
213 // 'nofollow' => false,
214 // ],
215 ]
216 );
217
218 $this->add_control(
219 'box_title_tag', [
220 'label' => esc_html__( 'Title Tag', 'spider-elements' ),
221 'type' => Controls_Manager::SELECT,
222 'separator' => 'before',
223 'default' => 'h5',
224 'options' => spel_get_title_tags(),
225 ]
226 );
227
228 $this->end_controls_section(); // End icon box Settings
229
230 $this->start_controls_section(
231 'icon_box_btn', [
232 'label' => esc_html__( 'Button', 'spider-elements' ),
233 'condition' => [
234 'style' => [ '1' ],
235 'style!' => [ '2' ]
236 ],
237 ]
238 );
239
240 $this->add_control(
241 'btn_text',
242 [
243 'label' => esc_html__( 'Text', 'spider-elements' ),
244 'type' => Controls_Manager::TEXT,
245 'default' => esc_html__( 'Click here', 'spider-elements' ),
246 'placeholder' => esc_html__( 'Enter button text', 'spider-elements' ),
247 'description' => esc_html__( '"Write your icon box button text"', 'spider-elements' ),
248 'separator' => 'before',
249 'dynamic' => [
250 'active' => true,
251 ],
252 ]
253 );
254
255 $this->add_control(
256 'btn_icon',
257 [
258 'label' => esc_html__( 'Icon', 'spider-elements' ),
259 'type' => Controls_Manager::ICONS,
260 'skin' => 'inline',
261 'label_block' => false,
262 'default' => [
263 'value' => 'fas fa-arrow-right',
264 'library' => 'fa-solid',
265 ],
266 ]
267 );
268
269 $this->end_controls_section(); // End icon box button Settings
270
271 }
272
273
274 /**
275 * Name: elementor_style_control()
276 * Desc: Register the Style Tab output on the Elementor editor.
277 * Params: no params
278 * Return: @void
279 * Since: @1.0.0
280 * Package: @spider-elements
281 * Author: spider-themes
282 */
283 //==================Start Icon Box all style controls===============//
284 public function elementor_style_control() {
285
286 //start Box style control section-------------------------//
287 $this->start_controls_section(
288 'sec_title_style', [
289 'label' => esc_html__( 'Box', 'spider-elements' ),
290 'tab' => Controls_Manager::TAB_STYLE,
291 ]
292 );
293
294
295 $this->add_responsive_control(
296 'box_text_align',
297 [
298 'label' => esc_html__( 'Text Alignment', 'spider-elements' ),
299 'type' => Controls_Manager::CHOOSE,
300 'options' => [
301 'left' => [
302 'title' => esc_html__( 'Left', 'spider-elements' ),
303 'icon' => 'eicon-text-align-left',
304 ],
305 'center' => [
306 'title' => esc_html__( 'Center', 'spider-elements' ),
307 'icon' => 'eicon-text-align-center',
308 ],
309 'right' => [
310 'title' => esc_html__( 'Right', 'spider-elements' ),
311 'icon' => 'eicon-text-align-right',
312 ],
313 'justify' => [
314 'title' => esc_html__( 'Justified', 'spider-elements' ),
315 'icon' => 'eicon-text-align-justify',
316 ],
317 ],
318 'selectors' => [
319 '{{WRAPPER}} .icon_box_content' => 'text-align: {{VALUE}};',
320 '{{WRAPPER}} .icon_box_two' => 'text-align: {{VALUE}};',
321 ],
322 // 'condition' => [
323 // 'style' => [ '1' ],
324 // 'style!' => [ '2' ]
325 // ],
326 ]
327 );
328
329 $this->add_group_control(
330 \Elementor\Group_Control_Border::get_type(),
331 [
332 'name' => 'box-border',
333 'selector' => '{{WRAPPER}} .icon_box,
334 {{WRAPPER}} .icon_box_two',
335 ]
336 );
337
338 $this->add_responsive_control(
339 'box_border_radius',
340 [
341 'label' => esc_html__( 'Border Radius', 'spider-elements' ),
342 'type' => Controls_Manager::DIMENSIONS,
343 'size_units' => [ 'px', '%', 'em' ],
344 'selectors' => [
345 '{{WRAPPER}} .icon_box' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
346 '{{WRAPPER}} .icon_box_two' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
347 ],
348 ]
349 );
350
351 $this->add_responsive_control(
352 'box_padding',
353 [
354 'label' => esc_html__( 'Padding', 'spider-elements' ),
355 'type' => Controls_Manager::DIMENSIONS,
356 'size_units' => [ 'px', 'em', '%' ],
357 'selectors' => [
358 '{{WRAPPER}} .box_bg_shape' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
359 '{{WRAPPER}} .box2_bg_shape' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
360 ],
361 'separator' => 'after',
362 ]
363 );
364
365 //star icon box normal/hover style tabs------------//
366 $this->start_controls_tabs(
367 'box_style_tabs'
368 );
369 //start icon box normal style tab-------------//
370 $this->start_controls_tab(
371 'box_normal_tab',
372 [
373 'label' => esc_html__( 'Normal', 'spider-elements' ),
374
375 ]
376 );
377
378 $this->add_group_control(
379 \Elementor\Group_Control_Background::get_type(),
380 [
381 'name' => 'background',
382 'types' => [ 'classic', 'gradient' ],
383 'exclude' => [ 'image' ],
384 'selector' => '{{WRAPPER}} .icon_box,
385 {{WRAPPER}} .icon_box_two',
386 ]
387 );
388
389 $this->add_group_control(
390 Group_Control_Box_Shadow::get_type(), [
391 'name' => 'icon_box_shadow',
392 'selector' => '{{WRAPPER}} .icon_box,
393 {{WRAPPER}} .icon_box_two',
394 ]
395 );
396
397
398 $this->end_controls_tab();
399 //end icon box normal style tab-------------//
400
401 //start icon box hover style tab-------------//
402 $this->start_controls_tab(
403 'box_hover_tab',
404 [
405 'label' => esc_html__( 'Hover', 'spider-elements' ),
406 ]
407 );
408
409 $this->add_group_control(
410 \Elementor\Group_Control_Background::get_type(),
411 [
412 'name' => 'box_hover_background',
413 'types' => [ 'classic', 'gradient' ],
414 'exclude' => [ 'image' ],
415 'selector' => '{{WRAPPER}} .icon_box:hover,
416 {{WRAPPER}} .icon_box_two:hover',
417 ]
418 );
419
420 $this->add_control(
421 'text_hover_color',
422 [
423 'label' => esc_html__( 'Title Color', 'spider-elements' ),
424 'type' => Controls_Manager::COLOR,
425 'selectors' => [
426 '{{WRAPPER}} .icon_box:hover .box_title' => 'color: {{VALUE}}',
427 '{{WRAPPER}} .icon_box_two:hover .box_two_title' => 'color: {{VALUE}}',
428 ],
429 ]
430 );
431
432 $this->add_control(
433 'desc_hover_color',
434 [
435 'label' => esc_html__( 'Description Color', 'spider-elements' ),
436 'type' => Controls_Manager::COLOR,
437 'selectors' => [
438 '{{WRAPPER}} .icon_box:hover .icon_box_description' => 'color: {{VALUE}}',
439 ],
440 'condition' => [
441 'style' => [ '1' ],
442 'style!' => [ '2' ]
443 ],
444 ]
445 );
446
447 $this->add_control(
448 'icon_hover_color',
449 [
450 'label' => esc_html__( 'Icon Color', 'spider-elements' ),
451 'type' => Controls_Manager::COLOR,
452 'selectors' => [
453 '{{WRAPPER}} .icon_box:hover .box_main_icon' => 'color: {{VALUE}}',
454 '{{WRAPPER}} .icon_box_two:hover .box_main_icon' => 'color: {{VALUE}}',
455 ],
456 ]
457 );
458
459 $this->add_control(
460 'icon_bghover_color',
461 [
462 'label' => esc_html__( 'Icon Background', 'spider-elements' ),
463 'type' => Controls_Manager::COLOR,
464 'selectors' => [
465 '{{WRAPPER}} .icon_box_two:hover .box_main_icon' => 'background: {{VALUE}}',
466 ],
467 'condition' => [
468 'style' => [ '2' ],
469 'style!' => [ '1' ]
470 ],
471 ]
472 );
473
474 $this->add_control(
475 'btn_hover_color',
476 [
477 'label' => esc_html__( 'Button hover', 'spider-elements' ),
478 'type' => Controls_Manager::COLOR,
479 'selectors' => [
480 '{{WRAPPER}} .icon_box:hover .box_button' => 'color: {{VALUE}}',
481 '{{WRAPPER}} .icon_box:hover .button_items i' => 'color: {{VALUE}}',
482 ],
483 'condition' => [
484 'style' => [ '1' ],
485 'style!' => [ '2' ]
486 ],
487 ]
488 );
489
490 $this->add_control(
491 'border_hover_color',
492 [
493 'label' => esc_html__( 'Border Color', 'spider-elements' ),
494 'type' => Controls_Manager::COLOR,
495 'selectors' => [
496 '{{WRAPPER}} .icon_box:hover' => 'border-color: {{VALUE}}',
497 '{{WRAPPER}} .icon_box_two:hover' => 'border-color: {{VALUE}}',
498 ],
499 ]
500 );
501
502 $this->add_group_control(
503 Group_Control_Box_Shadow::get_type(), [
504 'name' => 'icon_box_hover_shadow',
505 'selector' => '{{WRAPPER}} .icon_box:hover,
506 {{WRAPPER}} .icon_box_two:hover',
507 ]
508 );
509
510 $this->end_controls_tab();
511 //end icon box hover style tab-------------//
512 $this->end_controls_tabs();
513 //star icon box normal/hover style tabs------------//
514 $this->end_controls_section();
515 //end Box style control section------------------------------//
516
517
518 //start Icon style section----------------------//
519 $this->start_controls_section(
520 'icon_style',
521 [
522 'label' => esc_html__( 'Icon', 'spider-elements' ),
523 'tab' => Controls_Manager::TAB_STYLE,
524 ]
525 );
526
527 $this->add_responsive_control(
528 'icon_vertical_alignment',
529 [
530 'label' => esc_html__( 'Vertical Alignment', 'spider-elements' ),
531 'type' => Controls_Manager::CHOOSE,
532 'options' => [
533 'flex-start' => [
534 'title' => esc_html__( 'Top', 'spider-elements' ),
535 'icon' => 'eicon-v-align-top',
536 ],
537 'center' => [
538 'title' => esc_html__( 'Middle', 'spider-elements' ),
539 'icon' => 'eicon-v-align-middle',
540 ],
541 'flex-end' => [
542 'title' => esc_html__( 'Bottom', 'spider-elements' ),
543 'icon' => 'eicon-v-align-bottom',
544 ],
545 ],
546 'default' => 'flex-start',
547 'selectors' => [
548 '{{WRAPPER}} .box_icon' => 'display: flex; align-items: {{VALUE}};',
549 ],
550 'condition' => [
551 'style' => [ '1' ],
552 'style!' => [ '2' ]
553 ],
554 ]
555 );
556
557 $this->add_control(
558 'icon_color',
559 [
560 'label' => esc_html__( 'Color', 'spider-elements' ),
561 'type' => Controls_Manager::COLOR,
562 'selectors' => [
563 '{{WRAPPER}} .box_main_icon' => 'color: {{VALUE}}',
564 ],
565 ]
566 );
567
568 $this->add_control(
569 'icon_bg_color',
570 [
571 'label' => esc_html__( 'Background', 'spider-elements' ),
572 'type' => Controls_Manager::COLOR,
573 'selectors' => [
574 '{{WRAPPER}} .box_main_icon' => 'background: {{VALUE}}',
575 ],
576 'condition' => [
577 'style' => [ '2' ],
578 'style!' => [ '1' ]
579 ],
580 ]
581 );
582
583 $this->add_responsive_control(
584 'icon_size',
585 [
586 'label' => esc_html__( 'Size', 'spider-elements' ),
587 'type' => Controls_Manager::SLIDER,
588 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
589 'range' => [
590 'px' => [
591 'min' => 6,
592 'max' => 300,
593 ],
594 ],
595 'selectors' => [
596 '{{WRAPPER}} .box_main_icon svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
597 ],
598 ]
599 );
600
601
602 $this->add_responsive_control(
603 'box_icon_space',
604 [
605 'label' => esc_html__( 'Spacing', 'spider-elements' ),
606 'type' => Controls_Manager::SLIDER,
607 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
608 'default' => [
609 'size' => 20,
610 ],
611 'range' => [
612 'px' => [
613 'max' => 200,
614 ],
615 'em' => [
616 'max' => 10,
617 ],
618 'rem' => [
619 'max' => 10,
620 ],
621 ],
622 'selectors' => [
623 '{{WRAPPER}} .box_main_icon' => 'margin-right: {{SIZE}}{{UNIT}}',
624 ],
625 'condition' => [
626 'style' => [ '1' ],
627 'style!' => [ '2' ]
628 ],
629 ]
630 );
631
632 $this->add_responsive_control(
633 'box2_icon_space',
634 [
635 'label' => esc_html__( 'Spacing', 'spider-elements' ),
636 'type' => Controls_Manager::SLIDER,
637 'size_units' => [ 'px', '%', 'em', 'rem', 'vw', 'custom' ],
638 'default' => [
639 'size' => 10,
640 ],
641 'range' => [
642 'px' => [
643 'max' => 200,
644 ],
645 'em' => [
646 'max' => 10,
647 ],
648 'rem' => [
649 'max' => 10,
650 ],
651 ],
652 'selectors' => [
653 '{{WRAPPER}} .box_two_title' => 'margin-top: {{SIZE}}{{UNIT}}',
654 ],
655 'condition' => [
656 'style' => [ '2' ],
657 'style!' => [ '1' ]
658 ],
659 ]
660 );
661
662 $this->add_responsive_control(
663 'box_icon_padding',
664 [
665 'label' => esc_html__( 'Padding', 'spider-elements' ),
666 'type' => Controls_Manager::DIMENSIONS,
667 'size_units' => [ 'px' ],
668 'range' => [
669 'px' => [
670 'min' => - 100,
671 'max' => 100,
672 'step' => 5,
673 ],
674 ],
675 'default' => [
676 'unit' => 'px',
677 'size' => 10,
678 ],
679 'selectors' => [
680 '{{WRAPPER}} .box_main_icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
681 ],
682 'condition' => [
683 'style' => [ '2' ],
684 'style!' => [ '1' ]
685 ],
686 ]
687 );
688
689 $this->add_responsive_control(
690 'box_icon_radius', [
691 'label' => esc_html__( 'Border Radius', 'spider-elements' ),
692 'type' => Controls_Manager::DIMENSIONS,
693 'size_units' => [ 'px', '%', 'em' ],
694 'selectors' => [
695 '{{WRAPPER}} .box_main_icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
696 ],
697 'condition' => [
698 'style' => [ '2' ],
699 'style!' => [ '1' ]
700 ],
701 ]
702 );
703
704 $this->add_control(
705 'svg_heading',
706 [
707 'label' => esc_html__( 'Svg Color', 'spider-elements' ),
708 'type' => Controls_Manager::HEADING,
709 'separator' => 'before',
710 ]
711 );
712
713 $this->start_controls_tabs(
714 'svg_style_tabs'
715 );
716
717 //start svg normal----
718 $this->start_controls_tab(
719 'svg_normal_tab',
720 [
721 'label' => esc_html__( 'Normal', 'spider-elements' ),
722 ]
723 );
724
725 $this->add_control(
726 'svg_color',
727 [
728 'label' => esc_html__( 'Color', 'spider-elements' ),
729 'type' => Controls_Manager::COLOR,
730 'selectors' => [
731 '{{WRAPPER}} .box_main_icon svg path' => 'stroke: {{VALUE}}',
732 ],
733 ]
734 );
735
736 $this->add_control(
737 'svg_fill_color',
738 [
739 'label' => esc_html__( 'Fill Color', 'spider-elements' ),
740 'type' => Controls_Manager::COLOR,
741 'selectors' => [
742 '{{WRAPPER}} .box_main_icon svg path' => 'fill: {{VALUE}}',
743 // '{{WRAPPER}} .box_main_icon svg stop' => 'stop-color: {{VALUE}}',
744 ],
745 ]
746 );
747
748 $this->end_controls_tab();
749 //end svg normal-----//
750
751 //start svg Hover ------
752 $this->start_controls_tab(
753 'svg_hover_tab',
754 [
755 'label' => esc_html__( 'Hover', 'spider-elements' ),
756 ]
757 );
758
759 $this->add_control(
760 'svg_hover_color',
761 [
762 'label' => esc_html__( 'Color', 'spider-elements' ),
763 'type' => Controls_Manager::COLOR,
764 'selectors' => [
765 '{{WRAPPER}} .icon_box:hover .box_bg_shape .box_icon .box_main_icon svg path' => 'stroke: {{VALUE}}',
766 '{{WRAPPER}} .icon_box_two:hover .box2_bg_shape .box_main_icon svg path' => 'stroke: {{VALUE}}',
767 // '{{WRAPPER}} .box_main_icon svg stop' => 'stop-color: {{VALUE}}',
768 ],
769 ]
770 );
771
772 $this->add_control(
773 'svg_fill_hover_color',
774 [
775 'label' => esc_html__( 'Fill Color', 'spider-elements' ),
776 'type' => Controls_Manager::COLOR,
777 'selectors' => [
778 '{{WRAPPER}} .icon_box:hover .box_bg_shape .box_icon .box_main_icon svg path' => 'fill: {{VALUE}}',
779 '{{WRAPPER}} .icon_box_two:hover .box2_bg_shape .box_main_icon svg path' => 'fill: {{VALUE}}',
780 // '{{WRAPPER}} .box_main_icon svg stop' => 'stop-color: {{VALUE}}',
781 ],
782 ]
783 );
784
785 $this->end_controls_tab();
786 //end svg hover//------
787
788 $this->end_controls_tabs();
789 //end normal/hover tabs/////-----
790
791 $this->end_controls_section();
792 //end icon box Icon and svg style section------------------------//
793
794
795 //start icon box contents section-----------------------------//
796 $this->start_controls_section(
797 'box_contents',
798 [
799 'label' => esc_html__( 'Contents', 'spider-elements' ),
800 'tab' => Controls_Manager::TAB_STYLE,
801 ]
802 );
803
804 //start icon box title style controls-------------//
805 $this->add_control(
806 'title_heading',
807 [
808 'label' => esc_html__( 'Title', 'spider-elements' ),
809 'type' => Controls_Manager::HEADING
810 ]
811 );
812
813 $this->add_group_control(
814 Group_Control_Typography::get_type(),
815 [
816 'name' => 'box_content_typo',
817 'selector' => '{{WRAPPER}} .box_title,
818 {{WRAPPER}} .box_two_title',
819 ]
820 );
821
822 $this->add_control(
823 'title_color',
824 [
825 'label' => esc_html__( 'Text Color', 'spider-elements' ),
826 'type' => Controls_Manager::COLOR,
827 'selectors' => [
828 '{{WRAPPER}} .box_title' => 'color: {{VALUE}}',
829 '{{WRAPPER}} .box_two_title' => 'color: {{VALUE}}',
830 ],
831 ]
832 );
833 //end icon box title style controls------------------//
834
835 //start icon box description style controls----------------//
836 $this->add_control(
837 'desc_heading',
838 [
839 'label' => esc_html__( 'Description', 'spider-elements' ),
840 'type' => Controls_Manager::HEADING,
841 'separator' => 'before',
842 'condition' => [
843 'style' => [ '1' ],
844 'style!' => [ '2' ]
845 ],
846 ]
847 );
848
849 $this->add_group_control(
850 Group_Control_Typography::get_type(),
851 [
852 'name' => 'box_description_typo',
853 'selector' => '{{WRAPPER}} .icon_box_description',
854 'condition' => [
855 'style' => [ '1' ],
856 'style!' => [ '2' ]
857 ],
858 ]
859 );
860
861 $this->add_control(
862 'desc_color',
863 [
864 'label' => esc_html__( 'Text Color', 'spider-elements' ),
865 'type' => Controls_Manager::COLOR,
866 'selectors' => [
867 '{{WRAPPER}} .icon_box_description' => 'color: {{VALUE}}',
868 ],
869 'condition' => [
870 'style' => [ '1' ],
871 'style!' => [ '2' ]
872 ],
873 ]
874 );
875
876 $this->add_responsive_control(
877 'box_desc_margin',
878 [
879 'label' => esc_html__( 'Margin', 'spider-elements' ),
880 'type' => Controls_Manager::DIMENSIONS,
881 'size_units' => [ 'px' ],
882 'range' => [
883 'px' => [
884 'min' => - 100,
885 'max' => 100,
886 'step' => 5,
887 ],
888 ],
889 'default' => [
890 'unit' => 'px',
891 'size' => 10,
892 ],
893 'selectors' => [
894 '{{WRAPPER}} .icon_box_description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
895 ],
896 'condition' => [
897 'style' => [ '1' ],
898 'style!' => [ '2' ]
899 ],
900 ]
901 );
902
903 $this->add_control(
904 'box_btn_hrading',
905 [
906 'label' => esc_html__( 'Button', 'spider-elements' ),
907 'type' => Controls_Manager::HEADING,
908 'separator' => 'before',
909 'condition' => [
910 'style' => [ '1' ],
911 'style!' => [ '2' ]
912 ],
913 ]
914 );
915
916 $this->add_group_control(
917 Group_Control_Typography::get_type(),
918 [
919 'name' => 'box_btn_typo',
920 'selector' => '{{WRAPPER}} .box_button,
921 {{WRAPPER}} .button_items i',
922 'condition' => [
923 'style' => [ '1' ],
924 'style!' => [ '2' ]
925 ],
926 ]
927 );
928
929 $this->add_control(
930 'box_btn_color',
931 [
932 'label' => esc_html__( 'Button Color', 'spider-elements' ),
933 'type' => Controls_Manager::COLOR,
934 'selectors' => [
935 '{{WRAPPER}} .box_button' => 'color: {{VALUE}}',
936 '{{WRAPPER}} .button_items i' => 'color: {{VALUE}}',
937 ],
938 'condition' => [
939 'style' => [ '1' ],
940 'style!' => [ '2' ]
941 ],
942 ]
943 );
944
945 $this->end_controls_section();
946 //end icon box description style controls-------------------//
947
948 //start icon box background style section------------//
949 $this->start_controls_section(
950 'bg_section',
951 [
952 'label' => esc_html__( 'Background Shape', 'spider-elements' ),
953 'tab' => \Elementor\Controls_Manager::TAB_STYLE,
954 ]
955 );
956
957 $this->start_controls_tabs(
958 'bg_style_tabs'
959 );
960
961 //start BG normal----
962 $this->start_controls_tab(
963 'style_normal_tab',
964 [
965 'label' => esc_html__( 'Normal', 'spider-elements' ),
966 ]
967 );
968
969 $this->add_group_control(
970 \Elementor\Group_Control_Background::get_type(),
971 [
972 'name' => 'box_normal_background',
973 'types' => [ 'classic', 'gradient' ],
974 'selector' => '{{WRAPPER}} .box_bg_shape,
975 {{WRAPPER}} .box2_bg_shape',
976 ]
977 );
978
979 $this->end_controls_tab();
980 //end BG normal-----//
981
982 //start BG Hover ------
983 $this->start_controls_tab(
984 'style_hover_tab',
985 [
986 'label' => esc_html__( 'Hover', 'spider-elements' ),
987 ]
988 );
989
990 $this->add_group_control(
991 \Elementor\Group_Control_Background::get_type(),
992 [
993 'name' => 'hover_background',
994 'types' => [ 'classic', 'gradient' ],
995 'selector' => '{{WRAPPER}} .box_bg_shape:hover,
996 {{WRAPPER}} .box2_bg_shape:hover',
997 ]
998 );
999
1000 $this->end_controls_tab();
1001 //end BG hover//------
1002
1003 $this->end_controls_tabs();
1004 //end normal/hover tabs/////-----
1005
1006 $this->end_controls_section();
1007 //end background control style section---------////
1008
1009 }// ==================End icon box all section snd style controls===============//
1010
1011
1012 protected function render() {
1013 $settings = $this->get_settings_for_display();
1014 extract( $settings ); //extract all settings array to variables converted to name of key
1015 $box_title_tag = ! empty ( $settings['box_title_tag'] ) ? $settings['box_title_tag'] : 'h5';
1016
1017 //================= Template Parts =================//
1018 include "templates/Icon-box/icon-box{$settings['style']}.php";
1019
1020 }
1021 }