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
Video_Playlist.php
850 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' => esc_html__( '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' => esc_html__( 'Tab', 'spider-elements' ), |
| 102 | 'icon' => 'video_playlist_1', |
| 103 | ], |
| 104 | '2' => [ |
| 105 | 'title' => esc_html__( 'Slide', 'spider-elements' ), |
| 106 | 'icon' => 'video_playlist_2', |
| 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' => esc_html__( 'Title', 'spider-elements' ), |
| 121 | 'condition' => [ |
| 122 | 'style' => [ '1' ] |
| 123 | ] |
| 124 | ] |
| 125 | ); |
| 126 | |
| 127 | $this->add_control( |
| 128 | 'playlist_title', [ |
| 129 | 'label' => esc_html__( 'Text', 'spider-elements' ), |
| 130 | 'type' => Controls_Manager::TEXTAREA, |
| 131 | 'separator' => 'before' |
| 132 | ] |
| 133 | ); |
| 134 | |
| 135 | $this->add_group_control( |
| 136 | Group_Control_Typography::get_type(), [ |
| 137 | 'name' => 'playlist_title_typo', |
| 138 | 'selector' => '{{WRAPPER}} .play_list_title' |
| 139 | ] |
| 140 | ); |
| 141 | |
| 142 | $this->add_control( |
| 143 | 'playlist_title_color', [ |
| 144 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 145 | 'type' => Controls_Manager::COLOR, |
| 146 | 'selectors' => [ |
| 147 | '{{WRAPPER}} .play_list_title' => 'color: {{VALUE}};', |
| 148 | ], |
| 149 | ] |
| 150 | ); |
| 151 | |
| 152 | $this->add_control( |
| 153 | 'title_tag', [ |
| 154 | 'label' => esc_html__( 'Title Tag', 'spider-elements' ), |
| 155 | 'type' => Controls_Manager::SELECT, |
| 156 | 'separator' => 'before', |
| 157 | 'default' => 'h3', |
| 158 | 'options' => spel_get_title_tags(), |
| 159 | ] |
| 160 | ); |
| 161 | |
| 162 | $this->end_controls_section(); // End Title Section |
| 163 | |
| 164 | |
| 165 | //======================= Video Playlist Section =======================// |
| 166 | $this->start_controls_section( |
| 167 | 'section_playlist', [ |
| 168 | 'label' => esc_html__( 'Playlist', 'spider-elements' ), |
| 169 | ] |
| 170 | ); |
| 171 | |
| 172 | $repeater = new Repeater(); |
| 173 | $repeater->add_control( |
| 174 | 'title', [ |
| 175 | 'label' => esc_html__( 'Heading', 'spider-elements' ), |
| 176 | 'type' => Controls_Manager::TEXT, |
| 177 | 'dynamic' => [ |
| 178 | 'active' => true, |
| 179 | ], |
| 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 | 'default' => [ |
| 207 | 'url' => Utils::get_placeholder_image_src(), |
| 208 | ] |
| 209 | ] |
| 210 | ); |
| 211 | |
| 212 | $repeater2->add_control( |
| 213 | 'video_caption', [ |
| 214 | 'label' => esc_html__( 'Description', 'spider-elements' ), |
| 215 | 'type' => Controls_Manager::TEXTAREA, |
| 216 | 'placeholder' => esc_html__( 'Type your caption here', 'spider-elements' ), |
| 217 | 'description' => __( '<strong>Note: </strong>This field is applicable for Preset Two', 'spider-elements' ), |
| 218 | ] |
| 219 | ); |
| 220 | |
| 221 | $repeater2->add_control( |
| 222 | 'current_author', [ |
| 223 | 'label' => esc_html__( 'Author', 'spider-elements' ), |
| 224 | 'type' => Controls_Manager::HIDDEN, |
| 225 | // current login user-name // |
| 226 | 'default' => get_current_user_id() ? get_userdata( get_current_user_id() )->display_name : '' |
| 227 | ] |
| 228 | ); |
| 229 | |
| 230 | // CURRENT DATE control |
| 231 | $repeater2->add_control( |
| 232 | 'current_date', [ |
| 233 | 'label' => esc_html__( 'Current Date', 'spider-elements' ), |
| 234 | 'type' => Controls_Manager::HIDDEN, |
| 235 | // DEFAULT CURRENT DATE with time zone |
| 236 | 'default' => date( get_option( 'date_format' ) . get_option( 'time_format' ), current_time( 'timestamp', 0 ) ) |
| 237 | ] |
| 238 | ); |
| 239 | |
| 240 | $repeater->add_control( |
| 241 | 'videos', [ |
| 242 | 'label' => esc_html__( 'Playlist Items', 'spider-elements' ), |
| 243 | 'type' => Controls_Manager::REPEATER, |
| 244 | 'fields' => $repeater2->get_controls(), |
| 245 | 'default' => [ |
| 246 | [ |
| 247 | 'title2' => esc_html__( 'Add Video', 'spider-elements' ), |
| 248 | ] |
| 249 | ], |
| 250 | 'frontend_available' => true, |
| 251 | 'title_field' => '{{{ title2 }}}' |
| 252 | ] |
| 253 | ); |
| 254 | |
| 255 | $this->add_control( |
| 256 | 'tabs', [ |
| 257 | 'label' => esc_html__( 'Playlist Items', 'spider-elements' ), |
| 258 | 'type' => Controls_Manager::REPEATER, |
| 259 | 'fields' => $repeater->get_controls(), |
| 260 | 'default' => [ |
| 261 | [ |
| 262 | 'title' => esc_html__( 'Insert Video', 'spider-elements' ), |
| 263 | ] |
| 264 | ], |
| 265 | 'frontend_available' => true, |
| 266 | 'title_field' => '{{{ title }}}', |
| 267 | 'prevent_empty' => true, |
| 268 | // 'condition' => [ |
| 269 | // 'style' => [ '1' ] |
| 270 | // ] |
| 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__( 'Playlist Section', 'spider-elements' ), |
| 295 | 'tab' => Controls_Manager::TAB_STYLE, |
| 296 | ] |
| 297 | ); |
| 298 | |
| 299 | $this->add_group_control( |
| 300 | \Elementor\Group_Control_Background::get_type(), |
| 301 | [ |
| 302 | 'name' => 'background', |
| 303 | 'types' => [ 'classic', 'gradient' ], |
| 304 | 'selector' => '{{WRAPPER}} .video_list_area, |
| 305 | {{WRAPPER}} .video_slider_area', |
| 306 | ] |
| 307 | ); |
| 308 | |
| 309 | $this->add_responsive_control( |
| 310 | 'sec_padding', [ |
| 311 | 'label' => esc_html__( 'Padding', 'spider-elements' ), |
| 312 | 'type' => Controls_Manager::DIMENSIONS, |
| 313 | 'size_units' => [ 'px', '%', 'em' ], |
| 314 | 'selectors' => [ |
| 315 | '{{WRAPPER}} .video_list_area' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 316 | '{{WRAPPER}} .video_slider_area' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 317 | ], |
| 318 | 'default' => [ |
| 319 | 'unit' => 'px', // The selected CSS Unit. 'px', '%', 'em', |
| 320 | ], |
| 321 | ] |
| 322 | ); |
| 323 | |
| 324 | $this->add_control( |
| 325 | 'laaout_headin', |
| 326 | [ |
| 327 | 'label' => esc_html__( 'Layout', 'spider-elements' ), |
| 328 | 'type' => Controls_Manager::HEADING, |
| 329 | 'separator' => 'before', |
| 330 | 'condition' => [ |
| 331 | 'style' => [ '1' ] |
| 332 | ] |
| 333 | ] |
| 334 | ); |
| 335 | |
| 336 | $this->add_responsive_control( |
| 337 | 'layout_height', |
| 338 | [ |
| 339 | 'label' => esc_html__( 'Height', 'spider-elements' ), |
| 340 | 'type' => Controls_Manager::SLIDER, |
| 341 | 'size_units' => [ 'px', 'vh', 'vw' ], |
| 342 | 'range' => [ |
| 343 | 'px' => [ |
| 344 | 'min' => 200, |
| 345 | 'max' => 1200, |
| 346 | ], |
| 347 | 'vh' => [ |
| 348 | 'min' => 10, |
| 349 | 'max' => 100, |
| 350 | ], |
| 351 | 'vw' => [ |
| 352 | 'min' => 10, |
| 353 | 'max' => 100, |
| 354 | ], |
| 355 | ], |
| 356 | 'selectors' => [ |
| 357 | '{{WRAPPER}} .spel_video_list' => 'height: {{SIZE}}{{UNIT}};', |
| 358 | ], |
| 359 | 'condition' => [ |
| 360 | 'style' => [ '1' ] |
| 361 | ] |
| 362 | ] |
| 363 | ); |
| 364 | |
| 365 | $this->end_controls_section(); |
| 366 | |
| 367 | $this->start_controls_section( |
| 368 | 'section_style_top_bar', |
| 369 | [ |
| 370 | 'label' => esc_html__( 'Video List', 'spider-elements' ), |
| 371 | 'tab' => Controls_Manager::TAB_STYLE, |
| 372 | 'condition' => [ |
| 373 | 'style' => [ '1' ] |
| 374 | ] |
| 375 | ] |
| 376 | ); |
| 377 | |
| 378 | $this->add_control( |
| 379 | 'heading_playlist_name', |
| 380 | [ |
| 381 | 'label' => esc_html__( 'Title', 'spider-elements' ), |
| 382 | 'type' => Controls_Manager::HEADING, |
| 383 | ] |
| 384 | ); |
| 385 | |
| 386 | $this->add_group_control( |
| 387 | Group_Control_Typography::get_type(), |
| 388 | [ |
| 389 | 'name' => 'playlist_name_typography', |
| 390 | 'selector' => '{{WRAPPER}} .list_title', |
| 391 | ] |
| 392 | ); |
| 393 | |
| 394 | $this->start_controls_tabs( |
| 395 | 'video_list_tabs' |
| 396 | ); |
| 397 | |
| 398 | $this->start_controls_tab( |
| 399 | 'list_normal_tab', |
| 400 | [ |
| 401 | 'label' => esc_html__( 'Normal', 'spider-elements' ), |
| 402 | ] |
| 403 | ); |
| 404 | |
| 405 | $this->add_control( |
| 406 | 'playlist_name_color', |
| 407 | [ |
| 408 | 'label' => esc_html__( 'Text Color', 'spider-elements' ), |
| 409 | 'type' => Controls_Manager::COLOR, |
| 410 | 'default' => '', |
| 411 | 'selectors' => [ |
| 412 | '{{WRAPPER}} .list_title' => 'color: {{VALUE}};', |
| 413 | ], |
| 414 | ] |
| 415 | ); |
| 416 | |
| 417 | $this->add_group_control( |
| 418 | \Elementor\Group_Control_Background::get_type(), |
| 419 | [ |
| 420 | 'name' => 'playlist_name_bg', |
| 421 | 'types' => [ 'classic', 'gradient' ], |
| 422 | 'exclude' => [ 'image' ], |
| 423 | 'selector' => '{{WRAPPER}} .video_list .video_list_inner .accordion .accordion-panel', |
| 424 | ] |
| 425 | ); |
| 426 | |
| 427 | $this->end_controls_tab(); |
| 428 | |
| 429 | $this->start_controls_tab( |
| 430 | 'list_hover_tab', |
| 431 | [ |
| 432 | 'label' => esc_html__( 'Active', 'spider-elements' ), |
| 433 | ] |
| 434 | ); |
| 435 | |
| 436 | $this->add_control( |
| 437 | 'active_name_color', |
| 438 | [ |
| 439 | 'label' => esc_html__( 'Text Color', 'spider-elements' ), |
| 440 | 'type' => Controls_Manager::COLOR, |
| 441 | 'default' => '', |
| 442 | 'selectors' => [ |
| 443 | '{{WRAPPER}} .video_list .video_list_inner .accordion .spe-collapsed .spe-accordion .card-header .list_title' => 'color: {{VALUE}};', |
| 444 | ], |
| 445 | ] |
| 446 | ); |
| 447 | |
| 448 | $this->add_control( |
| 449 | 'active_count_color', |
| 450 | [ |
| 451 | 'label' => esc_html__( 'Count Color', 'spider-elements' ), |
| 452 | 'type' => Controls_Manager::COLOR, |
| 453 | 'default' => '', |
| 454 | 'selectors' => [ |
| 455 | '{{WRAPPER}} .video_list .video_list_inner .accordion .spe-collapsed .spe-accordion .card-header button .list_count' => 'color: {{VALUE}} !important;', |
| 456 | ], |
| 457 | ] |
| 458 | ); |
| 459 | |
| 460 | $this->add_control( |
| 461 | 'activer_icon_color', |
| 462 | [ |
| 463 | 'label' => esc_html__( 'Icon Color', 'spider-elements' ), |
| 464 | 'type' => Controls_Manager::COLOR, |
| 465 | 'selectors' => [ |
| 466 | '{{WRAPPER}} .video_list .video_list_inner .accordion .spe-collapsed .spe-accordion .card-header button .plus-minus svg path' => 'stroke: {{VALUE}} !important', |
| 467 | ], |
| 468 | ] |
| 469 | ); |
| 470 | |
| 471 | $this->add_group_control( |
| 472 | \Elementor\Group_Control_Background::get_type(), |
| 473 | [ |
| 474 | 'name' => 'active_name_bg', |
| 475 | 'types' => [ 'classic', 'gradient' ], |
| 476 | 'exclude' => [ 'image' ], |
| 477 | 'selector' => '{{WRAPPER}} .video_list .video_list_inner .accordion .spe-collapsed', |
| 478 | ] |
| 479 | ); |
| 480 | |
| 481 | $this->end_controls_tab(); |
| 482 | |
| 483 | $this->end_controls_tabs(); |
| 484 | |
| 485 | $this->add_responsive_control( |
| 486 | 'playlist_name_padding', |
| 487 | [ |
| 488 | 'label' => esc_html__( 'Padding', 'spider-elements' ), |
| 489 | 'type' => Controls_Manager::DIMENSIONS, |
| 490 | 'size_units' => [ 'px', 'em', '%' ], |
| 491 | 'separator' => 'before', |
| 492 | 'selectors' => [ |
| 493 | '{{WRAPPER}} .video_list .video_list_inner .accordion .accordion-panel .spe-accordion .card-header button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 494 | ], |
| 495 | ] |
| 496 | ); |
| 497 | |
| 498 | $this->add_control( |
| 499 | 'heading_videos_amount', |
| 500 | [ |
| 501 | 'label' => esc_html__( 'Video Count', 'spider-elements' ), |
| 502 | 'type' => Controls_Manager::HEADING, |
| 503 | 'separator' => 'before', |
| 504 | ] |
| 505 | ); |
| 506 | |
| 507 | $this->add_group_control( |
| 508 | Group_Control_Typography::get_type(), |
| 509 | [ |
| 510 | 'name' => 'videos_amount_typography', |
| 511 | 'selector' => '{{WRAPPER}} .video_list .video_list_inner .accordion .accordion-panel .spe-accordion .card-header button .list_count', |
| 512 | ] |
| 513 | ); |
| 514 | |
| 515 | $this->add_control( |
| 516 | 'count_color', |
| 517 | [ |
| 518 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 519 | 'type' => Controls_Manager::COLOR, |
| 520 | 'default' => '', |
| 521 | 'separator' => 'after', |
| 522 | 'selectors' => [ |
| 523 | '{{WRAPPER}} .list_count' => 'color: {{VALUE}} !important;', |
| 524 | ], |
| 525 | ] |
| 526 | ); |
| 527 | |
| 528 | $this->add_control( |
| 529 | 'icon_heading', |
| 530 | [ |
| 531 | 'label' => esc_html__( 'Icon', 'spider-elements' ), |
| 532 | 'type' => Controls_Manager::HEADING, |
| 533 | 'separator' => 'before', |
| 534 | ] |
| 535 | ); |
| 536 | |
| 537 | $this->add_control( |
| 538 | 'playlist_icon_color', |
| 539 | [ |
| 540 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 541 | 'type' => Controls_Manager::COLOR, |
| 542 | 'selectors' => [ |
| 543 | '{{WRAPPER}} .video_list .video_list_inner .accordion .accordion-panel .spe-accordion .card-header button .plus-minus #plus path' => 'stroke: {{VALUE}} !important', |
| 544 | ], |
| 545 | ] |
| 546 | ); |
| 547 | |
| 548 | $this->add_responsive_control( |
| 549 | 'icon_size', |
| 550 | [ |
| 551 | 'label' => esc_html__( 'Size', 'spider-elements' ), |
| 552 | 'type' => Controls_Manager::SLIDER, |
| 553 | 'range' => [ |
| 554 | 'min' => 6, |
| 555 | 'max' => 100, |
| 556 | ], |
| 557 | 'selectors' => [ |
| 558 | '{{WRAPPER}} .video_list .video_list_inner .accordion .accordion-panel .spe-accordion .card-header button .plus-minus #plus' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}} !important', |
| 559 | ], |
| 560 | ] |
| 561 | ); |
| 562 | |
| 563 | $this->end_controls_section(); |
| 564 | |
| 565 | $this->start_controls_section( |
| 566 | 'section_style_videos', |
| 567 | [ |
| 568 | 'label' => esc_html__( 'Videos', 'spider-elements' ), |
| 569 | 'tab' => Controls_Manager::TAB_STYLE, |
| 570 | 'condition' => [ |
| 571 | 'style' => [ '1' ] |
| 572 | ] |
| 573 | ] |
| 574 | ); |
| 575 | |
| 576 | $this->add_group_control( |
| 577 | \Elementor\Group_Control_Background::get_type(), |
| 578 | [ |
| 579 | 'name' => 'playlist_content_bg', |
| 580 | 'types' => [ 'classic', 'gradient' ], |
| 581 | 'exclude' => [ 'image' ], |
| 582 | 'selector' => '{{WRAPPER}} .video_list .video_list_inner .accordion .accordion-content .card-body', |
| 583 | ] |
| 584 | ); |
| 585 | |
| 586 | $this->add_responsive_control( |
| 587 | 'content_padding', |
| 588 | [ |
| 589 | 'label' => esc_html__( 'Padding', 'spider-elements' ), |
| 590 | 'type' => Controls_Manager::DIMENSIONS, |
| 591 | 'size_units' => [ 'px', 'em', '%' ], |
| 592 | 'separator' => 'after', |
| 593 | 'selectors' => [ |
| 594 | '{{WRAPPER}} .video_list .video_list_inner .accordion .accordion-content .card-body' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 595 | ], |
| 596 | ] |
| 597 | ); |
| 598 | |
| 599 | $this->add_control( |
| 600 | 'heading_tab_normal', |
| 601 | [ |
| 602 | 'label' => esc_html__( 'Title', 'spider-elements' ), |
| 603 | 'type' => Controls_Manager::HEADING, |
| 604 | 'separator' => 'before', |
| 605 | ] |
| 606 | ); |
| 607 | |
| 608 | $this->add_group_control( |
| 609 | Group_Control_Typography::get_type(), |
| 610 | [ |
| 611 | 'name' => 'normal_typography', |
| 612 | 'selector' => '{{WRAPPER}} .video_list .video_list_inner .card .card-body .nav li a .media .media-body .body_title', |
| 613 | ] |
| 614 | ); |
| 615 | |
| 616 | $this->add_control( |
| 617 | 'normal_color', |
| 618 | [ |
| 619 | 'label' => esc_html__( 'Text Color', 'spider-elements' ), |
| 620 | 'type' => Controls_Manager::COLOR, |
| 621 | 'separator' => 'after', |
| 622 | 'selectors' => [ |
| 623 | '{{WRAPPER}} .video_list .video_list_inner .card .card-body .nav li a .media .media-body .body_title' => 'color: {{VALUE}};', |
| 624 | '{{WRAPPER}} .e-tab-title .e-tab-title-text a' => 'color: {{VALUE}};', |
| 625 | ], |
| 626 | ] |
| 627 | ); |
| 628 | |
| 629 | $this->add_control( |
| 630 | 'heading_duration_normal', |
| 631 | [ |
| 632 | 'label' => esc_html__( 'Meta', 'spider-elements' ), |
| 633 | 'type' => Controls_Manager::HEADING, |
| 634 | 'separator' => 'before', |
| 635 | ] |
| 636 | ); |
| 637 | |
| 638 | $this->add_group_control( |
| 639 | Group_Control_Typography::get_type(), |
| 640 | [ |
| 641 | 'name' => 'normal_duration_typography', |
| 642 | 'selector' => '{{WRAPPER}} .video_list .video_list_inner .card .card-body .nav li a .media .media-body .list .videos_meta', |
| 643 | ] |
| 644 | ); |
| 645 | |
| 646 | $this->add_control( |
| 647 | 'meta_color', |
| 648 | [ |
| 649 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 650 | 'type' => Controls_Manager::COLOR, |
| 651 | 'selectors' => [ |
| 652 | '{{WRAPPER}} .videos_meta' => 'color: {{VALUE}} !important;', |
| 653 | ], |
| 654 | ] |
| 655 | ); |
| 656 | |
| 657 | |
| 658 | $this->end_controls_section(); |
| 659 | |
| 660 | // Style 2 controls |
| 661 | $this->start_controls_section( |
| 662 | 'style2_videos_slider', |
| 663 | [ |
| 664 | 'label' => esc_html__( 'Video', 'spider-elements' ), |
| 665 | 'tab' => Controls_Manager::TAB_STYLE, |
| 666 | 'condition' => [ |
| 667 | 'style' => [ '2' ] |
| 668 | ] |
| 669 | ] |
| 670 | ); |
| 671 | |
| 672 | $this->add_control( |
| 673 | 'slider_heading', |
| 674 | [ |
| 675 | 'label' => esc_html__( 'Title', 'spider-elements' ), |
| 676 | 'type' => Controls_Manager::HEADING, |
| 677 | ] |
| 678 | ); |
| 679 | |
| 680 | $this-> add_group_control( |
| 681 | Group_Control_Typography::get_type(), |
| 682 | [ |
| 683 | 'name' => 'title_typography', |
| 684 | 'selector' => '{{WRAPPER}} .slide_text a .video_title', |
| 685 | ] |
| 686 | ); |
| 687 | |
| 688 | $this->add_control( |
| 689 | 'title_color', |
| 690 | [ |
| 691 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 692 | 'type' => Controls_Manager::COLOR, |
| 693 | 'selectors' => [ |
| 694 | '{{WRAPPER}} .slide_text a .video_title' => 'color: {{VALUE}};', |
| 695 | ], |
| 696 | ] |
| 697 | ); |
| 698 | |
| 699 | $this->add_control( |
| 700 | 'title_hover_color', |
| 701 | [ |
| 702 | 'label' => esc_html__( 'Hover Color', 'spider-elements' ), |
| 703 | 'type' => Controls_Manager::COLOR, |
| 704 | 'selectors' => [ |
| 705 | '{{WRAPPER}} .slide_text a .video_title:hover' => 'color: {{VALUE}};', |
| 706 | ], |
| 707 | ] |
| 708 | ); |
| 709 | |
| 710 | $this->add_control( |
| 711 | 'description_heading', |
| 712 | [ |
| 713 | 'label' => esc_html__( 'Description', 'spider-elements' ), |
| 714 | 'type' => Controls_Manager::HEADING, |
| 715 | 'separator' => 'before', |
| 716 | ] |
| 717 | ); |
| 718 | |
| 719 | $this->add_group_control( |
| 720 | Group_Control_Typography::get_type(), |
| 721 | [ |
| 722 | 'name' => 'description_typography', |
| 723 | 'selector' => '{{WRAPPER}} .slide_text p', |
| 724 | ] |
| 725 | ); |
| 726 | |
| 727 | $this->add_control( |
| 728 | 'desc_color', |
| 729 | [ |
| 730 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 731 | 'type' => Controls_Manager::COLOR, |
| 732 | 'selectors' => [ |
| 733 | '{{WRAPPER}} .slide_text p' => 'color: {{VALUE}};', |
| 734 | ], |
| 735 | ] |
| 736 | ); |
| 737 | |
| 738 | $this->add_control( |
| 739 | 'desc_margin', |
| 740 | [ |
| 741 | 'label' => esc_html__( 'Margin', 'spider-elements' ), |
| 742 | 'type' => Controls_Manager::DIMENSIONS, |
| 743 | 'size_units' => [ 'px', 'em', '%' ], |
| 744 | 'selectors' => [ |
| 745 | '{{WRAPPER}} .slide_text p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 746 | ], |
| 747 | ] |
| 748 | ); |
| 749 | |
| 750 | $this->add_control( |
| 751 | 'meta_heading', |
| 752 | [ |
| 753 | 'label' => esc_html__( 'Meta', 'spider-elements' ), |
| 754 | 'type' => Controls_Manager::HEADING, |
| 755 | 'separator' => 'before', |
| 756 | ] |
| 757 | ); |
| 758 | |
| 759 | $this->add_group_control( |
| 760 | Group_Control_Typography::get_type(), |
| 761 | [ |
| 762 | 'name' => 'meta_typography', |
| 763 | 'selector' => '{{WRAPPER}} .slide_text .video_user a', |
| 764 | ] |
| 765 | ); |
| 766 | |
| 767 | $this->add_control( |
| 768 | 'meta2_color', |
| 769 | [ |
| 770 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 771 | 'type' => Controls_Manager::COLOR, |
| 772 | 'selectors' => [ |
| 773 | '{{WRAPPER}} .slide_text .video_user a' => 'color: {{VALUE}};', |
| 774 | ], |
| 775 | ] |
| 776 | ); |
| 777 | |
| 778 | $this->add_control( |
| 779 | 'meta_hover_color', |
| 780 | [ |
| 781 | 'label' => esc_html__( 'Hover Color', 'spider-elements' ), |
| 782 | 'type' => Controls_Manager::COLOR, |
| 783 | 'selectors' => [ |
| 784 | '{{WRAPPER}} .slide_text .video_user a:hover' => 'color: {{VALUE}};', |
| 785 | ], |
| 786 | ] |
| 787 | ); |
| 788 | |
| 789 | $this->end_controls_section(); |
| 790 | |
| 791 | $this->start_controls_section( |
| 792 | 'style2_slider', |
| 793 | [ |
| 794 | 'label' => esc_html__( 'Slider', 'spider-elements' ), |
| 795 | 'tab' => Controls_Manager::TAB_STYLE, |
| 796 | 'condition' => [ |
| 797 | 'style' => [ '2' ] |
| 798 | ] |
| 799 | ] |
| 800 | ); |
| 801 | |
| 802 | $this->add_control( |
| 803 | 'slider2_heading', |
| 804 | [ |
| 805 | 'label' => esc_html__( 'Thumbnail Title', 'spider-elements' ), |
| 806 | 'type' => Controls_Manager::HEADING, |
| 807 | ] |
| 808 | ); |
| 809 | |
| 810 | $this->add_group_control( |
| 811 | Group_Control_Typography::get_type(), |
| 812 | [ |
| 813 | 'name' => 'thumbnail_title_typography', |
| 814 | 'selector' => '{{WRAPPER}} .gallery_main_area .gallery-thumbs .item .caption_text .thumbnail_title', |
| 815 | ] |
| 816 | ); |
| 817 | |
| 818 | $this->add_control( |
| 819 | 'thumbnail_color', |
| 820 | [ |
| 821 | 'label' => esc_html__( 'Color', 'spider-elements' ), |
| 822 | 'type' => Controls_Manager::COLOR, |
| 823 | 'selectors' => [ |
| 824 | '{{WRAPPER}} .gallery_main_area .gallery-thumbs .item .caption_text .thumbnail_title' => 'color: {{VALUE}};', |
| 825 | ], |
| 826 | ] |
| 827 | ); |
| 828 | |
| 829 | } |
| 830 | |
| 831 | |
| 832 | /** |
| 833 | * Name: elementor_render() |
| 834 | * Desc: Render the widget output on the frontend. |
| 835 | * Params: no params |
| 836 | * Return: @void |
| 837 | * Since: @1.0.0 |
| 838 | * Package: @spider-elements |
| 839 | * Author: spider-themes |
| 840 | */ |
| 841 | protected function render() { |
| 842 | $settings = $this->get_settings(); |
| 843 | extract( $settings ); //extract all settings array to variables converted to name of key |
| 844 | |
| 845 | // Render the widget output on the frontend. |
| 846 | include "templates/video-playlist/video-playlist-{$settings['style']}.php"; |
| 847 | |
| 848 | } |
| 849 | } |
| 850 |