icon-box.php
1947 lines
| 1 | <?php |
| 2 | namespace Elementor; |
| 3 | |
| 4 | use \Elementor\ElementsKit_Widget_Icon_Box_Handler as Handler; |
| 5 | use \ElementsKit_Lite\Modules\Controls\Controls_Manager as ElementsKit_Controls_Manager; |
| 6 | |
| 7 | if ( ! defined( 'ABSPATH' ) ) exit; |
| 8 | |
| 9 | |
| 10 | class ElementsKit_Widget_Icon_Box extends Widget_Base { |
| 11 | use \ElementsKit_Lite\Widgets\Widget_Notice; |
| 12 | |
| 13 | public $base; |
| 14 | |
| 15 | public function get_name() { |
| 16 | return Handler::get_name(); |
| 17 | } |
| 18 | |
| 19 | public function get_title() { |
| 20 | return Handler::get_title(); |
| 21 | } |
| 22 | |
| 23 | public function get_icon() { |
| 24 | return Handler::get_icon(); |
| 25 | } |
| 26 | |
| 27 | public function get_categories() { |
| 28 | return Handler::get_categories(); |
| 29 | } |
| 30 | |
| 31 | public function get_keywords() { |
| 32 | return Handler::get_keywords(); |
| 33 | } |
| 34 | |
| 35 | public function get_help_url() { |
| 36 | return 'https://wpmet.com/doc/icon-box-4/'; |
| 37 | } |
| 38 | |
| 39 | public function get_style_depends() { |
| 40 | return ['ekit-button','ekit-icon-box']; |
| 41 | } |
| 42 | |
| 43 | protected function is_dynamic_content(): bool { |
| 44 | return false; |
| 45 | } |
| 46 | |
| 47 | public function has_widget_inner_wrapper(): bool { |
| 48 | return ! Plugin::$instance->experiments->is_feature_active( 'e_optimized_markup' ); |
| 49 | } |
| 50 | |
| 51 | protected function register_controls() { |
| 52 | |
| 53 | $this->start_controls_section( |
| 54 | 'ekit_icon_box', |
| 55 | [ |
| 56 | 'label' => esc_html__( 'Icon Box', 'elementskit-lite' ), |
| 57 | ] |
| 58 | ); |
| 59 | |
| 60 | $this->add_control( |
| 61 | 'enable_equal_height', |
| 62 | [ |
| 63 | 'label' => esc_html__( 'Equal Height?', 'elementskit-lite' ), |
| 64 | 'type' => Controls_Manager::SELECT, |
| 65 | 'options' => [ |
| 66 | 'enable' => esc_html__( 'Enable', 'elementskit-lite' ), |
| 67 | 'disable' => esc_html__( 'Disable', 'elementskit-lite' ), |
| 68 | ], |
| 69 | 'default' => 'disable', |
| 70 | 'prefix_class' => 'ekit-equal-height-', |
| 71 | // TODO: Remove this line `{{WRAPPER}}.ekit-equal-height-enable > div` condition after the `Optimized Markup` feature is stable |
| 72 | 'selectors' => [ |
| 73 | '{{WRAPPER}}.ekit-equal-height-enable, |
| 74 | {{WRAPPER}}.ekit-equal-height-enable > div, |
| 75 | {{WRAPPER}}.ekit-equal-height-enable .ekit-wid-con, |
| 76 | {{WRAPPER}}.ekit-equal-height-enable .ekit-wid-con .elementskit-infobox' => 'height: 100%;', |
| 77 | ], |
| 78 | ] |
| 79 | ); |
| 80 | |
| 81 | $this->add_control( |
| 82 | 'ekit_icon_box_enable_header_icon', [ |
| 83 | 'label' => esc_html__( 'Icon Type', 'elementskit-lite' ), |
| 84 | 'type' => Controls_Manager::CHOOSE, |
| 85 | 'label_block' => false, |
| 86 | 'options' => [ |
| 87 | 'none' => [ |
| 88 | 'title' => esc_html__( 'None', 'elementskit-lite' ), |
| 89 | 'icon' => 'fa fa-ban', |
| 90 | ], |
| 91 | 'icon' => [ |
| 92 | 'title' => esc_html__( 'Icon', 'elementskit-lite' ), |
| 93 | 'icon' => 'fa fa-paint-brush', |
| 94 | ], |
| 95 | 'image' => [ |
| 96 | 'title' => esc_html__( 'Image', 'elementskit-lite' ), |
| 97 | 'icon' => 'fa fa-image', |
| 98 | ], |
| 99 | ], |
| 100 | 'default' => 'icon', |
| 101 | ] |
| 102 | ); |
| 103 | |
| 104 | $this->add_control( |
| 105 | 'ekit_icon_box_header_icons__switch', |
| 106 | [ |
| 107 | 'label' => esc_html__('Add icon? ', 'elementskit-lite'), |
| 108 | 'type' => Controls_Manager::SWITCHER, |
| 109 | 'default' => 'yes', |
| 110 | 'label_on' =>esc_html__( 'Yes', 'elementskit-lite' ), |
| 111 | 'label_off' =>esc_html__( 'No', 'elementskit-lite' ), |
| 112 | 'condition' => [ |
| 113 | 'ekit_icon_box_enable_header_icon!' => 'none', |
| 114 | ] |
| 115 | ] |
| 116 | ); |
| 117 | |
| 118 | $this->add_control( |
| 119 | 'ekit_icon_box_header_icons', |
| 120 | [ |
| 121 | 'label' => esc_html__( 'Header Icon', 'elementskit-lite' ), |
| 122 | 'type' => Controls_Manager::ICONS, |
| 123 | 'fa4compatibility' => 'ekit_icon_box_header_icon', |
| 124 | 'default' => [ |
| 125 | 'value' => 'icon icon-review', |
| 126 | 'library' => 'ekiticons', |
| 127 | ], |
| 128 | 'label_block' => true, |
| 129 | 'condition' => [ |
| 130 | 'ekit_icon_box_enable_header_icon' => 'icon', |
| 131 | 'ekit_icon_box_header_icons__switch' => 'yes' |
| 132 | ] |
| 133 | ] |
| 134 | ); |
| 135 | |
| 136 | $this->add_control( |
| 137 | 'ekit_icon_box_header_image', |
| 138 | [ |
| 139 | 'label' => esc_html__( 'Choose Image', 'elementskit-lite' ), |
| 140 | 'type' => Controls_Manager::MEDIA, |
| 141 | 'default' => [ |
| 142 | 'url' => Utils::get_placeholder_image_src(), |
| 143 | 'id' => -1 |
| 144 | ], |
| 145 | 'dynamic' => [ |
| 146 | 'active' => true, |
| 147 | ], |
| 148 | 'condition' => [ |
| 149 | 'ekit_icon_box_enable_header_icon' => 'image', |
| 150 | ] |
| 151 | ] |
| 152 | ); |
| 153 | |
| 154 | $this->add_control( |
| 155 | 'ekit_icon_box_title_text', |
| 156 | [ |
| 157 | 'label' => esc_html__( 'Title ', 'elementskit-lite' ), |
| 158 | 'type' => Controls_Manager::TEXT, |
| 159 | 'dynamic' => [ |
| 160 | 'active' => true, |
| 161 | ], |
| 162 | 'default' => esc_html__( 'Strategy and Planning', 'elementskit-lite' ), |
| 163 | 'placeholder' => esc_html__( 'Enter your title', 'elementskit-lite' ), |
| 164 | 'label_block' => true, |
| 165 | 'separator' => 'before', |
| 166 | ] |
| 167 | ); |
| 168 | |
| 169 | $this->add_control( |
| 170 | 'ekit_icon_box_description_text', |
| 171 | [ |
| 172 | 'label' => esc_html__( 'Content', 'elementskit-lite' ), |
| 173 | 'type' => Controls_Manager::TEXTAREA, |
| 174 | 'dynamic' => [ |
| 175 | 'active' => true, |
| 176 | ], |
| 177 | 'default' => esc_html__( 'We bring the right people together to challenge established thinking and drive transform in 2020', 'elementskit-lite' ), |
| 178 | 'placeholder' => esc_html__( 'Enter your description', 'elementskit-lite' ), |
| 179 | 'separator' => 'none', |
| 180 | 'rows' => 10, |
| 181 | 'show_label' => false, |
| 182 | ] |
| 183 | ); |
| 184 | |
| 185 | $this->end_controls_section(); |
| 186 | |
| 187 | // Section Button |
| 188 | |
| 189 | $this->start_controls_section( |
| 190 | 'ekit_icon_box_section_button', |
| 191 | [ |
| 192 | 'label' => esc_html__( 'Read More', 'elementskit-lite' ), |
| 193 | ] |
| 194 | ); |
| 195 | $this->add_control( |
| 196 | 'ekit_icon_box_enable_btn', |
| 197 | [ |
| 198 | 'label' => esc_html__( 'Enable Button', 'elementskit-lite' ), |
| 199 | 'type' => Controls_Manager::SWITCHER, |
| 200 | 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ), |
| 201 | 'label_off' => esc_html__( 'No', 'elementskit-lite' ), |
| 202 | 'return_value' => 'yes', |
| 203 | 'default' => 'no', |
| 204 | 'separator' => 'before', |
| 205 | ] |
| 206 | ); |
| 207 | $this->add_control( |
| 208 | 'ekit_icon_box_enable_hover_btn', |
| 209 | [ |
| 210 | 'label' => esc_html__( 'Enable Button on Hover', 'elementskit-lite' ), |
| 211 | 'type' => Controls_Manager::SWITCHER, |
| 212 | 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ), |
| 213 | 'label_off' => esc_html__( 'No', 'elementskit-lite' ), |
| 214 | 'return_value' => 'yes', |
| 215 | 'default' => 'no', |
| 216 | 'separator' => 'before', |
| 217 | 'condition' => [ |
| 218 | 'ekit_icon_box_enable_btn' => 'yes', |
| 219 | ] |
| 220 | ] |
| 221 | ); |
| 222 | |
| 223 | $this->add_control( |
| 224 | 'ekit_icon_box_btn_text', |
| 225 | [ |
| 226 | 'label' =>esc_html__( 'Label', 'elementskit-lite' ), |
| 227 | 'type' => Controls_Manager::TEXT, |
| 228 | 'default' =>esc_html__( 'Learn more ', 'elementskit-lite' ), |
| 229 | 'placeholder' =>esc_html__( 'Learn more ', 'elementskit-lite' ), |
| 230 | 'dynamic' => array( 'active' => true ), |
| 231 | 'condition' => [ |
| 232 | 'ekit_icon_box_enable_btn' => 'yes', |
| 233 | ] |
| 234 | ] |
| 235 | ); |
| 236 | |
| 237 | |
| 238 | $this->add_control( |
| 239 | 'ekit_icon_box_btn_url', |
| 240 | [ |
| 241 | 'label' =>esc_html__( 'URL', 'elementskit-lite' ), |
| 242 | 'type' => Controls_Manager::URL, |
| 243 | 'placeholder' =>esc_url('https://wpmet.com'), |
| 244 | 'default' => [ |
| 245 | 'url' => '#', |
| 246 | ], |
| 247 | 'dynamic' => [ |
| 248 | 'active' => true, |
| 249 | ], |
| 250 | 'condition' => [ |
| 251 | 'ekit_icon_box_enable_btn' => 'yes', |
| 252 | ] |
| 253 | ] |
| 254 | ); |
| 255 | |
| 256 | $this->add_control( |
| 257 | 'ekit_icon_box_icons__switch', |
| 258 | [ |
| 259 | 'label' => esc_html__('Add icon? ', 'elementskit-lite'), |
| 260 | 'type' => Controls_Manager::SWITCHER, |
| 261 | 'default' => 'yes', |
| 262 | 'label_on' =>esc_html__( 'Yes', 'elementskit-lite' ), |
| 263 | 'label_off' =>esc_html__( 'No', 'elementskit-lite' ), |
| 264 | 'condition' => [ |
| 265 | 'ekit_icon_box_enable_btn' => 'yes', |
| 266 | ] |
| 267 | ] |
| 268 | ); |
| 269 | |
| 270 | $this->add_control( |
| 271 | 'ekit_icon_box_icons', |
| 272 | [ |
| 273 | 'label' =>esc_html__( 'Icon', 'elementskit-lite' ), |
| 274 | 'type' => Controls_Manager::ICONS, |
| 275 | 'fa4compatibility' => 'ekit_icon_box_icon', |
| 276 | 'default' => [ |
| 277 | 'value' => '', |
| 278 | ], |
| 279 | 'label_block' => true, |
| 280 | 'condition' => [ |
| 281 | 'ekit_icon_box_enable_btn' => 'yes', |
| 282 | 'ekit_icon_box_icons__switch' => 'yes' |
| 283 | ] |
| 284 | ] |
| 285 | ); |
| 286 | $this->add_control( |
| 287 | 'ekit_icon_box_icon_align', |
| 288 | [ |
| 289 | 'label' =>esc_html__( 'Icon Position', 'elementskit-lite' ), |
| 290 | 'type' => Controls_Manager::SELECT, |
| 291 | 'default' => 'left', |
| 292 | 'options' => [ |
| 293 | 'left' =>esc_html__( 'Before', 'elementskit-lite' ), |
| 294 | 'right' =>esc_html__( 'After', 'elementskit-lite' ), |
| 295 | ], |
| 296 | 'condition' => [ |
| 297 | 'ekit_icon_box_icons__switch' => 'yes', |
| 298 | 'ekit_icon_box_enable_btn' => 'yes', |
| 299 | ], |
| 300 | ] |
| 301 | ); |
| 302 | |
| 303 | $this->add_control( |
| 304 | 'ekit_icon_box_show_global_link', |
| 305 | [ |
| 306 | 'label' => esc_html__( 'Global Link', 'elementskit-lite' ), |
| 307 | 'type' => Controls_Manager::SWITCHER, |
| 308 | 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ), |
| 309 | 'label_off' => esc_html__( 'No', 'elementskit-lite' ), |
| 310 | 'return_value' => 'yes', |
| 311 | 'default' => 'yes', |
| 312 | 'condition' => [ |
| 313 | 'ekit_icon_box_enable_btn!' => 'yes', |
| 314 | ], |
| 315 | ] |
| 316 | ); |
| 317 | |
| 318 | $this->add_control( |
| 319 | 'ekit_icon_box_global_link', |
| 320 | [ |
| 321 | 'label' => esc_html__( 'Link', 'elementskit-lite' ), |
| 322 | 'type' => Controls_Manager::URL, |
| 323 | 'placeholder' => esc_html__( 'https://wpmet.com', 'elementskit-lite' ), |
| 324 | 'show_external' => true, |
| 325 | 'default' => [ |
| 326 | 'url' => '#', |
| 327 | ], |
| 328 | 'dynamic' => [ |
| 329 | 'active' => true, |
| 330 | ], |
| 331 | 'condition' => [ |
| 332 | 'ekit_icon_box_show_global_link' => 'yes', |
| 333 | 'ekit_icon_box_enable_btn!' => 'yes', |
| 334 | ], |
| 335 | ] |
| 336 | ); |
| 337 | |
| 338 | $this->end_controls_section(); |
| 339 | |
| 340 | // Settings |
| 341 | $this->start_controls_section( |
| 342 | 'ekit_icon_box_section_settings', |
| 343 | [ |
| 344 | 'label' => esc_html__( 'Settings', 'elementskit-lite' ), |
| 345 | ] |
| 346 | ); |
| 347 | |
| 348 | $this->add_control( |
| 349 | 'ekit_icon_box_enable_water_mark', |
| 350 | [ |
| 351 | 'label' => esc_html__( 'Enable Hover Water Mark ', 'elementskit-lite' ), |
| 352 | 'type' => Controls_Manager::SWITCHER, |
| 353 | 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ), |
| 354 | 'label_off' => esc_html__( 'No', 'elementskit-lite' ), |
| 355 | 'return_value' => 'yes', |
| 356 | 'default' => '', |
| 357 | ] |
| 358 | ); |
| 359 | |
| 360 | $this->add_control( |
| 361 | 'ekit_icon_box_water_mark_icons', |
| 362 | [ |
| 363 | 'label' => esc_html__( 'Social Icons', 'elementskit-lite' ), |
| 364 | 'type' => Controls_Manager::ICONS, |
| 365 | 'fa4compatibility' => 'ekit_icon_box_water_mark_icon', |
| 366 | 'default' => [ |
| 367 | 'value' => 'icon icon-review', |
| 368 | 'library' => 'ekiticons', |
| 369 | ], |
| 370 | 'label_block' => true, |
| 371 | 'condition' => [ |
| 372 | 'ekit_icon_box_enable_water_mark' => 'yes' |
| 373 | ] |
| 374 | ] |
| 375 | ); |
| 376 | |
| 377 | |
| 378 | |
| 379 | $this->add_control( |
| 380 | 'ekit_icon_box_icon_position', |
| 381 | [ |
| 382 | 'label' => esc_html__( 'Icon Position', 'elementskit-lite' ), |
| 383 | 'type' => Controls_Manager::SELECT, |
| 384 | 'default' => 'top', |
| 385 | 'options' => [ |
| 386 | 'top' => esc_html__( 'Top', 'elementskit-lite' ), |
| 387 | 'left' => esc_html__( 'Left', 'elementskit-lite' ), |
| 388 | 'right' => esc_html__( 'Right', 'elementskit-lite' ), |
| 389 | ], |
| 390 | 'separator' => 'before', |
| 391 | 'condition' => [ |
| 392 | 'ekit_icon_box_header_icons__switch' => 'yes', |
| 393 | 'ekit_icon_box_enable_header_icon!' => 'none', |
| 394 | ] |
| 395 | ] |
| 396 | ); |
| 397 | |
| 398 | $this->add_control( |
| 399 | 'ekit_icon_box_text_align_responsive', |
| 400 | [ |
| 401 | 'label' => esc_html__( 'Content Alignment', 'elementskit-lite' ), |
| 402 | 'type' => Controls_Manager::CHOOSE, |
| 403 | 'options' => [ |
| 404 | 'left' => [ |
| 405 | 'title' => esc_html__( 'Left', 'elementskit-lite' ), |
| 406 | 'icon' => 'eicon-text-align-left', |
| 407 | ], |
| 408 | 'center' => [ |
| 409 | 'title' => esc_html__( 'Center', 'elementskit-lite' ), |
| 410 | 'icon' => 'eicon-text-align-center', |
| 411 | ], |
| 412 | 'right' => [ |
| 413 | 'title' => esc_html__( 'Right', 'elementskit-lite' ), |
| 414 | 'icon' => 'eicon-text-align-right', |
| 415 | ], |
| 416 | ], |
| 417 | 'toggle' => true, |
| 418 | 'separator' => 'before', |
| 419 | ] |
| 420 | ); |
| 421 | $this->add_control( |
| 422 | 'ekit_icon_box_title_size', |
| 423 | [ |
| 424 | 'label' => esc_html__( 'Title HTML Tag', 'elementskit-lite' ), |
| 425 | 'type' => Controls_Manager::SELECT, |
| 426 | 'options' => [ |
| 427 | 'h1' => 'H1', |
| 428 | 'h2' => 'H2', |
| 429 | 'h3' => 'H3', |
| 430 | 'h4' => 'H4', |
| 431 | 'h5' => 'H5', |
| 432 | 'h6' => 'H6', |
| 433 | 'div' => 'div', |
| 434 | 'span' => 'span', |
| 435 | 'p' => 'p', |
| 436 | ], |
| 437 | 'default' => 'h3', |
| 438 | 'separator' => 'before', |
| 439 | ] |
| 440 | ); |
| 441 | $this->end_controls_section(); |
| 442 | |
| 443 | $this->start_controls_section( |
| 444 | 'ekit_icon_box_badge_control_tab', |
| 445 | [ |
| 446 | 'label' => esc_html__( 'Badge', 'elementskit-lite' ), |
| 447 | 'tab' => Controls_Manager::TAB_CONTENT, |
| 448 | ] |
| 449 | ); |
| 450 | |
| 451 | $this->add_control( |
| 452 | 'ekit_icon_box_badge_control', |
| 453 | [ |
| 454 | 'label' => esc_html__( 'Show Badge', 'elementskit-lite' ), |
| 455 | 'type' => Controls_Manager::SWITCHER, |
| 456 | 'label_on' => esc_html__( 'Show', 'elementskit-lite' ), |
| 457 | 'label_off' => esc_html__( 'Hide', 'elementskit-lite' ), |
| 458 | 'return_value' => 'yes', |
| 459 | 'default' => 'no', |
| 460 | ] |
| 461 | ); |
| 462 | $this->add_control( |
| 463 | 'ekit_icon_box_badge_title', |
| 464 | [ |
| 465 | 'label' => esc_html__( 'Title', 'elementskit-lite' ), |
| 466 | 'type' => Controls_Manager::TEXT, |
| 467 | 'dynamic' => [ |
| 468 | 'active' => true, |
| 469 | ], |
| 470 | 'default' => esc_html__( 'EXCLUSIVE', 'elementskit-lite' ), |
| 471 | 'placeholder' => esc_html__( 'Type your title here', 'elementskit-lite' ), |
| 472 | 'condition' => [ |
| 473 | 'ekit_icon_box_badge_control' => 'yes' |
| 474 | ] |
| 475 | ] |
| 476 | ); |
| 477 | |
| 478 | $this->add_control( |
| 479 | 'ekit_icon_box_badge_position', |
| 480 | [ |
| 481 | 'label' => esc_html__( 'Position', 'elementskit-lite' ), |
| 482 | 'type' => Controls_Manager::SELECT, |
| 483 | 'default' => 'top_left', |
| 484 | 'options' => [ |
| 485 | 'top_left' => esc_html__( 'Top Left', 'elementskit-lite' ), |
| 486 | 'top_center' => esc_html__( 'Top Center', 'elementskit-lite' ), |
| 487 | 'top_right' => esc_html__( 'Top Right', 'elementskit-lite' ), |
| 488 | 'center_left' => esc_html__( 'Center Left', 'elementskit-lite' ), |
| 489 | 'center_right' => esc_html__( 'Center Right', 'elementskit-lite' ), |
| 490 | 'bottom_left' => esc_html__( 'Bottom Left', 'elementskit-lite' ), |
| 491 | 'bottom_center' => esc_html__( 'Bottom Center', 'elementskit-lite' ), |
| 492 | 'bottom_right' => esc_html__( 'Bottom Right', 'elementskit-lite' ), |
| 493 | 'custom' => esc_html__( 'Custom', 'elementskit-lite' ), |
| 494 | ], |
| 495 | 'condition' => [ |
| 496 | 'ekit_icon_box_badge_control' => 'yes' |
| 497 | ] |
| 498 | ] |
| 499 | ); |
| 500 | |
| 501 | $this->add_responsive_control( |
| 502 | 'badge_arrow_horizontal_position', |
| 503 | [ |
| 504 | 'label' => esc_html__( 'Horizontal Position', 'elementskit-lite' ), |
| 505 | 'type' => Controls_Manager::SLIDER, |
| 506 | 'size_units' => [ 'px', '%' ], |
| 507 | 'range' => [ |
| 508 | 'px' => [ |
| 509 | 'min' => -1000, |
| 510 | 'max' => 1000, |
| 511 | 'step' => 1, |
| 512 | ], |
| 513 | '%' => [ |
| 514 | 'min' => -1000, |
| 515 | 'max' => 1000, |
| 516 | ], |
| 517 | ], |
| 518 | 'desktop_default' => [ |
| 519 | 'size' => 0, |
| 520 | 'unit' => 'px', |
| 521 | ], |
| 522 | 'selectors' => [ |
| 523 | '{{WRAPPER}} .ekit-wid-con .ekit-icon-box-badge' => 'left: {{SIZE}}{{UNIT}};', |
| 524 | ], |
| 525 | 'condition' => [ |
| 526 | 'ekit_icon_box_badge_position' => 'custom' |
| 527 | ] |
| 528 | ] |
| 529 | ); |
| 530 | |
| 531 | $this->add_responsive_control( |
| 532 | 'badge_arrow_horizontal_position_vertial', |
| 533 | [ |
| 534 | 'label' => esc_html__( 'Vertical Position', 'elementskit-lite' ), |
| 535 | 'type' => Controls_Manager::SLIDER, |
| 536 | 'size_units' => [ 'px', '%' ], |
| 537 | 'range' => [ |
| 538 | 'px' => [ |
| 539 | 'min' => -1000, |
| 540 | 'max' => 1000, |
| 541 | 'step' => 1, |
| 542 | ], |
| 543 | '%' => [ |
| 544 | 'min' => -1000, |
| 545 | 'max' => 1000, |
| 546 | ], |
| 547 | ], |
| 548 | 'desktop_default' => [ |
| 549 | 'size' => 0, |
| 550 | 'unit' => 'px', |
| 551 | ], |
| 552 | 'selectors' => [ |
| 553 | '{{WRAPPER}} .ekit-wid-con .ekit-icon-box-badge' => 'top: {{SIZE}}{{UNIT}};', |
| 554 | ], |
| 555 | 'condition' => [ |
| 556 | 'ekit_icon_box_badge_position' => 'custom' |
| 557 | ] |
| 558 | ] |
| 559 | ); |
| 560 | |
| 561 | $this->end_controls_section(); |
| 562 | |
| 563 | // start style for Icon Box Container |
| 564 | $this->start_controls_section( |
| 565 | 'ekit_icon_box_section_background_style', |
| 566 | [ |
| 567 | 'label' => esc_html__( 'Icon Box Container', 'elementskit-lite' ), |
| 568 | 'tab' => controls_Manager::TAB_STYLE, |
| 569 | ] |
| 570 | ); |
| 571 | $this->start_controls_tabs('ekit_icon_box_style_background_tab'); |
| 572 | $this->start_controls_tab( |
| 573 | 'ekit_icon_box_section_background_style_n_tab', |
| 574 | [ |
| 575 | 'label' => esc_html__( 'Normal', 'elementskit-lite' ), |
| 576 | ] |
| 577 | ); |
| 578 | $this->add_group_control( |
| 579 | Group_Control_Background::get_type(), |
| 580 | [ |
| 581 | 'name' => 'ekit_icon_box_infobox_bg_group', |
| 582 | 'label' => esc_html__( 'Background', 'elementskit-lite' ), |
| 583 | 'types' => [ 'classic', 'gradient', 'video' ], |
| 584 | 'selector' => '{{WRAPPER}} .elementskit-infobox', |
| 585 | ] |
| 586 | ); |
| 587 | $this->add_responsive_control( |
| 588 | 'ekit_icon_box_infobox_bg_padding', |
| 589 | [ |
| 590 | 'label' => esc_html__( 'Padding', 'elementskit-lite' ), |
| 591 | 'type' => Controls_Manager::DIMENSIONS, |
| 592 | 'size_units' => [ 'px', '%', 'em' ], |
| 593 | 'default' => [ |
| 594 | 'top' => '50', |
| 595 | 'right' => '40', |
| 596 | 'bottom' => '50', |
| 597 | 'left' => '40', |
| 598 | 'unit' => 'px', |
| 599 | ], |
| 600 | 'selectors' => [ |
| 601 | '{{WRAPPER}} .elementskit-infobox' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 602 | ], |
| 603 | ] |
| 604 | ); |
| 605 | $this->add_group_control( |
| 606 | Group_Control_Box_Shadow::get_type(), |
| 607 | [ |
| 608 | 'name' => 'ekit_icon_box_infobox_box_shadow_group', |
| 609 | 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ), |
| 610 | 'selector' => '{{WRAPPER}} .elementskit-infobox', |
| 611 | ] |
| 612 | ); |
| 613 | $this->add_group_control( |
| 614 | Group_Control_Border::get_type(), |
| 615 | [ |
| 616 | 'name' => 'ekit_icon_box_iocnbox_border_group', |
| 617 | 'label' => esc_html__( 'Border', 'elementskit-lite' ), |
| 618 | 'selector' => '{{WRAPPER}} .elementskit-infobox', |
| 619 | 'fields_options' => [ |
| 620 | 'border' => [ |
| 621 | 'default' => 'solid', |
| 622 | ], |
| 623 | 'size_units' => ['px'], |
| 624 | 'width' => [ |
| 625 | 'default' => [ |
| 626 | 'top' => '1', |
| 627 | 'right' => '1', |
| 628 | 'bottom' => '1', |
| 629 | 'left' => '1', |
| 630 | ], |
| 631 | ], |
| 632 | 'color' => [ |
| 633 | 'default' => '#f5f5f5', |
| 634 | ] |
| 635 | ] |
| 636 | ] |
| 637 | ); |
| 638 | $this->add_responsive_control( |
| 639 | 'ekit_icon_box_infobox_border_radious', |
| 640 | [ |
| 641 | 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ), |
| 642 | 'type' => Controls_Manager::DIMENSIONS, |
| 643 | 'size_units' => [ 'px', '%', 'em' ], |
| 644 | 'default' => [ |
| 645 | 'top' => '5', |
| 646 | 'right' => '5', |
| 647 | 'bottom' => '5', |
| 648 | 'left' => '5', |
| 649 | 'unit' => 'px', |
| 650 | ], |
| 651 | 'selectors' => [ |
| 652 | '{{WRAPPER}} .elementskit-infobox' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 653 | ], |
| 654 | ] |
| 655 | ); |
| 656 | $this->end_controls_tab(); |
| 657 | $this->start_controls_tab( |
| 658 | 'ekit_icon_box_section_background_style_n_hv_tab', |
| 659 | [ |
| 660 | 'label' => esc_html__( 'Hover', 'elementskit-lite' ), |
| 661 | ] |
| 662 | ); |
| 663 | $this->add_group_control( |
| 664 | Group_Control_Background::get_type(), |
| 665 | [ |
| 666 | 'name' => 'ekit_icon_box_infobox_bg_hover_group', |
| 667 | 'label' => esc_html__( 'Background', 'elementskit-lite' ), |
| 668 | 'types' => [ 'classic', 'gradient', 'video' ], |
| 669 | 'selector' => '{{WRAPPER}} .elementskit-infobox:hover', |
| 670 | ] |
| 671 | ); |
| 672 | $this->add_responsive_control( |
| 673 | 'ekit_icon_box_infobox_bg_padding_inner', |
| 674 | [ |
| 675 | 'label' => esc_html__( 'Padding', 'elementskit-lite' ), |
| 676 | 'type' => Controls_Manager::DIMENSIONS, |
| 677 | 'size_units' => [ 'px', '%', 'em' ], |
| 678 | |
| 679 | 'selectors' => [ |
| 680 | '{{WRAPPER}} .elementskit-infobox:hover' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 681 | ], |
| 682 | ] |
| 683 | ); |
| 684 | |
| 685 | $this->add_group_control( |
| 686 | Group_Control_Box_Shadow::get_type(), |
| 687 | [ |
| 688 | 'name' => 'ekit_icon_box_infobox_box_shadow_hv_group', |
| 689 | 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ), |
| 690 | 'selector' => '{{WRAPPER}} .elementskit-infobox:hover', |
| 691 | ] |
| 692 | ); |
| 693 | $this->add_group_control( |
| 694 | Group_Control_Border::get_type(), |
| 695 | [ |
| 696 | 'name' => 'ekit_icon_box_icon_box_border_hv_group', |
| 697 | 'label' => esc_html__( 'Border', 'elementskit-lite' ), |
| 698 | 'selector' => '{{WRAPPER}} .elementskit-infobox:hover', |
| 699 | ] |
| 700 | ); |
| 701 | $this->add_responsive_control( |
| 702 | 'ekit_icon_box_infobox_border_radious_hv', |
| 703 | [ |
| 704 | 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ), |
| 705 | 'type' => Controls_Manager::DIMENSIONS, |
| 706 | 'size_units' => [ 'px', '%', 'em' ], |
| 707 | 'selectors' => [ |
| 708 | '{{WRAPPER}} .elementskit-infobox:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 709 | ], |
| 710 | ] |
| 711 | ); |
| 712 | $this->add_control( |
| 713 | 'ekit_icon_box_info_box_hover_animation', |
| 714 | [ |
| 715 | 'label' => esc_html__( 'Hover Animation', 'elementskit-lite' ), |
| 716 | 'type' => Controls_Manager::HOVER_ANIMATION, |
| 717 | ] |
| 718 | ); |
| 719 | $this->end_controls_tab(); |
| 720 | $this->end_controls_tabs(); |
| 721 | $this->end_controls_section(); |
| 722 | |
| 723 | // start content style |
| 724 | $this->start_controls_section( |
| 725 | 'ekit_icon_section_style_content', |
| 726 | [ |
| 727 | 'label' => esc_html__( 'Content', 'elementskit-lite' ), |
| 728 | 'tab' => Controls_Manager::TAB_STYLE, |
| 729 | ] |
| 730 | ); |
| 731 | |
| 732 | $this->add_responsive_control( |
| 733 | 'ekit_icon_box_content_valign', |
| 734 | [ |
| 735 | 'label' => esc_html__( 'Vertical Alignment', 'elementskit-lite' ), |
| 736 | 'type' => Controls_Manager::CHOOSE, |
| 737 | 'options' => [ |
| 738 | 'top' => [ |
| 739 | 'title' => __( 'Top', 'elementskit-lite' ), |
| 740 | 'icon' => 'eicon-v-align-top', |
| 741 | ], |
| 742 | 'middle' => [ |
| 743 | 'title' => __( 'Middle', 'elementskit-lite' ), |
| 744 | 'icon' => 'eicon-v-align-middle', |
| 745 | ], |
| 746 | 'bottom' => [ |
| 747 | 'title' => __( 'Bottom', 'elementskit-lite' ), |
| 748 | 'icon' => 'eicon-v-align-bottom', |
| 749 | ], |
| 750 | ], |
| 751 | 'selectors_dictionary' => [ |
| 752 | 'top' => '-webkit-box-align: start; -ms-flex-align: start; -ms-grid-row-align: flex-start; align-items: flex-start;', |
| 753 | 'middle' => '-webkit-box-align: center; -ms-flex-align: center; -ms-grid-row-align: center; align-items: center;', |
| 754 | 'bottom' => '-webkit-box-align: end; -ms-flex-align: end; -ms-grid-row-align: flex-end; align-items: flex-end;', |
| 755 | ], |
| 756 | 'selectors' => [ |
| 757 | '{{WRAPPER}} .elementskit-infobox' => '{{VALUE}}', |
| 758 | ], |
| 759 | 'separator' => 'after', |
| 760 | 'condition' => [ |
| 761 | 'ekit_icon_box_header_icons__switch' => 'yes', |
| 762 | 'ekit_icon_box_icon_position' => ['left', 'right'], |
| 763 | ], |
| 764 | ] |
| 765 | ); |
| 766 | |
| 767 | $this->add_control( |
| 768 | 'ekit_icon_heading_title', |
| 769 | [ |
| 770 | 'label' => esc_html__( 'Title', 'elementskit-lite' ), |
| 771 | 'type' => Controls_Manager::HEADING, |
| 772 | ] |
| 773 | ); |
| 774 | |
| 775 | $this->add_responsive_control( |
| 776 | 'ekit_icon_title_bottom_space', |
| 777 | [ |
| 778 | 'label' => esc_html__( 'Margin', 'elementskit-lite' ), |
| 779 | 'type' => Controls_Manager::DIMENSIONS, |
| 780 | 'size_units' => [ 'px', '%', 'em' ], |
| 781 | 'selectors' => [ |
| 782 | '{{WRAPPER}} .elementskit-infobox .elementskit-info-box-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 783 | ], |
| 784 | 'default'=>[ |
| 785 | 'unit' => 'px', |
| 786 | 'size' => '20', |
| 787 | ], |
| 788 | ] |
| 789 | ); |
| 790 | |
| 791 | $this->add_responsive_control( |
| 792 | 'ekit_icon_title_padding', |
| 793 | [ |
| 794 | 'label' => esc_html__( 'Padding', 'elementskit-lite' ), |
| 795 | 'type' => Controls_Manager::DIMENSIONS, |
| 796 | 'size_units' => [ 'px', '%', 'em' ], |
| 797 | 'selectors' => [ |
| 798 | '{{WRAPPER}} .elementskit-infobox .elementskit-info-box-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 799 | ], |
| 800 | 'default' => [ |
| 801 | 'top' => '0', |
| 802 | 'right' => '0', |
| 803 | 'bottom' => '0', |
| 804 | 'left' => '0', |
| 805 | 'unit' => 'px', |
| 806 | 'isLinked' => '', |
| 807 | ], |
| 808 | ] |
| 809 | ); |
| 810 | |
| 811 | $this->add_control( |
| 812 | 'ekit_icon_title_color', |
| 813 | [ |
| 814 | 'label' => esc_html__( 'Color', 'elementskit-lite' ), |
| 815 | 'type' => Controls_Manager::COLOR, |
| 816 | 'default' => '#000000', |
| 817 | 'selectors' => [ |
| 818 | '{{WRAPPER}} .elementskit-infobox .elementskit-info-box-title' => 'color: {{VALUE}};', |
| 819 | ], |
| 820 | ] |
| 821 | ); |
| 822 | $this->add_control( |
| 823 | 'ekit_icon_title_color_hover', |
| 824 | [ |
| 825 | 'label' => esc_html__( 'Color Hover', 'elementskit-lite' ), |
| 826 | 'type' => Controls_Manager::COLOR, |
| 827 | 'default' => '#000000', |
| 828 | 'selectors' => [ |
| 829 | '{{WRAPPER}} .elementskit-infobox:hover .elementskit-info-box-title' => 'color: {{VALUE}};', |
| 830 | ], |
| 831 | ] |
| 832 | ); |
| 833 | |
| 834 | $this->add_group_control( |
| 835 | Group_Control_Typography::get_type(), |
| 836 | [ |
| 837 | 'name' => 'ekit_icon_title_typography_group', |
| 838 | 'selector' => '{{WRAPPER}} .elementskit-infobox .elementskit-info-box-title', |
| 839 | ] |
| 840 | ); |
| 841 | |
| 842 | $this->add_control( |
| 843 | 'ekit_icon_heading_description', |
| 844 | [ |
| 845 | 'label' => esc_html__( 'Description', 'elementskit-lite' ), |
| 846 | 'type' => Controls_Manager::HEADING, |
| 847 | 'separator' => 'before', |
| 848 | ] |
| 849 | ); |
| 850 | |
| 851 | $this->add_control( |
| 852 | 'ekit_icon_description_color', |
| 853 | [ |
| 854 | 'label' => esc_html__( 'Color', 'elementskit-lite' ), |
| 855 | 'type' => Controls_Manager::COLOR, |
| 856 | 'default' => '#656565', |
| 857 | 'selectors' => [ |
| 858 | '{{WRAPPER}} .elementskit-infobox .box-body > p' => 'color: {{VALUE}};', |
| 859 | ], |
| 860 | ] |
| 861 | ); |
| 862 | $this->add_control( |
| 863 | 'ekit_icon_description_color_hover', |
| 864 | [ |
| 865 | 'label' => esc_html__( 'Color Hover as', 'elementskit-lite' ), |
| 866 | 'type' => Controls_Manager::COLOR, |
| 867 | 'default' => '#656565', |
| 868 | 'selectors' => [ |
| 869 | '{{WRAPPER}} .elementskit-infobox:hover .box-body > p' => 'color: {{VALUE}};', |
| 870 | ], |
| 871 | ] |
| 872 | ); |
| 873 | |
| 874 | $this->add_group_control( |
| 875 | Group_Control_Typography::get_type(), |
| 876 | [ |
| 877 | 'name' => 'ekit_icon_description_typography_group', |
| 878 | 'selector' => '{{WRAPPER}} .elementskit-infobox .box-body > p', |
| 879 | ] |
| 880 | ); |
| 881 | |
| 882 | |
| 883 | $this->add_responsive_control( |
| 884 | 'ekit_icon_box_margin', |
| 885 | [ |
| 886 | 'label' => esc_html__( 'Margin', 'elementskit-lite' ), |
| 887 | 'type' => Controls_Manager::DIMENSIONS, |
| 888 | 'size_units' => [ 'px', '%', 'em' ], |
| 889 | 'selectors' => [ |
| 890 | '{{WRAPPER}} .elementskit-infobox p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 891 | ], |
| 892 | 'default' => [ |
| 893 | 'size' => 15, |
| 894 | 'unit' => 'px', |
| 895 | ], |
| 896 | ] |
| 897 | ); |
| 898 | |
| 899 | $this->add_control( |
| 900 | 'ekit_icon_box_watermark', |
| 901 | [ |
| 902 | 'label' => esc_html__( 'Water Mark', 'elementskit-lite' ), |
| 903 | 'type' => Controls_Manager::HEADING, |
| 904 | 'separator' => 'before', |
| 905 | 'condition' => [ |
| 906 | 'ekit_icon_box_enable_water_mark' => 'yes', |
| 907 | ] |
| 908 | ] |
| 909 | ); |
| 910 | |
| 911 | $this->add_control( |
| 912 | 'ekit_icon_box_watermark_color', |
| 913 | [ |
| 914 | 'label' => esc_html__( 'Water Mark Color', 'elementskit-lite' ), |
| 915 | 'type' => Controls_Manager::COLOR, |
| 916 | 'default' => '#000000', |
| 917 | 'selectors' => [ |
| 918 | '{{WRAPPER}} .elementskit-infobox .icon-hover' => 'color: {{VALUE}};fill: {{VALUE}};', |
| 919 | ], |
| 920 | 'condition' => [ |
| 921 | 'ekit_icon_box_enable_water_mark' => 'yes', |
| 922 | ] |
| 923 | ] |
| 924 | ); |
| 925 | |
| 926 | $this->add_responsive_control( |
| 927 | 'ekit_icon_box_watermark_font_size', |
| 928 | [ |
| 929 | 'label' => esc_html__( 'Water Mark Font Size', 'elementskit-lite' ), |
| 930 | 'type' => Controls_Manager::SLIDER, |
| 931 | 'size_units' => [ 'px' ], |
| 932 | 'range' => [ |
| 933 | 'px' => [ |
| 934 | 'min' => 0, |
| 935 | 'max' => 1000, |
| 936 | 'step' => 1, |
| 937 | ], |
| 938 | ], |
| 939 | 'default' => [ |
| 940 | 'unit' => 'px', |
| 941 | 'size' => 100, |
| 942 | ], |
| 943 | 'selectors' => [ |
| 944 | '{{WRAPPER}} .elementskit-infobox .icon-hover > :is(i, svg)' => 'font-size: {{SIZE}}{{UNIT}};', |
| 945 | ], |
| 946 | 'condition' => [ |
| 947 | 'ekit_icon_box_enable_water_mark' => 'yes', |
| 948 | ] |
| 949 | ] |
| 950 | ); |
| 951 | |
| 952 | $this->end_controls_section(); |
| 953 | |
| 954 | // Icon style |
| 955 | $this->start_controls_section( |
| 956 | 'ekit_icon_box_section_style_icon', |
| 957 | [ |
| 958 | 'label' => esc_html__( 'Icon', 'elementskit-lite' ), |
| 959 | 'tab' => Controls_Manager::TAB_STYLE, |
| 960 | 'condition' => [ |
| 961 | 'ekit_icon_box_enable_header_icon!' => 'none', |
| 962 | 'ekit_icon_box_header_icons__switch' => 'yes' |
| 963 | ] |
| 964 | ] |
| 965 | ); |
| 966 | |
| 967 | $this->start_controls_tabs( 'ekit_icon_box_icon_colors' ); |
| 968 | |
| 969 | $this->start_controls_tab( |
| 970 | 'ekit_icon_box_icon_colors_normal', |
| 971 | [ |
| 972 | 'label' => esc_html__( 'Normal', 'elementskit-lite' ), |
| 973 | ] |
| 974 | ); |
| 975 | |
| 976 | $this->add_control( |
| 977 | 'ekit_icon_box_icon_primary_color', |
| 978 | [ |
| 979 | 'label' => esc_html__( 'Icon Color', 'elementskit-lite' ), |
| 980 | 'type' => Controls_Manager::COLOR, |
| 981 | 'default' => '#656565', |
| 982 | 'selectors' => [ |
| 983 | '{{WRAPPER}} .elementskit-info-box-icon' => 'color: {{VALUE}};fill: {{VALUE}};', |
| 984 | ], |
| 985 | 'condition' => [ |
| 986 | 'ekit_icon_box_enable_header_icon' => 'icon' |
| 987 | ] |
| 988 | ] |
| 989 | ); |
| 990 | |
| 991 | $this->add_control( |
| 992 | 'ekit_icon_box_icon_secondary_color_normal', |
| 993 | [ |
| 994 | 'label' => esc_html__( 'Icon BG Color', 'elementskit-lite' ), |
| 995 | 'type' => Controls_Manager::COLOR, |
| 996 | 'default' => '', |
| 997 | 'selectors' => [ |
| 998 | '{{WRAPPER}} .elementskit-info-box-icon' => 'background-color: {{VALUE}};', |
| 999 | ], |
| 1000 | ] |
| 1001 | ); |
| 1002 | |
| 1003 | $this->add_group_control( |
| 1004 | Group_Control_Border::get_type(), |
| 1005 | [ |
| 1006 | 'name' => 'ekit_icon_box_border', |
| 1007 | 'label' => esc_html__( 'Border', 'elementskit-lite' ), |
| 1008 | 'selector' => '{{WRAPPER}} .elementskit-info-box-icon', |
| 1009 | ] |
| 1010 | ); |
| 1011 | |
| 1012 | |
| 1013 | |
| 1014 | $this->add_responsive_control( |
| 1015 | 'ekit_icon_box_icon_border_radius', |
| 1016 | [ |
| 1017 | 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ), |
| 1018 | 'type' => Controls_Manager::DIMENSIONS, |
| 1019 | 'size_units' => [ 'px', '%' ], |
| 1020 | 'selectors' => [ |
| 1021 | '{{WRAPPER}} .elementskit-info-box-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1022 | ], |
| 1023 | ] |
| 1024 | ); |
| 1025 | $this->add_group_control( |
| 1026 | Group_Control_Box_Shadow::get_type(), |
| 1027 | [ |
| 1028 | 'name' => 'ekit_icon_icon_box_shadow_normal_group', |
| 1029 | 'selector' => '{{WRAPPER}} .elementskit-info-box-icon', |
| 1030 | ] |
| 1031 | ); |
| 1032 | $this->end_controls_tab(); |
| 1033 | |
| 1034 | $this->start_controls_tab( |
| 1035 | 'ekit_icon_box_icon_colors_hover', |
| 1036 | [ |
| 1037 | 'label' => esc_html__( 'Hover', 'elementskit-lite' ), |
| 1038 | ] |
| 1039 | ); |
| 1040 | |
| 1041 | $this->add_control( |
| 1042 | 'ekit_icon_box_hover_primary_color', |
| 1043 | [ |
| 1044 | 'label' => esc_html__( 'Icon Hover Color', 'elementskit-lite' ), |
| 1045 | 'type' => Controls_Manager::COLOR, |
| 1046 | 'default' => '', |
| 1047 | 'selectors' => [ |
| 1048 | '{{WRAPPER}} .elementskit-infobox:hover .elementskit-info-box-icon' => 'color: {{VALUE}};fill: {{VALUE}};', |
| 1049 | ], |
| 1050 | 'condition' => [ |
| 1051 | 'ekit_icon_box_enable_header_icon' => 'icon' |
| 1052 | ] |
| 1053 | ] |
| 1054 | ); |
| 1055 | |
| 1056 | $this->add_control( |
| 1057 | 'ekit_icon_box_hover_background_color', |
| 1058 | [ |
| 1059 | 'label' => esc_html__( 'Background Color', 'elementskit-lite' ), |
| 1060 | 'type' => Controls_Manager::COLOR, |
| 1061 | 'default' => '', |
| 1062 | 'selectors' => [ |
| 1063 | '{{WRAPPER}} .elementskit-infobox:hover .elementskit-info-box-icon' => 'background-color: {{VALUE}};', |
| 1064 | ], |
| 1065 | ] |
| 1066 | ); |
| 1067 | |
| 1068 | $this->add_group_control( |
| 1069 | Group_Control_Border::get_type(), |
| 1070 | [ |
| 1071 | 'name' => 'ekit_icon_box_border_icon_group', |
| 1072 | 'label' => esc_html__( 'Border', 'elementskit-lite' ), |
| 1073 | 'selector' => '{{WRAPPER}} .elementskit-infobox:hover .elementskit-info-box-icon', |
| 1074 | ] |
| 1075 | ); |
| 1076 | |
| 1077 | $this->add_control( |
| 1078 | 'ekit_icon_icons_hover_animation', |
| 1079 | [ |
| 1080 | 'label' => esc_html__( 'Hover Animation', 'elementskit-lite' ), |
| 1081 | 'type' => Controls_Manager::HOVER_ANIMATION, |
| 1082 | ] |
| 1083 | ); |
| 1084 | $this->add_responsive_control( |
| 1085 | 'ekit_icon_box_icons_hover_border_radius', |
| 1086 | [ |
| 1087 | 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ), |
| 1088 | 'type' => Controls_Manager::DIMENSIONS, |
| 1089 | 'size_units' => [ 'px', '%' ], |
| 1090 | 'selectors' => [ |
| 1091 | '{{WRAPPER}} .elementskit-infobox:hover .elementskit-info-box-icon' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1092 | ], |
| 1093 | ] |
| 1094 | ); |
| 1095 | $this->add_group_control( |
| 1096 | Group_Control_Box_Shadow::get_type(), |
| 1097 | [ |
| 1098 | 'name' => 'ekit_icon_icon_box_shadow_group', |
| 1099 | 'selector' => '{{WRAPPER}} .elementskit-infobox:hover .elementskit-info-box-icon', |
| 1100 | ] |
| 1101 | ); |
| 1102 | $this->end_controls_tab(); |
| 1103 | |
| 1104 | $this->end_controls_tabs(); |
| 1105 | $this->add_responsive_control( |
| 1106 | 'ekit_icon_icon_size', |
| 1107 | [ |
| 1108 | 'label' => esc_html__( 'Size', 'elementskit-lite' ), |
| 1109 | 'type' => Controls_Manager::SLIDER, |
| 1110 | 'range' => [ |
| 1111 | 'px' => [ |
| 1112 | 'min' => 6, |
| 1113 | 'max' => 300, |
| 1114 | ], |
| 1115 | ], |
| 1116 | 'default' => [ |
| 1117 | 'size' => 40, |
| 1118 | 'unit' => 'px', |
| 1119 | ], |
| 1120 | 'selectors' => [ |
| 1121 | '{{WRAPPER}} .elementskit-infobox .elementskit-info-box-icon' => 'font-size: {{SIZE}}{{UNIT}};', |
| 1122 | ], |
| 1123 | 'separator' => 'before', |
| 1124 | 'condition' => [ |
| 1125 | 'ekit_icon_box_enable_header_icon' => 'icon' |
| 1126 | ] |
| 1127 | ] |
| 1128 | ); |
| 1129 | |
| 1130 | $this->add_responsive_control( |
| 1131 | 'ekit_icon_box_icon_space', |
| 1132 | [ |
| 1133 | 'label' => esc_html__( 'Spacing', 'elementskit-lite' ), |
| 1134 | 'type' => Controls_Manager::DIMENSIONS, |
| 1135 | 'size_units' => [ 'px', '%', 'em' ], |
| 1136 | 'selectors' => [ |
| 1137 | '{{WRAPPER}} .elementskit-infobox .elementskit-box-header .elementskit-info-box-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1138 | ], |
| 1139 | 'default' => [ |
| 1140 | 'top' => '', |
| 1141 | 'right' => '', |
| 1142 | 'bottom' => '', |
| 1143 | 'left' => '', |
| 1144 | 'unit' => 'px', |
| 1145 | 'isLinked' => 'true', |
| 1146 | ] |
| 1147 | ] |
| 1148 | ); |
| 1149 | |
| 1150 | $this->add_responsive_control( |
| 1151 | 'ekit_icon_icon_padding', |
| 1152 | [ |
| 1153 | 'label' => esc_html__( 'Padding', 'elementskit-lite' ), |
| 1154 | 'type' => Controls_Manager::DIMENSIONS, |
| 1155 | 'size_units' => [ 'px', '%', 'em' ], |
| 1156 | 'selectors' => [ |
| 1157 | '{{WRAPPER}} .elementskit-infobox .elementskit-info-box-icon' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1158 | ], |
| 1159 | 'default' => [ |
| 1160 | 'size' => 15, |
| 1161 | 'unit' => 'px', |
| 1162 | ], |
| 1163 | ] |
| 1164 | ); |
| 1165 | |
| 1166 | $this->add_responsive_control( |
| 1167 | 'ekit_icon_rotate', |
| 1168 | [ |
| 1169 | 'label' => esc_html__( 'Rotate', 'elementskit-lite' ), |
| 1170 | 'type' => Controls_Manager::SLIDER, |
| 1171 | 'default' => [ |
| 1172 | 'size' => 0, |
| 1173 | 'unit' => 'deg', |
| 1174 | ], |
| 1175 | 'desktop_default' => [ |
| 1176 | 'unit' => 'deg', |
| 1177 | ], |
| 1178 | 'tablet_default' => [ |
| 1179 | 'unit' => 'deg', |
| 1180 | ], |
| 1181 | 'mobile_default' => [ |
| 1182 | 'unit' => 'deg', |
| 1183 | ], |
| 1184 | 'range' => [ |
| 1185 | 'deg' => [ |
| 1186 | 'min' => 0, |
| 1187 | 'max' => 360, |
| 1188 | 'step' => 1, |
| 1189 | ], |
| 1190 | ], |
| 1191 | 'selectors' => [ |
| 1192 | '{{WRAPPER}} .elementskit-infobox .elementskit-info-box-icon' => 'transform: rotate({{SIZE}}{{UNIT}});', |
| 1193 | ], |
| 1194 | ] |
| 1195 | ); |
| 1196 | |
| 1197 | $this->add_responsive_control( |
| 1198 | 'ekit_icon_box_icon_height', |
| 1199 | [ |
| 1200 | 'label' => esc_html__( 'Height', 'elementskit-lite' ), |
| 1201 | 'type' => Controls_Manager::SLIDER, |
| 1202 | 'range' => [ |
| 1203 | 'px' => [ |
| 1204 | 'min' => 10, |
| 1205 | 'max' => 200, |
| 1206 | ], |
| 1207 | ], |
| 1208 | 'selectors' => [ |
| 1209 | '{{WRAPPER}} .elementskit-infobox .elementskit-info-box-icon ' => 'height: {{SIZE}}{{UNIT}};', |
| 1210 | ], |
| 1211 | |
| 1212 | ] |
| 1213 | ); |
| 1214 | |
| 1215 | $this->add_responsive_control( |
| 1216 | 'ekit_icon_box_icon_width', |
| 1217 | [ |
| 1218 | 'label' => esc_html__( 'Width', 'elementskit-lite' ), |
| 1219 | 'type' => Controls_Manager::SLIDER, |
| 1220 | 'range' => [ |
| 1221 | 'px' => [ |
| 1222 | 'min' => 10, |
| 1223 | 'max' => 200, |
| 1224 | ], |
| 1225 | ], |
| 1226 | 'selectors' => [ |
| 1227 | '{{WRAPPER}} .elementskit-infobox .elementskit-info-box-icon' => 'width: {{SIZE}}{{UNIT}};', |
| 1228 | ], |
| 1229 | |
| 1230 | |
| 1231 | ] |
| 1232 | ); |
| 1233 | |
| 1234 | $this->add_responsive_control( |
| 1235 | 'ekit_icon_box_icon_line_height', |
| 1236 | [ |
| 1237 | 'label' => esc_html__( 'Line Height', 'elementskit-lite' ), |
| 1238 | 'type' => Controls_Manager::SLIDER, |
| 1239 | 'range' => [ |
| 1240 | 'px' => [ |
| 1241 | 'min' => 10, |
| 1242 | 'max' => 200, |
| 1243 | ], |
| 1244 | ], |
| 1245 | 'selectors' => [ |
| 1246 | '{{WRAPPER}} .elementskit-infobox .elementkit-infobox-icon' => 'line-height: {{SIZE}}{{UNIT}};', |
| 1247 | '{{WRAPPER}} .elementskit-infobox .elementskit-info-box-icon' => 'line-height: {{SIZE}}{{UNIT}};', |
| 1248 | ], |
| 1249 | |
| 1250 | ] |
| 1251 | ); |
| 1252 | |
| 1253 | $this->add_responsive_control( |
| 1254 | 'ekit_icon_box_icon_vertical_align', |
| 1255 | [ |
| 1256 | 'label' => esc_html__( 'Vertical Position ', 'elementskit-lite' ), |
| 1257 | 'type' => Controls_Manager::SLIDER, |
| 1258 | 'range' => [ |
| 1259 | 'px' => [ |
| 1260 | 'min' => -200, |
| 1261 | 'max' => 200, |
| 1262 | ], |
| 1263 | ], |
| 1264 | 'selectors' => [ |
| 1265 | '{{WRAPPER}} .elementskit-infobox .elementskit-box-header .elementskit-info-box-icon' => ' -webkit-transform: translateY({{SIZE}}{{UNIT}}); -ms-transform: translateY({{SIZE}}{{UNIT}}); transform: translateY({{SIZE}}{{UNIT}});', |
| 1266 | ], |
| 1267 | 'condition' => [ |
| 1268 | 'ekit_icon_box_icon_position!' => 'top' |
| 1269 | ] |
| 1270 | |
| 1271 | ] |
| 1272 | ); |
| 1273 | $this->end_controls_section(); |
| 1274 | |
| 1275 | // start Button style |
| 1276 | $this->start_controls_section( |
| 1277 | 'ekit_icon_box_section_style', |
| 1278 | [ |
| 1279 | 'label' => esc_html__( 'Button', 'elementskit-lite' ), |
| 1280 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1281 | 'condition' => [ |
| 1282 | 'ekit_icon_box_enable_btn' => 'yes', |
| 1283 | ] |
| 1284 | ] |
| 1285 | ); |
| 1286 | $this->add_responsive_control( |
| 1287 | 'ekit_icon_box_text_padding', |
| 1288 | [ |
| 1289 | 'label' =>esc_html__( 'Padding', 'elementskit-lite' ), |
| 1290 | 'type' => Controls_Manager::DIMENSIONS, |
| 1291 | 'size_units' => [ 'px', 'em', '%' ], |
| 1292 | 'selectors' => [ |
| 1293 | '{{WRAPPER}} .elementskit-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1294 | ], |
| 1295 | ] |
| 1296 | ); |
| 1297 | $this->add_responsive_control( |
| 1298 | 'ekit_icon_box_text_margin', |
| 1299 | [ |
| 1300 | 'label' =>esc_html__( 'Margin', 'elementskit-lite' ), |
| 1301 | 'type' => Controls_Manager::DIMENSIONS, |
| 1302 | 'size_units' => [ 'px', 'em', '%' ], |
| 1303 | 'selectors' => [ |
| 1304 | '{{WRAPPER}} .elementskit-btn' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1305 | ], |
| 1306 | ] |
| 1307 | ); |
| 1308 | |
| 1309 | $this->add_group_control( |
| 1310 | Group_Control_Typography::get_type(), |
| 1311 | [ |
| 1312 | 'name' => 'ekit_icon_box_typography_group', |
| 1313 | 'label' =>esc_html__( 'Typography', 'elementskit-lite' ), |
| 1314 | 'selector' => '{{WRAPPER}} .elementskit-btn', |
| 1315 | ] |
| 1316 | ); |
| 1317 | $this->add_responsive_control( |
| 1318 | 'ekit_icon_box_btn_icon_font_size', |
| 1319 | array( |
| 1320 | 'label' => esc_html__( 'Icon Font Size', 'elementskit-lite' ), |
| 1321 | 'type' => Controls_Manager::SLIDER, |
| 1322 | 'size_units' => array( |
| 1323 | 'px', 'em', 'rem', |
| 1324 | ), |
| 1325 | 'range' => array( |
| 1326 | 'px' => array( |
| 1327 | 'min' => 1, |
| 1328 | 'max' => 100, |
| 1329 | ), |
| 1330 | ), |
| 1331 | 'selectors' => array( |
| 1332 | '{{WRAPPER}} .elementskit-btn i' => 'font-size: {{SIZE}}{{UNIT}};', |
| 1333 | '{{WRAPPER}} .elementskit-btn svg' => 'max-width: {{SIZE}}{{UNIT}};' |
| 1334 | ), |
| 1335 | 'condition' => [ |
| 1336 | 'ekit_icon_box_icons__switch' => 'yes', |
| 1337 | ], |
| 1338 | ) |
| 1339 | ); |
| 1340 | |
| 1341 | $this->add_control( |
| 1342 | 'ekit_icon_box_btn_icon_right_space', |
| 1343 | [ |
| 1344 | 'label' => esc_html__( 'Icon Space', 'elementskit-lite' ), |
| 1345 | 'type' => Controls_Manager::SLIDER, |
| 1346 | 'default' => [ |
| 1347 | 'size' => 5, |
| 1348 | 'unit' => 'px', |
| 1349 | ], |
| 1350 | 'selectors' => [ |
| 1351 | '{{WRAPPER}} .elementskit-btn i' => 'margin-left: {{SIZE}}{{UNIT}};', |
| 1352 | '{{WRAPPER}} .elementskit-btn svg' => 'margin-left: {{SIZE}}{{UNIT}};', |
| 1353 | ], |
| 1354 | 'condition' => [ |
| 1355 | 'ekit_icon_box_icons__switch' => 'yes', |
| 1356 | 'ekit_icon_box_icon_align' => 'right', |
| 1357 | ], |
| 1358 | ] |
| 1359 | ); |
| 1360 | |
| 1361 | $this->add_control( |
| 1362 | 'ekit_icon_box_btn_icon_left_space', |
| 1363 | [ |
| 1364 | 'label' => esc_html__( 'Icon Space', 'elementskit-lite' ), |
| 1365 | 'type' => Controls_Manager::SLIDER, |
| 1366 | 'default' => [ |
| 1367 | 'size' => 5, |
| 1368 | 'unit' => 'px', |
| 1369 | ], |
| 1370 | 'selectors' => [ |
| 1371 | '{{WRAPPER}} .elementskit-btn i' => 'margin-right: {{SIZE}}{{UNIT}};', |
| 1372 | '{{WRAPPER}} .elementskit-btn svg' => 'margin-right: {{SIZE}}{{UNIT}};', |
| 1373 | ], |
| 1374 | 'condition' => [ |
| 1375 | 'ekit_icon_box_icons__switch' => 'yes', |
| 1376 | 'ekit_icon_box_icon_align' => 'left', |
| 1377 | ], |
| 1378 | ] |
| 1379 | ); |
| 1380 | |
| 1381 | $this->start_controls_tabs( 'tabs_button_style' ); |
| 1382 | |
| 1383 | $this->start_controls_tab( |
| 1384 | 'ekit_icon_box_tab_button_normal', |
| 1385 | [ |
| 1386 | 'label' => esc_html__( 'Normal', 'elementskit-lite' ), |
| 1387 | ] |
| 1388 | ); |
| 1389 | |
| 1390 | $this->add_control( |
| 1391 | 'ekit_icon_box_button_text_color', |
| 1392 | [ |
| 1393 | 'label' => esc_html__( 'Text Color', 'elementskit-lite' ), |
| 1394 | 'type' => Controls_Manager::COLOR, |
| 1395 | 'default' => '', |
| 1396 | 'selectors' => [ |
| 1397 | '{{WRAPPER}} .elementskit-btn' => 'color: {{VALUE}};fill: {{VALUE}};', |
| 1398 | ], |
| 1399 | ] |
| 1400 | ); |
| 1401 | |
| 1402 | $this->add_group_control( |
| 1403 | Group_Control_Background::get_type(), |
| 1404 | [ |
| 1405 | 'name' => 'ekit_icon_box_btn_background_group', |
| 1406 | 'label' => esc_html__( 'Background', 'elementskit-lite' ), |
| 1407 | 'types' => [ 'classic', 'gradient' ], |
| 1408 | 'selector' => '{{WRAPPER}} .elementskit-btn', |
| 1409 | ] |
| 1410 | ); |
| 1411 | |
| 1412 | $this->add_group_control( |
| 1413 | Group_Control_Border::get_type(), |
| 1414 | [ |
| 1415 | 'name' => 'ekit_icon_box_button_border_color_group', |
| 1416 | 'label' => esc_html__( 'Border', 'elementskit-lite' ), |
| 1417 | 'selector' => '{{WRAPPER}} .elementskit-btn', |
| 1418 | ] |
| 1419 | ); |
| 1420 | $this->add_responsive_control( |
| 1421 | 'ekit_icon_box_btn_border_radius', |
| 1422 | [ |
| 1423 | 'label' =>esc_html__( 'Border Radius', 'elementskit-lite' ), |
| 1424 | 'type' => Controls_Manager::DIMENSIONS, |
| 1425 | 'size_units' => [ 'px'], |
| 1426 | 'default' => [ |
| 1427 | 'top' => '', |
| 1428 | 'right' => '', |
| 1429 | 'bottom' => '' , |
| 1430 | 'left' => '', |
| 1431 | ], |
| 1432 | 'selectors' => [ |
| 1433 | '{{WRAPPER}} .elementskit-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1434 | ], |
| 1435 | ] |
| 1436 | ); |
| 1437 | $this->add_group_control( |
| 1438 | Group_Control_Box_Shadow::get_type(), |
| 1439 | [ |
| 1440 | 'name' => 'ekit_icon_box_button_box_shadow', |
| 1441 | 'selector' => '{{WRAPPER}} .elementskit-btn', |
| 1442 | ] |
| 1443 | ); |
| 1444 | |
| 1445 | $this->end_controls_tab(); |
| 1446 | |
| 1447 | $this->start_controls_tab( |
| 1448 | 'ekit_icon_box_tab_button_hover', |
| 1449 | [ |
| 1450 | 'label' => esc_html__( 'Hover', 'elementskit-lite' ), |
| 1451 | ] |
| 1452 | ); |
| 1453 | |
| 1454 | $this->add_control( |
| 1455 | 'ekit_icon_box_btn_hover_color', |
| 1456 | [ |
| 1457 | 'label' => esc_html__( 'Text Color', 'elementskit-lite' ), |
| 1458 | 'type' => Controls_Manager::COLOR, |
| 1459 | 'selectors' => [ |
| 1460 | '{{WRAPPER}} .elementskit-infobox:hover .elementskit-btn' => 'color: {{VALUE}};', |
| 1461 | ], |
| 1462 | ] |
| 1463 | ); |
| 1464 | |
| 1465 | $this->add_group_control( |
| 1466 | Group_Control_Background::get_type(), |
| 1467 | [ |
| 1468 | 'name' => 'ekit_icon_box_btn_background_hover_group', |
| 1469 | 'label' => esc_html__( 'Background', 'elementskit-lite' ), |
| 1470 | 'types' => [ 'classic', 'gradient' ], |
| 1471 | 'selector' => '{{WRAPPER}} .elementskit-infobox:hover .elementskit-btn', |
| 1472 | ] |
| 1473 | ); |
| 1474 | |
| 1475 | $this->add_group_control( |
| 1476 | Group_Control_Border::get_type(), |
| 1477 | [ |
| 1478 | 'name' => 'ekit_icon_box_button_border_hv_color_group', |
| 1479 | 'label' => esc_html__( 'Border', 'elementskit-lite' ), |
| 1480 | 'selector' => '{{WRAPPER}} .elementskit-infobox:hover .elementskit-btn', |
| 1481 | ] |
| 1482 | ); |
| 1483 | $this->add_responsive_control( |
| 1484 | 'ekit_icon_box_btn_hover_border_radius', |
| 1485 | [ |
| 1486 | 'label' =>esc_html__( 'Border Radius', 'elementskit-lite' ), |
| 1487 | 'type' => Controls_Manager::DIMENSIONS, |
| 1488 | 'size_units' => [ 'px'], |
| 1489 | 'default' => [ |
| 1490 | 'top' => '', |
| 1491 | 'right' => '', |
| 1492 | 'bottom' => '' , |
| 1493 | 'left' => '', |
| 1494 | ], |
| 1495 | 'selectors' => [ |
| 1496 | '{{WRAPPER}} .elementskit-infobox:hover .elementskit-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1497 | ], |
| 1498 | ] |
| 1499 | ); |
| 1500 | $this->add_group_control( |
| 1501 | Group_Control_Box_Shadow::get_type(), |
| 1502 | [ |
| 1503 | 'name' => 'ekit_icon_box_button_box_shadow_hover_group', |
| 1504 | 'selector' => '{{WRAPPER}} .elementskit-infobox:hover .elementskit-btn', |
| 1505 | ] |
| 1506 | ); |
| 1507 | |
| 1508 | $this->add_control( |
| 1509 | 'ekit_icon_box_button_hover_animation', |
| 1510 | [ |
| 1511 | 'label' => esc_html__( 'Animation', 'elementskit-lite' ), |
| 1512 | 'type' => Controls_Manager::HOVER_ANIMATION, |
| 1513 | ] |
| 1514 | ); |
| 1515 | |
| 1516 | $this->end_controls_tab(); |
| 1517 | |
| 1518 | $this->end_controls_tabs(); |
| 1519 | |
| 1520 | |
| 1521 | $this->end_controls_section(); |
| 1522 | |
| 1523 | // Background Overlay style |
| 1524 | $this->start_controls_section( |
| 1525 | 'ekit_icon_box_section_bg_ovelry_style', |
| 1526 | [ |
| 1527 | 'label' => esc_html__( 'Background Overlay ', 'elementskit-lite' ), |
| 1528 | 'tab' => controls_Manager::TAB_STYLE, |
| 1529 | ] |
| 1530 | ); |
| 1531 | |
| 1532 | $this->add_control( |
| 1533 | 'ekit_icon_box_show_image_overlay', |
| 1534 | [ |
| 1535 | 'label' => esc_html__( 'Enable Image Overlay', 'elementskit-lite' ), |
| 1536 | 'type' => Controls_Manager::SWITCHER, |
| 1537 | 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ), |
| 1538 | 'label_off' => esc_html__( 'No', 'elementskit-lite' ), |
| 1539 | 'return_value' => 'yes', |
| 1540 | 'default' => '', |
| 1541 | ] |
| 1542 | ); |
| 1543 | |
| 1544 | $this->add_control( |
| 1545 | 'ekit_icon_box_show_image', |
| 1546 | [ |
| 1547 | 'label' => esc_html__( 'Choose Image', 'elementskit-lite' ), |
| 1548 | 'type' => Controls_Manager::MEDIA, |
| 1549 | 'dynamic' => [ |
| 1550 | 'active' => true, |
| 1551 | ], |
| 1552 | 'default' => [ |
| 1553 | 'url' => Utils::get_placeholder_image_src(), |
| 1554 | 'id' => -1 |
| 1555 | ], |
| 1556 | 'condition' => [ |
| 1557 | 'ekit_icon_box_show_image_overlay' => 'yes', |
| 1558 | ] |
| 1559 | ] |
| 1560 | ); |
| 1561 | |
| 1562 | $this->add_group_control( |
| 1563 | Group_Control_Background::get_type(), |
| 1564 | [ |
| 1565 | 'name' => 'ekit_icon_box_image_ovelry_color', |
| 1566 | 'label' => esc_html__( 'Background Overlay Color', 'elementskit-lite' ), |
| 1567 | 'types' => [ 'classic','gradient' ], |
| 1568 | 'selector' => '{{WRAPPER}} .elementskit-infobox.image-active::before', |
| 1569 | 'condition' => [ |
| 1570 | 'ekit_icon_box_show_image_overlay' => 'yes', |
| 1571 | ] |
| 1572 | ] |
| 1573 | ); |
| 1574 | |
| 1575 | $this->add_control( |
| 1576 | 'ekit_icon_box_show_overlay', |
| 1577 | [ |
| 1578 | 'label' => esc_html__( 'Enable Overlay', 'elementskit-lite' ), |
| 1579 | 'type' => Controls_Manager::SWITCHER, |
| 1580 | 'label_on' => esc_html__( 'Yes', 'elementskit-lite' ), |
| 1581 | 'label_off' => esc_html__( 'No', 'elementskit-lite' ), |
| 1582 | 'return_value' => 'yes', |
| 1583 | 'default' => '', |
| 1584 | ] |
| 1585 | ); |
| 1586 | $this->start_controls_tabs( |
| 1587 | 'ekit_icon_box_style_bg_overlay_tab', |
| 1588 | [ |
| 1589 | 'condition' => [ |
| 1590 | 'ekit_icon_box_show_overlay' => 'yes' |
| 1591 | ] |
| 1592 | ] |
| 1593 | ); |
| 1594 | $this->start_controls_tab( |
| 1595 | 'ekit_icon_box_section_bg_ov_style_n_tab', |
| 1596 | [ |
| 1597 | 'label' => esc_html__( 'Normal', 'elementskit-lite' ), |
| 1598 | ] |
| 1599 | ); |
| 1600 | |
| 1601 | $this->add_group_control( |
| 1602 | Group_Control_Background::get_type(), |
| 1603 | [ |
| 1604 | 'name' => 'ekit_icon_box_bg_ovelry_color', |
| 1605 | 'label' => esc_html__( 'Background Overlay Color', 'elementskit-lite' ), |
| 1606 | 'types' => [ 'classic', 'gradient' ], |
| 1607 | 'selector' => '{{WRAPPER}} .elementskit-infobox.gradient-active::before', |
| 1608 | ] |
| 1609 | ); |
| 1610 | $this->end_controls_tab(); |
| 1611 | $this->start_controls_tab( |
| 1612 | 'ekit_icon_box_section_bg_ov_style_n_hv_tab', |
| 1613 | [ |
| 1614 | 'label' => esc_html__( 'Hover', 'elementskit-lite' ), |
| 1615 | ] |
| 1616 | ); |
| 1617 | |
| 1618 | $this->add_group_control( |
| 1619 | Group_Control_Background::get_type(), |
| 1620 | [ |
| 1621 | 'name' => 'ekit_icon_box_bg_ovelry_color_hv', |
| 1622 | 'label' => esc_html__( 'Background Overlay Color', 'elementskit-lite' ), |
| 1623 | 'types' => [ 'classic', 'gradient' ], |
| 1624 | 'selector' => '{{WRAPPER}} .elementskit-infobox.gradient-active:hover::before', |
| 1625 | ] |
| 1626 | ); |
| 1627 | |
| 1628 | $this->end_controls_tab(); |
| 1629 | $this->end_controls_tabs(); |
| 1630 | $this->add_control( |
| 1631 | 'ekit_icon_box_section_bg_hover_color_direction', |
| 1632 | [ |
| 1633 | 'label' => esc_html__( 'Hover Direction', 'elementskit-lite' ), |
| 1634 | 'type' => Controls_Manager::CHOOSE, |
| 1635 | 'options' => [ |
| 1636 | 'hover_from_left' => [ |
| 1637 | 'title' => esc_html__( 'From Left', 'elementskit-lite' ), |
| 1638 | 'icon' => 'fa fa-caret-right', |
| 1639 | ], |
| 1640 | 'hover_from_top' => [ |
| 1641 | 'title' => esc_html__( 'From Top', 'elementskit-lite' ), |
| 1642 | 'icon' => 'fa fa-caret-down', |
| 1643 | ], |
| 1644 | 'hover_from_right' => [ |
| 1645 | 'title' => esc_html__( 'From Right', 'elementskit-lite' ), |
| 1646 | 'icon' => 'fa fa-caret-left', |
| 1647 | ], |
| 1648 | 'hover_from_bottom' => [ |
| 1649 | 'title' => esc_html__( 'From Bottom', 'elementskit-lite' ), |
| 1650 | 'icon' => 'fa fa-caret-up', |
| 1651 | ], |
| 1652 | |
| 1653 | ], |
| 1654 | 'default' => 'hover_from_left', |
| 1655 | 'toggle' => true, |
| 1656 | 'condition' => [ |
| 1657 | 'ekit_icon_box_show_overlay' => 'yes' |
| 1658 | ] |
| 1659 | ] |
| 1660 | ); |
| 1661 | $this->end_controls_section(); |
| 1662 | |
| 1663 | $this->start_controls_section( |
| 1664 | 'ekit_icon_box_badge_style_tab', |
| 1665 | [ |
| 1666 | 'label' => esc_html__( 'Badge', 'elementskit-lite' ), |
| 1667 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1668 | 'condition' => [ |
| 1669 | 'ekit_icon_box_badge_control' => 'yes', |
| 1670 | 'ekit_icon_box_badge_title!' => '' |
| 1671 | ] |
| 1672 | ] |
| 1673 | ); |
| 1674 | |
| 1675 | $this->add_responsive_control( |
| 1676 | 'ekit_icon_box_badge_padding', |
| 1677 | [ |
| 1678 | 'label' => esc_html__( 'Padding', 'elementskit-lite' ), |
| 1679 | 'type' => Controls_Manager::DIMENSIONS, |
| 1680 | 'size_units' => [ 'px', '%', 'em' ], |
| 1681 | 'default' => [ |
| 1682 | 'top' => '10', |
| 1683 | 'right' => '10', |
| 1684 | 'bottom' => '10', |
| 1685 | 'left' => '10', |
| 1686 | 'unit' => 'px', |
| 1687 | ], |
| 1688 | 'selectors' => [ |
| 1689 | '{{WRAPPER}} .ekit-badge' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1690 | ], |
| 1691 | ] |
| 1692 | ); |
| 1693 | |
| 1694 | $this->add_responsive_control( |
| 1695 | 'ekit_icon_box_badge_border_radius', |
| 1696 | [ |
| 1697 | 'label' => esc_html__( 'Border Radius', 'elementskit-lite' ), |
| 1698 | 'type' => Controls_Manager::DIMENSIONS, |
| 1699 | 'size_units' => [ 'px', '%', 'em' ], |
| 1700 | 'default' => [ |
| 1701 | 'top' => '0', |
| 1702 | 'right' => '0', |
| 1703 | 'bottom' => '0', |
| 1704 | 'left' => '0', |
| 1705 | 'unit' => 'px', |
| 1706 | ], |
| 1707 | 'selectors' => [ |
| 1708 | '{{WRAPPER}} .ekit-badge' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1709 | ], |
| 1710 | ] |
| 1711 | ); |
| 1712 | |
| 1713 | $this->add_control( |
| 1714 | 'badge_text_color', |
| 1715 | [ |
| 1716 | 'label' => esc_html__( 'Color', 'elementskit-lite' ), |
| 1717 | 'type' => Controls_Manager::COLOR, |
| 1718 | 'default' => '#fff', |
| 1719 | 'selectors' => [ |
| 1720 | '{{WRAPPER}} .ekit-badge' => 'color: {{VALUE}};', |
| 1721 | ], |
| 1722 | ] |
| 1723 | ); |
| 1724 | |
| 1725 | $this->add_group_control( |
| 1726 | Group_Control_Background::get_type(), |
| 1727 | [ |
| 1728 | 'name' => 'ekit_icon_box_badge_background', |
| 1729 | 'label' => esc_html__( 'Background', 'elementskit-lite' ), |
| 1730 | 'types' => [ 'classic', 'gradient' ], |
| 1731 | 'selector' => '{{WRAPPER}} .ekit-badge', |
| 1732 | ] |
| 1733 | ); |
| 1734 | |
| 1735 | $this->add_group_control( |
| 1736 | Group_Control_Box_Shadow::get_type(), |
| 1737 | [ |
| 1738 | 'name' => 'ekit_icon_box_badge_box_shadow', |
| 1739 | 'label' => esc_html__( 'Box Shadow', 'elementskit-lite' ), |
| 1740 | 'selector' => '{{WRAPPER}} .ekit-badge', |
| 1741 | ] |
| 1742 | ); |
| 1743 | |
| 1744 | $this->add_group_control( |
| 1745 | Group_Control_Typography::get_type(), |
| 1746 | [ |
| 1747 | 'name' => 'ekit_icon_box_badge_typography', |
| 1748 | 'label' => esc_html__( 'Typography', 'elementskit-lite' ), |
| 1749 | 'selector' => '{{WRAPPER}} .ekit-badge', |
| 1750 | ] |
| 1751 | ); |
| 1752 | |
| 1753 | |
| 1754 | $this->end_controls_section(); |
| 1755 | |
| 1756 | $this->insert_pro_message(); |
| 1757 | } |
| 1758 | |
| 1759 | protected function render( ) { |
| 1760 | echo '<div class="ekit-wid-con" >'; |
| 1761 | $this->render_raw(); |
| 1762 | echo '</div>'; |
| 1763 | } |
| 1764 | |
| 1765 | protected function render_raw( ) { |
| 1766 | $settings = $this->get_settings_for_display(); |
| 1767 | |
| 1768 | $icon_image_post = $settings['ekit_icon_box_icon_position']; |
| 1769 | $icon_pos_class = ''; |
| 1770 | $icon_pos_class .= $icon_image_post == 'right' ? 'elementskit-icon-right' : ''; |
| 1771 | $icon_pos_class .= $icon_image_post == 'left' ? 'media' : ''; |
| 1772 | $content_alignment = $settings['ekit_icon_box_text_align_responsive']; |
| 1773 | |
| 1774 | if($icon_image_post == 'top'){ |
| 1775 | $text_align = $settings['ekit_icon_box_text_align_responsive'].' '.'icon-top-align'; |
| 1776 | }else{ |
| 1777 | $text_align = $icon_image_post.' '.'icon-lef-right-aligin'; |
| 1778 | } |
| 1779 | $enable_overlay_color = ''; |
| 1780 | if($settings['ekit_icon_box_show_overlay'] == 'yes') { |
| 1781 | $enable_overlay_color = 'gradient-active'; |
| 1782 | } |
| 1783 | |
| 1784 | $ekit_icon_box_show_image = ''; |
| 1785 | if($settings['ekit_icon_box_show_image_overlay'] == 'yes') { |
| 1786 | $ekit_icon_box_show_image = 'image-active'; |
| 1787 | } |
| 1788 | // info box style |
| 1789 | |
| 1790 | $this->add_render_attribute( 'infobox_wrapper', 'class', 'elementskit-infobox' ); |
| 1791 | $this->add_render_attribute( 'infobox_wrapper', 'class', 'text-'.(empty($content_alignment) && $icon_image_post == 'top' ? 'center' : $content_alignment)); |
| 1792 | $this->add_render_attribute( 'infobox_wrapper', 'class', 'text-'.$text_align ); |
| 1793 | $this->add_render_attribute( 'infobox_wrapper', 'class', 'elementor-animation-' . $settings['ekit_icon_box_info_box_hover_animation'] ); |
| 1794 | $this->add_render_attribute( 'infobox_wrapper', 'class', $icon_pos_class ); |
| 1795 | $this->add_render_attribute( 'infobox_wrapper', 'class', $enable_overlay_color ); |
| 1796 | $this->add_render_attribute( 'infobox_wrapper', 'class', $ekit_icon_box_show_image ); |
| 1797 | $this->add_render_attribute( 'infobox_wrapper', 'class', $settings['ekit_icon_box_section_bg_hover_color_direction'] ); |
| 1798 | |
| 1799 | $ekit_icon_box_title_size_esc = \Elementor\Utils::validate_html_tag( $settings['ekit_icon_box_title_size'] ); |
| 1800 | |
| 1801 | // Icon |
| 1802 | $image = ''; |
| 1803 | if ( ! empty( $settings['ekit_icon_box_show_image']['url'] ) && $settings['ekit_icon_box_show_image_overlay'] == 'yes') { |
| 1804 | $this->add_render_attribute( 'image', 'src', $settings['ekit_icon_box_show_image']['url'] ); |
| 1805 | $this->add_render_attribute( 'image', 'alt', Control_Media::get_image_alt( $settings['ekit_icon_box_show_image'] ) ); |
| 1806 | |
| 1807 | $image_html = \Elementskit_Lite\Utils::get_attachment_image_html($settings, 'ekit_icon_box_show_image'); |
| 1808 | |
| 1809 | |
| 1810 | $image = '<figure class="image-hover">' . $image_html . '</figure>'; |
| 1811 | } |
| 1812 | |
| 1813 | // Button |
| 1814 | $btn_text = $settings['ekit_icon_box_btn_text']; |
| 1815 | $btn_url = (! empty( $settings['ekit_icon_box_btn_url']['url'])) ? $settings['ekit_icon_box_btn_url']['url'] : ''; |
| 1816 | |
| 1817 | // Set Link attributes |
| 1818 | if ( ! empty( $settings['ekit_icon_box_global_link']['url'] ) ) { |
| 1819 | $this->add_link_attributes( 'ekit_icon_box_global_link', $settings['ekit_icon_box_global_link'] ); |
| 1820 | } |
| 1821 | |
| 1822 | // Set attributes for read more button |
| 1823 | if ( $settings['ekit_icon_box_enable_btn'] == 'yes' && ! empty( $btn_url ) ) { |
| 1824 | $this->add_render_attribute( 'ekit_icon_readme_btn', 'class', 'elementskit-btn whitespace--normal' ); |
| 1825 | if(!empty($settings['ekit_icon_box_button_hover_animation'])) { |
| 1826 | $this->add_render_attribute( 'ekit_icon_readme_btn', 'class', 'elementor-animation-'.esc_attr($settings['ekit_icon_box_button_hover_animation']) ); |
| 1827 | } |
| 1828 | $this->add_link_attributes( 'ekit_icon_readme_btn', $settings['ekit_icon_box_btn_url'] ); |
| 1829 | } |
| 1830 | ?> |
| 1831 | <!-- link opening --> |
| 1832 | <?php if($settings['ekit_icon_box_show_global_link'] == 'yes' && $settings['ekit_icon_box_enable_btn'] != 'yes' && (!empty( $settings['ekit_icon_box_global_link']['url']))) : ?> |
| 1833 | <a <?php $this->print_render_attribute_string('ekit_icon_box_global_link'); ?> class="ekit_global_links"> |
| 1834 | <?php endif; ?> |
| 1835 | <!-- end link opening --> |
| 1836 | |
| 1837 | <div <?php echo $this->get_render_attribute_string( 'infobox_wrapper' ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Already escaped by elementor ?>> |
| 1838 | <?php if(! empty($settings['ekit_icon_box_header_icons']) && $settings['ekit_icon_box_enable_header_icon'] == 'icon' ) : ?> |
| 1839 | <div class="elementskit-box-header <?php echo 'elementor-animation-'.esc_attr($settings['ekit_icon_icons_hover_animation']); ?>"> |
| 1840 | <div class="elementskit-info-box-icon <?php echo ($settings['ekit_icon_box_icon_position'] != 'top' ? 'text-center' : ''); ?>"> |
| 1841 | <?php |
| 1842 | |
| 1843 | $migrated = isset( $settings['__fa4_migrated']['ekit_icon_box_header_icons'] ); |
| 1844 | // Check if its a new widget without previously selected icon using the old Icon control |
| 1845 | $is_new = empty( $settings['ekit_icon_box_header_icon'] ); |
| 1846 | if ( $is_new || $migrated ) { |
| 1847 | |
| 1848 | // new icon |
| 1849 | Icons_Manager::render_icon( $settings['ekit_icon_box_header_icons'], [ 'aria-hidden' => 'true', 'class' => 'elementkit-infobox-icon' ] ); |
| 1850 | } else { |
| 1851 | ?> |
| 1852 | <i class="<?php echo esc_attr($settings['ekit_icon_box_header_icon']); ?> elementkit-infobox-icon" aria-hidden="true"></i> |
| 1853 | <?php |
| 1854 | } |
| 1855 | ?> |
| 1856 | |
| 1857 | </div> |
| 1858 | </div> |
| 1859 | <?php endif;?> |
| 1860 | <?php if(! empty($settings['ekit_icon_box_header_image']) && $settings['ekit_icon_box_enable_header_icon'] == 'image' ) : ?> |
| 1861 | <div class="elementskit-box-header"> |
| 1862 | <div class="elementskit-info-box-icon <?php echo ($settings['ekit_icon_box_icon_position'] != 'top' ? 'text-center' : ''); ?>"> |
| 1863 | <?php |
| 1864 | echo wp_kses( |
| 1865 | \Elementskit_Lite\Utils::get_attachment_image_html($settings, 'ekit_icon_box_header_image'), |
| 1866 | \ElementsKit_Lite\Utils::get_kses_array() |
| 1867 | ); |
| 1868 | ?> |
| 1869 | </div> |
| 1870 | </div> |
| 1871 | <?php endif;?> |
| 1872 | <div class="box-body"> |
| 1873 | <?php if ($settings['ekit_icon_box_title_text'] != '') { ?> |
| 1874 | <<?php echo esc_attr($ekit_icon_box_title_size_esc); ?> class="elementskit-info-box-title"> |
| 1875 | <?php echo esc_html($settings['ekit_icon_box_title_text']); ?> |
| 1876 | </<?php echo esc_attr($ekit_icon_box_title_size_esc); ?>> |
| 1877 | <?php } ?> |
| 1878 | <?php if($settings['ekit_icon_box_description_text'] != ''): ?> |
| 1879 | <p><?php echo wp_kses($settings['ekit_icon_box_description_text'], \ElementsKit_Lite\Utils::get_kses_array()); ?></p> |
| 1880 | <?php endif; ?> |
| 1881 | <?php if($settings['ekit_icon_box_enable_btn'] == 'yes') : ?> |
| 1882 | <div class="box-footer <?php if($settings['ekit_icon_box_enable_hover_btn']== 'yes'){echo esc_attr("enable_hover_btn");} else {echo esc_attr("disable_hover_button");}?>"> |
| 1883 | <div class="btn-wraper"> |
| 1884 | <?php |
| 1885 | switch ($settings['ekit_icon_box_icon_align']) { |
| 1886 | case 'right': ?> |
| 1887 | <a <?php $this->print_render_attribute_string('ekit_icon_readme_btn'); ?>> |
| 1888 | <?php echo esc_html( $btn_text ); ?> |
| 1889 | <?php Icons_Manager::render_icon( $settings['ekit_icon_box_icons'], [ 'aria-hidden' => 'true' ] ); ?> |
| 1890 | </a> |
| 1891 | <?php break; |
| 1892 | case 'left': ?> |
| 1893 | <a <?php $this->print_render_attribute_string('ekit_icon_readme_btn'); ?>> |
| 1894 | <?php Icons_Manager::render_icon( $settings['ekit_icon_box_icons'], [ 'aria-hidden' => 'true' ] ); ?> |
| 1895 | <?php echo esc_html( $btn_text ); ?> |
| 1896 | </a> |
| 1897 | <?php break; |
| 1898 | default: ?> |
| 1899 | <a <?php $this->print_render_attribute_string('ekit_icon_readme_btn'); ?>> |
| 1900 | <?php echo esc_html( $btn_text ); ?> |
| 1901 | </a> |
| 1902 | <?php break; |
| 1903 | } |
| 1904 | ?> |
| 1905 | </div> |
| 1906 | </div> |
| 1907 | <?php endif; ?> |
| 1908 | </div> |
| 1909 | <?php if(!empty($settings['ekit_icon_box_enable_water_mark']) && $settings['ekit_icon_box_enable_water_mark'] == 'yes') : ?> |
| 1910 | |
| 1911 | <div class="icon-hover"> |
| 1912 | <?php |
| 1913 | // new icon |
| 1914 | $migrated = isset( $settings['__fa4_migrated']['ekit_icon_box_water_mark_icons'] ); |
| 1915 | // Check if its a new widget without previously selected icon using the old Icon control |
| 1916 | $is_new = empty( $settings['ekit_icon_box_water_mark_icon'] ); |
| 1917 | if ( $is_new || $migrated ) { |
| 1918 | // new icon |
| 1919 | Icons_Manager::render_icon( $settings['ekit_icon_box_water_mark_icons'], [ 'aria-hidden' => 'true' ] ); |
| 1920 | } else { |
| 1921 | ?> |
| 1922 | <i class="<?php echo esc_attr($settings['ekit_icon_box_water_mark_icon']); ?>" aria-hidden="true"></i> |
| 1923 | <?php |
| 1924 | } |
| 1925 | ?> |
| 1926 | </div> |
| 1927 | |
| 1928 | <?php endif; ?> |
| 1929 | |
| 1930 | <?php if(!empty($settings['ekit_icon_box_show_image_overlay']) && $settings['ekit_icon_box_show_image_overlay'] == 'yes') : ?> |
| 1931 | <?php echo wp_kses($image, \ElementsKit_Lite\Utils::get_kses_array()); ?> |
| 1932 | <?php endif; ?> |
| 1933 | |
| 1934 | <?php if($settings['ekit_icon_box_badge_control'] == 'yes' && $settings['ekit_icon_box_badge_title'] != '') : ?> |
| 1935 | <div class="ekit-icon-box-badge ekit_position_<?php echo esc_attr($settings['ekit_icon_box_badge_position']);?>"> |
| 1936 | <span class="ekit-badge"><?php echo esc_html($settings['ekit_icon_box_badge_title'])?></span> |
| 1937 | </div> |
| 1938 | <?php endif; ?> |
| 1939 | </div> |
| 1940 | <?php |
| 1941 | // link Closing |
| 1942 | if($settings['ekit_icon_box_show_global_link'] == 'yes' && $settings['ekit_icon_box_enable_btn'] != 'yes' && (!empty( $settings['ekit_icon_box_global_link']['url']))) : ?> |
| 1943 | </a> |
| 1944 | <?php endif; // end link Closing |
| 1945 | } |
| 1946 | } |
| 1947 |