templates
2 years ago
Accordion.php
2 years ago
Alerts_Box.php
2 years ago
Animated_Heading.php
2 years ago
Before_after.php
2 years ago
Blog_Grid.php
2 years ago
Buttons.php
2 years ago
Cheat_sheet.php
2 years ago
Counter.php
2 years ago
Fullscreen_Slider.php
2 years ago
Icon_box.php
2 years ago
Instagram.php
2 years ago
Integrations.php
2 years ago
List_Item.php
2 years ago
Marquee_Slides.php
2 years ago
Pricing_Table_Switcher.php
2 years ago
Pricing_Table_Tabs.php
2 years ago
Skill_Showcase.php
2 years ago
Tabs.php
2 years ago
Team_Carousel.php
2 years ago
Testimonial.php
2 years ago
Timeline.php
2 years ago
Video_Playlist.php
2 years ago
Video_Popup.php
2 years ago
Tabs.php
733 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Use namespace to avoid conflict |
| 4 | */ |
| 5 | |
| 6 | namespace SPEL\Widgets; |
| 7 | |
| 8 | use Elementor\Group_Control_Background; |
| 9 | use Elementor\Group_Control_Border; |
| 10 | use Elementor\Group_Control_Typography; |
| 11 | use Elementor\Widget_Base; |
| 12 | use Elementor\Controls_Manager; |
| 13 | use Elementor\Repeater; |
| 14 | |
| 15 | // Exit if accessed directly |
| 16 | if ( ! defined( 'ABSPATH' ) ) { |
| 17 | exit; |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Class Tabs |
| 22 | * @package spider\Widgets |
| 23 | * @since 1.0.0 |
| 24 | */ |
| 25 | class Tabs extends Widget_Base { |
| 26 | |
| 27 | public function get_name() { |
| 28 | return 'docy_tabs'; // ID of the widget (Don't change this name) |
| 29 | } |
| 30 | |
| 31 | public function get_title() { |
| 32 | return esc_html__( 'Tabs', 'spider-elements' ); |
| 33 | } |
| 34 | |
| 35 | public function get_icon() { |
| 36 | return 'eicon-tabs spel-icon'; |
| 37 | } |
| 38 | |
| 39 | public function get_keywords() { |
| 40 | return [ 'spider', 'spider elements', 'tab', 'tabs', 'tab widget' ]; |
| 41 | } |
| 42 | |
| 43 | public function get_categories() { |
| 44 | return [ 'spider-elements' ]; |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Name: get_style_depends() |
| 49 | * Desc: Register the required CSS dependencies for the frontend. |
| 50 | */ |
| 51 | public function get_style_depends() { |
| 52 | return [ 'elegant-icon', 'spel-main' ]; |
| 53 | } |
| 54 | |
| 55 | /** |
| 56 | * Name: get_script_depends() |
| 57 | * Desc: Register the required JS dependencies for the frontend. |
| 58 | */ |
| 59 | public function get_script_depends() { |
| 60 | return [ 'spel-el-widgets' ]; |
| 61 | } |
| 62 | |
| 63 | |
| 64 | /** |
| 65 | * Name: register_controls() |
| 66 | * Desc: Register controls for these widgets |
| 67 | * Params: no params |
| 68 | * Return: @void |
| 69 | * Since: @1.0.0 |
| 70 | * Package: @spider-elements |
| 71 | * Author: spider-themes |
| 72 | */ |
| 73 | protected function register_controls() { |
| 74 | $this->elementor_content_control(); |
| 75 | $this->elementor_style_control(); |
| 76 | } |
| 77 | |
| 78 | |
| 79 | /** |
| 80 | * Name: elementor_content_control() |
| 81 | * Desc: Register the Content Tab output on the Elementor editor. |
| 82 | * Params: no params |
| 83 | * Return: @void |
| 84 | * Since: @1.0.0 |
| 85 | * Package: @spider-elements |
| 86 | * Author: spider-themes |
| 87 | */ |
| 88 | public function elementor_content_control() { |
| 89 | |
| 90 | // ============================ Select Style ===========================// |
| 91 | $this->start_controls_section( |
| 92 | 'select_style', |
| 93 | [ |
| 94 | 'label' => __( 'Preset Skins', 'spider-elements' ), |
| 95 | ] |
| 96 | ); |
| 97 | |
| 98 | $this->add_control( |
| 99 | 'style', |
| 100 | [ |
| 101 | 'label' => __( 'Style', 'spider-elements' ), |
| 102 | 'type' => Controls_Manager::SELECT, |
| 103 | 'options' => [ |
| 104 | '1' => __( 'Inline Tab', 'spider-elements' ), |
| 105 | '2' => __( 'Full Width Tab', 'spider-elements' ), |
| 106 | ], |
| 107 | 'default' => '1', |
| 108 | ] |
| 109 | ); |
| 110 | |
| 111 | $this->end_controls_section(); // End Select Style |
| 112 | |
| 113 | |
| 114 | // ============================ Tabs ===========================// |
| 115 | $this->start_controls_section( |
| 116 | 'sec_tabs', |
| 117 | [ |
| 118 | 'label' => __( 'Tabs', 'spider-elements' ), |
| 119 | ] |
| 120 | ); |
| 121 | |
| 122 | $repeater = new Repeater(); |
| 123 | $repeater->add_control( |
| 124 | 'icon', |
| 125 | [ |
| 126 | 'label' => esc_html__( 'Icon', 'spider-elements' ), |
| 127 | 'type' => Controls_Manager::ICONS, |
| 128 | 'default' => [ |
| 129 | 'value' => 'far fa-lightbulb', |
| 130 | 'library' => 'fa-regular', |
| 131 | ], |
| 132 | |
| 133 | ] |
| 134 | ); |
| 135 | |
| 136 | $repeater->add_control( |
| 137 | 'tab_title', |
| 138 | [ |
| 139 | 'label' => __( 'Tab Title', 'spider-elements' ), |
| 140 | 'type' => Controls_Manager::TEXT, |
| 141 | 'default' => __( 'Tab Title', 'spider-elements' ), |
| 142 | 'placeholder' => __( 'Tab Title', 'spider-elements' ), |
| 143 | 'label_block' => true, |
| 144 | ] |
| 145 | ); |
| 146 | |
| 147 | $repeater->add_control( |
| 148 | 'tabs_content_type', |
| 149 | [ |
| 150 | 'label' => __( 'Content Type', 'spider-elements' ), |
| 151 | 'type' => Controls_Manager::SELECT, |
| 152 | 'options' => [ |
| 153 | 'content' => __( 'Content', 'spider-elements' ), |
| 154 | 'template' => __( 'Saved Templates', 'spider-elements' ), |
| 155 | ], |
| 156 | 'default' => 'content', |
| 157 | ] |
| 158 | ); |
| 159 | |
| 160 | $repeater->add_control( |
| 161 | 'primary_templates', |
| 162 | [ |
| 163 | 'label' => __( 'Choose Template', 'spider-elements' ), |
| 164 | 'type' => Controls_Manager::SELECT, |
| 165 | 'options' => spel_get_el_templates(), |
| 166 | 'condition' => [ |
| 167 | 'tabs_content_type' => 'template', |
| 168 | ], |
| 169 | ] |
| 170 | ); |
| 171 | |
| 172 | $repeater->add_control( |
| 173 | 'tab_content', |
| 174 | [ |
| 175 | 'label' => __( 'Content', 'spider-elements' ), |
| 176 | 'default' => __( 'Tab Content', 'spider-elements' ), |
| 177 | 'placeholder' => __( 'Tab Content', 'spider-elements' ), |
| 178 | 'type' => Controls_Manager::WYSIWYG, |
| 179 | 'show_label' => false, |
| 180 | 'condition' => [ |
| 181 | 'tabs_content_type' => 'content', |
| 182 | ], |
| 183 | ] |
| 184 | ); |
| 185 | |
| 186 | $repeater->end_controls_tab(); // End tab |
| 187 | |
| 188 | $this->add_control( |
| 189 | 'tabs', |
| 190 | [ |
| 191 | 'label' => __( 'Add Items', 'spider-elements' ), |
| 192 | 'type' => Controls_Manager::REPEATER, |
| 193 | 'fields' => $repeater->get_controls(), |
| 194 | 'title_field' => '{{{ tab_title }}}', |
| 195 | 'default' => [ |
| 196 | [ |
| 197 | 'tab_title' => esc_html__( 'Tab Title #1', 'spider-elements' ), |
| 198 | 'tab_content' => esc_html__( 'Nostra adipiscing sequi nisi hic venenatis pede aliquid eget aperiam commodi gravida?', 'spider-elements' ), |
| 199 | ], |
| 200 | [ |
| 201 | 'tab_title' => esc_html__( 'Tab Title #2', 'spider-elements' ), |
| 202 | 'tab_content' => esc_html__( 'Nostra adipiscing sequi nisi hic venenatis pede aliquid eget aperiam commodi gravida?', 'spider-elements' ), |
| 203 | ], |
| 204 | [ |
| 205 | 'tab_title' => esc_html__( 'Tab Title #3', 'spider-elements' ), |
| 206 | 'tab_content' => esc_html__( 'Nostra adipiscing sequi nisi hic venenatis pede aliquid eget aperiam commodi gravida?', 'spider-elements' ), |
| 207 | ], |
| 208 | ], |
| 209 | ] |
| 210 | ); |
| 211 | |
| 212 | $this->add_control( |
| 213 | 'is_navigation_arrow', |
| 214 | [ |
| 215 | 'label' => esc_html__( 'Navigation Arrow', 'spider-elements' ), |
| 216 | 'type' => Controls_Manager::SWITCHER, |
| 217 | 'description' => esc_html__( 'Show/Hide navigation arrow button for content area', 'spider-elements' ), |
| 218 | 'label_on' => esc_html__( 'Show', 'spider-elements' ), |
| 219 | 'label_off' => esc_html__( 'Hide', 'spider-elements' ), |
| 220 | 'return_value' => 'yes', |
| 221 | 'default' => 'no', |
| 222 | 'separator' => 'before' |
| 223 | ] |
| 224 | ); |
| 225 | |
| 226 | $this->add_control( |
| 227 | 'is_auto_numb', |
| 228 | [ |
| 229 | 'label' => esc_html__( 'Auto Numbering', 'spider-elements' ), |
| 230 | 'type' => Controls_Manager::SWITCHER, |
| 231 | 'description' => esc_html__( 'Show/Hide auto numbering for tab title', 'spider-elements' ), |
| 232 | 'label_on' => esc_html__( 'Show', 'spider-elements' ), |
| 233 | 'label_off' => esc_html__( 'Hide', 'spider-elements' ), |
| 234 | 'return_value' => 'yes', |
| 235 | 'default' => 'no', |
| 236 | 'separator' => 'before' |
| 237 | ] |
| 238 | ); |
| 239 | |
| 240 | $this->add_control( |
| 241 | 'is_auto_play', |
| 242 | [ |
| 243 | 'label' => esc_html__( 'Auto Play', 'spider-elements' ), |
| 244 | 'type' => Controls_Manager::SWITCHER, |
| 245 | 'description' => esc_html__( 'Show/Hide auto play for tab', 'spider-elements' ), |
| 246 | 'label_on' => esc_html__( 'Show', 'spider-elements' ), |
| 247 | 'label_off' => esc_html__( 'Hide', 'spider-elements' ), |
| 248 | 'return_value' => 'yes', |
| 249 | 'default' => 'no', |
| 250 | 'separator' => 'before' |
| 251 | ] |
| 252 | ); |
| 253 | |
| 254 | $this->add_control( |
| 255 | 'is_sticky_tab', |
| 256 | [ |
| 257 | 'label' => esc_html__( 'Sticky Mode', 'spider-elements' ), |
| 258 | 'type' => Controls_Manager::SWITCHER, |
| 259 | 'description' => esc_html__( 'Show/Hide sticky mode for tab title', 'spider-elements' ), |
| 260 | 'label_on' => esc_html__( 'Show', 'spider-elements' ), |
| 261 | 'label_off' => esc_html__( 'Hide', 'spider-elements' ), |
| 262 | 'return_value' => 'yes', |
| 263 | 'default' => 'no', |
| 264 | 'separator' => 'before' |
| 265 | ] |
| 266 | ); |
| 267 | |
| 268 | $this->add_control( |
| 269 | 'tab_alignment', |
| 270 | [ |
| 271 | 'label' => esc_html__( 'Alignment', 'spider-elements' ), |
| 272 | 'type' => Controls_Manager::CHOOSE, |
| 273 | 'options' => [ |
| 274 | 'flex-start' => [ |
| 275 | 'title' => esc_html__( 'Left', 'spider-elements' ), |
| 276 | 'icon' => 'eicon-h-align-left', |
| 277 | ], |
| 278 | 'center' => [ |
| 279 | 'title' => esc_html__( 'Center', 'spider-elements' ), |
| 280 | 'icon' => ' eicon-h-align-center', |
| 281 | ], |
| 282 | 'flex-end' => [ |
| 283 | 'title' => esc_html__( 'Right', 'spider-elements' ), |
| 284 | 'icon' => 'eicon-h-align-right', |
| 285 | ], |
| 286 | ], |
| 287 | 'default' => 'flex-start', |
| 288 | 'toggle' => true, |
| 289 | 'selectors' => [ |
| 290 | '{{WRAPPER}} .tab_shortcode .nav-tabs' => 'justify-content: {{VALUE}};', |
| 291 | '{{WRAPPER}} .header_tabs_area .nav-tabs' => 'justify-content: {{VALUE}};', |
| 292 | ], |
| 293 | 'separator' => 'before' |
| 294 | ] |
| 295 | ); |
| 296 | |
| 297 | $this->end_controls_section(); // End Tabs Section |
| 298 | |
| 299 | } |
| 300 | |
| 301 | |
| 302 | /** |
| 303 | * Name: elementor_style_control() |
| 304 | * Desc: Register the Style Tab output on the Elementor editor. |
| 305 | * Params: no params |
| 306 | * Return: @void |
| 307 | * Since: @1.0.0 |
| 308 | * Package: @spider-elements |
| 309 | * Author: spider-themes |
| 310 | */ |
| 311 | public function elementor_style_control() { |
| 312 | |
| 313 | //============================ Tab Title Style ============================// |
| 314 | $this->start_controls_section( |
| 315 | 'style_tabs_sec', |
| 316 | [ |
| 317 | 'label' => __( 'Tab Title', 'spider-elements' ), |
| 318 | 'tab' => Controls_Manager::TAB_STYLE, |
| 319 | ] |
| 320 | ); |
| 321 | |
| 322 | $this->add_group_control( |
| 323 | Group_Control_Typography::get_type(), |
| 324 | [ |
| 325 | 'name' => 'tab_item_typo', |
| 326 | 'selector' => '{{WRAPPER}} .tab_shortcode .nav-tabs .nav-item .nav-link, {{WRAPPER}} .header_tab_items .nav-tabs .nav-item .nav-link', |
| 327 | 'separator' => 'before', |
| 328 | ] |
| 329 | ); |
| 330 | |
| 331 | $this->add_responsive_control( |
| 332 | 'icon_size', |
| 333 | [ |
| 334 | 'label' => esc_html__( 'Icon Size', 'spider-elements' ), |
| 335 | 'type' => Controls_Manager::SLIDER, |
| 336 | 'size_units' => [ 'px', '%' ], |
| 337 | 'range' => [ |
| 338 | 'px' => [ |
| 339 | 'min' => 0, |
| 340 | 'max' => 100, |
| 341 | 'step' => 1, |
| 342 | ], |
| 343 | '%' => [ |
| 344 | 'min' => 0, |
| 345 | 'max' => 100, |
| 346 | ], |
| 347 | ], |
| 348 | 'default' => [ |
| 349 | 'unit' => 'px', |
| 350 | ], |
| 351 | 'selectors' => [ |
| 352 | '{{WRAPPER}} .tab_shortcode .nav-tabs .nav-item .nav-link i, {{WRAPPER}} .header_tabs_area .nav-tabs .nav-item .nav-link i ' => 'font-size: {{SIZE}}{{UNIT}};', |
| 353 | ], |
| 354 | ] |
| 355 | ); |
| 356 | |
| 357 | $this->add_group_control( |
| 358 | \Elementor\Group_Control_Border::get_type(), |
| 359 | [ |
| 360 | 'name' => 'title_border', |
| 361 | 'selector' => '{{WRAPPER}} .tab_shortcode .nav-tabs .nav-item .nav-link', |
| 362 | ] |
| 363 | ); |
| 364 | |
| 365 | $this->add_responsive_control( |
| 366 | 'title_border_radius', |
| 367 | [ |
| 368 | 'label' => __( 'Border Radius', 'spider-elements' ), |
| 369 | 'type' => Controls_Manager::DIMENSIONS, |
| 370 | 'size_units' => [ 'px', '%', 'em' ], |
| 371 | 'selectors' => [ |
| 372 | '{{WRAPPER}} .tab_shortcode .nav-tabs .nav-item .nav-link' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 373 | '{{WRAPPER}} .header_tabs_area .nav-tabs .nav-item .nav-link' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 374 | ], |
| 375 | ] |
| 376 | ); |
| 377 | |
| 378 | $this->add_responsive_control( |
| 379 | 'tab_margin', [ |
| 380 | 'label' => __( 'margin', 'spider-elements' ), |
| 381 | 'type' => Controls_Manager::DIMENSIONS, |
| 382 | 'size_units' => [ 'px', '%', 'em' ], |
| 383 | 'selectors' => [ |
| 384 | '{{WRAPPER}} .tab_shortcode .nav-tabs .nav-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 385 | '{{WRAPPER}} .header_tabs_area .nav-tabs .nav-item' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 386 | ], |
| 387 | ] |
| 388 | ); |
| 389 | |
| 390 | $this->add_responsive_control( |
| 391 | 'tab_pad', |
| 392 | [ |
| 393 | 'label' => __( 'Padding', 'spider-elements' ), |
| 394 | 'type' => Controls_Manager::DIMENSIONS, |
| 395 | 'size_units' => [ 'px', '%', 'em' ], |
| 396 | 'selectors' => [ |
| 397 | '{{WRAPPER}} .tab_shortcode .nav-tabs .nav-item .nav-link' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 398 | '{{WRAPPER}} .header_tabs_area .nav-tabs .nav-item .nav-link' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 399 | ], |
| 400 | ] |
| 401 | ); |
| 402 | |
| 403 | $this->add_control( |
| 404 | 'tab_title_hr', |
| 405 | [ |
| 406 | 'type' => Controls_Manager::DIVIDER, |
| 407 | ] |
| 408 | ); |
| 409 | |
| 410 | // Tab Title Normal/Active/hover State |
| 411 | $this->start_controls_tabs( |
| 412 | 'style_tab_title_tabs' |
| 413 | ); |
| 414 | |
| 415 | //=== Normal Tab Title |
| 416 | $this->start_controls_tab( |
| 417 | 'style_tab_title_normal', |
| 418 | [ |
| 419 | 'label' => __( 'Normal', 'spider-elements' ), |
| 420 | ] |
| 421 | ); |
| 422 | |
| 423 | $this->add_control( |
| 424 | 'normal_tab_title_text_color', |
| 425 | [ |
| 426 | 'label' => __( 'Text Color', 'spider-elements' ), |
| 427 | 'type' => Controls_Manager::COLOR, |
| 428 | 'selectors' => array( |
| 429 | '{{WRAPPER}} .tab_shortcode .spel_tab_title , {{WRAPPER}} .header_tab_items .spel_tab_title ' => 'color: {{VALUE}}', |
| 430 | ) |
| 431 | ] |
| 432 | ); |
| 433 | |
| 434 | $this->add_group_control( |
| 435 | \Elementor\Group_Control_Background::get_type(), |
| 436 | [ |
| 437 | 'name' => 'normal_tab_title_bg_color', |
| 438 | 'types' => [ 'classic', 'gradient' ], |
| 439 | 'exclude' => [ 'image' ], |
| 440 | 'selector' => |
| 441 | '{{WRAPPER}} .tab_shortcode .tab-item-title, |
| 442 | {{WRAPPER}} .header_tab_items .spel_tab_title ', |
| 443 | |
| 444 | ] |
| 445 | ); |
| 446 | |
| 447 | |
| 448 | $this->add_control( |
| 449 | 'normal_tab_icon_bg_color', |
| 450 | [ |
| 451 | 'label' => __( 'Icon Background Color', 'spider-elements' ), |
| 452 | 'type' => Controls_Manager::COLOR, |
| 453 | 'selectors' => array( |
| 454 | '{{WRAPPER}} .tab-item-title > .numb' => 'background: {{VALUE}};', |
| 455 | ), |
| 456 | 'condition' => [ |
| 457 | 'is_auto_numb' => 'yes', |
| 458 | ] |
| 459 | ] |
| 460 | ); |
| 461 | |
| 462 | $this->end_controls_tab(); //End Normal Tab Title |
| 463 | |
| 464 | //=== Hover Tab Title |
| 465 | $this->start_controls_tab( |
| 466 | 'style_tab_title_hover', [ |
| 467 | 'label' => __( 'Hover', 'spider-elements' ), |
| 468 | ] |
| 469 | ); |
| 470 | |
| 471 | $this->add_control( |
| 472 | 'hover_tab_title_text_color', [ |
| 473 | 'label' => __( 'Text Color', 'spider-elements' ), |
| 474 | 'type' => Controls_Manager::COLOR, |
| 475 | 'selectors' => array( |
| 476 | '{{WRAPPER}} .tab_shortcode .spel_tab_title :hover, |
| 477 | {{WRAPPER}} .header_tab_items .spel_tab_title :hover' => 'color: {{VALUE}};', |
| 478 | ) |
| 479 | ] |
| 480 | ); |
| 481 | |
| 482 | $this->add_group_control( |
| 483 | \Elementor\Group_Control_Background::get_type(), |
| 484 | [ |
| 485 | 'name' => 'hover_tab_title_bg_color', |
| 486 | 'types' => [ 'classic', 'gradient' ], |
| 487 | 'exclude' => [ 'image' ], |
| 488 | 'selector' => |
| 489 | '{{WRAPPER}} .tab_shortcode .tab-item-title:hover, |
| 490 | {{WRAPPER}} .header_tab_items .spel_tab_title :hover', |
| 491 | ] |
| 492 | ); |
| 493 | |
| 494 | $this->end_controls_tab(); //End Hover Tab Title |
| 495 | |
| 496 | |
| 497 | //=== Active Tab Title |
| 498 | $this->start_controls_tab( |
| 499 | 'style_tab_title_active', [ |
| 500 | 'label' => __( 'Active', 'spider-elements' ), |
| 501 | ] |
| 502 | ); |
| 503 | |
| 504 | $this->add_control( |
| 505 | 'active_tab_title_text_color', [ |
| 506 | 'label' => __( 'Text Color', 'spider-elements' ), |
| 507 | 'type' => Controls_Manager::COLOR, |
| 508 | 'selectors' => array( |
| 509 | '{{WRAPPER}} .tab_shortcode .spel_tab_title .active, |
| 510 | {{WRAPPER}} .header_tab_items .spel_tab_title .active' => 'color: {{VALUE}};', |
| 511 | ) |
| 512 | ] |
| 513 | ); |
| 514 | |
| 515 | |
| 516 | $this->add_group_control( |
| 517 | \Elementor\Group_Control_Background::get_type(), |
| 518 | [ |
| 519 | 'name' => 'active_tab_title_bg_color', |
| 520 | 'types' => [ 'classic', 'gradient' ], |
| 521 | 'exclude' => [ 'image' ], |
| 522 | 'selector' => |
| 523 | '{{WRAPPER}} .tab_shortcode .tab-item-title.active, |
| 524 | {{WRAPPER}} .header_tab_items .spel_tab_title .active', |
| 525 | |
| 526 | ] |
| 527 | ); |
| 528 | |
| 529 | |
| 530 | $this->add_control( |
| 531 | 'active_tab_title_border_color', |
| 532 | [ |
| 533 | 'label' => __( 'Border Top Color', 'spider-elements' ), |
| 534 | 'type' => Controls_Manager::COLOR, |
| 535 | 'selectors' => array( |
| 536 | '{{WRAPPER}} .tab_shortcode .spel_tab_title .active::before, |
| 537 | {{WRAPPER}} .tab_shortcode .nav-tabs .nav-item .nav-link:hover::before' => 'background: {{VALUE}};', |
| 538 | ), |
| 539 | 'condition' => [ |
| 540 | 'style' => [ '1' ] |
| 541 | ] |
| 542 | ] |
| 543 | ); |
| 544 | |
| 545 | $this->add_control( |
| 546 | 'active_tab_icon_bg_color', |
| 547 | [ |
| 548 | 'label' => __( 'Icon Background Color', 'spider-elements' ), |
| 549 | 'type' => Controls_Manager::COLOR, |
| 550 | 'selectors' => array( |
| 551 | '{{WRAPPER}} .tab-item-title.active > .numb, |
| 552 | {{WRAPPER}} .tab-item-title:hover > .numb' => 'background: {{VALUE}};', |
| 553 | ), |
| 554 | 'condition' => [ |
| 555 | 'is_auto_numb' => 'yes', |
| 556 | ] |
| 557 | ] |
| 558 | ); |
| 559 | |
| 560 | $this->end_controls_tab(); // End Active Tab Title |
| 561 | |
| 562 | $this->end_controls_section(); // End Tab Title Style |
| 563 | |
| 564 | //============================ Tab ProgressBar Style ============================// |
| 565 | $this->start_controls_section( |
| 566 | 'style_tabs_progressbar', |
| 567 | [ |
| 568 | 'label' => __( 'Tab ProgressBar', 'spider-elements' ), |
| 569 | 'tab' => Controls_Manager::TAB_STYLE, |
| 570 | 'condition' => [ |
| 571 | 'is_auto_play' => 'yes', |
| 572 | ] |
| 573 | ] |
| 574 | ); |
| 575 | |
| 576 | $this->add_group_control( |
| 577 | \Elementor\Group_Control_Background::get_type(), |
| 578 | [ |
| 579 | 'name' => 'progressbar_bg_color', |
| 580 | 'types' => [ 'classic', 'gradient' ], |
| 581 | 'exclude' => [ 'image' ], |
| 582 | 'selector' => |
| 583 | '{{WRAPPER}} .spe_auto_tabs .nav-item .nav-link .progress-bar,{{WRAPPER}} .spe_auto_tabs .nav-item .nav-link.active .tab_progress:before', |
| 584 | |
| 585 | ] |
| 586 | ); |
| 587 | $this->add_responsive_control( |
| 588 | 'progressbar_height', [ |
| 589 | 'label' => __( 'Progress Bar Hegiht', 'spider-elements' ), |
| 590 | 'type' => Controls_Manager::SLIDER, |
| 591 | 'size_units' => [ 'px', '%' ], |
| 592 | 'range' => [ |
| 593 | 'px' => [ |
| 594 | 'min' => 0, |
| 595 | 'max' => 10, |
| 596 | ], |
| 597 | '%' => [ |
| 598 | 'min' => 0, |
| 599 | 'max' => 10, |
| 600 | ], |
| 601 | ], |
| 602 | 'default' => [ |
| 603 | 'unit' => 'px', |
| 604 | 'size' => '2', |
| 605 | ], |
| 606 | 'selectors' => [ |
| 607 | '{{WRAPPER}} .spe_auto_tabs .nav-item .nav-link .progress-bar,{{WRAPPER}} .spe_auto_tabs .nav-item .nav-link .tab_progress' => 'height: {{SIZE}}{{UNIT}};', |
| 608 | ], |
| 609 | ] |
| 610 | ); |
| 611 | |
| 612 | $this->end_controls_section(); |
| 613 | |
| 614 | |
| 615 | //=============================== Content Section ===============================// |
| 616 | $this->start_controls_section( |
| 617 | 'style_content', |
| 618 | [ |
| 619 | 'label' => __( 'Content', 'spider-elements' ), |
| 620 | 'tab' => Controls_Manager::TAB_STYLE, |
| 621 | ] |
| 622 | ); |
| 623 | |
| 624 | $this->add_group_control( |
| 625 | \Elementor\Group_Control_Typography::get_type(), |
| 626 | [ |
| 627 | 'name' => 'tabs_content_typo', |
| 628 | 'selector' => '{{WRAPPER}} .tab-content .tab_style', |
| 629 | 'separator' => 'before', |
| 630 | ] |
| 631 | ); |
| 632 | |
| 633 | $this->add_control( |
| 634 | 'tabs_content_text_color', |
| 635 | [ |
| 636 | 'label' => __( 'Text Color', 'spider-elements' ), |
| 637 | 'type' => Controls_Manager::COLOR, |
| 638 | 'selectors' => array( |
| 639 | '{{WRAPPER}} .tab-content .tab_style, {{WRAPPER}} .tab-content .tab-pane' => 'color: {{VALUE}}', |
| 640 | ) |
| 641 | ] |
| 642 | ); |
| 643 | |
| 644 | $this->add_group_control( |
| 645 | Group_Control_Border::get_type(), |
| 646 | [ |
| 647 | 'name' => 'tabs_border', |
| 648 | 'label' => esc_html__( 'Border', 'spider-elements' ), |
| 649 | 'selector' => '{{WRAPPER}} .tab_shortcode .tab-content, {{WRAPPER}} .header_tab_content .tab-content', |
| 650 | ] |
| 651 | ); |
| 652 | |
| 653 | $this->add_responsive_control( |
| 654 | 'content_border_radius', |
| 655 | [ |
| 656 | 'label' => __( 'Border Radius', 'spider-elements' ), |
| 657 | 'type' => Controls_Manager::DIMENSIONS, |
| 658 | 'size_units' => [ 'px', '%', 'em' ], |
| 659 | 'selectors' => [ |
| 660 | '{{WRAPPER}} .tab_shortcode .tab-content' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 661 | ], |
| 662 | ] |
| 663 | ); |
| 664 | |
| 665 | $this->add_responsive_control( |
| 666 | 'content-pad', |
| 667 | [ |
| 668 | 'label' => __( 'Padding', 'spider-elements' ), |
| 669 | 'type' => Controls_Manager::DIMENSIONS, |
| 670 | 'size_units' => [ 'px', '%', 'em' ], |
| 671 | 'selectors' => [ |
| 672 | '{{WRAPPER}} .tab_shortcode .tab-content, {{WRAPPER}} .header_tab_content .tab-content' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 673 | ], |
| 674 | ] |
| 675 | ); |
| 676 | |
| 677 | |
| 678 | $this->add_group_control( |
| 679 | Group_Control_Background::get_type(), [ |
| 680 | 'name' => 'content_background', |
| 681 | 'types' => [ 'classic', 'gradient' ], |
| 682 | 'selector' => '{{WRAPPER}} .tab-content', |
| 683 | ] |
| 684 | ); |
| 685 | |
| 686 | $this->end_controls_section(); // End Content Section |
| 687 | |
| 688 | |
| 689 | //=============================== Navigation Arrow ===============================// |
| 690 | $this->start_controls_section( |
| 691 | 'style_nav_arrow', |
| 692 | [ |
| 693 | 'label' => __( 'Navigation Arrow', 'spider-elements' ), |
| 694 | 'tab' => Controls_Manager::TAB_STYLE, |
| 695 | 'condition' => [ |
| 696 | 'is_navigation_arrow' => 'yes', |
| 697 | ] |
| 698 | ] |
| 699 | ); |
| 700 | |
| 701 | $this->end_controls_section(); // End Navigation Arrow |
| 702 | |
| 703 | } |
| 704 | |
| 705 | |
| 706 | /** |
| 707 | * Name: elementor_render() |
| 708 | * Desc: Render the widget output on the frontend. |
| 709 | * Params: no params |
| 710 | * Return: @void |
| 711 | * Since: @1.0.0 |
| 712 | * Package: @spider-elements |
| 713 | * Author: spider-themes |
| 714 | */ |
| 715 | protected function render() { |
| 716 | |
| 717 | $settings = $this->get_settings_for_display(); |
| 718 | extract( $settings ); //extract all settings array to variables converted to name of key |
| 719 | |
| 720 | $tabs = $this->get_settings_for_display( 'tabs' ); |
| 721 | $id_int = substr( $this->get_id_int(), 0, 3 ); |
| 722 | |
| 723 | $navigation_arrow_class = ! empty( $is_navigation_arrow == 'yes' ) ? ' process_tab_shortcode' : ''; |
| 724 | $sticky_tab_class = ! empty( $is_sticky_tab == 'yes' ) ? ' sticky_tab' : ''; |
| 725 | $tab_auto_class = !empty( $is_auto_play == 'yes' ) ? 'spe_auto_tabs' : ''; |
| 726 | |
| 727 | //================= Template Parts =================// |
| 728 | include "templates/tabs/tab-{$settings['style']}.php"; |
| 729 | |
| 730 | } |
| 731 | |
| 732 | |
| 733 | } |