PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 2.15.2
Shortcodes and extra features for Phlox theme v2.15.2
2.17.21 2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / elementor / widgets / modern-button.php
auxin-elements / includes / elementor / widgets Last commit date
theme-elements 2 years ago accordion.php 4 years ago audio.php 4 years ago before-after.php 3 years ago button.php 4 years ago carousel-navigation.php 4 years ago circle-chart.php 3 years ago contact-box.php 4 years ago contact-form.php 4 years ago custom-list.php 4 years ago divider.php 4 years ago gallery.php 2 years ago gmap.php 4 years ago heading-modern.php 3 years ago icon.php 3 years ago image.php 4 years ago mailchimp.php 4 years ago modern-button.php 4 years ago products-grid.php 3 years ago quote.php 4 years ago recent-comments.php 3 years ago recent-posts-grid-carousel.php 4 years ago recent-posts-land-style.php 4 years ago recent-posts-masonry.php 4 years ago recent-posts-tiles-carousel.php 4 years ago recent-posts-tiles.php 4 years ago recent-posts-timeline.php 4 years ago recent-products.php 4 years ago responsive-table.php 3 years ago search.php 4 years ago staff.php 4 years ago svg.php 3 years ago tabs.php 3 years ago testimonial.php 4 years ago text.php 4 years ago touch-slider.php 4 years ago video.php 4 years ago
modern-button.php
1097 lines
1 <?php
2 namespace Auxin\Plugin\CoreElements\Elementor\Elements;
3
4 use Elementor\Plugin;
5 use Elementor\Widget_Base;
6 use Elementor\Controls_Manager;
7 use Elementor\Group_Control_Typography;
8 use Elementor\Icons_Manager;
9 use Elementor\Core\Schemes\Typography;
10 use Elementor\Group_Control_Background;
11 use Elementor\Group_Control_Box_Shadow;
12 use Elementor\Group_Control_Text_Shadow;
13
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit; // Exit if accessed directly.
17 }
18
19 /**
20 * Elementor 'ModernButton' widget.
21 *
22 * Elementor widget that displays an 'ModernButton' with lightbox.
23 *
24 * @since 1.0.0
25 */
26 class ModernButton extends Widget_Base {
27
28 /**
29 * Get widget name.
30 *
31 * Retrieve 'ModernButton' widget name.
32 *
33 * @since 1.0.0
34 * @access public
35 *
36 * @return string Widget name.
37 */
38 public function get_name() {
39 return 'aux_modern_button';
40 }
41
42 /**
43 * Get widget title.
44 *
45 * Retrieve 'ModernButton' widget title.
46 *
47 * @since 1.0.0
48 * @access public
49 *
50 * @return string Widget title.
51 */
52 public function get_title() {
53 return __('Modern Button', 'auxin-elements' );
54 }
55
56 /**
57 * Get widget icon.
58 *
59 * Retrieve 'ModernButton' widget icon.
60 *
61 * @since 1.0.0
62 * @access public
63 *
64 * @return string Widget icon.
65 */
66 public function get_icon() {
67 return 'eicon-button auxin-badge';
68 }
69
70 /**
71 * Get widget categories.
72 *
73 * Retrieve 'ModernButton' widget icon.
74 *
75 * @since 1.0.0
76 * @access public
77 *
78 * @return string Widget icon.
79 */
80 public function get_categories() {
81 return [ 'auxin-core' ];
82 }
83
84 /**
85 * Register 'ModernButton' widget controls.
86 *
87 * Adds different input fields to allow the user to change and customize the widget settings.
88 *
89 * @since 1.0.0
90 * @access protected
91 */
92 protected function register_controls() {
93
94 /*-----------------------------------------------------------------------------------*/
95 /* Button
96 /*-----------------------------------------------------------------------------------*/
97
98 $this->start_controls_section(
99 'button_section',
100 [
101 'label' => __('Button', 'auxin-elements' ),
102 ]
103 );
104
105 $this->add_control(
106 'label',
107 [
108 'label' => __('Text','auxin-elements' ),
109 'type' => Controls_Manager::TEXT,
110 'default' => __('Click Here','auxin-elements' )
111 ]
112 );
113
114 $this->add_control(
115 'label2',
116 [
117 'label' => __('Highlighted Text', 'auxin-elements' ),
118 'type' => Controls_Manager::TEXT,
119 'default' => __('','auxin-elements' )
120 ]
121 );
122
123 $this->add_control(
124 'label3',
125 [
126 'label' => __('After Text', 'auxin-elements' ),
127 'type' => Controls_Manager::TEXT,
128 'default' => __('','auxin-elements' )
129 ]
130 );
131
132 $this->add_control(
133 'vertical_align',
134 [
135 'label' => __( 'Text Vertical Align', 'auxin-elements' ),
136 'type' => Controls_Manager::CHOOSE,
137 'options' => [
138 'top' => [
139 'title' => __( 'Top', 'auxin-elements' ),
140 'icon' => 'eicon-v-align-top',
141 ],
142 'center' => [
143 'title' => __( 'Center', 'auxin-elements' ),
144 'icon' => 'eicon-v-align-middle',
145 ],
146 'bottom' => [
147 'title' => __( 'Bottom', 'auxin-elements' ),
148 'icon' => 'eicon-v-align-bottom',
149 ],
150 ],
151 'selectors' => [
152 '{{WRAPPER}} .aux-text' => 'display:flex; align-items:{{VALUE}};'
153 ],
154 'selectors_dictionary' => [
155 'top' => 'flex-start',
156 'bottom' => 'flex-end'
157 ],
158 'conditions' => [
159 'relation' => 'or',
160 'terms' => [
161 [
162 'name' => 'label2',
163 'operator' => '!==',
164 'value' => ''
165 ],
166 [
167 'name' => 'label3',
168 'operator' => '!==',
169 'value' => ''
170 ]
171 ]
172 ],
173 'default' => ''
174 ]
175 );
176
177 $this->add_responsive_control(
178 'btn_align',
179 [
180 'label' => __( 'Alignment', 'auxin-elements' ),
181 'type' => Controls_Manager::CHOOSE,
182 'options' => [
183 'left' => [
184 'title' => __( 'Left', 'auxin-elements' ),
185 'icon' => 'eicon-text-align-left',
186 ],
187 'center' => [
188 'title' => __( 'Center', 'auxin-elements' ),
189 'icon' => 'eicon-text-align-center',
190 ],
191 'right' => [
192 'title' => __( 'Right', 'auxin-elements' ),
193 'icon' => 'eicon-text-align-right',
194 ],
195 'justify' => [
196 'title' => __( 'Justified', 'auxin-elements' ),
197 'icon' => 'eicon-text-align-justify',
198 ]
199 ],
200 'default' => 'left',
201 'selectors' => [
202 '{{WRAPPER}} .aux-modern-button-wrapper' => 'text-align:{{VALUE}};',
203 ]
204 ]
205 );
206
207 $this->add_control(
208 'link',
209 [
210 'label' => __('Link','auxin-elements' ),
211 'type' => Controls_Manager::URL,
212 'placeholder' => 'https://your-link.com',
213 'show_external' => true,
214 'dynamic' => [
215 'active' => true
216 ]
217 ]
218 );
219
220 $this->add_control(
221 'link_css_id',
222 array(
223 'label' => __('Link CSS ID','auxin-elements' ),
224 'type' => Controls_Manager::TEXT,
225 'placeholder' => 'Css ID for anchor tag',
226 'label_block' => true,
227 )
228 );
229
230 $this->add_control(
231 'open_video_in_lightbox',
232 array(
233 'label' => __('Open Video in Lightbox','auxin-elements' ),
234 'description' => __( 'To use this option, the above link option should be a video', 'auxin-elements' ),
235 'type' => Controls_Manager::SWITCHER,
236 'label_on' => __( 'On', 'auxin-elements' ),
237 'label_off' => __( 'Off', 'auxin-elements' ),
238 'return_value' => 'yes',
239 'default' => ''
240 )
241 );
242
243 $this->add_control(
244 'icon_display',
245 [
246 'label' => __( 'Display Icon', 'auxin-elements' ),
247 'type' => Controls_Manager::SWITCHER,
248 'label_on' => __( 'On', 'auxin-elements' ),
249 'label_off' => __( 'Off', 'auxin-elements' ),
250 'return_value' => 'yes',
251 'default' => 'no',
252 'separator' => 'before'
253 ]
254 );
255
256 $this->add_control(
257 'icon',
258 [
259 'type' => Controls_Manager::ICONS,
260 'default' => [
261 'value' => 'auxicon-arrow-down',
262 'library' => 'auxicon'
263 ],
264 'condition' => [
265 'icon_display' => 'yes'
266 ],
267 ]
268 );
269
270 $this->end_controls_section();
271
272 /*-----------------------------------------------------------------------------------*/
273 /* Button Style Section
274 /*-----------------------------------------------------------------------------------*/
275
276 $this->start_controls_section(
277 'section_style_btn',
278 [
279 'label' => __('Button', 'auxin-elements' ),
280 'tab' => Controls_Manager::TAB_STYLE,
281 ]
282 );
283
284 $this->add_control(
285 'btn_type',
286 [
287 'label' => __('Type', 'auxin-elements'),
288 'type' => Controls_Manager::SELECT,
289 'default' => 'default',
290 'options' => [
291 'default' => __('Default', 'auxin-elements' ),
292 'outline' => __('Outline' , 'auxin-elements' ),
293 ]
294 ]
295 );
296
297 $this->add_control(
298 'btn_shape',
299 [
300 'label' => __('Shape', 'auxin-elements'),
301 'type' => Controls_Manager::SELECT,
302 'default' => 'normal',
303 'options' => [
304 'normal' => __('Normal', 'auxin-elements' ),
305 'round' => __('Round' , 'auxin-elements' ),
306 'curve' => __('Curve' , 'auxin-elements' ),
307 ]
308 ]
309 );
310
311 $this->add_control(
312 'btn_size',
313 [
314 'label' => __('Size', 'auxin-elements'),
315 'type' => Controls_Manager::SELECT,
316 'default' => 'md',
317 'options' => [
318 'xl' => __('Exlarge', 'auxin-elements' ),
319 'lg' => __('Large' , 'auxin-elements' ),
320 'md' => __('Medium' , 'auxin-elements' ),
321 'sm' => __('Small' , 'auxin-elements' ),
322 'xs' => __('Tiny' , 'auxin-elements' )
323 ]
324 ]
325 );
326
327 $this->add_control(
328 'btn_skin',
329 [
330 'label' => __('Skin', 'auxin-elements'),
331 'label_block' => false,
332 'type' => 'aux-visual-select',
333 'default' => 'black',
334 'options' =>[
335 'black' => [
336 'label' => __('black', 'auxin-elements'),
337 'css_class' => 'aux-color-selector aux-button aux-visual-selector-black'
338 ],
339 'white' => [
340 'label' => __('White', 'auxin-elements'),
341 'css_class' => 'aux-color-selector aux-button aux-visual-selector-white'
342 ],
343 'info' => [
344 'label' => __('Ball Blue', 'auxin-elements'),
345 'css_class' => 'aux-color-selector aux-button aux-visual-selector-ball-blue'
346 ],
347 'warning' => [
348 'label' => __('Mikado Yellow', 'auxin-elements'),
349 'css_class' => 'aux-color-selector aux-button aux-visual-selector-mikado-yellow'
350 ],
351 'caution' => [
352 'label' => __('Carmine Pink', 'auxin-elements'),
353 'css_class' => 'aux-color-selector aux-button aux-visual-selector-carmine-pink'
354 ]
355 ]
356 ]
357 );
358
359 $this->start_controls_tabs( 'btn_styles' );
360
361 $this->start_controls_tab(
362 'btn_normal',
363 [
364 'label' => __( 'Normal' , 'auxin-elements' )
365 ]
366 );
367
368 $this->add_group_control(
369 Group_Control_Background::get_type(),
370 [
371 'name' => 'btn_bg_normal',
372 'label' => __( 'Background', 'auxin-elements' ),
373 'types' => [ 'classic', 'gradient' ],
374 'selector' => '{{WRAPPER}} .aux-modern-button.aux-modern-button-outline .aux-overlay:before, {{WRAPPER}} .aux-modern-button .aux-overlay:before'
375 ]
376 );
377
378 $this->add_group_control(
379 Group_Control_Box_Shadow::get_type(),
380 [
381 'name' => 'btn_box_shadow_normal',
382 'selector' => '{{WRAPPER}} .aux-overlay:before, {{WRAPPER}} .aux-overlay:after'
383 ]
384 );
385
386 $this->add_responsive_control(
387 'btn_padding_normal',
388 [
389 'label' => __( 'Padding', 'auxin-elements' ),
390 'type' => Controls_Manager::DIMENSIONS,
391 'size_units' => [ 'px', '%' ],
392 'selectors' => [
393 '{{WRAPPER}} .aux-modern-button' => 'padding:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
394 ]
395 ]
396 );
397
398 $this->add_responsive_control(
399 'btn_border_radius_normal',
400 [
401 'label' => __( 'Border Radius', 'auxin-elements' ),
402 'type' => Controls_Manager::DIMENSIONS,
403 'size_units' => [ 'px', 'em', '%' ],
404 'allowed_dimensions' => 'all',
405 'separator' => 'before',
406 'selectors' => [
407 '{{WRAPPER}} .aux-overlay:before, {{WRAPPER}} .aux-overlay:after' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
408 ]
409 ]
410 );
411
412 $this->end_controls_tab();
413
414 $this->start_controls_tab(
415 'button_hover',
416 [
417 'label' => __( 'Hover' , 'auxin-elements' )
418 ]
419 );
420
421 $this->add_group_control(
422 Group_Control_Background::get_type(),
423 [
424 'name' => 'btn_bg_hover',
425 'label' => __( 'Background', 'auxin-elements' ),
426 'types' => [ 'classic', 'gradient' ],
427 'selector' => '{{WRAPPER}} .aux-modern-button.aux-modern-button-outline .aux-overlay:after, {{WRAPPER}} .aux-modern-button .aux-overlay:after'
428 ]
429 );
430
431 $this->add_group_control(
432 Group_Control_Box_Shadow::get_type(),
433 [
434 'name' => 'btn_box_shadow_hover',
435 'selector' => '{{WRAPPER}} .aux-modern-button:hover .aux-overlay:before, {{WRAPPER}} .aux-modern-button:hover .aux-overlay:after'
436 ]
437 );
438
439 $this->add_responsive_control(
440 'btn_padding_hover',
441 [
442 'label' => __( 'Padding', 'auxin-elements' ),
443 'type' => Controls_Manager::DIMENSIONS,
444 'size_units' => [ 'px', '%' ],
445 'selectors' => [
446 '{{WRAPPER}} .aux-modern-button:hover' => 'padding:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
447 ]
448 ]
449 );
450
451 $this->add_responsive_control(
452 'btn_border_radius_hover',
453 [
454 'label' => __( 'Border Radius', 'auxin-elements' ),
455 'type' => Controls_Manager::DIMENSIONS,
456 'size_units' => [ 'px', 'em', '%' ],
457 'allowed_dimensions' => 'all',
458 'separator' => 'before',
459 'selectors' => [
460 '{{WRAPPER}} .aux-modern-button:hover .aux-overlay:before, {{WRAPPER}} .aux-modern-button:hover .aux-overlay:after' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
461 ]
462 ]
463 );
464
465 $this->end_controls_tab();
466
467 $this->end_controls_tabs();
468
469 $this->end_controls_section();
470
471 /*-----------------------------------------------------------------------------------*/
472 /* Label Style Section
473 /*-----------------------------------------------------------------------------------*/
474
475 $this->start_controls_section(
476 'section_style_text',
477 [
478 'label' => __('Text', 'auxin-elements' ),
479 'tab' => Controls_Manager::TAB_STYLE
480 ]
481 );
482
483
484 $this->start_controls_tabs( 'text_styles' );
485
486 $this->start_controls_tab(
487 'text_normal',
488 [
489 'label' => __( 'Normal' , 'auxin-elements' )
490 ]
491 );
492
493 $this->add_group_control(
494 Group_Control_Typography::get_type(),
495 [
496 'name' => 'text_normal_typo',
497 'scheme' => Typography::TYPOGRAPHY_1,
498 'selector' => '{{WRAPPER}} .aux-text'
499 ]
500 );
501
502 $this->add_control(
503 'text_normal_color',
504 [
505 'label' => __( 'Color', 'auxin-elements' ),
506 'type' => Controls_Manager::COLOR,
507 'selectors' => [
508 '{{WRAPPER}} .aux-text' => 'color: {{VALUE}};'
509 ]
510 ]
511
512 );
513
514 $this->add_group_control(
515 Group_Control_Text_Shadow::get_type(),
516 [
517 'name' => 'text_normal_text_shadow',
518 'label' => __( 'Text Shadow', 'auxin-elements' ),
519 'selector' => '{{WRAPPER}} .aux-text'
520 ]
521 );
522
523 $this->end_controls_tab();
524
525 $this->start_controls_tab(
526 'text_hover',
527 [
528 'label' => __( 'Hover' , 'auxin-elements' )
529 ]
530 );
531
532 $this->add_group_control(
533 Group_Control_Typography::get_type(),
534 [
535 'name' => 'text_hover_typo',
536 'scheme' => Typography::TYPOGRAPHY_1,
537 'selector' => '{{WRAPPER}} .aux-modern-button:hover .aux-text'
538 ]
539 );
540
541 $this->add_control(
542 'text_hover_color',
543 [
544 'label' => __( 'Color', 'auxin-elements' ),
545 'type' => Controls_Manager::COLOR,
546 'selectors' => [
547 '{{WRAPPER}} .aux-modern-button:hover .aux-text' => 'color:{{VALUE}};'
548 ]
549 ]
550 );
551
552 $this->add_group_control(
553 Group_Control_Text_Shadow::get_type(),
554 [
555 'name' => 'text_hover_text_shadow',
556 'label' => __( 'Text Shadow', 'auxin-elements' ),
557 'selector' => '{{WRAPPER}} .aux-modern-button:hover .aux-text'
558 ]
559 );
560
561 $this->end_controls_tab();
562
563 $this->end_controls_tabs();
564
565 $this->end_controls_section();
566
567
568 /*-----------------------------------------------------------------------------------*/
569 /* Label Highlighted Style Section
570 /*-----------------------------------------------------------------------------------*/
571
572 $this->start_controls_section(
573 'section_style_text2',
574 [
575 'label' => __('Highlighted Text', 'auxin-elements' ),
576 'tab' => Controls_Manager::TAB_STYLE,
577 'condition' => [
578 'label2!' => ''
579 ]
580 ]
581 );
582
583
584 $this->start_controls_tabs( 'text2_styles' );
585
586 $this->start_controls_tab(
587 'text2_normal',
588 [
589 'label' => __( 'Normal' , 'auxin-elements' )
590 ]
591 );
592
593 $this->add_group_control(
594 Group_Control_Typography::get_type(),
595 [
596 'name' => 'text2_normal_typo',
597 'scheme' => Typography::TYPOGRAPHY_1,
598 'selector' => '{{WRAPPER}} .aux-text-highlighted'
599 ]
600 );
601
602 $this->add_control(
603 'text2_normal_color',
604 [
605 'label' => __( 'Color', 'auxin-elements' ),
606 'type' => Controls_Manager::COLOR,
607 'selectors' => [
608 '{{WRAPPER}} .aux-text-highlighted' => 'color: {{VALUE}};'
609 ]
610 ]
611
612 );
613
614 $this->add_group_control(
615 Group_Control_Text_Shadow::get_type(),
616 [
617 'name' => 'text2_normal_text_shadow',
618 'label' => __( 'Text Shadow', 'auxin-elements' ),
619 'selector' => '{{WRAPPER}} .aux-text-highlighted'
620 ]
621 );
622
623 $this->end_controls_tab();
624
625 $this->start_controls_tab(
626 'text2_hover',
627 [
628 'label' => __( 'Hover' , 'auxin-elements' )
629 ]
630 );
631
632 $this->add_group_control(
633 Group_Control_Typography::get_type(),
634 [
635 'name' => 'text2_hover_typo',
636 'scheme' => Typography::TYPOGRAPHY_1,
637 'selector' => '{{WRAPPER}} .aux-modern-button:hover .aux-text-highlighted'
638 ]
639 );
640
641 $this->add_control(
642 'text2_hover_color',
643 [
644 'label' => __( 'Color', 'auxin-elements' ),
645 'type' => Controls_Manager::COLOR,
646 'selectors' => [
647 '{{WRAPPER}} .aux-modern-button:hover .aux-text-highlighted' => 'color:{{VALUE}};'
648 ]
649 ]
650 );
651
652 $this->add_group_control(
653 Group_Control_Text_Shadow::get_type(),
654 [
655 'name' => 'text2_hover_text_shadow',
656 'label' => __( 'Text Shadow', 'auxin-elements' ),
657 'selector' => '{{WRAPPER}} .aux-modern-button:hover .aux-text-highlighted'
658 ]
659 );
660
661 $this->end_controls_tab();
662
663 $this->end_controls_tabs();
664
665 $this->add_responsive_control(
666 'text2_margin',
667 [
668 'label' => __( 'Margin', 'auxin-elements' ),
669 'type' => Controls_Manager::DIMENSIONS,
670 'size_units' => [ 'px', 'em', '%' ],
671 'selectors' => [
672 '{{WRAPPER}} .aux-text-highlighted' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
673 ],
674 'separator' => 'before'
675 ]
676 );
677
678 $this->end_controls_section();
679
680 /*-----------------------------------------------------------------------------------*/
681 /* Label After Style Section
682 /*-----------------------------------------------------------------------------------*/
683
684 $this->start_controls_section(
685 'section_style_text3',
686 [
687 'label' => __('After Text', 'auxin-elements' ),
688 'tab' => Controls_Manager::TAB_STYLE,
689 'condition' => [
690 'label3!' => ''
691 ]
692 ]
693 );
694
695
696 $this->start_controls_tabs( 'text3_styles' );
697
698 $this->start_controls_tab(
699 'text3_normal',
700 [
701 'label' => __( 'Normal' , 'auxin-elements' )
702 ]
703 );
704
705 $this->add_group_control(
706 Group_Control_Typography::get_type(),
707 [
708 'name' => 'text3_normal_typo',
709 'scheme' => Typography::TYPOGRAPHY_1,
710 'selector' => '{{WRAPPER}} .aux-text-after'
711 ]
712 );
713
714 $this->add_control(
715 'text3_normal_color',
716 [
717 'label' => __( 'Color', 'auxin-elements' ),
718 'type' => Controls_Manager::COLOR,
719 'selectors' => [
720 '{{WRAPPER}} .aux-text-after' => 'color: {{VALUE}};'
721 ]
722 ]
723
724 );
725
726 $this->add_group_control(
727 Group_Control_Text_Shadow::get_type(),
728 [
729 'name' => 'text3_normal_text_shadow',
730 'label' => __( 'Text Shadow', 'auxin-elements' ),
731 'selector' => '{{WRAPPER}} .aux-text-after'
732 ]
733 );
734
735 $this->end_controls_tab();
736
737 $this->start_controls_tab(
738 'text3_hover',
739 [
740 'label' => __( 'Hover' , 'auxin-elements' )
741 ]
742 );
743
744 $this->add_group_control(
745 Group_Control_Typography::get_type(),
746 [
747 'name' => 'text3_hover_typo',
748 'scheme' => Typography::TYPOGRAPHY_1,
749 'selector' => '{{WRAPPER}} .aux-modern-button:hover .aux-text-after'
750 ]
751 );
752
753 $this->add_control(
754 'text3_hover_color',
755 [
756 'label' => __( 'Color', 'auxin-elements' ),
757 'type' => Controls_Manager::COLOR,
758 'selectors' => [
759 '{{WRAPPER}} .aux-modern-button:hover .aux-text-after' => 'color:{{VALUE}};'
760 ]
761 ]
762 );
763
764 $this->add_group_control(
765 Group_Control_Text_Shadow::get_type(),
766 [
767 'name' => 'text3_hover_text_shadow',
768 'label' => __( 'Text Shadow', 'auxin-elements' ),
769 'selector' => '{{WRAPPER}} .aux-modern-button:hover .aux-text-after'
770 ]
771 );
772
773 $this->end_controls_tab();
774
775 $this->end_controls_tabs();
776
777 $this->add_responsive_control(
778 'text3_margin',
779 [
780 'label' => __( 'Margin', 'auxin-elements' ),
781 'type' => Controls_Manager::DIMENSIONS,
782 'size_units' => [ 'px', 'em', '%' ],
783 'selectors' => [
784 '{{WRAPPER}} .aux-text-after' => 'margin:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
785 ],
786 'separator' => 'before'
787 ]
788 );
789
790 $this->end_controls_section();
791
792 /*-----------------------------------------------------------------------------------*/
793 /* Button Style Section
794 /*-----------------------------------------------------------------------------------*/
795
796 $this->start_controls_section(
797 'section_style_icon',
798 [
799 'label' => __('Icon', 'auxin-elements' ),
800 'tab' => Controls_Manager::TAB_STYLE,
801 'condition' => [
802 'icon_display' => 'yes'
803 ]
804 ]
805 );
806
807 $this->add_control(
808 'icon_align',
809 [
810 'label' => __('Alignment', 'auxin-elements'),
811 'type' => Controls_Manager::SELECT,
812 'default' => 'left',
813 'options' => [
814 'top' => __('Over', 'auxin-elements' ),
815 'bottom' => __('Below', 'auxin-elements' ),
816 'left' => __('Left', 'auxin-elements' ),
817 'right' => __('Right', 'auxin-elements' ),
818 ]
819 ]
820 );
821
822 $this->start_controls_tabs( 'icon_styles' );
823
824 $this->start_controls_tab(
825 'icon_normal',
826 [
827 'label' => __( 'Normal' , 'auxin-elements' )
828 ]
829 );
830
831 $this->add_responsive_control(
832 'icon_normal_size',
833 [
834 'label' => __( 'Size', 'auxin-elements' ),
835 'type' => Controls_Manager::SLIDER,
836 'size_units' => [ 'px', '%' ],
837 'range' => [
838 'px' => [
839 'min' => 10,
840 'max' => 512,
841 'step' => 2,
842 ],
843 '%' => [
844 'min' => 0,
845 'max' => 100,
846 ],
847 ],
848 'selectors' => [
849 '{{WRAPPER}} .aux-icon' => 'font-size: {{SIZE}}{{UNIT}};',
850 ]
851 ]
852 );
853
854 $this->add_control(
855 'icon_normal_color',
856 [
857 'label' => __( 'Color', 'auxin-elements' ),
858 'type' => Controls_Manager::COLOR,
859 'selectors' => [
860 '{{WRAPPER}} .aux-icon' => 'color: {{VALUE}};',
861 ]
862 ]
863 );
864
865 $this->add_group_control(
866 Group_Control_Background::get_type(),
867 [
868 'name' => 'icon_normal_bg',
869 'label' => __( 'Background', 'auxin-elements' ),
870 'types' => [ 'classic', 'gradient' ],
871 'selector' => '{{WRAPPER}} .aux-icon:before',
872 ]
873 );
874
875 $this->add_group_control(
876 Group_Control_Box_Shadow::get_type(),
877 [
878 'name' => 'icon_normal_box_shadow',
879 'selector' => '{{WRAPPER}} .aux-icon'
880 ]
881 );
882
883 $this->add_responsive_control(
884 'icon_normal_margin',
885 [
886 'label' => __( 'Margin', 'auxin-elements' ),
887 'type' => Controls_Manager::DIMENSIONS,
888 'size_units' => [ 'px', '%' ],
889 'selectors' => [
890 '{{WRAPPER}} .aux-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
891 ]
892 ]
893 );
894
895 $this->add_responsive_control(
896 'icon_normal_padding',
897 [
898 'label' => __( 'Padding', 'auxin-elements' ),
899 'type' => Controls_Manager::DIMENSIONS,
900 'size_units' => [ 'px', '%' ],
901 'selectors' => [
902 '{{WRAPPER}} .aux-icon' => 'padding:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
903 ]
904 ]
905 );
906
907 $this->add_responsive_control(
908 'icon_normal_border_radius',
909 [
910 'label' => __( 'Border Radius', 'auxin-elements' ),
911 'type' => Controls_Manager::DIMENSIONS,
912 'size_units' => [ 'px', 'em', '%' ],
913 'allowed_dimensions' => 'all',
914 'separator' => 'before',
915 'selectors' => [
916 '{{WRAPPER}} .aux-icon' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
917 ],
918 ]
919 );
920
921 $this->end_controls_tab();
922
923 $this->start_controls_tab(
924 'icon_hover',
925 [
926 'label' => __( 'Hover' , 'auxin-elements' )
927 ]
928 );
929
930 $this->add_responsive_control(
931 'icon_hover_size',
932 [
933 'label' => __( 'Size', 'auxin-elements' ),
934 'type' => Controls_Manager::SLIDER,
935 'size_units' => [ 'px', '%' ],
936 'range' => [
937 'px' => [
938 'min' => 10,
939 'max' => 512,
940 'step' => 2,
941 ],
942 '%' => [
943 'min' => 0,
944 'max' => 100,
945 ],
946 ],
947 'selectors' => [
948 '{{WRAPPER}} .aux-modern-button:hover .aux-icon' => 'font-size: {{SIZE}}{{UNIT}};',
949 ]
950 ]
951 );
952
953 $this->add_control(
954 'icon_hover_color',
955 [
956 'label' => __( 'Color', 'auxin-elements' ),
957 'type' => Controls_Manager::COLOR,
958 'selectors' => [
959 '{{WRAPPER}} .aux-modern-button:hover .aux-icon' => 'color: {{VALUE}};',
960 ]
961 ]
962 );
963
964 $this->add_group_control(
965 Group_Control_Background::get_type(),
966 [
967 'name' => 'icon_hover_bg',
968 'label' => __( 'Background', 'auxin-elements' ),
969 'types' => [ 'classic', 'gradient' ],
970 'selector' => '{{WRAPPER}} .aux-icon:after',
971 ]
972 );
973
974 $this->add_group_control(
975 Group_Control_Box_Shadow::get_type(),
976 [
977 'name' => 'icon_hover_box_shadow',
978 'selector' => '{{WRAPPER}} .aux-modern-button:hover .aux-icon'
979 ]
980 );
981
982 $this->add_responsive_control(
983 'icon_hover_margin',
984 [
985 'label' => __( 'Margin', 'auxin-elements' ),
986 'type' => Controls_Manager::DIMENSIONS,
987 'size_units' => [ 'px', '%' ],
988 'selectors' => [
989 '{{WRAPPER}} .aux-modern-button:hover .aux-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
990 ]
991 ]
992 );
993
994 $this->add_responsive_control(
995 'icon_hover_padding',
996 [
997 'label' => __( 'Padding', 'auxin-elements' ),
998 'type' => Controls_Manager::DIMENSIONS,
999 'size_units' => [ 'px', '%' ],
1000 'selectors' => [
1001 '{{WRAPPER}} .aux-modern-button:hover .aux-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1002 ]
1003 ]
1004 );
1005
1006 $this->add_responsive_control(
1007 'icon_hover_border_radius',
1008 [
1009 'label' => __( 'Border Radius', 'auxin-elements' ),
1010 'type' => Controls_Manager::DIMENSIONS,
1011 'size_units' => [ 'px', 'em', '%' ],
1012 'allowed_dimensions' => 'all',
1013 'separator' => 'before',
1014 'selectors' => [
1015 '{{WRAPPER}} .aux-icon:hover' => 'border-radius:{{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};'
1016 ],
1017 ]
1018 );
1019
1020 $this->end_controls_tab();
1021
1022 $this->end_controls_tabs();
1023
1024 $this->end_controls_section();
1025 }
1026
1027 /**
1028 * Render image box widget output on the frontend.
1029 *
1030 * Written in PHP and used to generate the final HTML.
1031 *
1032 * @since 1.0.0
1033 * @access protected
1034 */
1035 protected function render() {
1036
1037 $url = '';
1038 $settings = $this->get_settings_for_display();
1039
1040 $this->add_render_attribute( 'wrapper', 'class', 'aux-modern-button-wrapper' );
1041 $this->add_render_attribute( 'wrapper', 'class', 'aux-modern-button-align-' . $settings['btn_align'] );
1042
1043 $this->add_render_attribute( 'button', 'class', 'aux-modern-button' );
1044 $this->add_render_attribute( 'button', 'class', 'aux-' . $settings['btn_skin'] );
1045 $this->add_render_attribute( 'button', 'class', 'aux-modern-button-' . $settings['btn_size'] );
1046 $this->add_render_attribute( 'button', 'class', 'aux-modern-button-' . $settings['btn_shape'] );
1047 $this->add_render_attribute( 'button', 'class', 'aux-modern-button-' . $settings['btn_type'] );
1048 $this->add_render_attribute( 'button', 'class', 'aux-icon-' . $settings['icon_align'] );
1049
1050
1051 if ( ! empty( $settings['link']['url'] ) ) {
1052 $this->add_link_attributes( 'button', $settings['link'] );
1053 $url = $settings['link']['url'];
1054 }
1055
1056 if ( $settings['link_css_id'] ) {
1057 $this->add_render_attribute( 'button', 'id', $settings['link_css_id'] );
1058 }
1059
1060 ?>
1061 <div <?php echo $this->get_render_attribute_string( 'wrapper' ); ?> >
1062 <?php
1063 if ( auxin_is_true( $settings['open_video_in_lightbox'] ) && strlen( $url ) > 3 ) { // disable lighbox if anchor is set
1064
1065 $this->add_render_attribute( 'button', 'class', 'aux-open-video' );
1066 $this->add_render_attribute( 'button', 'data-type', 'video' );
1067
1068 echo '<span class="aux-lightbox-video ">';
1069 }
1070 ?>
1071 <a <?php echo $this->get_render_attribute_string( 'button' ); ?>>
1072 <div class="aux-overlay"></div>
1073 <?php if ( $settings['icon_display'] ) { ;?>
1074 <div class="aux-icon ">
1075 <?php Icons_Manager::render_icon( $settings['icon'], [ 'aria-hidden' => 'true' ] );?>
1076 </div>
1077 <?php };?>
1078 <div class="aux-text">
1079 <?php
1080 if( ! empty( $settings['label'] ) ){ printf( '<span class="aux-text-before">%s</span>', do_shortcode( $settings['label'] ) ); }
1081 if( ! empty( $settings['label2'] ) ){ printf( '<span class="aux-text-highlighted">%s</span>', do_shortcode( $settings['label2'] ) ); }
1082 if( ! empty( $settings['label3'] ) ){ printf( '<span class="aux-text-after">%s</span>', do_shortcode( $settings['label3'] ) ); }
1083 ?>
1084 </div>
1085 </a>
1086 <?php
1087 if ( auxin_is_true( $settings['open_video_in_lightbox'] ) ) {
1088 echo '</span>';
1089 }
1090 ?>
1091
1092 </div>
1093
1094 <?php
1095 }
1096
1097 }