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