PluginProbe
Borderless – Addons and Templates for Elementor / trunk
Borderless – Addons and Templates for Elementor vtrunk
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 All 78 releases
borderless / modules / wpbakery / elements / modal.php

modal.php in Borderless – Addons and Templates for Elementor trunk, at modules/wpbakery/elements/modal.php

793 lines 28.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 die( '-1' );
4 }
5
6 /*-----------------------------------------------------------------------------------*/
7 /* Modal
8 /*-----------------------------------------------------------------------------------*/
9
10 class WPBakeryShortCode_borderless_wpbakery_modal extends WPBakeryShortCodesContainer {
11 protected function content( $atts, $content = null ) {
12 extract( shortcode_atts( array(
13 'trigger' => 'trigger-button',
14 'title' => 'Title',
15 'title_tag' => 'span',
16 'text_color' => '',
17 'alignment' => 'trigger-left',
18 'initial_height' => '',
19 'button_shape' => 'borderless-rounded',
20 'button_outline_shape' => '',
21 'button_color' => '',
22 'button_title_color' => '',
23 'button_background_color' => '',
24 'button_outline_color' => '',
25 'button_size' => 'button-size-small',
26 'icon_display' => '',
27 'custom_image_icon' => '',
28 'custom_svg_icon' => '',
29 'icon' => '',
30 'icon_color' => '',
31 'custom_icon_color' => '',
32 'shape' => '',
33 'color_shape' => '',
34 'icon_size' => '',
35 'icon_spacing' => '',
36 'icon_gap' => '0',
37 'height' => 'auto',
38 'width' => '100px',
39 'animations' => '',
40 'animation_delay' => '',
41 'animation_speed' => 'slower animated infinite',
42 //Static
43 'el_id' => '',
44 'el_class' => '',
45 'css' => '',
46 'css_animation' => ''
47 ), $atts ) );
48 $output = '';
49
50 // Assets.
51 wp_enqueue_style(
52 'borderless-wpbakery-style',
53 BORDERLESS__STYLES . 'wpbakery.min.css',
54 false,
55 BORDERLESS__VERSION
56 );
57 wp_enqueue_script(
58 'borderless-wpbakery-script',
59 BORDERLESS__SCRIPTS . 'borderless-wpbakery.min.js', array('jquery'),
60 BORDERLESS__VERSION,
61 true
62 );
63
64 // Retrieve data from the database.
65 $options = get_option( 'borderless' );
66
67
68 // Set default values
69 $borderless_primary_color = isset( $options['primary_color'] ) ? $options['primary_color'] : '#3379fc'; //Primary Color
70 $borderless_secondary_color = isset( $options['secondary_color'] ) ? $options['secondary_color'] : '#3379fc'; //Secondary Color
71 $borderless_text_color = isset( $options['text_color'] ) ? $options['text_color'] : ''; //Text Color
72 $borderless_accent_color = isset( $options['accent_color'] ) ? $options['accent_color'] : '#3379fc'; //Accent Color
73
74 // Start Default Extra Class, CSS and CSS animation
75
76 $css = isset( $atts['css'] ) ? $atts['css'] : '';
77 $el_id = isset( $atts['el_id'] ) ? $atts['el_id'] : '';
78 $el_id = ! empty( $el_id ) ? 'id="' . esc_attr( $el_id ) . '"' : '';
79 $el_class = isset( $atts['el_class'] ) ? $atts['el_class'] : '';
80
81 if ( '' !== $css_animation ) {
82 wp_enqueue_script( 'waypoints' );
83 $css_animation_style = ' wpb_animate_when_almost_visible wpb_' . esc_attr( $css_animation );
84 }
85
86 $class_to_filter = vc_shortcode_custom_css_class( $css, ' ' ) . $this->getExtraClass( $el_class ) . $this->getCSSAnimation( $css_animation );
87 $css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $this->settings['base'], $atts );
88
89 $uniqid = md5( uniqid( rand(), true ) );
90 $uniqid = preg_replace( '/[0-9]+/', '', $uniqid );
91 $uniqid = esc_attr( $uniqid );
92
93 // End Default Extra Class, CSS and CSS animation
94
95 // Start Trigger Mode
96
97 $output .= '<div class="borderless-wpbakery-modal-trigger ' . esc_attr( $alignment ) . '">';
98
99 if ( $trigger == 'trigger-button' ) {
100
101 if ( $button_color == 'custom' ) {
102
103 // Button Background Color
104
105 $button_background_color = ! empty( $button_background_color ) ? 'background-color: ' . esc_attr( $button_background_color ) . ';' : 'background-color: ' . esc_attr( $borderless_primary_color ) . ';';
106
107 // Text Color
108
109 $button_title_color = ! empty( $button_title_color ) ? 'color: ' . esc_attr( $button_title_color ) . ';' : 'color: ' . esc_attr( $borderless_primary_color ) . ';';
110
111 // Border Color
112
113 $button_outline_color = ! empty( $button_outline_color ) ? 'border-color: ' . esc_attr( $button_outline_color ) . ';' : 'border-color: ' . esc_attr( $borderless_primary_color ) . ';';
114
115 } else {
116
117 // Button Background Color
118
119 $button_background_color = empty( $button_outline_shape ) ? 'background-color: ' . esc_attr( $borderless_primary_color ) . ';' : '';
120
121 // Text Color
122
123 $button_title_color = ! empty( $button_outline_shape ) ? 'color: ' . esc_attr( $borderless_primary_color ) . ';' : 'color:#FFF;';
124
125 // Border Color
126
127 $button_outline_color = ! empty( $button_outline_shape ) ? 'border-color: ' . esc_attr( $borderless_primary_color ) . ';' : '';
128
129 }
130
131 $style = $button_background_color . ' ' . $button_title_color . ' ' . $button_outline_color;
132
133 $class_array = array(
134 'borderless-wpbakery-modal-button',
135 sanitize_html_class( $button_size ),
136 sanitize_html_class( $trigger ),
137 sanitize_html_class( $button_shape ),
138 sanitize_html_class( $button_outline_shape ),
139 );
140 $class_attribute = implode( ' ', $class_array );
141
142 $output .= '<div style="' . esc_attr( $style ) . '" class="' . esc_attr( $class_attribute ) . '" data-modal="' . esc_attr( $uniqid ) . '">' . esc_html( $title ) . '</div>';
143
144 } else if ( $trigger == 'trigger-image' ) {
145
146 // Image
147
148 if ( $icon_display == 'image_icon' ) {
149
150 $default_src = vc_asset_url( 'vc/no_image.png' );
151 $img = wp_get_attachment_image_src( $custom_image_icon );
152 $src = $img[0];
153 $custom_src = $src ? esc_url( $src ) : esc_url( $default_src );
154
155 $icon_content = '<img src="' . $custom_src . '" >';
156
157 } elseif ( $icon_display == 'svg_icon' ) {
158
159 $default_src = vc_asset_url( 'vc/no_image.png' );
160 $img = wp_get_attachment_image_src( $custom_svg_icon );
161 $src = $img[0];
162 $custom_src = $src ? esc_url( $src ) : esc_url( $default_src );
163
164 $height = esc_attr( $height );
165 $width = esc_attr( $width );
166
167 $icon_content = '<div class="borderless-wpbakery-modal-svg" style="height:' . $height . ';width:' . $width . ';"><img class="borderless-svg-img" src="' . $custom_src . '" ></div>';
168
169 } else {
170
171 $iconClass = isset( $icon ) ? esc_attr( $icon ) : 'fa fa-adjust';
172
173 $custom_icon_color_style = $custom_icon_color ? 'color:' . esc_attr( $custom_icon_color ) . ';' : 'color:' . esc_attr( $borderless_primary_color ) . ';'; //Icon Color
174
175 $font_size_reference = esc_attr( $icon_size );
176
177 if ( $icon_size != '' ) {
178 $icon_size_style = 'font-size:' . esc_attr( $icon_size ) . ';';
179 } else {
180 $icon_size_style = '';
181 }
182
183 if ( $shape != '' ) {
184
185 if ( $shape == 'rounded' || $shape == 'square' || $shape == 'round' ) {
186 $color_shape_style = $color_shape ? 'background-color:' . esc_attr( $color_shape ) . ';' : 'background-color:' . esc_attr( $borderless_primary_color ) . ';'; //Background Color Shape
187 } else {
188 $color_shape_style = $color_shape ? 'border-color:' . esc_attr( $color_shape ) . ';' : 'border-color:' . esc_attr( $borderless_primary_color ) . ';'; //Border Color Shape
189 }
190
191 if ( $icon_spacing != '' ) {
192 $icon_spacing_style = 'height:' . esc_attr( $icon_spacing ) . '; width:' . esc_attr( $icon_spacing ) . ';';
193 } else {
194 $icon_spacing_style = 'height:calc(' . $font_size_reference . ' + 2em); width:calc(' . $font_size_reference . ' + 2em);';
195 }
196
197 $shape_render_start = '<div class="borderless-wpbakery-modal-icon-inner ' . esc_attr( $shape ) . '" style="' . $color_shape_style . $icon_spacing_style . '">';
198 $shape_render_finish = '</div>';
199
200 } else {
201 $shape_render_start = $shape_render_finish = '';
202 }
203
204 $icon_content = $shape_render_start . '<span style="' . esc_attr( $custom_icon_color_style . ' ' . $icon_size_style ) . '" class="borderless-wpbakery-modal-image ' . esc_attr( $iconClass ) . '"></span>' . $shape_render_finish;
205 }
206
207 $class_array = array(
208 'borderless-wpbakery-modal-icon',
209 $animations,
210 $animation_delay,
211 $animation_speed,
212 );
213 $class_attribute = implode( ' ', array_map( 'esc_attr', $class_array ) );
214
215 $output .= '<div data-modal="' . esc_attr( $uniqid ) . '" class="' . $class_attribute . '" ' . esc_attr( $icon_gap ) . '>';
216 $output .= $icon_content;
217 $output .= '</div>';
218
219 } else if ( $trigger == 'trigger-text' ) {
220
221 // Title Color
222
223 if ( ! empty( $text_color ) ) {
224 $text_color_style = 'color: ' . esc_attr( $text_color ) . ';';
225 } else {
226 $text_color_style = '';
227 }
228
229 $allowed_tags = array( 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'span', 'div', 'p' );
230
231 if ( in_array( $title_tag, $allowed_tags ) ) {
232 $title_tag = esc_attr( $title_tag );
233 } else {
234 $title_tag = 'span';
235 }
236
237 $output .= '<' . $title_tag . ' style="' . esc_attr( $text_color_style ) . '" class="borderless-wpbakery-modal-text" data-modal="' . esc_attr( $uniqid ) . '">' . esc_html( $title ) . '</' . $title_tag . '>';
238 }
239
240 $output .= '</div>';
241
242 // End Trigger Mode
243
244 // Start Modal Height
245
246 if ( ! empty( $initial_height ) ) {
247 $initial_height = 'style="height:' . esc_attr( $initial_height ) . ';"';
248 }
249
250 // End Modal Height
251
252 $output .= '<div id="' . esc_attr( $uniqid ) . '" class="borderless-wpbakery-modal">';
253 $output .= '<div id="' . esc_attr( $uniqid ) . '" class="borderless-wpbakery-modal-inner' . esc_attr( $css_class ) . '">';
254 $output .= '<a class="borderless-wpbakery-modal-close">&times;</a>';
255 $output .= '<div ' . $el_id . ' ' . $initial_height . ' class="borderless-wpbakery-modal-content">' . wpb_js_remove_wpautop( do_shortcode( $content ) ) . '</div>';
256 $output .= '</div>';
257 $output .= '</div>';
258
259 return $output;
260 }
261 }
262
263
264
265 vc_map( array(
266 'name' => __( 'Modal', 'borderless' ),
267 'base' => 'borderless_wpbakery_modal',
268 'icon' => plugins_url('../images/modal.png', __FILE__),
269 "content_element" => true,
270 "show_settings_on_create" => false,
271 "is_container" => true,
272 'category' => __( 'Borderless', 'borderless' ),
273 'description' => __( 'Add and manage multiple icons', 'borderless' ),
274 'params' => array(
275
276 array(
277 'type' => 'dropdown',
278 'heading' => __( 'Start From', 'borderless' ),
279 'param_name' => 'trigger',
280 'value' => array(
281 __( 'Button', 'borderless' ) => 'trigger-button',
282 __( 'Image', 'borderless' ) => 'trigger-image',
283 __( 'Text', 'borderless' ) => 'trigger-text',
284 ),
285 'description' => __( 'Select start mode.', 'borderless' ),
286 ),
287
288 array(
289 'type' => 'textfield',
290 'heading' => __( 'Title', 'borderless' ),
291 'param_name' => 'title',
292 'description' => __( 'Enter Title.', 'borderless' ),
293 'dependency' => array(
294 'element' => 'trigger',
295 'value' => array( 'trigger-button','trigger-text' ),
296 ),
297 ),
298
299 array(
300 'type' => 'dropdown',
301 'heading' => __( 'Title Tag', 'borderless' ),
302 'param_name' => 'title_tag',
303 'value' => array(
304 __( 'span', 'borderless' ) => 'span',
305 __( 'h1', 'borderless' ) => 'h1',
306 __( 'h2', 'borderless' ) => 'h2',
307 __( 'h3', 'borderless' ) => 'h3',
308 __( 'h4', 'borderless' ) => 'h4',
309 __( 'h5', 'borderless' ) => 'h5',
310 __( 'h6', 'borderless' ) => 'h6',
311 __( 'p', 'borderless' ) => 'p',
312 __( 'div', 'borderless' ) => 'div',
313 ),
314 'description' => __( 'Select element tag.', 'borderless' ),
315 'dependency' => array(
316 'element' => 'trigger',
317 'value' => array( 'trigger-text' ),
318 ),
319 ),
320
321 array(
322 'type' => 'colorpicker',
323 'heading' => __( 'Title Color', 'borderless' ),
324 'param_name' => 'text_color',
325 'description' => __( 'Select custom title color.', 'borderless' ),
326 'dependency' => array(
327 'element' => 'trigger',
328 'value' => array( 'trigger-text' ),
329 ),
330 ),
331
332 array(
333 'type' => 'dropdown',
334 'heading' => __( 'Alignment', 'borderless' ),
335 'param_name' => 'alignment',
336 'value' => array(
337 __( 'Left', 'borderless' ) => 'trigger-left',
338 __( 'Right', 'borderless' ) => 'trigger-right',
339 __( 'Center', 'borderless' ) => 'trigger-center',
340 ),
341 'description' => __( 'Select alignment.', 'borderless' ),
342 ),
343
344 array(
345 'type' => 'dropdown',
346 'heading' => __( 'Initial Height', 'borderless' ),
347 'param_name' => 'initial_height',
348 'value' => array(
349 __( 'None', 'borderless' ) => '',
350 __( '5', 'borderless' ) => '5vh',
351 __( '10', 'borderless' ) => '10vh',
352 __( '15', 'borderless' ) => '15vh',
353 __( '20', 'borderless' ) => '20vh',
354 __( '25', 'borderless' ) => '25vh',
355 __( '30', 'borderless' ) => '30vh',
356 __( '35', 'borderless' ) => '35vh',
357 __( '40', 'borderless' ) => '40vh',
358 __( '45', 'borderless' ) => '45vh',
359 __( '50', 'borderless' ) => '50vh',
360 ),
361 'description' => __( 'Select the initial height for modal.', 'borderless' ),
362 ),
363
364 /*
365 * Button Tab
366 */
367
368 array(
369 'type' => 'dropdown',
370 'heading' => __( 'Shape', 'borderless' ),
371 'description' => __( 'Select shape.', 'borderless' ),
372 'param_name' => 'button_shape',
373 'value' => array(
374 __( 'Rounded', 'borderless' ) => 'borderless-rounded',
375 __( 'Square', 'borderless' ) => 'borderless-square',
376 __( 'Round', 'borderless' ) => 'borderless-round',
377 ),
378 'dependency' => array(
379 'element' => 'trigger',
380 'value' => array( 'trigger-button' ),
381 ),
382 'group' => 'Button',
383 ),
384
385 array(
386 'type' => 'dropdown',
387 'heading' => __( 'Outline Shape', 'borderless' ),
388 'description' => __( 'Select outilne shape.', 'borderless' ),
389 'param_name' => 'button_outline_shape',
390 'value' => array(
391 __( 'None', 'borderless' ) => '',
392 __( 'Outline', 'borderless' ) => 'borderless-outline',
393 __( 'Outline 2x', 'borderless' ) => 'borderless-outline-2',
394 __( 'Outline 3x', 'borderless' ) => 'borderless-outline-3',
395 __( 'Outline 4x', 'borderless' ) => 'borderless-outline-4',
396 __( 'Outline 5x', 'borderless' ) => 'borderless-outline-5',
397 ),
398 'dependency' => array(
399 'element' => 'trigger',
400 'value' => array( 'trigger-button' ),
401 ),
402 'group' => 'Button',
403 ),
404
405 array(
406 'type' => 'dropdown',
407 'heading' => __( 'Button Color', 'borderless' ),
408 'param_name' => 'button_color',
409 'value' => array(
410 __( 'Preset Color', 'borderless' ) => '',
411 __( 'Custom Color', 'borderless' ) => 'custom',
412 ),
413 'description' => __( 'Select icon color.', 'borderless' ),
414 'dependency' => array(
415 'element' => 'trigger',
416 'value' => array( 'trigger-button' ),
417 ),
418 'group' => 'Button',
419 ),
420
421 array(
422 'type' => 'colorpicker',
423 'heading' => __( 'Title Color', 'borderless' ),
424 'param_name' => 'button_title_color',
425 'description' => __( 'Select color.', 'borderless' ),
426 'group' => 'Button',
427 'dependency' => array(
428 'element' => 'button_color',
429 'value' => array( 'custom' ),
430 ),
431 ),
432
433 array(
434 'type' => 'colorpicker',
435 'heading' => __( 'Background Color', 'borderless' ),
436 'param_name' => 'button_background_color',
437 'description' => __( 'Select color.', 'borderless' ),
438 'group' => 'Button',
439 'dependency' => array(
440 'element' => 'button_color',
441 'value' => array( 'custom' ),
442 ),
443 ),
444
445 array(
446 'type' => 'colorpicker',
447 'heading' => __( 'Outline Color', 'borderless' ),
448 'param_name' => 'button_outline_color',
449 'description' => __( 'Select color.', 'borderless' ),
450 'group' => 'Button',
451 'dependency' => array(
452 'element' => 'button_color',
453 'value' => array( 'custom' ),
454 ),
455 ),
456
457 array(
458 'type' => 'dropdown',
459 'heading' => __( 'Size', 'borderless' ),
460 'description' => __( 'Select button size.', 'borderless' ),
461 'param_name' => 'button_size',
462 'value' => array(
463 __( 'Small', 'borderless' ) => 'button-size-small',
464 __( 'Normal', 'borderless' ) => 'button-size-normal',
465 __( 'Large', 'borderless' ) => 'button-size-large',
466 __( 'Block', 'borderless' ) => 'button-size-block',
467 ),
468 'dependency' => array(
469 'element' => 'trigger',
470 'value' => array( 'trigger-button' ),
471 ),
472 'group' => 'Button',
473 ),
474
475 /*
476 * Icon Tab
477 */
478
479 array(
480 'type' => 'dropdown',
481 'heading' => __( 'Icon to display', 'borderless' ),
482 'param_name' => 'icon_display',
483 'value' => array(
484 __( 'Icon Manager', 'borderless' ) => 'icon_manager',
485 __( 'Image Icon', 'borderless' ) => 'image_icon',
486 __( 'SVG Icon', 'borderless' ) => 'svg_icon',
487 ),
488 'description' => __( 'Enable Icon Library.', 'borderless' ),
489 'dependency' => array(
490 'element' => 'trigger',
491 'value' => array( 'trigger-image' ),
492 ),
493 'group' => 'Image',
494 ),
495
496 array(
497 'type' => 'attach_image',
498 'heading' => __( 'Upload Image Icon', 'borderless' ),
499 'param_name' => 'custom_image_icon',
500 'description' => __( 'Upload the custom image icon.', 'borderless' ),
501 'group' => 'Image',
502 'dependency' => array(
503 'element' => 'icon_display',
504 'value' => array( 'image_icon' ),
505 ),
506 ),
507
508 array(
509 'type' => 'attach_image',
510 'heading' => __( 'Upload SVG Icon', 'borderless' ),
511 'param_name' => 'custom_svg_icon',
512 'description' => __( 'Upload the custom svg icon.', 'borderless' ),
513 'group' => 'Image',
514 'dependency' => array(
515 'element' => 'icon_display',
516 'value' => array( 'svg_icon' ),
517 ),
518 ),
519
520 array(
521 'type' => 'iconmanager',
522 'heading' => __( 'Icon', 'borderless' ),
523 'param_name' => 'icon',
524 'description' => __( 'Select icon from library.', 'borderless' ),
525 'group' => 'Image',
526 'dependency' => array(
527 'element' => 'icon_display',
528 'value' => array( 'icon_manager' ),
529 ),
530 ),
531
532 array(
533 'type' => 'dropdown',
534 'heading' => __( 'Icon color', 'borderless' ),
535 'param_name' => 'icon_color',
536 'value' => array(
537 __( 'Preset Color', 'borderless' ) => '',
538 __( 'Custom Color', 'borderless' ) => 'custom',
539 ),
540 'description' => __( 'Select icon color.', 'borderless' ),
541 'dependency' => array(
542 'element' => 'icon_display',
543 'value' => array( 'icon_manager' ),
544 ),
545 'group' => 'Image',
546 ),
547 array(
548 'type' => 'colorpicker',
549 'heading' => __( 'Custom Icon Color', 'borderless' ),
550 'param_name' => 'custom_icon_color',
551 'description' => __( 'Select custom icon color.', 'borderless' ),
552 'group' => 'Image',
553 'dependency' => array(
554 'element' => 'icon_color',
555 'value' => array( 'custom' ),
556 ),
557 ),
558 array(
559 'type' => 'dropdown',
560 'heading' => __( 'Shape', 'borderless' ),
561 'description' => __( 'Select icon shape.', 'borderless' ),
562 'param_name' => 'shape',
563 'group' => 'Image',
564 'dependency' => array(
565 'element' => 'icon_display',
566 'value' => array( 'icon_manager' ),
567 ),
568 'value' => array(
569 __( 'None', 'borderless' ) => '',
570 __( 'Rounded', 'borderless' ) => 'rounded',
571 __( 'Square', 'borderless' ) => 'square',
572 __( 'Round', 'borderless' ) => 'round',
573 __( 'Outline Rounded', 'borderless' ) => 'outline-rounded',
574 __( 'Outline Square', 'borderless' ) => 'outline-square',
575 __( 'Outline Round', 'borderless' ) => 'outline-round',
576 ),
577 ),
578 array(
579 'type' => 'colorpicker',
580 'heading' => __( 'Color Shape', 'borderless' ),
581 'param_name' => 'color_shape',
582 'description' => __( 'Select custom shape background color.', 'borderless' ),
583 'group' => 'Image',
584 'dependency' => array(
585 'element' => 'shape',
586 'value' => array( 'rounded','square','round','outline-rounded','outline-square','outline-round', ),
587 ),
588 ),
589 array(
590 'type' => 'textfield',
591 'heading' => __( 'Size', 'borderless' ),
592 'param_name' => 'icon_size',
593 'description' => __( 'Icon size. Default value is 16px.', 'borderless' ),
594 'dependency' => array(
595 'element' => 'icon_display',
596 'value' => array( 'icon_manager' ),
597 ),
598 'group' => 'Image',
599 ),
600 array(
601 'type' => 'textfield',
602 'heading' => __( 'Spacing', 'borderless' ),
603 'param_name' => 'icon_spacing',
604 'description' => __( 'Select icon spacing. e.g. 16px.', 'borderless' ),
605 'dependency' => array(
606 'element' => 'icon_display',
607 'value' => array( 'icon_manager' ),
608 ),
609 'group' => 'Image',
610 ),
611 array(
612 'type' => 'textfield',
613 'heading' => __( 'Height', 'borderless' ),
614 'param_name' => 'height',
615 'description' => __( 'Insert the SVG height.', 'borderless' ),
616 'dependency' => array(
617 'element' => 'icon_display',
618 'value' => array( 'svg_icon' ),
619 ),
620 'group' => 'Image',
621 ),
622 array(
623 'type' => 'textfield',
624 'heading' => __( 'Width', 'borderless' ),
625 'param_name' => 'width',
626 'description' => __( 'Insert the SVG width.', 'borderless' ),
627 'dependency' => array(
628 'element' => 'icon_display',
629 'value' => array( 'svg_icon' ),
630 ),
631 'group' => 'Image',
632 ),
633
634
635 array(
636 'type' => 'dropdown',
637 'heading' => __( 'Animations', 'borderless' ),
638 'param_name' => 'animations',
639 'dependency' => array(
640 'element' => 'icon_display',
641 'value' => array( 'icon_manager', 'image_icon', 'svg_icon' ),
642 ),
643 'value' => array(
644 __( 'No Animation', 'borderless' ) => '',
645 __( 'Bounce', 'borderless' ) => 'bounce',
646 __( 'Flash', 'borderless' ) => 'flash',
647 __( 'Pulse', 'borderless' ) => 'pulse',
648 __( 'Rubber Band', 'borderless' ) => 'rubberBand',
649 __( 'Shake', 'borderless' ) => 'shake',
650 __( 'Head Shake', 'borderless' ) => 'headShake',
651 __( 'Swing', 'borderless' ) => 'swing',
652 __( 'Tada', 'borderless' ) => 'tada',
653 __( 'Wobble', 'borderless' ) => 'wobble',
654 __( 'Jello', 'borderless' ) => 'jello',
655 __( 'Bounce In', 'borderless' ) => 'bounceIn',
656 __( 'Bounce In Down', 'borderless' ) => 'bounceInDown',
657 __( 'Bounce In Left', 'borderless' ) => 'bounceInLeft',
658 __( 'Bounce In Right', 'borderless' ) => 'bounceInRight',
659 __( 'Bounce In Up', 'borderless' ) => 'bounceInUp',
660 __( 'Bounce Out', 'borderless' ) => 'bounceOut',
661 __( 'Bounce Out Down', 'borderless' ) => 'bounceOutDown',
662 __( 'Bounce Out Left', 'borderless' ) => 'bounceOutLeft',
663 __( 'Bounce Out Right', 'borderless' ) => 'bounceOutRight',
664 __( 'Bounce Out Up', 'borderless' ) => 'bounceOutUp',
665 __( 'Fade In', 'borderless' ) => 'fadeIn',
666 __( 'Fade In Down', 'borderless' ) => 'fadeInDown',
667 __( 'Fade In Down Big', 'borderless' ) => 'fadeInDownBig',
668 __( 'Fade In Left', 'borderless' ) => 'fadeInLeft',
669 __( 'Fade In Left Big', 'borderless' ) => 'fadeInLeftBig',
670 __( 'Fade In Right', 'borderless' ) => 'fadeInRight',
671 __( 'Fade In Right Big', 'borderless' ) => 'fadeInRightBig',
672 __( 'Fade In Up', 'borderless' ) => 'fadeInUp',
673 __( 'Fade In Up Big', 'borderless' ) => 'fadeInUpBig',
674 __( 'Fade Out', 'borderless' ) => 'fadeOut',
675 __( 'Fade Out Down', 'borderless' ) => 'fadeOutDown',
676 __( 'Fade Out Down Big', 'borderless' ) => 'fadeOutDownBig',
677 __( 'Fade Out Left', 'borderless' ) => 'fadeOutLeft',
678 __( 'Fade Out Left Big', 'borderless' ) => 'fadeOutLeftBig',
679 __( 'Fade Out Right', 'borderless' ) => 'fadeOutRight',
680 __( 'Fade Out Right Big', 'borderless' ) => 'fadeOutRightBig',
681 __( 'Fade Out Up', 'borderless' ) => 'fadeOutUp',
682 __( 'Fade Out Up Big', 'borderless' ) => 'fadeOutUpBig',
683 __( 'Flip In X', 'borderless' ) => 'flipInX',
684 __( 'Flip In Y', 'borderless' ) => 'flipInY',
685 __( 'Flip Out X', 'borderless' ) => 'flipOutX',
686 __( 'Flip Out Y', 'borderless' ) => 'flipOutY',
687 __( 'Light Speed In', 'borderless' ) => 'lightSpeedIn',
688 __( 'Light Speed Out', 'borderless' ) => 'lightSpeedOut',
689 __( 'Rotate In', 'borderless' ) => 'rotateIn',
690 __( 'Rotate In Down Left', 'borderless' ) => 'rotateInDownLeft',
691 __( 'Rotate In Down Right', 'borderless' ) => 'rotateInDownRight',
692 __( 'Rotate In Up Left', 'borderless' ) => 'rotateInUpLeft',
693 __( 'Rotate In Up Right', 'borderless' ) => 'rotateInUpRight',
694 __( 'Rotate Out', 'borderless' ) => 'rotateOut',
695 __( 'Rotate Out Down Left', 'borderless' ) => 'rotateOutDownLeft',
696 __( 'Rotate Out Down Right', 'borderless' ) => 'rotateOutDownRight',
697 __( 'Rotate Out Up Left', 'borderless' ) => 'rotateOutUpLeft',
698 __( 'Rotate Out Up Right', 'borderless' ) => 'rotateOutUpRight',
699 __( 'Hinge', 'borderless' ) => 'hinge',
700 __( 'Jack In The Box', 'borderless' ) => 'jackInTheBox',
701 __( 'Roll In', 'borderless' ) => 'rollIn',
702 __( 'Roll Out', 'borderless' ) => 'rollOut',
703 __( 'Zoom In', 'borderless' ) => 'zoomIn',
704 __( 'Zoom In Down', 'borderless' ) => 'zoomInDown',
705 __( 'Zoom In Left', 'borderless' ) => 'zoomInLeft',
706 __( 'Zoom In Right', 'borderless' ) => 'zoomInRight',
707 __( 'Zoom In Up', 'borderless' ) => 'zoomInUp',
708 __( 'Zoom Out', 'borderless' ) => 'zoomOut',
709 __( 'Zoom Out Down', 'borderless' ) => 'zoomOutDown',
710 __( 'Zoom Out Left', 'borderless' ) => 'zoomOutLeft',
711 __( 'Zoom Out Right', 'borderless' ) => 'zoomOutRight',
712 __( 'Zoom Out Up', 'borderless' ) => 'zoomOutUp',
713 __( 'Slide In Down', 'borderless' ) => 'slideInDown',
714 __( 'Slide In Left', 'borderless' ) => 'slideInLeft',
715 __( 'Slide In Right', 'borderless' ) => 'slideInRight',
716 __( 'Slide In Up', 'borderless' ) => 'slideInUp',
717 __( 'Slide Out Down', 'borderless' ) => 'slideOutDown',
718 __( 'Slide Out Left', 'borderless' ) => 'slideOutLeft',
719 __( 'Slide Out Right', 'borderless' ) => 'slideOutRight',
720 __( 'Slide Out Up', 'borderless' ) => 'slideOutUp',
721 __( 'Heart Beat', 'borderless' ) => 'heartBeat',
722
723 ),
724 'description' => __( 'Select the type of animation you want on hover.', 'borderless' ),
725 'group' => 'Image',
726 ),
727
728 array(
729 'type' => 'dropdown',
730 'heading' => __( 'Animation Delay', 'borderless' ),
731 'param_name' => 'animation_delay',
732 'value' => array(
733 __( 'No Delay', 'borderless' ) => '',
734 __( 'Delay 1 second', 'borderless' ) => 'delay-1s',
735 __( 'Delay 2 seconds', 'borderless' ) => 'delay-2s',
736 __( 'Delay 3 seconds', 'borderless' ) => 'delay-3s',
737 __( 'Delay 4 seconds', 'borderless' ) => 'delay-4s',
738 __( 'Delay 5 seconds', 'borderless' ) => 'delay-5s',
739
740 ),
741 'dependency' => array(
742 'element' => 'animations',
743 'value' => array( 'bounce','flash','pulse','rubberBand','shake','headShake','swing','tada','wobble','jello','bounceIn','bounceInDown','bounceInLeft','bounceInRight','bounceInUp','bounceOut','bounceOutDown','bounceOutLeft','bounceOutRight','bounceOutUp','fadeIn','fadeInDown','fadeInDownBig','fadeInLeft','fadeInLeftBig','fadeInRight','fadeInRightBig','fadeInUp','fadeInUpBig','fadeOut','fadeOutDown','fadeOutDownBig','fadeOutLeft','fadeOutLeftBig','fadeOutRight','fadeOutRightBig','fadeOutUp','fadeOutUpBig','flipInX','flipInY','flipOutX','flipOutY','lightSpeedIn','lightSpeedOut','rotateIn','rotateInDownLeft','rotateInDownRight','rotateInUpLeft','rotateInUpRight','rotateOut','rotateOutDownLeft','rotateOutDownRight','rotateOutUpLeft','rotateOutUpRight','hinge','jackInTheBox','rollIn','rollOut','zoomIn','zoomInDown','zoomInLeft','zoomInRight','zoomInUp','zoomOut','zoomOutDown','zoomOutLeft','zoomOutRight','zoomOutUp','slideInDown','slideInLeft','slideInRight','slideInUp','slideOutDown','slideOutLeft','slideOutRight','slideOutUp','heartBeat' ),
744 ),
745 'description' => __( 'Select delay for animation.', 'borderless' ),
746 'group' => 'Image',
747 ),
748
749 array(
750 'type' => 'dropdown',
751 'heading' => __( 'Animation Speed', 'borderless' ),
752 'param_name' => 'animation_speed',
753 'value' => array(
754 __( 'Slower - 3s', 'borderless' ) => 'slower animated infinite',
755 __( 'Slow - 2s', 'borderless' ) => 'slow animated infinite',
756 __( 'Fast - 800ms', 'borderless' ) => 'fast animated infinite',
757 __( 'Faster - 500ms', 'borderless' ) => 'faster animated infinite',
758
759 ),
760 'dependency' => array(
761 'element' => 'animations',
762 'value' => array( 'bounce','flash','pulse','rubberBand','shake','headShake','swing','tada','wobble','jello','bounceIn','bounceInDown','bounceInLeft','bounceInRight','bounceInUp','bounceOut','bounceOutDown','bounceOutLeft','bounceOutRight','bounceOutUp','fadeIn','fadeInDown','fadeInDownBig','fadeInLeft','fadeInLeftBig','fadeInRight','fadeInRightBig','fadeInUp','fadeInUpBig','fadeOut','fadeOutDown','fadeOutDownBig','fadeOutLeft','fadeOutLeftBig','fadeOutRight','fadeOutRightBig','fadeOutUp','fadeOutUpBig','flipInX','flipInY','flipOutX','flipOutY','lightSpeedIn','lightSpeedOut','rotateIn','rotateInDownLeft','rotateInDownRight','rotateInUpLeft','rotateInUpRight','rotateOut','rotateOutDownLeft','rotateOutDownRight','rotateOutUpLeft','rotateOutUpRight','hinge','jackInTheBox','rollIn','rollOut','zoomIn','zoomInDown','zoomInLeft','zoomInRight','zoomInUp','zoomOut','zoomOutDown','zoomOutLeft','zoomOutRight','zoomOutUp','slideInDown','slideInLeft','slideInRight','slideInUp','slideOutDown','slideOutLeft','slideOutRight','slideOutUp','heartBeat' ),
763 ),
764 'description' => __( 'Select Speed for animation.', 'borderless' ),
765 'group' => 'Image',
766 ),
767
768 // Animation
769 vc_map_add_css_animation(),
770
771 array(
772 'type' => 'el_id',
773 'heading' => __( 'Element ID', 'borderless' ),
774 'param_name' => 'el_id',
775 'description' => sprintf( __( 'Enter element ID (Note: make sure it is unique and valid according to %sw3c specification%s).', 'borderless' ), '<a href="https://www.w3schools.com/tags/att_global_id.asp" target="_blank">', '</a>' ),
776 ),
777
778 array(
779 'type' => 'textfield',
780 'heading' => __( 'Extra class name', 'borderless' ),
781 'param_name' => 'el_class',
782 'description' => __( 'Style particular content element differently - add a class name and refer to it in custom CSS.', 'borderless' ),
783 ),
784
785 array(
786 'type' => 'css_editor',
787 'heading' => __( 'CSS box', 'borderless' ),
788 'param_name' => 'css',
789 'group' => __( 'Design Options', 'borderless' ),
790 ),
791 ),
792 "js_view" => 'VcColumnView'
793 ) );