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
Video_Playlist.php
851 lines
| 1 | <?php |
| 2 | /** |
| 3 | * Use namespace to avoid conflict |
| 4 | */ |
| 5 | |
| 6 | namespace SPEL\Widgets; |
| 7 | |
| 8 | use Elementor\Group_Control_Typography; |
| 9 | use Elementor\Widget_Base; |
| 10 | use Elementor\Controls_Manager; |
| 11 | use Elementor\Repeater; |
| 12 | use Elementor\Group_Control_Text_Shadow; |
| 13 | use Elementor\Utils; |
| 14 | |
| 15 | // Exit if accessed directly |
| 16 | if ( ! defined( 'ABSPATH' ) ) { |
| 17 | exit; |
| 18 | } |
| 19 | |
| 20 | /** |
| 21 | * Class Video_playlist |
| 22 | * @package spider\Widgets |
| 23 | * @since 1.0.0 |
| 24 | */ |
| 25 | class Video_Playlist extends Widget_Base { |
| 26 | public function get_name() { |
| 27 | return 'docy_videos_playlist'; // ID of the widget (Don't change this name) |
| 28 | } |
| 29 | |
| 30 | public function get_title() { |
| 31 | return esc_html__( 'Video Playlist', 'spider-elements' ); |
| 32 | } |
| 33 | |
| 34 | public function get_icon() { |
| 35 | return 'eicon-video-playlist spel-icon'; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * Name: get_style_depends() |
| 40 | * Desc: Register the required CSS dependencies for the frontend. |
| 41 | */ |
| 42 | public function get_style_depends() { |
| 43 | return [ 'ionicons', 'slick', 'slick-theme', 'elegant-icon', 'video-js', 'video-js-theaterMode', 'spel-main' ]; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Name: get_script_depends() |
| 48 | * Desc: Register the required JS dependencies for the frontend. |
| 49 | */ |
| 50 | public function get_script_depends() { |
| 51 | return [ 'slick', 'video-js', 'artplayer', 'video-js-nuevo', 'ionicons', 'spel-el-widgets', 'spel-script' ]; |
| 52 | } |
| 53 | |
| 54 | public function get_keywords() { |
| 55 | return [ 'spider', 'spider elements', 'video', 'playlist', 'video playlist', 'video list' ]; |
| 56 | } |
| 57 | |
| 58 | public function get_categories() { |
| 59 | return [ 'spider-elements' ]; |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Name: register_controls() |
| 64 | * Desc: Register controls for these widgets |
| 65 | * Params: no params |
| 66 | * Return: @void |
| 67 | * Since: @1.0.0 |
| 68 | * Package: @spider-elements |
| 69 | * Author: spider-themes |
| 70 | */ |
| 71 | protected function register_controls() { |
| 72 | $this->elementor_content_control(); |
| 73 | $this->elementor_style_control(); |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Name: elementor_content_control() |
| 78 | * Desc: Register the Content Tab output on the Elementor editor. |
| 79 | * Params: no params |
| 80 | * Return: @void |
| 81 | * Since: @1.0.0 |
| 82 | * Package: @spider-elements |
| 83 | * Author: spider-themes |
| 84 | */ |
| 85 | public function elementor_content_control() { |
| 86 | |
| 87 | |
| 88 | //==================== Select Preset Skin ====================// |
| 89 | $this->start_controls_section( |
| 90 | 'spe_video_preset', [ |
| 91 | 'label' => __( 'Preset Skin', 'spider-elements' ), |
| 92 | ] |
| 93 | ); |
| 94 | |
| 95 | $this->add_control( |
| 96 | 'style', [ |
| 97 | 'label' => esc_html__( 'Skin', 'spider-elements' ), |
| 98 | 'type' => Controls_Manager::CHOOSE, |
| 99 | 'options' => [ |
| 100 | '1' => [ |
| 101 | 'title' => __( 'Tab', 'spider-elements' ), |
| 102 | 'icon' => 'video-playlist', |
| 103 | ], |
| 104 | '2' => [ |
| 105 | 'title' => __( 'Slide', 'spider-elements' ), |
| 106 | 'icon' => 'video-playlist2', |
| 107 | ], |
| 108 | ], |
| 109 | 'toggle' => false, |
| 110 | 'default' => '1', |
| 111 | ] |
| 112 | ); |
| 113 | |
| 114 | $this->end_controls_section(); // End Preset Skin |
| 115 | |
| 116 | |
| 117 | //======================= Title Section =======================// |
| 118 | $this->start_controls_section( |
| 119 | 'title_opt_sec', [ |
| 120 | 'label' => __( 'Title', 'spider-elements' ), |
| 121 | 'condition' => [ |
| 122 | 'style' => [ '1' ] |
| 123 | ] |
| 124 | ] |
| 125 | ); |
| 126 | |
| 127 | $this->add_control( |
| 128 | 'title', [ |
| 129 | 'label' => esc_html__( 'Title text', 'spider-elements' ), |
| 130 | 'type' => Controls_Manager::TEXTAREA, |
| 131 | 'separator' => 'before' |
| 132 | ] |
| 133 | ); |
| 134 | |
| 135 | $this->add_control( |
| 136 | 'title_tag', [ |
| 137 | 'label' => __( 'Title HTML Tag', 'spider-elements' ), |
| 138 | 'type' => Controls_Manager::SELECT, |
| 139 | 'options' => spel_get_title_tags(), |
| 140 | 'default' => 'h3', |
| 141 | ] |
| 142 | ); |
| 143 | |
| 144 | $this->add_control( |
| 145 | 'color_title', [ |
| 146 | 'label' => __( 'Text Color', 'spider-elements' ), |
| 147 | 'type' => Controls_Manager::COLOR, |
| 148 | 'selectors' => [ |
| 149 | '{{WRAPPER}} .title' => 'color: {{VALUE}};', |
| 150 | ], |
| 151 | ] |
| 152 | ); |
| 153 | |
| 154 | $this->add_group_control( |
| 155 | Group_Control_Typography::get_type(), [ |
| 156 | 'name' => 'typography_title', |
| 157 | 'selector' => '{{WRAPPER}} .title' |
| 158 | ] |
| 159 | ); |
| 160 | |
| 161 | $this->end_controls_section(); // End Title Section |
| 162 | |
| 163 | |
| 164 | //======================= Video Playlist Section =======================// |
| 165 | $this->start_controls_section( |
| 166 | 'section_playlist', [ |
| 167 | 'label' => esc_html__( 'Playlist', 'spider-elements' ), |
| 168 | ] |
| 169 | ); |
| 170 | |
| 171 | $repeater = new Repeater(); |
| 172 | $repeater->add_control( |
| 173 | 'title', [ |
| 174 | 'label' => esc_html__( 'Heading', 'spider-elements' ), |
| 175 | 'type' => Controls_Manager::TEXT, |
| 176 | 'dynamic' => [ |
| 177 | 'active' => true, |
| 178 | ], |
| 179 | 'default' => esc_html__( 'Title', 'spider-elements' ), |
| 180 | 'placeholder' => esc_html__( 'Tab Title Text Here', 'spider-elements' ), |
| 181 | 'label_block' => true, |
| 182 | ] |
| 183 | ); |
| 184 | |
| 185 | $repeater2 = new repeater(); |
| 186 | $repeater2->add_control( |
| 187 | 'title2', [ |
| 188 | 'label' => esc_html__( 'Title', 'spider-elements' ), |
| 189 | 'type' => Controls_Manager::TEXT, |
| 190 | 'label_block' => true, |
| 191 | ] |
| 192 | ); |
| 193 | |
| 194 | $repeater2->add_control( |
| 195 | 'video_upload', [ |
| 196 | 'label' => esc_html__( 'Upload Video', 'spider-elements' ), |
| 197 | 'type' => Controls_Manager::MEDIA, |
| 198 | 'media_type' => 'video', |
| 199 | ] |
| 200 | ); |
| 201 | |
| 202 | $repeater2->add_control( |
| 203 | 'thumbnail', [ |
| 204 | 'label' => esc_html__( 'Thumbnail', 'spider-elements' ), |
| 205 | 'type' => Controls_Manager::MEDIA, |
| 206 | 'dynamic' => [ |
| 207 | 'active' => true, |
| 208 | ], |
| 209 | 'default' => [ |
| 210 | 'url' => Utils::get_placeholder_image_src(), |
| 211 | ] |
| 212 | ] |
| 213 | ); |
| 214 | |
| 215 | $repeater2->add_control( |
| 216 | 'video_caption', [ |
| 217 | 'label' => esc_html__( 'Description', 'spider-elements' ), |
| 218 | 'type' => Controls_Manager::TEXTAREA, |
| 219 | 'default' => esc_html__( 'Default title', 'spider-elements' ), |
| 220 | 'placeholder' => esc_html__( 'Type your caption here', 'spider-elements' ), |
| 221 | 'description' => esc_html__( 'This field is applicable for Preset Two', 'spider-elements' ), |
| 222 | ] |
| 223 | ); |
| 224 | |
| 225 | $repeater2->add_control( |
| 226 | 'current_author', [ |
| 227 | 'label' => esc_html__( 'Author', 'spider-elements' ), |
| 228 | 'type' => Controls_Manager::HIDDEN, |
| 229 | // current login user name |
| 230 | 'default' => get_current_user_id() ? get_userdata( get_current_user_id() )->display_name : '' |
| 231 | ] |
| 232 | ); |
| 233 | // CURRENT DATE control |
| 234 | $repeater2->add_control( |
| 235 | 'current_date', [ |
| 236 | 'label' => esc_html__( 'Current Date', 'spider-elements' ), |
| 237 | 'type' => Controls_Manager::HIDDEN, |
| 238 | // DEFAULT CURRENT DATE with time zone |
| 239 | 'default' => date( get_option( 'date_format' ) . get_option( 'time_format' ), current_time( 'timestamp', 0 ) ) |
| 240 | ] |
| 241 | ); |
| 242 | |
| 243 | $repeater->add_control( |
| 244 | 'videos', [ |
| 245 | 'label' => esc_html__( 'Playlist Items', 'spider-elements' ), |
| 246 | 'type' => Controls_Manager::REPEATER, |
| 247 | 'fields' => $repeater2->get_controls(), |
| 248 | 'default' => [ |
| 249 | [ |
| 250 | 'title2' => esc_html__( 'Add Video', 'spider-elements' ), |
| 251 | ] |
| 252 | ], |
| 253 | 'frontend_available' => true, |
| 254 | 'title_field' => '{{{ title2 }}}' |
| 255 | ] |
| 256 | ); |
| 257 | |
| 258 | $this->add_control( |
| 259 | 'tabs', [ |
| 260 | 'label' => esc_html__( 'Playlist Items', 'spider-elements' ), |
| 261 | 'type' => Controls_Manager::REPEATER, |
| 262 | 'fields' => $repeater->get_controls(), |
| 263 | 'default' => [ |
| 264 | [ |
| 265 | 'title' => esc_html__( 'Insert Video', 'spider-elements' ), |
| 266 | ] |
| 267 | ], |
| 268 | 'frontend_available' => true, |
| 269 | 'title_field' => '{{{ title }}}', |
| 270 | 'prevent_empty' => true, |
| 271 | ] |
| 272 | ); |
| 273 | |
| 274 | $this->end_controls_section(); // end of playlist section |
| 275 | |
| 276 | } |
| 277 | |
| 278 | |
| 279 | /** |
| 280 | * Name: elementor_style_control() |
| 281 | * Desc: Register the Style Tab output on the Elementor editor. |
| 282 | * Params: no params |
| 283 | * Return: @void |
| 284 | * Since: @1.0.0 |
| 285 | * Package: @spider-elements |
| 286 | * Author: spider-themes |
| 287 | */ |
| 288 | public function elementor_style_control() { |
| 289 | |
| 290 | // Style Section |
| 291 | $this->start_controls_section( |
| 292 | 'style_sec', |
| 293 | [ |
| 294 | 'label' => esc_html__( 'Style Section', 'spider-elements' ), |
| 295 | 'tab' => Controls_Manager::TAB_STYLE, |
| 296 | ] |
| 297 | ); |
| 298 | |
| 299 | $this->add_responsive_control( |
| 300 | 'sec_padding', [ |
| 301 | 'label' => __( 'Section padding', 'spider-elements' ), |
| 302 | 'type' => Controls_Manager::DIMENSIONS, |
| 303 | 'size_units' => [ 'px', '%', 'em' ], |
| 304 | 'selectors' => [ |
| 305 | '{{WRAPPER}} .video_list_area' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 306 | ], |
| 307 | 'default' => [ |
| 308 | 'unit' => 'px', // The selected CSS Unit. 'px', '%', 'em', |
| 309 | ], |
| 310 | ] |
| 311 | ); |
| 312 | |
| 313 | $this->add_control( |
| 314 | 'sec_bg_color', [ |
| 315 | 'label' => esc_html__( 'Background Color', 'spider-elements' ), |
| 316 | 'type' => Controls_Manager::COLOR, |
| 317 | 'selectors' => [ |
| 318 | '{{WRAPPER}} .video_list_area' => 'background-color: {{VALUE}};', |
| 319 | ], |
| 320 | ] |
| 321 | ); |
| 322 | |
| 323 | $this->end_controls_section(); |
| 324 | |
| 325 | $this->start_controls_section( |
| 326 | 'section_style_layout', |
| 327 | [ |
| 328 | 'label' => esc_html__( 'Layout', 'spider-elements' ), |
| 329 | 'tab' => Controls_Manager::TAB_STYLE, |
| 330 | ] |
| 331 | ); |
| 332 | |
| 333 | $this->add_responsive_control( |
| 334 | 'layout_height', |
| 335 | [ |
| 336 | 'label' => esc_html__( 'Height', 'spider-elements' ), |
| 337 | 'type' => Controls_Manager::SLIDER, |
| 338 | 'size_units' => [ 'px', 'vh', 'vw' ], |
| 339 | 'range' => [ |
| 340 | 'px' => [ |
| 341 | 'min' => 200, |
| 342 | 'max' => 1200, |
| 343 | ], |
| 344 | 'vh' => [ |
| 345 | 'min' => 10, |
| 346 | 'max' => 100, |
| 347 | ], |
| 348 | 'vw' => [ |
| 349 | 'min' => 10, |
| 350 | 'max' => 100, |
| 351 | ], |
| 352 | ], |
| 353 | 'selectors' => [ |
| 354 | '{{WRAPPER}} .e-tabs .e-tabs-main-area' => 'height: {{SIZE}}{{UNIT}};', |
| 355 | ], |
| 356 | ] |
| 357 | ); |
| 358 | |
| 359 | $this->end_controls_section(); |
| 360 | |
| 361 | $this->start_controls_section( |
| 362 | 'section_style_top_bar', |
| 363 | [ |
| 364 | 'label' => esc_html__( 'Top Bar', 'spider-elements' ), |
| 365 | 'tab' => Controls_Manager::TAB_STYLE, |
| 366 | ] |
| 367 | ); |
| 368 | |
| 369 | $this->add_control( |
| 370 | 'heading_playlist_name', |
| 371 | [ |
| 372 | 'label' => esc_html__( 'Playlist Name', 'spider-elements' ), |
| 373 | 'type' => Controls_Manager::HEADING, |
| 374 | ] |
| 375 | ); |
| 376 | |
| 377 | $this->add_control( |
| 378 | 'playlist_name_background', |
| 379 | [ |
| 380 | 'label' => esc_html__( 'Background', 'spider-elements' ), |
| 381 | 'type' => Controls_Manager::COLOR, |
| 382 | 'selectors' => [ |
| 383 | '{{WRAPPER}} .e-tabs-header' => 'background-color: {{VALUE}};', |
| 384 | ], |
| 385 | ] |
| 386 | ); |
| 387 | |
| 388 | $this->add_control( |
| 389 | 'playlist_name_color', |
| 390 | [ |
| 391 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 392 | 'type' => Controls_Manager::COLOR, |
| 393 | 'default' => '', |
| 394 | 'selectors' => [ |
| 395 | '{{WRAPPER}} .e-tabs-header .e-tabs-title' => 'color: {{VALUE}};', |
| 396 | ], |
| 397 | ] |
| 398 | ); |
| 399 | |
| 400 | $this->add_group_control( |
| 401 | Group_Control_Typography::get_type(), |
| 402 | [ |
| 403 | 'name' => 'playlist_name_typography', |
| 404 | 'selector' => '{{WRAPPER}} .e-tabs-header .e-tabs-title', |
| 405 | ] |
| 406 | ); |
| 407 | |
| 408 | $this->add_control( |
| 409 | 'heading_videos_amount', |
| 410 | [ |
| 411 | 'label' => esc_html__( 'Video Count', 'spider-elements' ), |
| 412 | 'type' => Controls_Manager::HEADING, |
| 413 | ] |
| 414 | ); |
| 415 | |
| 416 | $this->add_control( |
| 417 | 'videos_amount_color', |
| 418 | [ |
| 419 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 420 | 'type' => Controls_Manager::COLOR, |
| 421 | 'default' => '', |
| 422 | 'selectors' => [ |
| 423 | '{{WRAPPER}} .e-tabs-header .e-tabs-videos-count' => 'color: {{VALUE}};', |
| 424 | '{{WRAPPER}} .e-tabs-header .e-tabs-header-right-side i' => 'color: {{VALUE}};', |
| 425 | '{{WRAPPER}} .e-tabs-header .e-tabs-header-right-side svg' => 'fill: {{VALUE}};', |
| 426 | ], |
| 427 | ] |
| 428 | ); |
| 429 | |
| 430 | $this->add_group_control( |
| 431 | Group_Control_Typography::get_type(), |
| 432 | [ |
| 433 | 'name' => 'videos_amount_typography', |
| 434 | 'selector' => '{{WRAPPER}} .e-tabs-header .e-tabs-videos-count', |
| 435 | ] |
| 436 | ); |
| 437 | |
| 438 | $this->end_controls_section(); |
| 439 | |
| 440 | $this->start_controls_section( |
| 441 | 'section_style_videos', |
| 442 | [ |
| 443 | 'label' => esc_html__( 'Videos', 'spider-elements' ), |
| 444 | 'tab' => Controls_Manager::TAB_STYLE, |
| 445 | ] |
| 446 | ); |
| 447 | |
| 448 | $this->start_controls_tabs( 'playlist_tabs' ); |
| 449 | |
| 450 | $this->start_controls_tab( |
| 451 | 'playlist_tabs_normal', |
| 452 | [ |
| 453 | 'label' => esc_html__( 'Normal', 'spider-elements' ), |
| 454 | ] |
| 455 | ); |
| 456 | |
| 457 | $this->add_control( |
| 458 | 'heading_tab_normal', |
| 459 | [ |
| 460 | 'label' => esc_html__( 'Item', 'spider-elements' ), |
| 461 | 'type' => Controls_Manager::HEADING, |
| 462 | ] |
| 463 | ); |
| 464 | |
| 465 | $this->add_control( |
| 466 | 'normal_background', |
| 467 | [ |
| 468 | 'label' => esc_html__( 'Background', 'spider-elements' ), |
| 469 | 'type' => Controls_Manager::COLOR, |
| 470 | 'selectors' => [ |
| 471 | '{{WRAPPER}} .video_list .video_list_inner .card' => 'background-color: {{VALUE}};', |
| 472 | ], |
| 473 | ] |
| 474 | ); |
| 475 | |
| 476 | $this->add_control( |
| 477 | 'normal_color', |
| 478 | [ |
| 479 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 480 | 'type' => Controls_Manager::COLOR, |
| 481 | 'selectors' => [ |
| 482 | '{{WRAPPER}} .e-tab-title .e-tab-title-text' => 'color: {{VALUE}};', |
| 483 | '{{WRAPPER}} .e-tab-title .e-tab-title-text a' => 'color: {{VALUE}};', |
| 484 | ], |
| 485 | ] |
| 486 | ); |
| 487 | |
| 488 | $this->add_group_control( |
| 489 | Group_Control_Typography::get_type(), [ |
| 490 | 'name' => 'normal_typography', |
| 491 | 'selector' => '{{WRAPPER}} .e-tab-title .e-tab-title-text', |
| 492 | ] |
| 493 | ); |
| 494 | |
| 495 | $this->add_control( |
| 496 | 'heading_duration_normal', |
| 497 | [ |
| 498 | 'label' => esc_html__( 'Duration', 'spider-elements' ), |
| 499 | 'type' => Controls_Manager::HEADING, |
| 500 | ] |
| 501 | ); |
| 502 | |
| 503 | $this->add_control( |
| 504 | 'normal_duration_color', |
| 505 | [ |
| 506 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 507 | 'type' => Controls_Manager::COLOR, |
| 508 | 'selectors' => [ |
| 509 | '{{WRAPPER}} .e-tab-title .e-tab-duration' => 'color: {{VALUE}};', |
| 510 | ], |
| 511 | ] |
| 512 | ); |
| 513 | |
| 514 | $this->add_group_control( |
| 515 | Group_Control_Typography::get_type(), |
| 516 | [ |
| 517 | 'name' => 'normal_duration_typography', |
| 518 | 'selector' => '{{WRAPPER}} .e-tab-title .e-tab-duration', |
| 519 | ] |
| 520 | ); |
| 521 | |
| 522 | $this->add_control( |
| 523 | 'heading_icon_normal', |
| 524 | [ |
| 525 | 'label' => esc_html__( 'Icon', 'spider-elements' ), |
| 526 | 'type' => Controls_Manager::HEADING, |
| 527 | ] |
| 528 | ); |
| 529 | |
| 530 | $this->add_control( |
| 531 | 'normal_icon_color', |
| 532 | [ |
| 533 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 534 | 'type' => Controls_Manager::COLOR, |
| 535 | 'selectors' => [ |
| 536 | '{{WRAPPER}} .video_list .video_list_inner .card .card-body .nav li a .media .d-flex .video_tab_img:after' => 'color: {{VALUE}};', |
| 537 | ], |
| 538 | ] |
| 539 | ); |
| 540 | |
| 541 | |
| 542 | // Default shadow values for the icon. |
| 543 | $this->add_group_control( |
| 544 | Group_Control_Text_Shadow::get_type(), |
| 545 | [ |
| 546 | 'name' => 'normal_icon_top_text_shadow', |
| 547 | 'fields_options' => [ |
| 548 | 'text_shadow_type' => [ |
| 549 | 'label' => _x( 'Shadow', 'Text Shadow Control', 'spider-elements' ), |
| 550 | ], |
| 551 | 'text_shadow' => [ |
| 552 | 'selectors' => [ |
| 553 | '{{WRAPPER}} .e-tab-title i' => 'text-shadow: {{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{COLOR}};', |
| 554 | '{{WRAPPER}} .e-tab-title svg' => 'filter: drop-shadow({{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{COLOR}});', |
| 555 | ], |
| 556 | ], |
| 557 | ], |
| 558 | ] |
| 559 | ); |
| 560 | |
| 561 | $this->add_responsive_control( |
| 562 | 'normal_icon_size', |
| 563 | [ |
| 564 | 'label' => esc_html__( 'Size', 'spider-elements' ), |
| 565 | 'type' => Controls_Manager::SLIDER, |
| 566 | 'range' => [ |
| 567 | 'min' => 10, |
| 568 | 'max' => 30, |
| 569 | ], |
| 570 | 'selectors' => [ |
| 571 | '{{WRAPPER}}' => '--playlist-item-icon-size: {{SIZE}}px', |
| 572 | '{{WRAPPER}}' => '--playlist-item-icon-size: {{SIZE}}px', |
| 573 | ], |
| 574 | ] |
| 575 | ); |
| 576 | |
| 577 | $this->add_control( |
| 578 | 'heading_separator_normal', |
| 579 | [ |
| 580 | 'label' => esc_html__( 'Separator', 'spider-elements' ), |
| 581 | 'type' => Controls_Manager::HEADING, |
| 582 | 'separator' => 'before', |
| 583 | ] |
| 584 | ); |
| 585 | |
| 586 | $this->add_control( |
| 587 | 'normal_separator_style', |
| 588 | [ |
| 589 | 'label' => esc_html__( 'Style', 'spider-elements' ), |
| 590 | 'type' => Controls_Manager::SELECT, |
| 591 | 'default' => '', |
| 592 | 'options' => [ |
| 593 | '' => esc_html__( 'None', 'spider-elements' ), |
| 594 | 'solid' => _x( 'Solid', 'Border Control', 'spider-elements' ), |
| 595 | 'double' => _x( 'Double', 'Border Control', 'spider-elements' ), |
| 596 | 'dotted' => _x( 'Dotted', 'Border Control', 'spider-elements' ), |
| 597 | 'dashed' => _x( 'Dashed', 'Border Control', 'spider-elements' ), |
| 598 | 'groove' => _x( 'Groove', 'Border Control', 'spider-elements' ), |
| 599 | ], |
| 600 | 'selectors' => [ |
| 601 | '{{WRAPPER}} .e-tab-title' => 'border-style: {{VALUE}};', |
| 602 | ], |
| 603 | ] |
| 604 | ); |
| 605 | |
| 606 | $this->add_responsive_control( |
| 607 | 'normal_separator_weight', |
| 608 | [ |
| 609 | 'label' => esc_html__( 'Weight', 'spider-elements' ), |
| 610 | 'type' => Controls_Manager::SLIDER, |
| 611 | 'range' => [ |
| 612 | 'min' => 0, |
| 613 | 'max' => 10, |
| 614 | ], |
| 615 | 'selectors' => [ |
| 616 | '{{WRAPPER}} .e-tab-title' => 'border-width: 0 0 {{SIZE}}px 0;', |
| 617 | ], |
| 618 | 'condition' => [ |
| 619 | 'normal_separator_style!' => '', |
| 620 | ], |
| 621 | ] |
| 622 | ); |
| 623 | |
| 624 | $this->add_control( |
| 625 | 'normal_separator_color', |
| 626 | [ |
| 627 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 628 | 'type' => Controls_Manager::COLOR, |
| 629 | 'selectors' => [ |
| 630 | '{{WRAPPER}} .e-tab-title' => 'border-color: {{VALUE}};', |
| 631 | ], |
| 632 | 'condition' => [ |
| 633 | 'normal_separator_style!' => '', |
| 634 | ], |
| 635 | ] |
| 636 | ); |
| 637 | |
| 638 | $this->end_controls_tab(); |
| 639 | |
| 640 | |
| 641 | $this->start_controls_tab( |
| 642 | 'playlist_tabs_active', |
| 643 | [ |
| 644 | 'label' => esc_html__( 'Active', 'spider-elements' ), |
| 645 | ] |
| 646 | ); |
| 647 | |
| 648 | $this->add_control( |
| 649 | 'heading_tab_active', |
| 650 | [ |
| 651 | 'label' => esc_html__( 'Item', 'spider-elements' ), |
| 652 | 'type' => Controls_Manager::HEADING, |
| 653 | ] |
| 654 | ); |
| 655 | |
| 656 | $this->add_control( |
| 657 | 'active_background', |
| 658 | [ |
| 659 | 'label' => esc_html__( 'Background', 'spider-elements' ), |
| 660 | 'type' => Controls_Manager::COLOR, |
| 661 | 'selectors' => [ |
| 662 | '{{WRAPPER}} .e-tabs-items-wrapper .e-tabs-items .e-tab-title:where( .e-active, :hover )' => 'background-color: {{VALUE}};', |
| 663 | ], |
| 664 | ] |
| 665 | ); |
| 666 | |
| 667 | $this->add_control( |
| 668 | 'active_color', |
| 669 | [ |
| 670 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 671 | 'type' => Controls_Manager::COLOR, |
| 672 | 'default' => '#556068', |
| 673 | 'selectors' => [ |
| 674 | '{{WRAPPER}} .e-tabs-items-wrapper .e-tab-title:where( .e-active, :hover ) .e-tab-title-text' => 'color: {{VALUE}};', |
| 675 | '{{WRAPPER}} .e-tabs-items-wrapper .e-tab-title:where( .e-active, :hover ) .e-tab-title-text a' => 'color: {{VALUE}};', |
| 676 | ], |
| 677 | ] |
| 678 | ); |
| 679 | |
| 680 | $this->add_group_control( |
| 681 | Group_Control_Typography::get_type(), [ |
| 682 | 'name' => 'active_typography', |
| 683 | 'selector' => '{{WRAPPER}} .e-tabs-items-wrapper .e-tab-title:where( .e-active, :hover ) .e-tab-title-text', |
| 684 | ] |
| 685 | ); |
| 686 | |
| 687 | $this->add_control( |
| 688 | 'heading_duration_active', [ |
| 689 | 'label' => esc_html__( 'Duration', 'spider-elements' ), |
| 690 | 'type' => Controls_Manager::HEADING, |
| 691 | ] |
| 692 | ); |
| 693 | |
| 694 | $this->add_control( |
| 695 | 'active_duration_color', |
| 696 | [ |
| 697 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 698 | 'type' => Controls_Manager::COLOR, |
| 699 | 'default' => '', |
| 700 | 'selectors' => [ |
| 701 | '{{WRAPPER}} .e-tabs-items-wrapper .e-tab-title:where( .e-active, :hover ) .e-tab-duration' => 'color: {{VALUE}};', |
| 702 | ], |
| 703 | ] |
| 704 | ); |
| 705 | |
| 706 | $this->add_group_control( |
| 707 | Group_Control_Typography::get_type(), |
| 708 | [ |
| 709 | 'name' => 'active_duration_typography', |
| 710 | 'selector' => '{{WRAPPER}} .e-tabs-items-wrapper .e-tab-title:where( .e-active, :hover ) .e-tab-duration', |
| 711 | ] |
| 712 | ); |
| 713 | |
| 714 | $this->add_control( |
| 715 | 'heading_icon_active', |
| 716 | [ |
| 717 | 'label' => esc_html__( 'Icon', 'spider-elements' ), |
| 718 | 'type' => Controls_Manager::HEADING, |
| 719 | ] |
| 720 | ); |
| 721 | |
| 722 | $this->add_control( |
| 723 | 'active_icon_color', |
| 724 | [ |
| 725 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 726 | 'type' => Controls_Manager::COLOR, |
| 727 | 'selectors' => [ |
| 728 | '{{WRAPPER}} .e-tabs-items-wrapper .e-tab-title:where( .e-active, :hover ) i' => 'color: {{VALUE}};', |
| 729 | '{{WRAPPER}} .e-tabs-items-wrapper .e-tab-title:where( .e-active, :hover ) svg' => 'color: {{VALUE}};', |
| 730 | '{{WRAPPER}} .e-tabs-items-wrapper .e-tab-title:where( .e-active, :hover ) svg path' => 'fill: {{VALUE}};', |
| 731 | ], |
| 732 | ] |
| 733 | ); |
| 734 | |
| 735 | $this->add_group_control( |
| 736 | Group_Control_Text_Shadow::get_type(), |
| 737 | [ |
| 738 | 'name' => 'active_icon_top_text_shadow', |
| 739 | 'fields_options' => [ |
| 740 | 'text_shadow_type' => [ |
| 741 | 'label' => _x( 'Shadow', 'Text Shadow Control', 'spider-elements' ), |
| 742 | ], |
| 743 | ], |
| 744 | 'selector' => '{{WRAPPER}} .e-tab-title:where( .e-active, :hover ) i, {{WRAPPER}} .e-tab-title:where( .e-active, :hover ) svg', |
| 745 | ] |
| 746 | ); |
| 747 | |
| 748 | $this->add_responsive_control( |
| 749 | 'active_icon_size', |
| 750 | [ |
| 751 | 'label' => esc_html__( 'Size', 'spider-elements' ), |
| 752 | 'type' => Controls_Manager::SLIDER, |
| 753 | 'range' => [ |
| 754 | 'min' => 10, |
| 755 | 'max' => 30, |
| 756 | ], |
| 757 | 'selectors' => [ |
| 758 | '{{WRAPPER}} .e-tab-title:where( .e-active, :hover ) span i' => 'font-size: {{SIZE}}px', |
| 759 | '{{WRAPPER}} .e-tab-title:where( .e-active, :hover ) span svg' => 'width: {{SIZE}}px; height: {{SIZE}}px;', |
| 760 | ], |
| 761 | ] |
| 762 | ); |
| 763 | |
| 764 | $this->add_control( |
| 765 | 'heading_separator_active', |
| 766 | [ |
| 767 | 'label' => esc_html__( 'Separator', 'spider-elements' ), |
| 768 | 'type' => Controls_Manager::HEADING, |
| 769 | 'separator' => 'before', |
| 770 | ] |
| 771 | ); |
| 772 | |
| 773 | $this->add_control( |
| 774 | 'active_separator_style', |
| 775 | [ |
| 776 | 'label' => esc_html__( 'Style', 'spider-elements' ), |
| 777 | 'type' => Controls_Manager::SELECT, |
| 778 | 'default' => '', |
| 779 | 'options' => [ |
| 780 | '' => esc_html__( 'None', 'spider-elements' ), |
| 781 | 'solid' => _x( 'Solid', 'Border Control', 'spider-elements' ), |
| 782 | 'double' => _x( 'Double', 'Border Control', 'spider-elements' ), |
| 783 | 'dotted' => _x( 'Dotted', 'Border Control', 'spider-elements' ), |
| 784 | 'dashed' => _x( 'Dashed', 'Border Control', 'spider-elements' ), |
| 785 | 'groove' => _x( 'Groove', 'Border Control', 'spider-elements' ), |
| 786 | ], |
| 787 | 'selectors' => [ |
| 788 | '{{WRAPPER}} .e-tabs-items-wrapper .e-tab-title.e-active' => 'border-style: {{VALUE}};', |
| 789 | ], |
| 790 | ] |
| 791 | ); |
| 792 | |
| 793 | $this->add_responsive_control( |
| 794 | 'active_separator_weight', |
| 795 | [ |
| 796 | 'label' => esc_html__( 'Weight', 'spider-elements' ), |
| 797 | 'type' => Controls_Manager::SLIDER, |
| 798 | 'range' => [ |
| 799 | 'min' => 0, |
| 800 | 'max' => 10, |
| 801 | ], |
| 802 | 'selectors' => [ |
| 803 | '{{WRAPPER}} .e-tabs-items-wrapper .e-tab-title.e-active' => 'border-width: 0 0 {{SIZE}}px 0;', |
| 804 | ], |
| 805 | 'condition' => [ |
| 806 | 'active_separator_style!' => '', |
| 807 | ], |
| 808 | ] |
| 809 | ); |
| 810 | |
| 811 | $this->add_control( |
| 812 | 'active_separator_color', |
| 813 | [ |
| 814 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 815 | 'type' => Controls_Manager::COLOR, |
| 816 | 'selectors' => [ |
| 817 | '{{WRAPPER}} .e-tabs-items-wrapper .e-tabs-items .e-tab-title.e-active' => 'border-color: {{VALUE}};', |
| 818 | ], |
| 819 | 'condition' => [ |
| 820 | 'active_separator_style!' => '', |
| 821 | ], |
| 822 | ] |
| 823 | ); |
| 824 | |
| 825 | $this->end_controls_tab(); |
| 826 | |
| 827 | $this->end_controls_tabs(); |
| 828 | |
| 829 | $this->end_controls_section(); |
| 830 | |
| 831 | } |
| 832 | |
| 833 | |
| 834 | /** |
| 835 | * Name: elementor_render() |
| 836 | * Desc: Render the widget output on the frontend. |
| 837 | * Params: no params |
| 838 | * Return: @void |
| 839 | * Since: @1.0.0 |
| 840 | * Package: @spider-elements |
| 841 | * Author: spider-themes |
| 842 | */ |
| 843 | protected function render() { |
| 844 | $settings = $this->get_settings(); |
| 845 | extract( $settings ); //extract all settings array to variables converted to name of key |
| 846 | |
| 847 | // Render the widget output on the frontend. |
| 848 | include "templates/video-playlist/video-playlist-{$settings['style']}.php"; |
| 849 | |
| 850 | } |
| 851 | } |