1jQuery(document).ready(function ($) { 2 $(window).scroll(function () { 3 if ($(this).scrollTop() > 1) { 4 $('.header').addClass("sticky"); 5 } else { 6 $('.header').removeClass("sticky"); 7 } 8 }); 9}); 10 11document.addEventListener('DOMContentLoaded', function() { 12 const columns = document.querySelectorAll('.section-industries__item'); 13 14 columns.forEach(function(column) { 15 column.addEventListener('click', function() { 16 columns.forEach(function(col) { 17 col.classList.remove('active'); 18 const txt = col.querySelector('.item-industries__content'); 19 txt.classList.remove('active'); 20 }); 21 column.classList.add('active'); 22 const text = column.querySelector('.item-industries__content'); 23 setTimeout(text.classList.add('active'), 3000); 24 }); 25 }); 26}); 27document.addEventListener('change', function (e) { 28 29 if (!e.target.matches('.pum-file-input[type="file"]')) { 30 return; 31 } 32 33 const input = e.target; 34 const uploadBox = input.closest('.pum-file-upload-area'); 35 36 if (!uploadBox) return; 37 38 const uploadContent = uploadBox.querySelector('.pum-upload-content'); 39 40 if (!uploadContent) return; 41 42 if (input.files && input.files.length > 0) { 43 44 const fileName = input.files[0].name; 45 46 uploadContent.innerHTML = ` 47 <div class="pum-file-attached"> 48 <div class="pum-file-attached-title"> 49 FILE ATTACHED 50 </div> 51 52 <div class="pum-file-attached-name"></div> 53 </div> 54 `; 55 56 uploadContent.querySelector('.pum-file-attached-name').textContent = fileName; 57 58 uploadBox.classList.add('has-file'); 59 60 } else { 61 62 uploadBox.classList.remove('has-file'); 63 } 64 65}); 66 67// jQuery(".section-industries__items").owlCarousel({ 68// stageClass: "owl-wrapper", 69// stageOuterClass: "owl-wrapper-outer", 70// loadedClass: "owl-carousel", 71// responsive:{ 72// 0:{ 73// items:1, 74// }, 75// 767:{ 76// items:3, 77// } 78// }, 79// nav: false, 80// dots: true, 81// dotsSpeed: 500, 82// items: 3, 83// rewind: true, 84// }); 85// 86 87let owl_case = jQuery('.join-events'); 88 89 let owl_caseOptions = { 90 stageClass: "owl-wrapper", 91 stageOuterClass: "owl-wrapper-outer", 92 loadedClass: "owl-carousel", 93 nav: false, 94 dots: true, 95 dotsSpeed: 500, 96 rewind: true, 97 items: 1 98 }; 99 100if ( jQuery(window).width() < 640 ) { 101 let owl_caseActive = owl_case.owlCarousel(owl_caseOptions); 102} else { 103 owl_case.addClass('off'); 104} 105 106 107let owl = jQuery('.section-industries__items'); 108 109 let owlOptions = { 110 stageClass: "owl-wrapper", 111 stageOuterClass: "owl-wrapper-outer", 112 loadedClass: "owl-carousel", 113 nav: false, 114 dots: true, 115 dotsSpeed: 500, 116 rewind: true, 117 items: 1 118 }; 119 120if ( jQuery(window).width() < 640 ) { 121 let owlActive = owl.owlCarousel(owlOptions); 122} else { 123 owl.addClass('off'); 124} 125 126 127 128jQuery(window).resize(function() { 129 if (jQuery(window).width() < 640 ) { 130 if ( jQuery('.section-industries__items').hasClass('off') ) { 131 let owlActive = owl.owlCarousel(owlOptions); 132 owl.removeClass('off'); 133 } 134 } else { 135 if ( !jQuery('.section-industries__items').hasClass('off') ) { 136 owl.addClass('off').trigger('destroy.owl.carousel'); 137 owl.find('.owl-stage-outer').children(':eq(0)').unwrap(); 138 } 139 } 140}); 141 142let owl_benefits = jQuery('.benefits-training'); 143 144 let owlOptions_benefits = { 145 stageClass: "owl-wrapper", 146 stageOuterClass: "owl-wrapper-outer", 147 loadedClass: "owl-carousel", 148 nav: false, 149 dots: true, 150 dotsSpeed: 500, 151 rewind: true, 152 items: 1 153 }; 154 155if ( jQuery(window).width() < 640 ) { 156 let owlActive_benefits = owl_benefits.owlCarousel(owlOptions_benefits); 157} else { 158 owl.addClass('off'); 159} 160 161 162 163jQuery(window).resize(function() { 164 if (jQuery(window).width() < 640 ) { 165 if ( jQuery('.benefits-training').hasClass('off') ) {
166 let owlActive_benefits = owl.owlCarousel(owlOptions_benefits); 167 owl_benefits.removeClass('off'); 168 } 169 } else { 170 if ( !jQuery('.benefits-training').hasClass('off') ) { 171 owl_benefits.addClass('off').trigger('destroy.owl.carousel'); 172 owl_benefits.find('.owl-stage-outer').children(':eq(0)').unwrap(); 173 } 174 } 175}); 176 177let owl_rectop = jQuery('.recruit-top-items'); 178 179 let owlOptions_rectop = { 180 stageClass: "owl-wrapper", 181 stageOuterClass: "owl-wrapper-outer", 182 loadedClass: "owl-carousel", 183 nav: false, 184 dots: true, 185 dotsSpeed: 500, 186 rewind: true, 187 items: 1, 188 margin : 10 189 }; 190 191if ( jQuery(window).width() < 640 ) { 192 let owlActive_rectop = owl_rectop.owlCarousel(owlOptions_rectop); 193} else { 194 owl_rectop.addClass('off'); 195} 196 197 198 199jQuery(window).resize(function() { 200 if (jQuery(window).width() < 640 ) { 201 if ( jQuery('.recruit-top-items').hasClass('off') ) { 202 let owlActive_rectop = owl_rectop.owlCarousel(owlOptions_rectop); 203 owl_rectop.removeClass('off'); 204 } 205 } else { 206 if ( !jQuery('.recruit-top-items').hasClass('off') ) { 207 owl_rectop.addClass('off').trigger('destroy.owl.carousel'); 208 owl_rectop.find('.owl-stage-outer').children(':eq(0)').unwrap(); 209 } 210 } 211}); 212 213let owl_assist = jQuery('.section-assist-items'); 214 215 let owlOptions_assist = { 216 stageClass: "owl-wrapper", 217 stageOuterClass: "owl-wrapper-outer", 218 loadedClass: "owl-carousel", 219 nav: false, 220 dots: true, 221 dotsSpeed: 500, 222 rewind: true, 223 items: 1 224 }; 225 226if ( jQuery(window).width() < 640 ) { 227 let owlActive_assist = owl_assist.owlCarousel(owlOptions_assist); 228} else { 229 owl_assist.addClass('off'); 230} 231 232 233 234jQuery(window).resize(function() { 235 if (jQuery(window).width() < 640 ) { 236 if ( jQuery('.section-assist-items').hasClass('off') ) { 237 let owlActive_assist = owl_assist.owlCarousel(owlOptions_assist); 238 owl_assist.removeClass('off'); 239 } 240 } else { 241 if ( !jQuery('.section-assist-items').hasClass('off') ) { 242 owl_assist.addClass('off').trigger('destroy.owl.carousel'); 243 owl_assist.find('.owl-stage-outer').children(':eq(0)').unwrap(); 244 } 245 } 246}); 247 248 249let owls = jQuery('.science-data-section__items'); 250 251let owlOptionss = { 252 stageClass: "owl-wrapper", 253 stageOuterClass: "owl-wrapper-outer", 254 loadedClass: "owl-carousel", 255 nav: false, 256 dots: true, 257 dotsSpeed: 500, 258 rewind: true, 259 items: 1, 260 margin : 10 261}; 262 263if ( jQuery(window).width() < 640 ) { 264 let owlActive = owls.owlCarousel(owlOptionss); 265} else { 266 owls.addClass('off'); 267} 268 269jQuery(window).resize(function() { 270 if (jQuery(window).width() < 640 ) { 271 if ( jQuery('.science-data-section__items').hasClass('off') ) { 272 let owlActive = owls.owlCarousel(owlOptionss); 273 owls.removeClass('off'); 274 } 275 } else { 276 if ( !jQuery('.science-data-section__items').hasClass('off') ) { 277 owls.addClass('off').trigger('destroy.owl.carousel'); 278 owls.find('.owl-stage-outer').children(':eq(0)').unwrap(); 279 } 280 } 281}); 282 283let owlsr = jQuery('.reviews-new_items'); 284 285let owlOptionssr = { 286 stageClass: "owl-wrapper", 287 stageOuterClass: "owl-wrapper-outer", 288 loadedClass: "owl-carousel", 289 nav: false, 290 dots: true, 291 dotsSpeed: 500, 292 rewind: true, 293 items: 1, 294 margin : 10 295}; 296 297if ( jQuery(window).width() < 640 ) { 298 let owlActiver = owlsr.owlCarousel(owlOptionssr); 299} else { 300 owlsr.addClass('off'); 301} 302 303jQuery(window).resize(function() { 304 if (jQuery(window).width() < 640 ) { 305 if ( jQuery('.reviews-new_items').hasClass('off') ) { 306 let owlActiver = owlsr.owlCarousel(owlOptionssr); 307 owlsr.removeClass('off'); 308 } 309 } else { 310 if ( !jQuery('.reviews-new_items').hasClass('off') ) { 311 owlsr.addClass('off').trigger('destroy.owl.carousel'); 312 owlsr.find('.owl-stage-outer').children(':eq(0)').unwrap(); 313 } 314 } 315}); 316 317 318 319let owlss = jQuery('.section-expertise__items'); 320 321let owlOptionsss = { 322 stageClass: "owl-wrapper", 323 stageOuterClass: "owl-wrapper-outer", 324 loadedClass: "owl-carousel", 325 nav: false, 326 dots: true, 327 dotsSpeed: 500, 328 rewind: true, 329 items: 1, 330 margin : 10 331}; 332 333if ( jQuery(window).width() < 640 ) { 334 let owlActive = owlss.owlCarousel(owlOptionsss); 335} else { 336 owlss.addClass('off'); 337} 338 339jQuery(window).resize(function() { 340 if (jQuery(window).width() < 640 ) { 341 if ( jQuery('.section-expertise__items').hasClass('off') ) { 342 let owlActive = owlss.owlCarousel(owlOptionsss); 343 owlss.removeClass('off'); 344 } 345 } else { 346 if ( !jQuery('.section-expertise__items').hasClass('off') ) { 347 owlss.addClass('off').trigger('destroy.owl.carousel'); 348 owlss.find('.owl-stage-outer').children(':eq(0)').unwrap(); 349 } 350 } 351}); 352 353 354jQuery(document).ready(function () { 355 356 let owlch = jQuery('.community-history-slider .vc_column-inner .wpb_wrapper'); 357 358 let owlOptionsch = { 359 stageClass: "owl-wrapper", 360 stageOuterClass: "owl-wrapper-outer", 361 loadedClass: "owl-carousel", 362 nav: false, 363 dots: true, 364 rewind: true, 365 items: 1, 366 loop: true, 367 autoplay: true, 368 autoplayTimeout: 3000, 369 autoplayHoverPause: true 370 }; 371 let owlActivech = owlch.owlCarousel(owlOptionsch); 372 373 374 let owldp = jQuery('.development-process-slider .vc_column-inner .wpb_wrapper'); 375 376 let owlOptionsdp = { 377 stageClass: "owl-wrapper", 378 stageOuterClass: "owl-wrapper-outer", 379 loadedClass: "owl-carousel", 380 nav: true, 381 dots: false, 382 rewind: true, 383 items: 1, 384 margin : 10, 385 onInitialized: addNavNumbers, 386 onChanged: updateNavNumbers, 387 navText: [ 388 '<span class="custom-prev"><i class="vc_btn3-icon vc-material vc-material-arrow_back"></i></span>', // Custom Previous Button 389 '<span class="custom-next"><i class="vc_btn3-icon vc-material vc-material-arrow_forward"></i></span>', // Custom Next Button 390 ], 391 }; 392 let owlActivedp = owldp.owlCarousel(owlOptionsdp); 393 394 function addNavNumbers(event) { 395 var total = event.item.count; 396 jQuery(".development-process-slider .owl-nav").each(function () { 397 jQuery(this).children(".owl-prev").after(` 398 <div class="page-indicator">
399 <span>STEP </span> 400 <span id="current-slide">1</span> 401 <span>/</span> 402 <span id="total-slides">`+total+`</span> 403 </div> 404 `); 405 }); 406 } 407 408 function updateNavNumbers(event) { 409 var total = event.item.count; // Total slides 410 var current = event.item.index - event.relatedTarget._clones.length / 2 + 1; 411 if (current > total) current -= total; // Adjust for looped slides 412 413 jQuery("#current-slide").text(current); 414 jQuery("#total-slides").text(total); 415 416 jQuery(".development-point").hide(); 417 jQuery(".dpt"+current).show(); 418 } 419 420 const path_names = ['usa', 'mena', 'uk', 'europe', 'africa', 'middleeast']; 421 //setTimeout(jQuery("#usa-tooltip").fadeOut(300), 300); 422 //; 423 let isCircle = false; 424 let isTitle = false; 425 let usa_circle = jQuery('[data-name="usa-circle"]'); 426 let usa_name = jQuery('[data-name="usa-title"]'); 427 let uk_circle = jQuery('[data-name="uk-circle"]'); 428 let uk_name = jQuery('[data-name="uk-title"]'); 429 let europe_circle = jQuery('[data-name="europe-circle"]'); 430 let europe_name = jQuery('[data-name="europe-title"]'); 431 let mena_circle = jQuery('[data-name="mena-circle"]'); 432 let mena_name = jQuery('[data-name="mena-title"]'); 433 let name = ''; 434 mena_name.on("mouseenter", function(){ 435 name="mena"; 436 isTitle = true; 437 }); 438 mena_name.on("mouseleave", function(){ 439 isTitle = false; 440 }); 441 mena_circle.on("mouseenter", function(){ 442 name="mena"; 443 isCircle = true; 444 let path_name = name.replace("-circle", ""); 445 path_names_off = path_names.filter(function(item) { 446 return item !== path_name; 447 }); 448 jQuery.each(path_names_off, function(index, pname) { 449 jQuery('[data-name="'+pname+'-marker"]').animate({"fill-opacity": 0}, 300); 450 jQuery('[data-name="'+pname+'"]').animate({"fill-opacity": 0.12}, 300); 451 }); 452 jQuery("#"+path_name+"-tooltip").animate({"opacity": 1}, 300);//.fadeIn(300); 453 }); 454 mena_circle.on("mouseleave", function(){ 455 setTimeout(() => { 456 if (!isTitle && !isCircle){ 457 jQuery.each(path_names, function(index, pname) { 458 jQuery('[data-name="'+pname+'"]').animate({"fill-opacity": 1}, 300); 459 jQuery('[data-name="'+pname+'-marker"]').animate({"fill-opacity": 1}, 1000); 460 }); 461 name = jQuery(this).data("name"); 462 path_name = name.replace("-circle", ""); 463 jQuery("#"+path_name+"-tooltip").animate({"opacity": 0}, 300);//.fadeOut(300); 464 } 465 }, 10); 466 isCircle = false; 467 }); 468 europe_name.on("mouseenter", function(){ 469 name="europe"; 470 isTitle = true; 471 }); 472 europe_name.on("mouseleave", function(){ 473 isTitle = false; 474 }); 475 europe_circle.on("mouseenter", function(){ 476 name="europe"; 477 isCircle = true; 478 let path_name = name.replace("-circle", ""); 479 path_names_off = path_names.filter(function(item) { 480 return item !== path_name; 481 }); 482 jQuery.each(path_names_off, function(index, pname) { 483 jQuery('[data-name="'+pname+'-marker"]').animate({"fill-opacity": 0}, 300); 484 jQuery('[data-name="'+pname+'"]').animate({"fill-opacity": 0.12}, 300); 485 }); 486 jQuery("#"+path_name+"-tooltip").animate({"opacity": 1}, 300);//.fadeIn(300); 487 }); 488 europe_circle.on("mouseleave", function(){ 489 setTimeout(() => { 490 if (!isTitle && !isCircle){ 491 jQuery.each(path_names, function(index, pname) { 492 jQuery('[data-name="'+pname+'"]').animate({"fill-opacity": 1}, 300); 493 jQuery('[data-name="'+pname+'-marker"]').animate({"fill-opacity": 1}, 1000); 494 }); 495 name = jQuery(this).data("name"); 496 path_name = name.replace("-circle", ""); 497 jQuery("#"+path_name+"-tooltip").animate({"opacity": 0}, 300);//.fadeOut(300); 498 } 499 }, 10); 500 isCircle = false;
501 }); 502 uk_name.on("mouseenter", function(){ 503 name="uk"; 504 isTitle = true; 505 }); 506 uk_name.on("mouseleave", function(){ 507 isTitle = false; 508 }); 509 uk_circle.on("mouseenter", function(){ 510 name="uk"; 511 isCircle = true; 512 let path_name = name.replace("-circle", ""); 513 path_names_off = path_names.filter(function(item) { 514 return item !== path_name; 515 }); 516 jQuery.each(path_names_off, function(index, pname) { 517 jQuery('[data-name="'+pname+'-marker"]').animate({"fill-opacity": 0}, 300); 518 jQuery('[data-name="'+pname+'"]').animate({"fill-opacity": 0.12}, 300); 519 }); 520 jQuery("#"+path_name+"-tooltip").animate({"opacity": 1}, 300);//.fadeIn(300); 521 }); 522 uk_circle.on("mouseleave", function(){ 523 setTimeout(() => { 524 if (!isTitle && !isCircle){ 525 jQuery.each(path_names, function(index, pname) { 526 jQuery('[data-name="'+pname+'"]').animate({"fill-opacity": 1}, 300); 527 jQuery('[data-name="'+pname+'-marker"]').animate({"fill-opacity": 1}, 1000); 528 }); 529 name = jQuery(this).data("name"); 530 path_name = name.replace("-circle", ""); 531 jQuery("#"+path_name+"-tooltip").animate({"opacity": 0}, 300);//.fadeOut(300); 532 } 533 }, 10); 534 isCircle = false; 535 }); 536 usa_name.on("mouseenter", function(){ 537 name="usa"; 538 isTitle = true; 539 }); 540 usa_name.on("mouseleave", function(){ 541 isTitle = false; 542 }); 543 usa_circle.on("mouseenter", function(){ 544 name="usa"; 545 isCircle = true; 546 let path_name = name.replace("-circle", ""); 547 path_names_off = path_names.filter(function(item) { 548 return item !== path_name; 549 }); 550 jQuery.each(path_names_off, function(index, pname) { 551 jQuery('[data-name="'+pname+'-marker"]').animate({"fill-opacity": 0}, 300); 552 jQuery('[data-name="'+pname+'"]').animate({"fill-opacity": 0.12}, 300); 553 }); 554 jQuery("#"+path_name+"-tooltip").animate({"opacity": 1}, 300);//.fadeIn(300); 555 }); 556 usa_circle.on("mouseleave", function(){ 557 setTimeout(() => { 558 if (!isTitle && !isCircle){ 559 jQuery.each(path_names, function(index, pname) { 560 jQuery('[data-name="'+pname+'"]').animate({"fill-opacity": 1}, 300); 561 jQuery('[data-name="'+pname+'-marker"]').animate({"fill-opacity": 1}, 1000); 562 }); 563 name = jQuery(this).data("name"); 564 path_name = name.replace("-circle", ""); 565 jQuery("#"+path_name+"-tooltip").animate({"opacity": 0}, 300);//.fadeOut(300); 566 } 567 }, 10); 568 isCircle = false; 569 }); 570 jQuery(".map-mobile-title").on("click", function(){ 571 //fill-opacity = 0.12 572 if(jQuery(this).hasClass("usa-title")){ 573 name = "usa"; 574 } 575 if(jQuery(this).hasClass("uk-title")){ 576 name = "uk"; 577 } 578 if(jQuery(this).hasClass("europe-title")){ 579 name = "europe"; 580 } 581 if(jQuery(this).hasClass("mena-title")){ 582 name = "mena"; 583 } 584 if(jQuery(this).hasClass("map-mobile-title-active")){ 585 jQuery("#"+name+"-tooltip").fadeOut(300); 586 jQuery(this).removeClass("map-mobile-title-active"); 587 }else{ 588 jQuery("#"+name+"-tooltip").fadeIn(300); 589 jQuery(this).addClass("map-mobile-title-active"); 590 } 591 592 }); 593 594 let owladv = jQuery('.advisory-board'); 595 596 let owlOptionsadv = { 597 stageClass: "owl-wrapper", 598 stageOuterClass: "owl-wrapper-outer", 599 loadedClass: "owl-carousel", 600 nav: true, 601 dots: false, 602 rewind: true, 603 items: 3, 604 margin : 10, 605 navText: [ 606 '<span class="custom-prev"><i class="vc_btn3-icon vc-material vc-material-arrow_back"></i></span>', // Custom Previous Button 607 '<span class="custom-next"><i class="vc_btn3-icon vc-material vc-material-arrow_forward"></i></span>', // Custom Next Button 608 ], 609 }; 610 let owlOptionsadvMob = { 611 stageClass: "owl-wrapper", 612 stageOuterClass: "owl-wrapper-outer", 613 loadedClass: "owl-carousel", 614 nav: false, 615 dots: true, 616 rewind: true, 617 items: 1, 618 margin : 10, 619 }; 620 if ( jQuery(window).width() < 640 ) { 621 let owlActiveadv = owladv.owlCarousel(owlOptionsadvMob); 622 } else { 623 let owlActiveadv = owladv.owlCarousel(owlOptionsadv); 624 } 625 626 627 628 629 let owlhis = jQuery('.history-elements .wpb_wrapper'); 630 631 let owlOptionhis = { 632 stageClass: "owl-wrapper", 633 stageOuterClass: "owl-wrapper-outer", 634 loadedClass: "owl-carousel", 635 nav: false, 636 dots: false, 637 dotsSpeed: 500, 638 rewind: true, 639 items: 1, 640 margin : 10 641 }; 642 643 if ( jQuery(window).width() < 640 ) { 644 let owlActivehis = owlhis.owlCarousel(owlOptionhis); 645 } else { 646 owlhis.addClass('off'); 647 } 648 649 jQuery(window).resize(function() { 650 if (jQuery(window).width() < 640 ) { 651 if ( jQuery('.history-elements .wpb_wrapper').hasClass('off') ) { 652 let owlActiver = owlsr.owlCarousel(owlOptionhis); 653 owlhis.removeClass('off'); 654 } 655 } else { 656 if ( !jQuery('.history-elements .wpb_wrapper').hasClass('off') ) { 657 owlhis.addClass('off').trigger('destroy.owl.carousel'); 658 owlhis.find('.owl-stage-outer').children(':eq(0)').unwrap(); 659 } 660 } 661 }); 662 663 664 const wrapper = document.querySelector(".marque_gallery .wpb_wrapper"); 665 const boxes = gsap.utils.toArray(".marque_gallery .wpb_wrapper .wpb_single_image"); 666 const loop = horizontalLoop(boxes, { repeat: -1 }); 667 668 function horizontalLoop(items, config) { 669 items = gsap.utils.toArray(items); 670 config = config || {}; 671 let tl = gsap.timeline({repeat: config.repeat, paused: config.paused, defaults: {ease: "none"}, onReverseComplete: () => tl.totalTime(tl.rawTime() + tl.duration() * 100)}), 672 length = items.length, 673 startX = items[0].offsetLeft, 674 times = [], 675 widths = [], 676 xPercents = [], 677 curIndex = 0, 678 pixelsPerSecond = (config.speed || 1) * 100, 679 snap = config.snap === false ? v => v : gsap.utils.snap(config.snap || 1), // some browsers shift by a pixel to accommodate flex layouts, so for example if width is 20% the first element's width might be 242px, and the next 243px, alternating back and forth. So we snap to 5 percentage points to make things look more natural 680 totalWidth, curX, distanceToStart, distanceToLoop, item, i; 681 gsap.set(items, { // convert "x" to "xPercent" to make things responsive, and populate the widths/xPercents Arrays to make lookups faster. 682 xPercent: (i, el) => { 683 let w = widths[i] = parseFloat(gsap.getProperty(el, "width", "px")); 684 xPercents[i] = snap(parseFloat(gsap.getProperty(el, "x", "px")) / w * 100 + gsap.getProperty(el, "xPercent")); 685 return xPercents[i]; 686 } 687 }); 688 gsap.set(items, {x: 0}); 689 totalWidth = items[length-1].offsetLeft + xPercents[length-1] / 100 * widths[length-1] - startX + items[length-1].offsetWidth * gsap.getProperty(items[length-1], "scaleX") + (parseFloat(config.paddingRight) || 0); 690 for (i = 0; i < length; i++) { 691 item = items[i]; 692 curX = xPercents[i] / 100 * widths[i]; 693 distanceToStart = item.offsetLeft + curX - startX; 694 distanceToLoop = distanceToStart + widths[i] * gsap.getProperty(item, "scaleX"); 695 tl.to(item, {xPercent: snap((curX - distanceToLoop) / widths[i] * 100), duration: distanceToLoop / pixelsPerSecond}, 0) 696 .fromTo(item, {xPercent: snap((curX - distanceToLoop + totalWidth) / widths[i] * 100)}, {xPercent: xPercents[i], duration: (curX - distanceToLoop + totalWidth - curX) / pixelsPerSecond, immediateRender: false}, distanceToLoop / pixelsPerSecond) 697 .add("label" + i, distanceToStart / pixelsPerSecond); 698 times[i] = distanceToStart / pixelsPerSecond; 699 } 700 function toIndex(index, vars) { 701 vars = vars || {}; 702 (Math.abs(index - curIndex) > length / 2) && (index += index > curIndex ? -length : length); // always go in the shortest direction 703 let newIndex = gsap.utils.wrap(0, length, index), 704 time = times[newIndex]; 705 if (time > tl.time() !== index > curIndex) { // if we're wrapping the timeline's playhead, make the proper adjustments 706 vars.modifiers = {time: gsap.utils.wrap(0, tl.duration())}; 707 time += tl.duration() * (index > curIndex ? 1 : -1); 708 } 709 curIndex = newIndex;
710 vars.overwrite = true; 711 return tl.tweenTo(time, vars); 712 } 713 tl.next = vars => toIndex(curIndex+1, vars); 714 tl.previous = vars => toIndex(curIndex-1, vars); 715 tl.current = () => curIndex; 716 tl.toIndex = (index, vars) => toIndex(index, vars); 717 tl.times = times; 718 tl.progress(1, true).progress(0, true); // pre-render for performance 719 if (config.reversed) { 720 tl.vars.onReverseComplete(); 721 tl.reverse(); 722 } 723 return tl; 724} 725}); 726 727jQuery(function ($) { 728 var $tour = $('.referral-body-tour'); 729 var $panels = $tour.find('.vc_tta-panels'); 730 731 if (!$panels.find('.referral-tabs-box').length) { 732 var $box = $('<div class="referral-tabs-box"></div>'); 733 734 $panels.children('.vc_tta-panel').each(function () { 735 var $panel = $(this); 736 var $heading = $panel.children('.vc_tta-panel-heading'); 737 738 // ÐÑли Ð¿Ð°Ð½ÐµÐ»Ñ Ð°ÐºÑÐ¸Ð²Ð½Ð°Ñ â делаем акÑивнÑм и заголовок 739 if ($panel.hasClass('vc_active')) { 740 $heading.addClass('vc_active'); 741 } 742 743 $box.append($heading); 744 }); 745 746 $panels.prepend($box); 747 } 748 749 // ÐÑи клике пеÑеклÑÑаем акÑивнÑй заголовок 750 $tour.on('click', '.referral-tabs-box .vc_tta-panel-heading', function () { 751 var $heading = $(this); 752 753 $tour.find('.referral-tabs-box .vc_tta-panel-heading') 754 .removeClass('vc_active'); 755 756 $heading.addClass('vc_active'); 757 }); 758});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.