| 1 |
<?php |
| 2 |
use Bricksable\Classes\Bricksable_Helpers; |
| 3 |
|
| 4 |
if ( ! defined( 'ABSPATH' ) ) { |
| 5 |
exit; // Exit if accessed directly. |
| 6 |
} |
| 7 |
|
| 8 |
class Bricksable_Element_Flipbox extends \Bricks\Element { |
| 9 |
public $category = 'bricksable'; |
| 10 |
public $name = 'ba-flipbox'; |
| 11 |
public $icon = 'ti-layers'; |
| 12 |
public $css_selector = '.ba-flipbox-wrapper'; |
| 13 |
|
| 14 |
public function get_label() { |
| 15 |
return esc_html__( 'Flipbox', 'bricksable' ); |
| 16 |
} |
| 17 |
|
| 18 |
public function set_control_groups() { |
| 19 |
|
| 20 |
$this->control_groups['front_content'] = array( |
| 21 |
'title' => esc_html__( 'Front Content', 'bricksable' ), |
| 22 |
'tab' => 'content', |
| 23 |
); |
| 24 |
|
| 25 |
$this->control_groups['back_content'] = array( |
| 26 |
'title' => esc_html__( 'Back Content', 'bricksable' ), |
| 27 |
'tab' => 'content', |
| 28 |
); |
| 29 |
|
| 30 |
$this->control_groups['settings'] = array( |
| 31 |
'title' => esc_html__( 'Flipbox Setting', 'bricksable' ), |
| 32 |
'tab' => 'content', |
| 33 |
); |
| 34 |
|
| 35 |
$this->control_groups['frontIcon'] = array( |
| 36 |
'title' => esc_html__( 'Flipbox Front Icon', 'bricksable' ), |
| 37 |
'tab' => 'style', |
| 38 |
); |
| 39 |
|
| 40 |
$this->control_groups['backIcon'] = array( |
| 41 |
'title' => esc_html__( 'Flipbox Back Icon', 'bricksable' ), |
| 42 |
'tab' => 'style', |
| 43 |
); |
| 44 |
|
| 45 |
$this->control_groups['frontStyle'] = array( |
| 46 |
'title' => esc_html__( 'Flipbox Front', 'bricksable' ), |
| 47 |
'tab' => 'style', |
| 48 |
); |
| 49 |
|
| 50 |
$this->control_groups['backStyle'] = array( |
| 51 |
'title' => esc_html__( 'Flipbox Back', 'bricksable' ), |
| 52 |
'tab' => 'style', |
| 53 |
); |
| 54 |
|
| 55 |
$this->control_groups['backButtonStyle'] = array( |
| 56 |
'title' => esc_html__( 'Button', 'bricksable' ), |
| 57 |
'tab' => 'style', |
| 58 |
); |
| 59 |
|
| 60 |
unset( $this->control_groups['_typography'] ); |
| 61 |
unset( $this->control_groups['_border'] ); |
| 62 |
unset( $this->control_groups['_boxShadow'] ); |
| 63 |
|
| 64 |
} |
| 65 |
|
| 66 |
public function set_controls() { |
| 67 |
// Front. |
| 68 |
$this->controls['front_content_type'] = array( |
| 69 |
'tab' => 'content', |
| 70 |
'group' => 'front_content', |
| 71 |
'label' => esc_html__( 'Content Type', 'bricksable' ), |
| 72 |
'type' => 'select', |
| 73 |
'options' => array( |
| 74 |
'content' => esc_html__( 'Content', 'bricksable' ), |
| 75 |
'templates' => esc_html__( 'Templates', 'bricksable' ), |
| 76 |
), |
| 77 |
'clearable' => false, |
| 78 |
'pasteStyles' => false, |
| 79 |
'default' => 'content', |
| 80 |
'placeholder' => esc_html__( 'Content', 'bricksable' ), |
| 81 |
'description' => esc_html__( 'Using Template will ignore all contents below. Bricks 1.3 is required when using templates type.', 'bricksable' ), |
| 82 |
); |
| 83 |
|
| 84 |
$this->controls['front_template'] = array( |
| 85 |
'tab' => 'content', |
| 86 |
'group' => 'front_content', |
| 87 |
'label' => esc_html__( 'Template', 'bricksable' ), |
| 88 |
'type' => 'select', |
| 89 |
'options' => bricks_is_builder() ? Bricksable_Helpers::get_templates_list( get_the_ID() ) : array(), |
| 90 |
'searchable' => true, |
| 91 |
'placeholder' => esc_html__( 'Select template', 'bricksable' ), |
| 92 |
'required' => array( 'front_content_type', '=', 'templates' ), |
| 93 |
); |
| 94 |
|
| 95 |
$this->controls['front_content_type_separator'] = array( |
| 96 |
'tab' => 'content', |
| 97 |
'group' => 'front_content', |
| 98 |
'type' => 'separator', |
| 99 |
'label' => esc_html__( 'Content', 'bricksable' ), |
| 100 |
); |
| 101 |
|
| 102 |
$this->controls['front_icon'] = array( |
| 103 |
'tab' => 'content', |
| 104 |
'group' => 'front_content', |
| 105 |
'label' => esc_html__( 'Icon', 'bricksable' ), |
| 106 |
'type' => 'icon', |
| 107 |
'default' => array( |
| 108 |
'library' => 'themify', |
| 109 |
'icon' => 'ti-wordpress', |
| 110 |
), |
| 111 |
'required' => array( 'use_front_icon_image', '!=', true ), |
| 112 |
); |
| 113 |
|
| 114 |
$this->controls['use_front_icon_image'] = array( |
| 115 |
'tab' => 'content', |
| 116 |
'group' => 'front_content', |
| 117 |
'label' => esc_html__( 'Use Icon Image', 'bricksable' ), |
| 118 |
'type' => 'checkbox', |
| 119 |
'inline' => true, |
| 120 |
'description' => esc_html__( 'Use Icon Image instead of Icon.', 'bricksable' ), |
| 121 |
); |
| 122 |
|
| 123 |
$this->controls['front_icon_image'] = array( |
| 124 |
'tab' => 'content', |
| 125 |
'group' => 'front_content', |
| 126 |
'label' => esc_html__( 'Icon Image', 'bricksable' ), |
| 127 |
'type' => 'image', |
| 128 |
'required' => array( 'use_front_icon_image', '=', true ), |
| 129 |
); |
| 130 |
|
| 131 |
$this->controls['front_heading'] = array( |
| 132 |
'tab' => 'content', |
| 133 |
'group' => 'front_content', |
| 134 |
'label' => esc_html__( 'Heading', 'bricksable' ), |
| 135 |
'type' => 'text', |
| 136 |
'spellcheck' => true, |
| 137 |
'inlineEditing' => true, |
| 138 |
'default' => 'Front heading', |
| 139 |
'hasDynamicData' => 'text', |
| 140 |
); |
| 141 |
|
| 142 |
$this->controls['front_subheading'] = array( |
| 143 |
'tab' => 'content', |
| 144 |
'group' => 'front_content', |
| 145 |
'label' => esc_html__( 'Subheading', 'bricksable' ), |
| 146 |
'type' => 'text', |
| 147 |
'spellcheck' => true, |
| 148 |
'inlineEditing' => true, |
| 149 |
'hasDynamicData' => 'text', |
| 150 |
); |
| 151 |
|
| 152 |
$this->controls['front_heading_tag'] = array( |
| 153 |
'tab' => 'content', |
| 154 |
'group' => 'front_content', |
| 155 |
'label' => esc_html__( 'Heading Tag', 'bricksable' ), |
| 156 |
'type' => 'select', |
| 157 |
'options' => array( |
| 158 |
'h1' => esc_html__( 'Heading 1 (h1)', 'bricksable' ), |
| 159 |
'h2' => esc_html__( 'Heading 2 (h2)', 'bricksable' ), |
| 160 |
'h3' => esc_html__( 'Heading 3 (h3)', 'bricksable' ), |
| 161 |
'h4' => esc_html__( 'Heading 4 (h4)', 'bricksable' ), |
| 162 |
'h5' => esc_html__( 'Heading 5 (h5)', 'bricksable' ), |
| 163 |
'h6' => esc_html__( 'Heading 6 (h6)', 'bricksable' ), |
| 164 |
), |
| 165 |
'clearable' => false, |
| 166 |
'pasteStyles' => false, |
| 167 |
'default' => 'h3', |
| 168 |
); |
| 169 |
|
| 170 |
$this->controls['front_content'] = array( |
| 171 |
'tab' => 'content', |
| 172 |
'group' => 'front_content', |
| 173 |
'type' => 'editor', |
| 174 |
'default' => '<p>Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>', |
| 175 |
); |
| 176 |
|
| 177 |
$this->controls['front_background'] = array( |
| 178 |
'tab' => 'content', |
| 179 |
'group' => 'front_content', |
| 180 |
'label' => esc_html__( 'Background', 'bricksable' ), |
| 181 |
'type' => 'background', |
| 182 |
'inline' => true, |
| 183 |
'small' => true, |
| 184 |
'exclude' => array( |
| 185 |
'parallax', |
| 186 |
'videoUrl', |
| 187 |
'videoScale', |
| 188 |
), |
| 189 |
'css' => array( |
| 190 |
array( |
| 191 |
'property' => 'background', |
| 192 |
'selector' => '.ba-flipbox-front', |
| 193 |
), |
| 194 |
), |
| 195 |
'default' => array( |
| 196 |
'color' => array( |
| 197 |
'rgb' => 'rgba(224, 224, 224, 1)', |
| 198 |
'hex' => '#e0e0e0', |
| 199 |
), |
| 200 |
), |
| 201 |
); |
| 202 |
|
| 203 |
// Back. |
| 204 |
$this->controls['back_content_type'] = array( |
| 205 |
'tab' => 'content', |
| 206 |
'group' => 'back_content', |
| 207 |
'label' => esc_html__( 'Content Type', 'bricksable' ), |
| 208 |
'type' => 'select', |
| 209 |
'options' => array( |
| 210 |
'content' => esc_html__( 'Content', 'bricksable' ), |
| 211 |
'templates' => esc_html__( 'Templates', 'bricksable' ), |
| 212 |
), |
| 213 |
'clearable' => false, |
| 214 |
'pasteStyles' => false, |
| 215 |
'default' => 'content', |
| 216 |
'placeholder' => esc_html__( 'Content', 'bricksable' ), |
| 217 |
'description' => esc_html__( 'Using Template will ignore all contents below. Bricks 1.3 is required when using templates type.', 'bricksable' ), |
| 218 |
); |
| 219 |
|
| 220 |
$this->controls['back_template'] = array( |
| 221 |
'tab' => 'content', |
| 222 |
'group' => 'back_content', |
| 223 |
'label' => esc_html__( 'Template', 'bricksable' ), |
| 224 |
'type' => 'select', |
| 225 |
'options' => bricks_is_builder() ? Bricksable_Helpers::get_templates_list( get_the_ID() ) : array(), |
| 226 |
'searchable' => true, |
| 227 |
'placeholder' => esc_html__( 'Select template', 'bricksable' ), |
| 228 |
'required' => array( 'back_content_type', '=', 'templates' ), |
| 229 |
); |
| 230 |
|
| 231 |
$this->controls['back_content_type_separator'] = array( |
| 232 |
'tab' => 'content', |
| 233 |
'group' => 'back_content', |
| 234 |
'type' => 'separator', |
| 235 |
'label' => esc_html__( 'Content', 'bricksable' ), |
| 236 |
); |
| 237 |
$this->controls['back_icon'] = array( |
| 238 |
'tab' => 'content', |
| 239 |
'group' => 'back_content', |
| 240 |
'label' => esc_html__( 'Icon', 'bricksable' ), |
| 241 |
'type' => 'icon', |
| 242 |
'default' => array( |
| 243 |
'library' => 'themify', |
| 244 |
'icon' => 'ti-wordpress', |
| 245 |
), |
| 246 |
); |
| 247 |
|
| 248 |
$this->controls['use_back_icon_image'] = array( |
| 249 |
'tab' => 'content', |
| 250 |
'group' => 'back_content', |
| 251 |
'label' => esc_html__( 'Use Icon Image', 'bricksable' ), |
| 252 |
'type' => 'checkbox', |
| 253 |
'inline' => true, |
| 254 |
'description' => esc_html__( 'Use Icon Image instead of Icon.', 'bricksable' ), |
| 255 |
); |
| 256 |
|
| 257 |
$this->controls['back_icon_image'] = array( |
| 258 |
'tab' => 'content', |
| 259 |
'group' => 'back_content', |
| 260 |
'label' => esc_html__( 'Icon Image', 'bricksable' ), |
| 261 |
'type' => 'image', |
| 262 |
'required' => array( 'use_back_icon_image', '=', true ), |
| 263 |
); |
| 264 |
|
| 265 |
$this->controls['back_link'] = array( |
| 266 |
'tab' => 'content', |
| 267 |
'group' => 'back_content', |
| 268 |
'label' => esc_html__( 'Link', 'bricksable' ), |
| 269 |
'type' => 'link', |
| 270 |
); |
| 271 |
|
| 272 |
$this->controls['back_heading'] = array( |
| 273 |
'tab' => 'content', |
| 274 |
'group' => 'back_content', |
| 275 |
'label' => esc_html__( 'Heading', 'bricksable' ), |
| 276 |
'type' => 'text', |
| 277 |
'spellcheck' => true, |
| 278 |
'inlineEditing' => true, |
| 279 |
'default' => 'Back heading', |
| 280 |
'hasDynamicData' => 'text', |
| 281 |
); |
| 282 |
|
| 283 |
$this->controls['back_subheading'] = array( |
| 284 |
'tab' => 'content', |
| 285 |
'group' => 'back_content', |
| 286 |
'label' => esc_html__( 'Subheading', 'bricksable' ), |
| 287 |
'type' => 'text', |
| 288 |
'spellcheck' => true, |
| 289 |
'inlineEditing' => true, |
| 290 |
'hasDynamicData' => 'text', |
| 291 |
); |
| 292 |
|
| 293 |
$this->controls['back_heading_tag'] = array( |
| 294 |
'tab' => 'content', |
| 295 |
'group' => 'back_content', |
| 296 |
'label' => esc_html__( 'Heading Tag', 'bricksable' ), |
| 297 |
'type' => 'select', |
| 298 |
'options' => array( |
| 299 |
'h1' => esc_html__( 'Heading 1 (h1)', 'bricksable' ), |
| 300 |
'h2' => esc_html__( 'Heading 2 (h2)', 'bricksable' ), |
| 301 |
'h3' => esc_html__( 'Heading 3 (h3)', 'bricksable' ), |
| 302 |
'h4' => esc_html__( 'Heading 4 (h4)', 'bricksable' ), |
| 303 |
'h5' => esc_html__( 'Heading 5 (h5)', 'bricksable' ), |
| 304 |
'h6' => esc_html__( 'Heading 6 (h6)', 'bricksable' ), |
| 305 |
), |
| 306 |
'clearable' => false, |
| 307 |
'pasteStyles' => false, |
| 308 |
'default' => 'h3', |
| 309 |
); |
| 310 |
|
| 311 |
$this->controls['back_content'] = array( |
| 312 |
'tab' => 'content', |
| 313 |
'group' => 'back_content', |
| 314 |
'label' => esc_html__( 'Content', 'bricksable' ), |
| 315 |
'type' => 'editor', |
| 316 |
'default' => '<p>Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus.</p>', |
| 317 |
); |
| 318 |
|
| 319 |
$this->controls['back_background'] = array( |
| 320 |
'tab' => 'content', |
| 321 |
'group' => 'back_content', |
| 322 |
'label' => esc_html__( 'Background', 'bricksable' ), |
| 323 |
'type' => 'background', |
| 324 |
'inline' => true, |
| 325 |
'small' => true, |
| 326 |
'exclude' => array( |
| 327 |
'parallax', |
| 328 |
'videoUrl', |
| 329 |
'videoScale', |
| 330 |
), |
| 331 |
'css' => array( |
| 332 |
array( |
| 333 |
'property' => 'background', |
| 334 |
'selector' => '.ba-flipbox-back', |
| 335 |
), |
| 336 |
), |
| 337 |
'default' => array( |
| 338 |
'color' => array( |
| 339 |
'rgb' => 'rgba(224, 224, 224, 1)', |
| 340 |
'hex' => '#e0e0e0', |
| 341 |
), |
| 342 |
), |
| 343 |
); |
| 344 |
|
| 345 |
$this->controls['back_button_separator'] = array( |
| 346 |
'tab' => 'content', |
| 347 |
'group' => 'back_content', |
| 348 |
'label' => esc_html__( 'Button', 'bricksable' ), |
| 349 |
'type' => 'separator', |
| 350 |
); |
| 351 |
|
| 352 |
$this->controls['use_back_button'] = array( |
| 353 |
'tab' => 'content', |
| 354 |
'group' => 'back_content', |
| 355 |
'label' => esc_html__( 'Use Button', 'bricksable' ), |
| 356 |
'type' => 'checkbox', |
| 357 |
'inline' => true, |
| 358 |
); |
| 359 |
|
| 360 |
$this->controls['back_button_text'] = array( |
| 361 |
'tab' => 'content', |
| 362 |
'group' => 'back_content', |
| 363 |
'label' => esc_html__( 'Button Text', 'bricksable' ), |
| 364 |
'type' => 'text', |
| 365 |
'default' => esc_html__( 'Button', 'bricksable' ), |
| 366 |
'hasDynamicData' => 'text', |
| 367 |
'required' => array( 'use_back_button', '=', true ), |
| 368 |
); |
| 369 |
|
| 370 |
$this->controls['back_button_link'] = array( |
| 371 |
'tab' => 'content', |
| 372 |
'group' => 'back_content', |
| 373 |
'label' => esc_html__( 'Link type', 'bricksable' ), |
| 374 |
'type' => 'link', |
| 375 |
'required' => array( 'use_back_button', '=', true ), |
| 376 |
); |
| 377 |
|
| 378 |
$this->controls['back_button_size'] = array( |
| 379 |
'tab' => 'content', |
| 380 |
'group' => 'back_content', |
| 381 |
'label' => esc_html__( 'Size', 'bricksable' ), |
| 382 |
'type' => 'select', |
| 383 |
'options' => $this->control_options['buttonSizes'], |
| 384 |
'inline' => true, |
| 385 |
'reset' => true, |
| 386 |
'placeholder' => esc_html__( 'Medium', 'bricksable' ), |
| 387 |
'required' => array( 'use_back_button', '=', true ), |
| 388 |
); |
| 389 |
|
| 390 |
$this->controls['back_button_style'] = array( |
| 391 |
'tab' => 'content', |
| 392 |
'group' => 'back_content', |
| 393 |
'label' => esc_html__( 'Style', 'bricksable' ), |
| 394 |
'type' => 'select', |
| 395 |
'options' => $this->control_options['styles'], |
| 396 |
'inline' => true, |
| 397 |
'reset' => true, |
| 398 |
'default' => 'primary', |
| 399 |
'placeholder' => esc_html__( 'None', 'bricksable' ), |
| 400 |
'required' => array( 'use_back_button', '=', true ), |
| 401 |
); |
| 402 |
|
| 403 |
$this->controls['back_button_circle'] = array( |
| 404 |
'tab' => 'content', |
| 405 |
'group' => 'back_content', |
| 406 |
'label' => esc_html__( 'Circle', 'bricksable' ), |
| 407 |
'type' => 'checkbox', |
| 408 |
'reset' => true, |
| 409 |
'required' => array( 'use_back_button', '=', true ), |
| 410 |
); |
| 411 |
|
| 412 |
$this->controls['back_button_block'] = array( |
| 413 |
'tab' => 'content', |
| 414 |
'group' => 'back_content', |
| 415 |
'label' => esc_html__( 'Stretch', 'bricksable' ), |
| 416 |
'type' => 'checkbox', |
| 417 |
'reset' => true, |
| 418 |
'required' => array( 'use_back_button', '=', true ), |
| 419 |
); |
| 420 |
|
| 421 |
$this->controls['back_button_outline'] = array( |
| 422 |
'tab' => 'content', |
| 423 |
'group' => 'back_content', |
| 424 |
'label' => esc_html__( 'Outline', 'bricksable' ), |
| 425 |
'type' => 'checkbox', |
| 426 |
'reset' => true, |
| 427 |
'required' => array( 'use_back_button', '=', true ), |
| 428 |
); |
| 429 |
|
| 430 |
// Button Icon. |
| 431 |
$this->controls['back_button_icon'] = array( |
| 432 |
'tab' => 'content', |
| 433 |
'group' => 'back_content', |
| 434 |
'label' => esc_html__( 'Icon', 'bricksable' ), |
| 435 |
'type' => 'icon', |
| 436 |
'required' => array( 'use_back_button', '=', true ), |
| 437 |
); |
| 438 |
|
| 439 |
$this->controls['back_button_iconTypography'] = array( |
| 440 |
'tab' => 'content', |
| 441 |
'group' => 'back_content', |
| 442 |
'label' => esc_html__( 'Typography', 'bricksable' ), |
| 443 |
'type' => 'typography', |
| 444 |
'css' => array( |
| 445 |
array( |
| 446 |
'property' => 'font', |
| 447 |
'selector' => 'i', |
| 448 |
), |
| 449 |
), |
| 450 |
'inline' => true, |
| 451 |
'small' => true, |
| 452 |
'required' => array( 'back_button_icon', '!=', '' ), |
| 453 |
); |
| 454 |
|
| 455 |
$this->controls['back_button_iconPosition'] = array( |
| 456 |
'tab' => 'content', |
| 457 |
'group' => 'back_content', |
| 458 |
'label' => esc_html__( 'Position', 'bricksable' ), |
| 459 |
'type' => 'select', |
| 460 |
'options' => $this->control_options['iconPosition'], |
| 461 |
'inline' => true, |
| 462 |
'placeholder' => esc_html__( 'Right', 'bricksable' ), |
| 463 |
'required' => array( 'back_button_icon', '!=', '' ), |
| 464 |
); |
| 465 |
|
| 466 |
$this->controls['back_button_iconSpace'] = array( |
| 467 |
'tab' => 'content', |
| 468 |
'group' => 'back_content', |
| 469 |
'label' => esc_html__( 'Space between', 'bricksable' ), |
| 470 |
'type' => 'checkbox', |
| 471 |
'css' => array( |
| 472 |
array( |
| 473 |
'property' => 'justify-content', |
| 474 |
'selector' => '.bricks-button-inner', |
| 475 |
'value' => 'space-between', |
| 476 |
), |
| 477 |
), |
| 478 |
'required' => array( 'back_button_icon', '!=', '' ), |
| 479 |
); |
| 480 |
|
| 481 |
$this->controls['back_button_Margin'] = array( |
| 482 |
'tab' => 'style', |
| 483 |
'group' => 'backButtonStyle', |
| 484 |
'label' => esc_html__( 'Margin', 'bricksable' ), |
| 485 |
'type' => 'dimensions', |
| 486 |
'css' => array( |
| 487 |
array( |
| 488 |
'property' => 'margin', |
| 489 |
'selector' => '.ba-flipbox-back .bricks-button', |
| 490 |
), |
| 491 |
), |
| 492 |
'default' => array( |
| 493 |
'top' => 20, |
| 494 |
'right' => 0, |
| 495 |
'bottom' => 0, |
| 496 |
'left' => 0, |
| 497 |
), |
| 498 |
); |
| 499 |
|
| 500 |
$this->controls['back_button_Padding'] = array( |
| 501 |
'tab' => 'style', |
| 502 |
'group' => 'backButtonStyle', |
| 503 |
'label' => esc_html__( 'Padding', 'bricksable' ), |
| 504 |
'type' => 'dimensions', |
| 505 |
'css' => array( |
| 506 |
array( |
| 507 |
'property' => 'padding', |
| 508 |
'selector' => '.ba-flipbox-back .bricks-button', |
| 509 |
), |
| 510 |
), |
| 511 |
); |
| 512 |
|
| 513 |
$this->controls['back_button_typography'] = array( |
| 514 |
'tab' => 'style', |
| 515 |
'group' => 'backButtonStyle', |
| 516 |
'label' => esc_html__( 'Typography', 'bricksable' ), |
| 517 |
'type' => 'typography', |
| 518 |
'css' => array( |
| 519 |
array( |
| 520 |
'property' => 'font', |
| 521 |
'selector' => '.ba-flipbox-back .bricks-button', |
| 522 |
), |
| 523 |
), |
| 524 |
'inline' => true, |
| 525 |
'small' => true, |
| 526 |
); |
| 527 |
|
| 528 |
$this->controls['back_button_background'] = array( |
| 529 |
'tab' => 'style', |
| 530 |
'group' => 'backButtonStyle', |
| 531 |
'label' => esc_html__( 'Background', 'bricksable' ), |
| 532 |
'type' => 'background', |
| 533 |
'inline' => true, |
| 534 |
'small' => true, |
| 535 |
'exclude' => array( |
| 536 |
'parallax', |
| 537 |
'videoUrl', |
| 538 |
'videoScale', |
| 539 |
), |
| 540 |
'css' => array( |
| 541 |
array( |
| 542 |
'property' => 'background', |
| 543 |
'selector' => '.ba-flipbox-back .bricks-button', |
| 544 |
), |
| 545 |
), |
| 546 |
); |
| 547 |
|
| 548 |
$this->controls['button_iconBorder'] = array( |
| 549 |
'tab' => 'style', |
| 550 |
'group' => 'backButtonStyle', |
| 551 |
'label' => esc_html__( 'Icon border', 'bricksable' ), |
| 552 |
'type' => 'border', |
| 553 |
'css' => array( |
| 554 |
array( |
| 555 |
'property' => 'border', |
| 556 |
'selector' => '.ba-flipbox-back .bricks-button', |
| 557 |
), |
| 558 |
), |
| 559 |
'inline' => true, |
| 560 |
'small' => true, |
| 561 |
); |
| 562 |
|
| 563 |
$this->controls['button_BoxShadow'] = array( |
| 564 |
'tab' => 'style', |
| 565 |
'group' => 'backButtonStyle', |
| 566 |
'label' => esc_html__( 'Icon box shadow', 'bricksable' ), |
| 567 |
'type' => 'box-shadow', |
| 568 |
'css' => array( |
| 569 |
array( |
| 570 |
'property' => 'box-shadow', |
| 571 |
'selector' => '.ba-flipbox-back .bricks-button', |
| 572 |
), |
| 573 |
), |
| 574 |
'inline' => true, |
| 575 |
'small' => true, |
| 576 |
); |
| 577 |
|
| 578 |
// Front Icon. |
| 579 |
$this->controls['front_iconMargin'] = array( |
| 580 |
'tab' => 'style', |
| 581 |
'group' => 'frontIcon', |
| 582 |
'label' => esc_html__( 'Icon margin', 'bricksable' ), |
| 583 |
'type' => 'dimensions', |
| 584 |
'css' => array( |
| 585 |
array( |
| 586 |
'property' => 'margin', |
| 587 |
'selector' => '.ba-flipbox-front .icon', |
| 588 |
), |
| 589 |
array( |
| 590 |
'property' => 'margin', |
| 591 |
'selector' => '.ba-flipbox-front .icon-image-wrapper', |
| 592 |
), |
| 593 |
), |
| 594 |
); |
| 595 |
|
| 596 |
$this->controls['front_iconPadding'] = array( |
| 597 |
'tab' => 'style', |
| 598 |
'group' => 'frontIcon', |
| 599 |
'label' => esc_html__( 'Icon padding', 'bricksable' ), |
| 600 |
'type' => 'dimensions', |
| 601 |
'css' => array( |
| 602 |
array( |
| 603 |
'property' => 'padding', |
| 604 |
'selector' => '.ba-flipbox-front .icon', |
| 605 |
), |
| 606 |
array( |
| 607 |
'property' => 'padding', |
| 608 |
'selector' => '.ba-flipbox-front .icon-image-wrapper', |
| 609 |
), |
| 610 |
), |
| 611 |
); |
| 612 |
|
| 613 |
$this->controls['front_iconPosition'] = array( |
| 614 |
'tab' => 'style', |
| 615 |
'group' => 'frontIcon', |
| 616 |
'label' => esc_html__( 'Icon position', 'bricksable' ), |
| 617 |
'type' => 'select', |
| 618 |
'options' => array( |
| 619 |
'top' => esc_html__( 'Top', 'bricksable' ), |
| 620 |
'right' => esc_html__( 'Right', 'bricksable' ), |
| 621 |
'bottom' => esc_html__( 'Bottom', 'bricksable' ), |
| 622 |
'left' => esc_html__( 'Left', 'bricksable' ), |
| 623 |
), |
| 624 |
'inline' => true, |
| 625 |
'placeholder' => esc_html__( 'Top', 'bricksable' ), |
| 626 |
); |
| 627 |
|
| 628 |
$this->controls['front_iconSize'] = array( |
| 629 |
'tab' => 'style', |
| 630 |
'group' => 'frontIcon', |
| 631 |
'label' => esc_html__( 'Icon size', 'bricksable' ), |
| 632 |
'type' => 'slider', |
| 633 |
'css' => array( |
| 634 |
array( |
| 635 |
'property' => 'font-size', |
| 636 |
'selector' => '.ba-flipbox-front .icon', |
| 637 |
), |
| 638 |
), |
| 639 |
'required' => array( 'use_front_icon_image', '!=', true ), |
| 640 |
); |
| 641 |
|
| 642 |
$this->controls['front_iconHeight'] = array( |
| 643 |
'tab' => 'style', |
| 644 |
'group' => 'frontIcon', |
| 645 |
'label' => esc_html__( 'Icon height', 'bricksable' ), |
| 646 |
'type' => 'slider', |
| 647 |
'units' => array( |
| 648 |
'px' => array( |
| 649 |
'min' => 1, |
| 650 |
'max' => 200, |
| 651 |
'step' => 1, |
| 652 |
), |
| 653 |
'%' => array( |
| 654 |
'min' => 0, |
| 655 |
'max' => 100, |
| 656 |
'step' => 1, |
| 657 |
), |
| 658 |
'vh' => array( |
| 659 |
'min' => 0, |
| 660 |
'max' => 100, |
| 661 |
'step' => 1, |
| 662 |
), |
| 663 |
), |
| 664 |
'css' => array( |
| 665 |
array( |
| 666 |
'property' => 'height', |
| 667 |
'selector' => '.ba-flipbox-front .icon', |
| 668 |
), |
| 669 |
array( |
| 670 |
'property' => 'line-height', |
| 671 |
'selector' => '.ba-flipbox-front .icon', |
| 672 |
), |
| 673 |
), |
| 674 |
'required' => array( 'use_front_icon_image', '!=', true ), |
| 675 |
); |
| 676 |
|
| 677 |
$this->controls['front_iconWidth'] = array( |
| 678 |
'tab' => 'style', |
| 679 |
'group' => 'frontIcon', |
| 680 |
'label' => esc_html__( 'Icon width', 'bricksable' ), |
| 681 |
'type' => 'slider', |
| 682 |
'units' => array( |
| 683 |
'px' => array( |
| 684 |
'min' => 1, |
| 685 |
'max' => 200, |
| 686 |
'step' => 1, |
| 687 |
), |
| 688 |
'%' => array( |
| 689 |
'min' => 0, |
| 690 |
'max' => 100, |
| 691 |
'step' => 1, |
| 692 |
), |
| 693 |
'vw' => array( |
| 694 |
'min' => 0, |
| 695 |
'max' => 100, |
| 696 |
'step' => 1, |
| 697 |
), |
| 698 |
), |
| 699 |
'css' => array( |
| 700 |
array( |
| 701 |
'property' => 'min-width', |
| 702 |
'selector' => '.ba-flipbox-front .icon', |
| 703 |
), |
| 704 |
array( |
| 705 |
'property' => 'max-width', |
| 706 |
'selector' => '.ba-flipbox-front .icon-image-wrapper', |
| 707 |
), |
| 708 |
), |
| 709 |
); |
| 710 |
|
| 711 |
$this->controls['front_iconColor'] = array( |
| 712 |
'tab' => 'style', |
| 713 |
'group' => 'frontIcon', |
| 714 |
'label' => esc_html__( 'Icon color', 'bricksable' ), |
| 715 |
'type' => 'color', |
| 716 |
'inline' => true, |
| 717 |
'css' => array( |
| 718 |
array( |
| 719 |
'property' => 'color', |
| 720 |
'selector' => '.ba-flipbox-front .icon', |
| 721 |
), |
| 722 |
), |
| 723 |
'required' => array( 'use_front_icon_image', '!=', true ), |
| 724 |
); |
| 725 |
|
| 726 |
$this->controls['front_iconBackgroundColor'] = array( |
| 727 |
'tab' => 'style', |
| 728 |
'group' => 'frontIcon', |
| 729 |
'label' => esc_html__( 'Icon background', 'bricksable' ), |
| 730 |
'type' => 'color', |
| 731 |
'inline' => true, |
| 732 |
'small' => true, |
| 733 |
'css' => array( |
| 734 |
array( |
| 735 |
'property' => 'background-color', |
| 736 |
'selector' => '.ba-flipbox-front .icon', |
| 737 |
), |
| 738 |
array( |
| 739 |
'property' => 'background-color', |
| 740 |
'selector' => '.ba-flipbox-front .icon-image-wrapper', |
| 741 |
), |
| 742 |
), |
| 743 |
); |
| 744 |
|
| 745 |
$this->controls['front_iconBorder'] = array( |
| 746 |
'tab' => 'style', |
| 747 |
'group' => 'frontIcon', |
| 748 |
'label' => esc_html__( 'Icon border', 'bricksable' ), |
| 749 |
'type' => 'border', |
| 750 |
'css' => array( |
| 751 |
array( |
| 752 |
'property' => 'border', |
| 753 |
'selector' => '.ba-flipbox-front .icon', |
| 754 |
), |
| 755 |
array( |
| 756 |
'property' => 'border', |
| 757 |
'selector' => '.ba-flipbox-front .icon-image-wrapper img', |
| 758 |
), |
| 759 |
), |
| 760 |
'inline' => true, |
| 761 |
'small' => true, |
| 762 |
); |
| 763 |
|
| 764 |
$this->controls['front_iconBoxShadow'] = array( |
| 765 |
'tab' => 'style', |
| 766 |
'group' => 'frontIcon', |
| 767 |
'label' => esc_html__( 'Icon box shadow', 'bricksable' ), |
| 768 |
'type' => 'box-shadow', |
| 769 |
'css' => array( |
| 770 |
array( |
| 771 |
'property' => 'box-shadow', |
| 772 |
'selector' => '.ba-flipbox-front .icon', |
| 773 |
), |
| 774 |
array( |
| 775 |
'property' => 'box-shadow', |
| 776 |
'selector' => '.ba-flipbox-front .icon-image-wrapper img', |
| 777 |
), |
| 778 |
), |
| 779 |
'inline' => true, |
| 780 |
'small' => true, |
| 781 |
); |
| 782 |
|
| 783 |
// Back Icon. |
| 784 |
$this->controls['back_iconMargin'] = array( |
| 785 |
'tab' => 'style', |
| 786 |
'group' => 'backIcon', |
| 787 |
'label' => esc_html__( 'Icon margin', 'bricksable' ), |
| 788 |
'type' => 'dimensions', |
| 789 |
'css' => array( |
| 790 |
array( |
| 791 |
'property' => 'margin', |
| 792 |
'selector' => '.ba-flipbox-back .icon', |
| 793 |
), |
| 794 |
array( |
| 795 |
'property' => 'margin', |
| 796 |
'selector' => '.ba-flipbox-back .icon-image-wrapper', |
| 797 |
), |
| 798 |
), |
| 799 |
); |
| 800 |
|
| 801 |
$this->controls['back_iconPadding'] = array( |
| 802 |
'tab' => 'style', |
| 803 |
'group' => 'backIcon', |
| 804 |
'label' => esc_html__( 'Icon padding', 'bricksable' ), |
| 805 |
'type' => 'dimensions', |
| 806 |
'css' => array( |
| 807 |
array( |
| 808 |
'property' => 'padding', |
| 809 |
'selector' => '.ba-flipbox-back .icon', |
| 810 |
), |
| 811 |
array( |
| 812 |
'property' => 'padding', |
| 813 |
'selector' => '.ba-flipbox-back .icon-image-wrapper', |
| 814 |
), |
| 815 |
), |
| 816 |
); |
| 817 |
|
| 818 |
$this->controls['back_iconPosition'] = array( |
| 819 |
'tab' => 'style', |
| 820 |
'group' => 'backIcon', |
| 821 |
'label' => esc_html__( 'Icon position', 'bricksable' ), |
| 822 |
'type' => 'select', |
| 823 |
'options' => array( |
| 824 |
'top' => esc_html__( 'Top', 'bricksable' ), |
| 825 |
'right' => esc_html__( 'Right', 'bricksable' ), |
| 826 |
'bottom' => esc_html__( 'Bottom', 'bricksable' ), |
| 827 |
'left' => esc_html__( 'Left', 'bricksable' ), |
| 828 |
), |
| 829 |
'inline' => true, |
| 830 |
'placeholder' => esc_html__( 'Top', 'bricksable' ), |
| 831 |
); |
| 832 |
|
| 833 |
$this->controls['back_iconSize'] = array( |
| 834 |
'tab' => 'style', |
| 835 |
'group' => 'backIcon', |
| 836 |
'label' => esc_html__( 'Icon size', 'bricksable' ), |
| 837 |
'type' => 'slider', |
| 838 |
'css' => array( |
| 839 |
array( |
| 840 |
'property' => 'font-size', |
| 841 |
'selector' => '.ba-flipbox-back .icon', |
| 842 |
), |
| 843 |
), |
| 844 |
'required' => array( 'use_back_icon_image', '!=', true ), |
| 845 |
); |
| 846 |
|
| 847 |
$this->controls['back_iconHeight'] = array( |
| 848 |
'tab' => 'style', |
| 849 |
'group' => 'backIcon', |
| 850 |
'label' => esc_html__( 'Icon height', 'bricksable' ), |
| 851 |
'type' => 'slider', |
| 852 |
'units' => array( |
| 853 |
'px' => array( |
| 854 |
'min' => 1, |
| 855 |
'max' => 200, |
| 856 |
'step' => 1, |
| 857 |
), |
| 858 |
'%' => array( |
| 859 |
'min' => 0, |
| 860 |
'max' => 100, |
| 861 |
'step' => 1, |
| 862 |
), |
| 863 |
'vh' => array( |
| 864 |
'min' => 0, |
| 865 |
'max' => 100, |
| 866 |
'step' => 1, |
| 867 |
), |
| 868 |
), |
| 869 |
'css' => array( |
| 870 |
array( |
| 871 |
'property' => 'height', |
| 872 |
'selector' => '.ba-flipbox-back .icon', |
| 873 |
), |
| 874 |
array( |
| 875 |
'property' => 'line-height', |
| 876 |
'selector' => '.ba-flipbox-back .icon', |
| 877 |
), |
| 878 |
), |
| 879 |
'required' => array( 'use_back_icon_image', '!=', true ), |
| 880 |
); |
| 881 |
|
| 882 |
$this->controls['back_iconWidth'] = array( |
| 883 |
'tab' => 'style', |
| 884 |
'group' => 'backIcon', |
| 885 |
'label' => esc_html__( 'Icon width', 'bricksable' ), |
| 886 |
'type' => 'slider', |
| 887 |
'units' => array( |
| 888 |
'px' => array( |
| 889 |
'min' => 1, |
| 890 |
'max' => 200, |
| 891 |
'step' => 1, |
| 892 |
), |
| 893 |
'%' => array( |
| 894 |
'min' => 0, |
| 895 |
'max' => 100, |
| 896 |
'step' => 1, |
| 897 |
), |
| 898 |
'vw' => array( |
| 899 |
'min' => 0, |
| 900 |
'max' => 100, |
| 901 |
'step' => 1, |
| 902 |
), |
| 903 |
), |
| 904 |
'css' => array( |
| 905 |
array( |
| 906 |
'property' => 'min-width', |
| 907 |
'selector' => '.ba-flipbox-back .icon', |
| 908 |
), |
| 909 |
array( |
| 910 |
'property' => 'max-width', |
| 911 |
'selector' => '.ba-flipbox-back .icon-image-wrapper', |
| 912 |
), |
| 913 |
), |
| 914 |
); |
| 915 |
|
| 916 |
$this->controls['back_iconColor'] = array( |
| 917 |
'tab' => 'style', |
| 918 |
'group' => 'backIcon', |
| 919 |
'label' => esc_html__( 'Icon color', 'bricksable' ), |
| 920 |
'type' => 'color', |
| 921 |
'inline' => true, |
| 922 |
'css' => array( |
| 923 |
array( |
| 924 |
'property' => 'color', |
| 925 |
'selector' => '.ba-flipbox-back .icon', |
| 926 |
), |
| 927 |
), |
| 928 |
'required' => array( 'use_back_icon_image', '!=', true ), |
| 929 |
); |
| 930 |
|
| 931 |
$this->controls['back_iconBackgroundColor'] = array( |
| 932 |
'tab' => 'style', |
| 933 |
'group' => 'backIcon', |
| 934 |
'label' => esc_html__( 'Icon background', 'bricksable' ), |
| 935 |
'type' => 'color', |
| 936 |
'inline' => true, |
| 937 |
'small' => true, |
| 938 |
'css' => array( |
| 939 |
array( |
| 940 |
'property' => 'background-color', |
| 941 |
'selector' => '.ba-flipbox-back .icon', |
| 942 |
), |
| 943 |
array( |
| 944 |
'property' => 'background-color', |
| 945 |
'selector' => '.ba-flipbox-back .icon-image-wrapper', |
| 946 |
), |
| 947 |
), |
| 948 |
); |
| 949 |
|
| 950 |
$this->controls['back_iconBorder'] = array( |
| 951 |
'tab' => 'style', |
| 952 |
'group' => 'backIcon', |
| 953 |
'label' => esc_html__( 'Icon border', 'bricksable' ), |
| 954 |
'type' => 'border', |
| 955 |
'css' => array( |
| 956 |
array( |
| 957 |
'property' => 'border', |
| 958 |
'selector' => '.ba-flipbox-back .icon', |
| 959 |
), |
| 960 |
array( |
| 961 |
'property' => 'border', |
| 962 |
'selector' => '.ba-flipbox-back .icon-image-wrapper img', |
| 963 |
), |
| 964 |
), |
| 965 |
'inline' => true, |
| 966 |
'small' => true, |
| 967 |
); |
| 968 |
|
| 969 |
$this->controls['back_iconBoxShadow'] = array( |
| 970 |
'tab' => 'style', |
| 971 |
'group' => 'backIcon', |
| 972 |
'label' => esc_html__( 'Icon box shadow', 'bricksable' ), |
| 973 |
'type' => 'box-shadow', |
| 974 |
'css' => array( |
| 975 |
array( |
| 976 |
'property' => 'box-shadow', |
| 977 |
'selector' => '.ba-flipbox-back .icon', |
| 978 |
), |
| 979 |
array( |
| 980 |
'property' => 'box-shadow', |
| 981 |
'selector' => '.ba-flipbox-back .icon-image-wrapper img', |
| 982 |
), |
| 983 |
), |
| 984 |
'inline' => true, |
| 985 |
'small' => true, |
| 986 |
); |
| 987 |
|
| 988 |
// Front Style. |
| 989 |
$this->controls['front_textAlign'] = array( |
| 990 |
'tab' => 'style', |
| 991 |
'group' => 'frontStyle', |
| 992 |
'label' => esc_html__( 'Text align', 'bricksable' ), |
| 993 |
'type' => 'text-align', |
| 994 |
'css' => array( |
| 995 |
array( |
| 996 |
'property' => 'text-align', |
| 997 |
'selector' => '.ba-flipbox-front', |
| 998 |
), |
| 999 |
), |
| 1000 |
'inline' => true, |
| 1001 |
); |
| 1002 |
|
| 1003 |
$this->controls['front_verticalAlign'] = array( |
| 1004 |
'tab' => 'style', |
| 1005 |
'group' => 'frontStyle', |
| 1006 |
'label' => esc_html__( 'Vertical align', 'bricksable' ), |
| 1007 |
'type' => 'select', |
| 1008 |
'options' => $this->control_options['alignItems'], |
| 1009 |
'css' => array( |
| 1010 |
array( |
| 1011 |
'property' => 'align-items', |
| 1012 |
'selector' => '.ba-flipbox-front', |
| 1013 |
), |
| 1014 |
), |
| 1015 |
'inline' => true, |
| 1016 |
'default' => 'center', |
| 1017 |
); |
| 1018 |
|
| 1019 |
$this->controls['front_typographyHeading'] = array( |
| 1020 |
'tab' => 'style', |
| 1021 |
'group' => 'frontStyle', |
| 1022 |
'type' => 'typography', |
| 1023 |
'label' => esc_html__( 'Heading typography', 'bricksable' ), |
| 1024 |
'css' => array( |
| 1025 |
array( |
| 1026 |
'property' => 'font', |
| 1027 |
'selector' => '.ba-flipbox-front .bricks-heading', |
| 1028 |
), |
| 1029 |
), |
| 1030 |
'inline' => true, |
| 1031 |
'small' => true, |
| 1032 |
'required' => array( 'front_heading', '!=', '' ), |
| 1033 |
); |
| 1034 |
|
| 1035 |
$this->controls['front_heading_bottomGap'] = array( |
| 1036 |
'tab' => 'style', |
| 1037 |
'group' => 'frontStyle', |
| 1038 |
'type' => 'slider', |
| 1039 |
'label' => esc_html__( 'Heading Gap', 'bricksable' ), |
| 1040 |
'css' => array( |
| 1041 |
array( |
| 1042 |
'property' => 'margin-bottom', |
| 1043 |
'selector' => '.ba-flipbox-front .bricks-heading', |
| 1044 |
), |
| 1045 |
), |
| 1046 |
'units' => array( |
| 1047 |
'em' => array( |
| 1048 |
'min' => 0, |
| 1049 |
'max' => 20, |
| 1050 |
'step' => 0.1, |
| 1051 |
), |
| 1052 |
), |
| 1053 |
'default' => '0.75em', |
| 1054 |
'placeholder' => '0.75', |
| 1055 |
'required' => array( 'front_heading', '!=', '' ), |
| 1056 |
); |
| 1057 |
|
| 1058 |
$this->controls['front_typographyBody'] = array( |
| 1059 |
'tab' => 'style', |
| 1060 |
'group' => 'frontStyle', |
| 1061 |
'type' => 'typography', |
| 1062 |
'label' => esc_html__( 'Body typography', 'bricksable' ), |
| 1063 |
'css' => array( |
| 1064 |
array( |
| 1065 |
'property' => 'font', |
| 1066 |
'selector' => '.ba-flipbox-front .ba-flipbox-content', |
| 1067 |
), |
| 1068 |
), |
| 1069 |
'inline' => true, |
| 1070 |
'small' => true, |
| 1071 |
); |
| 1072 |
|
| 1073 |
$this->controls['front_typographySubHeading'] = array( |
| 1074 |
'tab' => 'style', |
| 1075 |
'group' => 'frontStyle', |
| 1076 |
'type' => 'typography', |
| 1077 |
'label' => esc_html__( 'Subheading typography', 'bricksable' ), |
| 1078 |
'css' => array( |
| 1079 |
array( |
| 1080 |
'property' => 'font', |
| 1081 |
'selector' => '.ba-flipbox-front .ba-flipbox-subheading', |
| 1082 |
), |
| 1083 |
), |
| 1084 |
'inline' => true, |
| 1085 |
'small' => true, |
| 1086 |
'required' => array( 'front_subheading', '!=', '' ), |
| 1087 |
); |
| 1088 |
|
| 1089 |
$this->controls['front_subheading_bottomGap'] = array( |
| 1090 |
'tab' => 'style', |
| 1091 |
'group' => 'frontStyle', |
| 1092 |
'type' => 'slider', |
| 1093 |
'label' => esc_html__( 'Subheading Gap', 'bricksable' ), |
| 1094 |
'css' => array( |
| 1095 |
array( |
| 1096 |
'property' => 'margin-bottom', |
| 1097 |
'selector' => '.ba-flipbox-front .ba-flipbox-subheading', |
| 1098 |
), |
| 1099 |
), |
| 1100 |
'units' => array( |
| 1101 |
'em' => array( |
| 1102 |
'min' => 0, |
| 1103 |
'max' => 20, |
| 1104 |
'step' => 0.1, |
| 1105 |
), |
| 1106 |
), |
| 1107 |
'default' => '0em', |
| 1108 |
'required' => array( 'front_subheading', '!=', '' ), |
| 1109 |
); |
| 1110 |
|
| 1111 |
$this->controls['use_front_gradient'] = array( |
| 1112 |
'tab' => 'style', |
| 1113 |
'group' => 'frontStyle', |
| 1114 |
'label' => esc_html__( 'Use Gradient', 'bricksable' ), |
| 1115 |
'type' => 'checkbox', |
| 1116 |
'inline' => true, |
| 1117 |
'description' => esc_html__( 'Enable gradient for Front Content.', 'bricksable' ), |
| 1118 |
); |
| 1119 |
|
| 1120 |
$this->controls['front_gradient'] = array( |
| 1121 |
'tab' => 'style', |
| 1122 |
'group' => 'frontStyle', |
| 1123 |
'label' => esc_html__( 'Gradient', 'bricksable' ), |
| 1124 |
'type' => 'gradient', |
| 1125 |
'css' => array( |
| 1126 |
array( |
| 1127 |
'property' => 'background-image', |
| 1128 |
'selector' => '.ba-flipbox-front', |
| 1129 |
), |
| 1130 |
), |
| 1131 |
'required' => array( 'use_front_gradient', '=', true ), |
| 1132 |
); |
| 1133 |
|
| 1134 |
$this->controls['front_containerBorder'] = array( |
| 1135 |
'tab' => 'style', |
| 1136 |
'group' => 'frontStyle', |
| 1137 |
'type' => 'border', |
| 1138 |
'label' => esc_html__( 'Border', 'bricksable' ), |
| 1139 |
'css' => array( |
| 1140 |
array( |
| 1141 |
'property' => 'border', |
| 1142 |
'selector' => '.ba-flipbox-front', |
| 1143 |
), |
| 1144 |
), |
| 1145 |
'inline' => true, |
| 1146 |
'small' => true, |
| 1147 |
); |
| 1148 |
|
| 1149 |
$this->controls['front_containerBoxShadow'] = array( |
| 1150 |
'tab' => 'style', |
| 1151 |
'group' => 'frontStyle', |
| 1152 |
'type' => 'box-shadow', |
| 1153 |
'label' => esc_html__( 'Box shadow', 'bricksable' ), |
| 1154 |
'css' => array( |
| 1155 |
array( |
| 1156 |
'property' => 'box-shadow', |
| 1157 |
'selector' => '.ba-flipbox-front', |
| 1158 |
), |
| 1159 |
), |
| 1160 |
'inline' => true, |
| 1161 |
'small' => true, |
| 1162 |
); |
| 1163 |
|
| 1164 |
$this->controls['front_containerMargin'] = array( |
| 1165 |
'tab' => 'style', |
| 1166 |
'group' => 'frontStyle', |
| 1167 |
'type' => 'dimensions', |
| 1168 |
'label' => esc_html__( 'Margin', 'bricksable' ), |
| 1169 |
'css' => array( |
| 1170 |
array( |
| 1171 |
'property' => 'margin', |
| 1172 |
'selector' => '.ba-flipbox-front', |
| 1173 |
), |
| 1174 |
), |
| 1175 |
); |
| 1176 |
|
| 1177 |
$this->controls['front_contentPadding'] = array( |
| 1178 |
'tab' => 'style', |
| 1179 |
'group' => 'frontStyle', |
| 1180 |
'type' => 'dimensions', |
| 1181 |
'label' => esc_html__( 'Padding', 'bricksable' ), |
| 1182 |
'css' => array( |
| 1183 |
array( |
| 1184 |
'property' => 'padding', |
| 1185 |
'selector' => '.ba-flipbox-front', |
| 1186 |
), |
| 1187 |
), |
| 1188 |
'default' => array( |
| 1189 |
'top' => 20, |
| 1190 |
'right' => 20, |
| 1191 |
'bottom' => 20, |
| 1192 |
'left' => 20, |
| 1193 |
), |
| 1194 |
); |
| 1195 |
|
| 1196 |
// Back Style. |
| 1197 |
$this->controls['back_textAlign'] = array( |
| 1198 |
'tab' => 'style', |
| 1199 |
'group' => 'backStyle', |
| 1200 |
'label' => esc_html__( 'Text align', 'bricksable' ), |
| 1201 |
'type' => 'text-align', |
| 1202 |
'css' => array( |
| 1203 |
array( |
| 1204 |
'property' => 'text-align', |
| 1205 |
'selector' => '.ba-flipbox-back', |
| 1206 |
), |
| 1207 |
), |
| 1208 |
'inline' => true, |
| 1209 |
); |
| 1210 |
|
| 1211 |
$this->controls['back_verticalAlign'] = array( |
| 1212 |
'tab' => 'style', |
| 1213 |
'group' => 'backStyle', |
| 1214 |
'label' => esc_html__( 'Vertical align', 'bricksable' ), |
| 1215 |
'type' => 'select', |
| 1216 |
'options' => $this->control_options['alignItems'], |
| 1217 |
'css' => array( |
| 1218 |
array( |
| 1219 |
'property' => 'align-items', |
| 1220 |
'selector' => '.ba-flipbox-back', |
| 1221 |
), |
| 1222 |
), |
| 1223 |
'inline' => true, |
| 1224 |
'default' => 'center', |
| 1225 |
); |
| 1226 |
|
| 1227 |
$this->controls['back_typographyHeading'] = array( |
| 1228 |
'tab' => 'style', |
| 1229 |
'group' => 'backStyle', |
| 1230 |
'type' => 'typography', |
| 1231 |
'label' => esc_html__( 'Heading typography', 'bricksable' ), |
| 1232 |
'css' => array( |
| 1233 |
array( |
| 1234 |
'property' => 'font', |
| 1235 |
'selector' => '.ba-flipbox-back .bricks-heading', |
| 1236 |
), |
| 1237 |
), |
| 1238 |
'inline' => true, |
| 1239 |
'small' => true, |
| 1240 |
'required' => array( 'back_heading', '!=', '' ), |
| 1241 |
); |
| 1242 |
|
| 1243 |
$this->controls['back_heading_bottomGap'] = array( |
| 1244 |
'tab' => 'style', |
| 1245 |
'group' => 'backStyle', |
| 1246 |
'type' => 'slider', |
| 1247 |
'label' => esc_html__( 'Heading Gap', 'bricksable' ), |
| 1248 |
'css' => array( |
| 1249 |
array( |
| 1250 |
'property' => 'margin-bottom', |
| 1251 |
'selector' => '.ba-flipbox-back .bricks-heading', |
| 1252 |
), |
| 1253 |
), |
| 1254 |
'units' => array( |
| 1255 |
'em' => array( |
| 1256 |
'min' => 0, |
| 1257 |
'max' => 20, |
| 1258 |
'step' => 0.1, |
| 1259 |
), |
| 1260 |
), |
| 1261 |
'default' => '0.75em', |
| 1262 |
'placeholder' => '0.75', |
| 1263 |
'required' => array( 'back_heading', '!=', '' ), |
| 1264 |
); |
| 1265 |
|
| 1266 |
$this->controls['back_typographyBody'] = array( |
| 1267 |
'tab' => 'style', |
| 1268 |
'group' => 'backStyle', |
| 1269 |
'type' => 'typography', |
| 1270 |
'label' => esc_html__( 'Body typography', 'bricksable' ), |
| 1271 |
'css' => array( |
| 1272 |
array( |
| 1273 |
'property' => 'font', |
| 1274 |
'selector' => '.ba-flipbox-back .ba-flipbox-content', |
| 1275 |
), |
| 1276 |
), |
| 1277 |
'inline' => true, |
| 1278 |
'small' => true, |
| 1279 |
); |
| 1280 |
|
| 1281 |
$this->controls['back_typographySubHeading'] = array( |
| 1282 |
'tab' => 'style', |
| 1283 |
'group' => 'backStyle', |
| 1284 |
'type' => 'typography', |
| 1285 |
'label' => esc_html__( 'Subheading typography', 'bricksable' ), |
| 1286 |
'css' => array( |
| 1287 |
array( |
| 1288 |
'property' => 'font', |
| 1289 |
'selector' => '.ba-flipbox-back .ba-flipbox-subheading', |
| 1290 |
), |
| 1291 |
), |
| 1292 |
'inline' => true, |
| 1293 |
'small' => true, |
| 1294 |
'required' => array( 'back_subheading', '!=', '' ), |
| 1295 |
); |
| 1296 |
|
| 1297 |
$this->controls['back_subheading_bottomGap'] = array( |
| 1298 |
'tab' => 'style', |
| 1299 |
'group' => 'backStyle', |
| 1300 |
'type' => 'slider', |
| 1301 |
'label' => esc_html__( 'Subheading Gap', 'bricksable' ), |
| 1302 |
'css' => array( |
| 1303 |
array( |
| 1304 |
'property' => 'margin-bottom', |
| 1305 |
'selector' => '.ba-flipbox-back .ba-flipbox-subheading', |
| 1306 |
), |
| 1307 |
), |
| 1308 |
'units' => array( |
| 1309 |
'em' => array( |
| 1310 |
'min' => 0, |
| 1311 |
'max' => 20, |
| 1312 |
'step' => 0.1, |
| 1313 |
), |
| 1314 |
), |
| 1315 |
'default' => '0em', |
| 1316 |
'required' => array( 'back_subheading', '!=', '' ), |
| 1317 |
); |
| 1318 |
|
| 1319 |
$this->controls['use_back_gradient'] = array( |
| 1320 |
'tab' => 'style', |
| 1321 |
'group' => 'backStyle', |
| 1322 |
'label' => esc_html__( 'Use Gradient', 'bricksable' ), |
| 1323 |
'type' => 'checkbox', |
| 1324 |
'inline' => true, |
| 1325 |
'description' => esc_html__( 'Enable gradient for Back Content.', 'bricksable' ), |
| 1326 |
); |
| 1327 |
|
| 1328 |
$this->controls['back_gradient'] = array( |
| 1329 |
'tab' => 'style', |
| 1330 |
'group' => 'backStyle', |
| 1331 |
'label' => esc_html__( 'Gradient', 'bricksable' ), |
| 1332 |
'type' => 'gradient', |
| 1333 |
'css' => array( |
| 1334 |
array( |
| 1335 |
'property' => 'background-image', |
| 1336 |
'selector' => '.ba-flipbox-back', |
| 1337 |
), |
| 1338 |
), |
| 1339 |
'required' => array( 'use_back_gradient', '=', true ), |
| 1340 |
); |
| 1341 |
|
| 1342 |
$this->controls['back_containerBorder'] = array( |
| 1343 |
'tab' => 'style', |
| 1344 |
'group' => 'backStyle', |
| 1345 |
'type' => 'border', |
| 1346 |
'label' => esc_html__( 'Border', 'bricksable' ), |
| 1347 |
'css' => array( |
| 1348 |
array( |
| 1349 |
'property' => 'border', |
| 1350 |
'selector' => '.ba-flipbox-back', |
| 1351 |
), |
| 1352 |
), |
| 1353 |
'inline' => true, |
| 1354 |
'small' => true, |
| 1355 |
); |
| 1356 |
|
| 1357 |
$this->controls['back_containerBoxShadow'] = array( |
| 1358 |
'tab' => 'style', |
| 1359 |
'group' => 'backStyle', |
| 1360 |
'type' => 'box-shadow', |
| 1361 |
'label' => esc_html__( 'Box shadow', 'bricksable' ), |
| 1362 |
'css' => array( |
| 1363 |
array( |
| 1364 |
'property' => 'box-shadow', |
| 1365 |
'selector' => '.ba-flipbox-back', |
| 1366 |
), |
| 1367 |
), |
| 1368 |
'inline' => true, |
| 1369 |
'small' => true, |
| 1370 |
); |
| 1371 |
|
| 1372 |
$this->controls['back_containerMargin'] = array( |
| 1373 |
'tab' => 'style', |
| 1374 |
'group' => 'backStyle', |
| 1375 |
'type' => 'dimensions', |
| 1376 |
'label' => esc_html__( 'Margin', 'bricksable' ), |
| 1377 |
'css' => array( |
| 1378 |
array( |
| 1379 |
'property' => 'margin', |
| 1380 |
'selector' => '.ba-flipbox-back', |
| 1381 |
), |
| 1382 |
), |
| 1383 |
); |
| 1384 |
|
| 1385 |
$this->controls['back_containerPadding'] = array( |
| 1386 |
'tab' => 'style', |
| 1387 |
'group' => 'backStyle', |
| 1388 |
'type' => 'dimensions', |
| 1389 |
'label' => esc_html__( 'Padding', 'bricksable' ), |
| 1390 |
'css' => array( |
| 1391 |
array( |
| 1392 |
'property' => 'padding', |
| 1393 |
'selector' => '.ba-flipbox-back', |
| 1394 |
), |
| 1395 |
), |
| 1396 |
'default' => array( |
| 1397 |
'top' => 20, |
| 1398 |
'right' => 20, |
| 1399 |
'bottom' => 20, |
| 1400 |
'left' => 20, |
| 1401 |
), |
| 1402 |
); |
| 1403 |
|
| 1404 |
// Flipbox Settings. |
| 1405 |
$this->controls['height'] = array( |
| 1406 |
'tab' => 'content', |
| 1407 |
'group' => 'settings', |
| 1408 |
'label' => esc_html__( 'Height', 'bricksable' ), |
| 1409 |
'type' => 'slider', |
| 1410 |
'css' => array( |
| 1411 |
array( |
| 1412 |
'property' => 'min-height', |
| 1413 |
'selector' => '.ba-flipbox-wrapper', |
| 1414 |
), |
| 1415 |
), |
| 1416 |
'units' => array( |
| 1417 |
'px' => array( |
| 1418 |
'min' => 1, |
| 1419 |
'max' => 1600, |
| 1420 |
'step' => 1, |
| 1421 |
), |
| 1422 |
'vh' => array( |
| 1423 |
'min' => 1, |
| 1424 |
'max' => 100, |
| 1425 |
'step' => 1, |
| 1426 |
), |
| 1427 |
), |
| 1428 |
'default' => '300px', |
| 1429 |
'description' => esc_html__( "Adjust the flipbox container's height.", 'bricksable' ), |
| 1430 |
); |
| 1431 |
|
| 1432 |
$this->controls['flipbox_animation_duration'] = array( |
| 1433 |
'tab' => 'content', |
| 1434 |
'group' => 'settings', |
| 1435 |
'label' => esc_html__( 'Animation Duration', 'bricksable' ), |
| 1436 |
'type' => 'number', |
| 1437 |
'min' => 100, |
| 1438 |
'max' => 2000, |
| 1439 |
'step' => '100', |
| 1440 |
'unit' => 'ms', |
| 1441 |
'css' => array( |
| 1442 |
array( |
| 1443 |
'property' => 'transition-duration', |
| 1444 |
'selector' => '.ba-flipbox-front', |
| 1445 |
), |
| 1446 |
array( |
| 1447 |
'property' => 'transition-duration', |
| 1448 |
'selector' => '.ba-flipbox-back', |
| 1449 |
), |
| 1450 |
), |
| 1451 |
'inline' => true, |
| 1452 |
'default' => 650, |
| 1453 |
'placeholder' => '650', |
| 1454 |
); |
| 1455 |
|
| 1456 |
$this->controls['effect'] = array( |
| 1457 |
'tab' => 'content', |
| 1458 |
'group' => 'settings', |
| 1459 |
'label' => esc_html__( 'Effect', 'bricksable' ), |
| 1460 |
'type' => 'select', |
| 1461 |
'options' => array( |
| 1462 |
'flip' => esc_html__( 'Flip', 'bricksable' ), |
| 1463 |
'zoom' => esc_html__( 'Zoom', 'bricksable' ), |
| 1464 |
'fade' => esc_html__( 'Fade', 'bricksable' ), |
| 1465 |
), |
| 1466 |
'inline' => true, |
| 1467 |
'default' => 'flip', |
| 1468 |
'placeholder' => esc_html__( 'Flip', 'bricksable' ), |
| 1469 |
); |
| 1470 |
|
| 1471 |
$this->controls['flip_animation'] = array( |
| 1472 |
'tab' => 'content', |
| 1473 |
'group' => 'settings', |
| 1474 |
'label' => esc_html__( 'Flip Animation', 'bricksable' ), |
| 1475 |
'type' => 'select', |
| 1476 |
'options' => array( |
| 1477 |
'up' => esc_html__( 'Flip Up', 'bricksable' ), |
| 1478 |
'right' => esc_html__( 'Flip Right', 'bricksable' ), |
| 1479 |
'bottom' => esc_html__( 'Flip Bottom', 'bricksable' ), |
| 1480 |
'left' => esc_html__( 'Flip Left', 'bricksable' ), |
| 1481 |
), |
| 1482 |
'inline' => true, |
| 1483 |
'default' => 'left', |
| 1484 |
'placeholder' => esc_html__( 'Flip Left', 'bricksable' ), |
| 1485 |
'required' => array( 'effect', '=', 'flip' ), |
| 1486 |
); |
| 1487 |
|
| 1488 |
$this->controls['zoom_animation'] = array( |
| 1489 |
'tab' => 'content', |
| 1490 |
'group' => 'settings', |
| 1491 |
'label' => esc_html__( 'Zoom Animation', 'bricksable' ), |
| 1492 |
'type' => 'select', |
| 1493 |
'options' => array( |
| 1494 |
'in' => esc_html__( 'Zoom In', 'bricksable' ), |
| 1495 |
'out' => esc_html__( 'Zoom Out', 'bricksable' ), |
| 1496 |
), |
| 1497 |
'inline' => true, |
| 1498 |
'default' => 'in', |
| 1499 |
'placeholder' => esc_html__( 'Zoom In', 'bricksable' ), |
| 1500 |
'required' => array( 'effect', '=', 'zoom' ), |
| 1501 |
); |
| 1502 |
|
| 1503 |
$this->controls['flip_3d'] = array( |
| 1504 |
'tab' => 'content', |
| 1505 |
'group' => 'settings', |
| 1506 |
'label' => esc_html__( '3D Effect', 'bricksable' ), |
| 1507 |
'type' => 'checkbox', |
| 1508 |
'inline' => true, |
| 1509 |
'description' => esc_html__( 'Enable 3D effect on your flipbox.', 'bricksable' ), |
| 1510 |
'required' => array( 'effect', '=', 'flip' ), |
| 1511 |
); |
| 1512 |
|
| 1513 |
$this->controls['flip_elastic'] = array( |
| 1514 |
'tab' => 'content', |
| 1515 |
'group' => 'settings', |
| 1516 |
'label' => esc_html__( 'Use Elastic Effect', 'bricksable' ), |
| 1517 |
'type' => 'checkbox', |
| 1518 |
'inline' => true, |
| 1519 |
'description' => esc_html__( 'Enable elastic effect when you hover over your flipbox.', 'bricksable' ), |
| 1520 |
'required' => array( 'effect', '=', array( 'flip', 'zoom' ) ), |
| 1521 |
); |
| 1522 |
} |
| 1523 |
|
| 1524 |
public function render() { |
| 1525 |
$settings = $this->settings; |
| 1526 |
|
| 1527 |
// Front. |
| 1528 |
$icon_position = isset( $settings['front_iconPosition'] ) ? $settings['front_iconPosition'] : 'top'; |
| 1529 |
|
| 1530 |
if ( $icon_position ) { |
| 1531 |
$wrapper_classes[] = isset( $settings['front_content_type'] ) && 'templates' === $settings['front_content_type'] ? 'ba-flipbox-content-templates' : 'icon-box-wrapper icon-position-' . $icon_position; |
| 1532 |
} |
| 1533 |
|
| 1534 |
$this->set_attribute( 'ba-flipbox-front-wrapper', 'class', $wrapper_classes ); |
| 1535 |
|
| 1536 |
// Icon. |
| 1537 |
if ( isset( $settings['front_icon']['icon'] ) ) { |
| 1538 |
$this->set_attribute( |
| 1539 |
'icon', |
| 1540 |
'class', |
| 1541 |
array( |
| 1542 |
'icon', |
| 1543 |
$settings['front_icon']['icon'], |
| 1544 |
) |
| 1545 |
); |
| 1546 |
} |
| 1547 |
|
| 1548 |
$this->set_attribute( 'ba-flipbox-front', 'class', array( 'ba-flipbox-front', 'ba-flipbox-container' ) ); |
| 1549 |
$this->set_attribute( 'ba-flipbox-front-content', 'class', array( 'ba-flipbox-content-wrapper' ) ); |
| 1550 |
$front_heading_tag = isset( $settings['front_heading_tag'] ) ? esc_html( $settings['front_heading_tag'] ) : 'h3'; |
| 1551 |
$front_heading_classes = array( |
| 1552 |
'bricks-heading', |
| 1553 |
'bricks-heading-' . $front_heading_tag, |
| 1554 |
); |
| 1555 |
$this->set_attribute( 'front_heading', $front_heading_tag ); |
| 1556 |
$this->set_attribute( 'front_heading', 'class', $front_heading_classes ); |
| 1557 |
|
| 1558 |
$this->set_attribute( 'front_subheading', 'class', 'ba-flipbox-subheading' ); |
| 1559 |
$this->set_attribute( 'front_content', 'class', 'ba-flipbox-content' ); |
| 1560 |
|
| 1561 |
$front_heading_output = ''; |
| 1562 |
$front_subheading_output = ''; |
| 1563 |
$front_content_output = ''; |
| 1564 |
|
| 1565 |
if ( isset( $settings['front_heading'] ) ) { |
| 1566 |
$front_heading_output = '<' . $this->render_attributes( 'front_heading' ) . '>' . $settings['front_heading'] . '</' . $front_heading_tag . '>'; |
| 1567 |
} |
| 1568 |
|
| 1569 |
if ( isset( $settings['front_subheading'] ) ) { |
| 1570 |
$front_subheading_output .= '<div ' . $this->render_attributes( 'front_subheading' ) . '>' . $settings['front_subheading'] . '</div>'; |
| 1571 |
} |
| 1572 |
|
| 1573 |
if ( isset( $settings['front_content'] ) ) { |
| 1574 |
$front_subheading_output .= '<div ' . $this->render_attributes( 'front_content' ) . '>' . $settings['front_content'] . '</div>'; |
| 1575 |
} |
| 1576 |
|
| 1577 |
// Render front icon box. |
| 1578 |
$front_box_html = ''; |
| 1579 |
// Template. |
| 1580 |
if ( isset( $settings['front_content_type'] ) && 'templates' === $settings['front_content_type'] ) { |
| 1581 |
|
| 1582 |
$template_id = ! empty( $settings['front_template'] ) ? intval( $settings['front_template'] ) : false; |
| 1583 |
if ( ! $template_id ) { |
| 1584 |
return $this->render_element_placeholder( |
| 1585 |
array( |
| 1586 |
'title' => esc_html__( 'No template selected.', 'bricksable' ), |
| 1587 |
) |
| 1588 |
); |
| 1589 |
} |
| 1590 |
|
| 1591 |
$front_box_html = do_shortcode( '[bricks_template id="' . $template_id . '" ]' ); |
| 1592 |
|
| 1593 |
} else { |
| 1594 |
if ( 'bottom' === $icon_position ) { |
| 1595 |
$front_box_html .= '<div ' . $this->render_attributes( 'ba-flipbox-front-content' ) . '>' . $front_heading_output . $front_subheading_output . $front_content_output . '</div>'; |
| 1596 |
} |
| 1597 |
|
| 1598 |
if ( isset( $settings['front_icon']['icon'] ) && ! isset( $settings['use_front_icon_image'] ) ) { |
| 1599 |
$front_box_html .= '<i ' . $this->render_attributes( 'icon' ) . '></i>'; |
| 1600 |
} |
| 1601 |
|
| 1602 |
// Icon Image Render. |
| 1603 |
if ( isset( $settings['use_front_icon_image'] ) && isset( $settings['front_icon_image'] ) ) { |
| 1604 |
$image_atts = array(); |
| 1605 |
$image_atts['id'] = 'image-' . $settings['front_icon_image']['id']; |
| 1606 |
|
| 1607 |
$image_wrapper_classes = array( 'icon-image-wrapper' ); |
| 1608 |
$img_classes = array( 'ba-flipbox-icon-img' ); |
| 1609 |
$img_classes[] = 'size-' . $settings['front_icon_image']['size']; |
| 1610 |
$image_atts['class'] = join( ' ', $img_classes ); |
| 1611 |
|
| 1612 |
$this->set_attribute( 'front_icon_image', 'class', $image_wrapper_classes ); |
| 1613 |
|
| 1614 |
$front_box_html .= '<div ' . $this->render_attributes( 'front_icon_image' ) . '>'; |
| 1615 |
$close_front_tag = false; |
| 1616 |
|
| 1617 |
// Lazy load atts set via 'wp_get_attachment_image_attributes' filter. |
| 1618 |
if ( isset( $settings['front_icon_image']['id'] ) ) { |
| 1619 |
$front_box_html .= wp_get_attachment_image( $settings['front_icon_image']['id'], $settings['front_icon_image']['size'], false, $image_atts ); |
| 1620 |
} elseif ( ! empty( $settings['front_icon_image']['url'] ) ) { |
| 1621 |
$front_box_html .= '<img src="' . $settings['front_icon_image']['url'] . '">'; |
| 1622 |
} |
| 1623 |
|
| 1624 |
if ( $close_front_tag ) { |
| 1625 |
$front_box_html .= '</div>'; |
| 1626 |
} |
| 1627 |
|
| 1628 |
$front_box_html .= '</div>'; |
| 1629 |
} |
| 1630 |
|
| 1631 |
if ( 'bottom' !== $icon_position ) { |
| 1632 |
$front_box_html .= '<div ' . $this->render_attributes( 'ba-flipbox-front-content' ) . '>' . $front_heading_output . $front_subheading_output . $front_content_output . '</div>'; |
| 1633 |
} |
| 1634 |
} |
| 1635 |
|
| 1636 |
$front_wrapper = sprintf( |
| 1637 |
'<div %1$s> |
| 1638 |
<div %2$s>%3$s</div> |
| 1639 |
</div>', |
| 1640 |
$this->render_attributes( 'ba-flipbox-front' ), |
| 1641 |
$this->render_attributes( 'ba-flipbox-front-wrapper' ), |
| 1642 |
$front_box_html |
| 1643 |
); |
| 1644 |
|
| 1645 |
// Back. |
| 1646 |
$back_icon_position = isset( $settings['back_iconPosition'] ) ? $settings['back_iconPosition'] : 'top'; |
| 1647 |
|
| 1648 |
if ( $back_icon_position ) { |
| 1649 |
$back_wrapper_classes[] = isset( $settings['back_content_type'] ) && 'templates' === $settings['back_content_type'] ? 'ba-flipbox-content-templates' : 'icon-box-wrapper icon-position-' . $back_icon_position; |
| 1650 |
} |
| 1651 |
|
| 1652 |
$this->set_attribute( 'ba-flipbox-back-wrapper', 'class', $back_wrapper_classes ); |
| 1653 |
|
| 1654 |
// Link. |
| 1655 |
if ( isset( $settings['back_link'] ) ) { |
| 1656 |
$this->set_link_attributes( 'a', $settings['back_link'] ); |
| 1657 |
} |
| 1658 |
|
| 1659 |
// Icon. |
| 1660 |
if ( isset( $settings['back_icon']['icon'] ) ) { |
| 1661 |
$this->set_attribute( |
| 1662 |
'back_icon', |
| 1663 |
'class', |
| 1664 |
array( |
| 1665 |
'icon', |
| 1666 |
$settings['back_icon']['icon'], // Dont' sanitize_html_class (Font Awesome uses two class names, so we need spaces). |
| 1667 |
) |
| 1668 |
); |
| 1669 |
} |
| 1670 |
|
| 1671 |
$this->set_attribute( 'ba-flipbox-back', 'class', array( 'ba-flipbox-back', 'ba-flipbox-container' ) ); |
| 1672 |
$this->set_attribute( 'ba-flipbox-back-content', 'class', array( 'ba-flipbox-content-wrapper' ) ); |
| 1673 |
$back_heading_tag = isset( $settings['back_heading_tag'] ) ? esc_html( $settings['back_heading_tag'] ) : 'h3'; |
| 1674 |
$heading_classes = array( |
| 1675 |
'bricks-heading', |
| 1676 |
'bricks-heading-' . $back_heading_tag, |
| 1677 |
); |
| 1678 |
$this->set_attribute( 'back_heading', $back_heading_tag ); |
| 1679 |
$this->set_attribute( 'back_heading', 'class', $heading_classes ); |
| 1680 |
$this->set_attribute( 'back_subheading', 'class', 'ba-flipbox-subheading' ); |
| 1681 |
$this->set_attribute( 'back_content', 'class', 'ba-flipbox-content' ); |
| 1682 |
|
| 1683 |
$back_heading_output = ''; |
| 1684 |
$back_subheading_output = ''; |
| 1685 |
$back_content_output = ''; |
| 1686 |
|
| 1687 |
if ( isset( $settings['back_heading'] ) ) { |
| 1688 |
$back_heading_output .= '<' . $this->render_attributes( 'back_heading' ) . '>' . $settings['back_heading'] . '</' . $back_heading_tag . '>'; |
| 1689 |
} |
| 1690 |
|
| 1691 |
if ( isset( $settings['back_subheading'] ) ) { |
| 1692 |
$back_subheading_output .= '<div ' . $this->render_attributes( 'back_subheading' ) . '>' . $settings['back_subheading'] . '</div>'; |
| 1693 |
} |
| 1694 |
|
| 1695 |
if ( isset( $settings['back_content'] ) ) { |
| 1696 |
$back_content_output .= '<div ' . $this->render_attributes( 'back_content' ) . '>' . $settings['back_content'] . '</div>'; |
| 1697 |
} |
| 1698 |
// Render back icon box. |
| 1699 |
$back_icon_box_html = ''; |
| 1700 |
// Template. |
| 1701 |
if ( isset( $settings['back_content_type'] ) && 'templates' === $settings['back_content_type'] ) { |
| 1702 |
|
| 1703 |
$template_id = ! empty( $settings['back_template'] ) ? intval( $settings['back_template'] ) : false; |
| 1704 |
if ( ! $template_id ) { |
| 1705 |
return $this->render_element_placeholder( |
| 1706 |
array( |
| 1707 |
'title' => esc_html__( 'No template selected.', 'bricksable' ), |
| 1708 |
) |
| 1709 |
); |
| 1710 |
} |
| 1711 |
|
| 1712 |
$back_icon_box_html = do_shortcode( '[bricks_template id="' . $template_id . '" ]' ); |
| 1713 |
|
| 1714 |
} else { |
| 1715 |
if ( 'bottom' === $icon_position ) { |
| 1716 |
$back_icon_box_html .= '<div ' . $this->render_attributes( 'ba-flipbox-back-content' ) . '>' . $back_heading_output . $back_subheading_output . $back_content_output . '</div>'; |
| 1717 |
} |
| 1718 |
|
| 1719 |
if ( isset( $settings['back_icon']['icon'] ) && ! isset( $settings['back_icon_image'] ) ) { |
| 1720 |
if ( isset( $settings['back_link'] ) ) { |
| 1721 |
$back_icon_box_html .= '<a ' . $this->render_attributes( 'a' ) . '>'; |
| 1722 |
} |
| 1723 |
|
| 1724 |
$back_icon_box_html .= '<i ' . $this->render_attributes( 'back_icon' ) . '></i>'; |
| 1725 |
|
| 1726 |
if ( isset( $settings['back_link'] ) ) { |
| 1727 |
$back_icon_box_html .= '</a>'; |
| 1728 |
} |
| 1729 |
} |
| 1730 |
|
| 1731 |
// Icon Image Render. |
| 1732 |
if ( isset( $settings['use_back_icon_image'] ) && isset( $settings['back_icon_image'] ) ) { |
| 1733 |
$image_atts = array(); |
| 1734 |
$image_atts['id'] = 'image-' . $settings['back_icon_image']['id']; |
| 1735 |
|
| 1736 |
$image_wrapper_classes = array( 'icon-image-wrapper' ); |
| 1737 |
$img_classes = array( 'ba-flipbox-icon-img' ); |
| 1738 |
$img_classes[] = 'size-' . $settings['back_icon_image']['size']; |
| 1739 |
$image_atts['class'] = join( ' ', $img_classes ); |
| 1740 |
|
| 1741 |
$this->set_attribute( 'back_icon_image', 'class', $image_wrapper_classes ); |
| 1742 |
|
| 1743 |
$back_icon_box_html .= '<div ' . $this->render_attributes( 'back_icon_image' ) . '>'; |
| 1744 |
$close_back_tag = false; |
| 1745 |
|
| 1746 |
// Lazy load atts set via 'wp_get_attachment_image_attributes' filter. |
| 1747 |
if ( isset( $settings['back_icon_image']['id'] ) ) { |
| 1748 |
$back_icon_box_html .= wp_get_attachment_image( $settings['back_icon_image']['id'], $settings['back_icon_image']['size'], false, $image_atts ); |
| 1749 |
} elseif ( ! empty( $settings['back_icon_image']['url'] ) ) { |
| 1750 |
$back_icon_box_html .= '<img src="' . $settings['back_icon_image']['url'] . '">'; |
| 1751 |
} |
| 1752 |
|
| 1753 |
if ( $close_back_tag ) { |
| 1754 |
$back_icon_box_html .= '</div>'; |
| 1755 |
} |
| 1756 |
|
| 1757 |
$back_icon_box_html .= '</div>'; |
| 1758 |
} |
| 1759 |
|
| 1760 |
if ( 'bottom' !== $icon_position ) { |
| 1761 |
$back_icon_box_html .= '<div ' . $this->render_attributes( 'ba-flipbox-back-content' ) . '>' . $back_heading_output . $back_subheading_output . $back_content_output . '</div>'; |
| 1762 |
} |
| 1763 |
|
| 1764 |
// Button. |
| 1765 |
$button_classes[] = 'bricks-button'; |
| 1766 |
|
| 1767 |
$button_classes[] = isset( $settings['back_button_size'] ) ? 'bricks-button-' . $settings['back_button_size'] : 'bricks-button-md'; |
| 1768 |
|
| 1769 |
if ( isset( $settings['back_button_style'] ) ) { |
| 1770 |
// Outline. |
| 1771 |
if ( isset( $settings['back_button_outline'] ) ) { |
| 1772 |
$button_classes[] = 'bricks-outline'; |
| 1773 |
$button_classes[] = 'bricks-color-' . $settings['back_button_style']; |
| 1774 |
} else { |
| 1775 |
// Fill. |
| 1776 |
$button_classes[] = 'bricks-background-' . $settings['back_button_style']; |
| 1777 |
} |
| 1778 |
} |
| 1779 |
|
| 1780 |
// Button circle. |
| 1781 |
if ( isset( $settings['back_button_circle'] ) ) { |
| 1782 |
$button_classes[] = 'bricks-button-circle'; |
| 1783 |
} |
| 1784 |
|
| 1785 |
if ( isset( $settings['back_button_block'] ) ) { |
| 1786 |
$button_classes[] = 'bricks-button-block'; |
| 1787 |
} |
| 1788 |
|
| 1789 |
$this->set_attribute( 'button-wrapper', 'class', $button_classes ); |
| 1790 |
|
| 1791 |
// Link. |
| 1792 |
if ( isset( $settings['back_button_link'] ) ) { |
| 1793 |
$this->set_link_attributes( 'button-wrapper', $settings['back_button_link'] ); |
| 1794 |
} |
| 1795 |
|
| 1796 |
$icon_position = isset( $settings['back_button_iconPosition'] ) ? $settings['back_button_iconPosition'] : 'right'; |
| 1797 |
|
| 1798 |
if ( isset( $settings['back_button_icon']['icon'] ) ) { |
| 1799 |
$this->set_attribute( 'button_icon', 'class', $settings['back_button_icon']['icon'] ); |
| 1800 |
$this->set_attribute( 'button-wrapper', 'class', "icon-$icon_position" ); |
| 1801 |
} |
| 1802 |
|
| 1803 |
$link_tag = isset( $settings['back_button_link'] ) ? 'a' : 'span'; |
| 1804 |
|
| 1805 |
// Render button. |
| 1806 |
$button_html = '<' . esc_attr( $link_tag ) . ' ' . $this->render_attributes( 'button-wrapper' ) . '>'; |
| 1807 |
|
| 1808 |
$button_html .= '<span class="bricks-button-inner">'; |
| 1809 |
|
| 1810 |
if ( isset( $settings['back_button_icon']['icon'] ) && 'left' === $icon_position ) { |
| 1811 |
$button_html .= '<i ' . $this->render_attributes( 'button_icon' ) . '></i>'; |
| 1812 |
} |
| 1813 |
|
| 1814 |
if ( isset( $settings['back_button_text'] ) ) { |
| 1815 |
$button_html .= '<span ' . $this->render_attributes( 'button-text' ) . '>' . trim( $settings['back_button_text'] ) . '</span>'; |
| 1816 |
} |
| 1817 |
|
| 1818 |
if ( isset( $settings['back_button_icon']['icon'] ) && 'right' === $icon_position ) { |
| 1819 |
$button_html .= '<i ' . $this->render_attributes( 'button_icon' ) . '></i>'; |
| 1820 |
} |
| 1821 |
|
| 1822 |
$button_html .= '</span>'; |
| 1823 |
|
| 1824 |
$button_html .= '</' . esc_attr( $link_tag ) . '>'; |
| 1825 |
} |
| 1826 |
$back_wrapper = sprintf( |
| 1827 |
'<div %1$s> |
| 1828 |
<div %2$s>%3$s%4$s</div> |
| 1829 |
</div>', |
| 1830 |
$this->render_attributes( 'ba-flipbox-back' ), |
| 1831 |
$this->render_attributes( 'ba-flipbox-back-wrapper' ), |
| 1832 |
$back_icon_box_html, |
| 1833 |
isset( $settings['use_back_button'] ) ? $button_html : '' |
| 1834 |
); |
| 1835 |
|
| 1836 |
$flip_animation = ''; |
| 1837 |
if ( 'flip' === $settings['effect'] ) { |
| 1838 |
$flip_animation = $settings['flip_animation']; |
| 1839 |
|
| 1840 |
} elseif ( 'zoom' === $settings['effect'] ) { |
| 1841 |
$flip_animation = $settings['zoom_animation']; |
| 1842 |
} else { |
| 1843 |
$flip_animation = 'in'; |
| 1844 |
} |
| 1845 |
$flip_3d = isset( $settings['flip_3d'] ) && 'flip' === $settings['effect'] ? ' ba-flipbox-3d' : ''; |
| 1846 |
$flip_elastic = isset( $settings['flip_elastic'] ) ? ' ba-flipbox-flip-elastic' : ''; |
| 1847 |
$flipbox_animation = esc_attr( $flip_3d ) . ' ba-flipbox-' . esc_attr( $settings['effect'] ) . '-' . esc_attr( $flip_animation ) . esc_attr( $flip_elastic ); |
| 1848 |
// Render element content. |
| 1849 |
$output = sprintf( |
| 1850 |
'<div class="ba-flipbox-wrapper%3$s">%1$s%2$s</div>', |
| 1851 |
$front_wrapper, |
| 1852 |
$back_wrapper, |
| 1853 |
esc_attr( $flipbox_animation ) |
| 1854 |
); |
| 1855 |
//phpcs:ignore |
| 1856 |
echo $output; |
| 1857 |
} |
| 1858 |
|
| 1859 |
} |
| 1860 |
|