1let progressBar = null; 2 3function checkNavColor(slider) { 4 let menu_color = slider.find('.swiper-slide-active').data('color'); 5 6 checkNavColor.hasLongBanner = $('.header_opacity').length; 7 if (checkNavColor.hasLongBanner) { 8 var logoOpacity = $('body.header_opacity').length; 9 var bLogoImg = $('body:not(.left_header_column) header .logo img').length; 10 11 if ( 12 bLogoImg && 13 logoOpacity 14 ) { 15 $('header .logo img').attr('src', arAsproOptions.THEME.LOGO_IMAGE); 16 } 17 18 $('header').removeClass('theme-light theme-dark'); 19 $('header').addClass('theme-' + (menu_color === 'light' ? 'dark' : 'light')); 20 21 if ( 22 menu_color === 'light' && 23 bLogoImg && 24 logoOpacity && 25 arAsproOptions.THEME.LOGO_IMAGE_WHITE 26 ) { 27 $('header .logo img').attr('src', arAsproOptions.THEME.LOGO_IMAGE_WHITE); 28 } 29 } 30 31 // swiper-pagintaion & navigation background color change 32 if (menu_color) { 33 slider.find('.banners-big__nav-wrap').removeClass('theme-light theme-dark'); 34 slider.find('.banners-big__nav-wrap').addClass('theme-' + (menu_color === 'light' ? 'dark' : 'light')); 35 } 36 37 var eventdata = {slider: slider}; 38 BX.onCustomEvent('onSlide', [eventdata]); 39} 40 41readyDOM(function () { 42 $(".main-slider").mouseenter(function () { 43 let swiper = $(this).data("swiper"); 44 if (!$(this).hasClass("video_visible") && swiper) { 45 if (swiper?.params.autoplay.enabled) { 46 if (!swiper.autoplay.paused) { 47 swiper.autoplay.pause(); 48 } 49 } 50 } 51 }); 52 53 $(".main-slider").mouseleave(function () { 54 let swiper = $(this).data("swiper"); 55 if (!$(this).hasClass("video_visible") && swiper) { 56 if ($(this).data("swiper")?.params.autoplay.enabled) { 57 if (swiper.autoplay.paused) { 58 $(this).data("swiper").autoplay.resume(); 59 } 60 } 61 } 62 }); 63}); 64 65BX.addCustomEvent("onSetSliderOptions", function (options) { 66 if ("type" in options && options.type === "main_banner") { 67 if (typeof arAsproOptions["THEME"] != "undefined") { 68 const slideshowSpeed = Math.abs(parseInt(arAsproOptions["THEME"]["BIGBANNER_SLIDESSHOWSPEED"])); 69 const animationSpeed = Math.abs(parseInt(arAsproOptions["THEME"]["BIGBANNER_ANIMATIONSPEED"])); 70 71 options.autoplay = slideshowSpeed && arAsproOptions["THEME"]["BIGBANNER_ANIMATIONTYPE"].length ? {} : false; 72 // options.autoplay.pauseOnMouseEnter = true; 73 // options.autoplay.disableOnInteraction = false; 74 options.effect = arAsproOptions["THEME"]["BIGBANNER_ANIMATIONTYPE"] === "FADE" ? "fade" : "slide"; 75 if (animationSpeed >= 0) { 76 options.speed = animationSpeed; 77 } 78 if (slideshowSpeed >= 0) { 79 options.autoplay.delay = slideshowSpeed; 80 } 81 /*if (arAsproOptions["THEME"]["BIGBANNER_ANIMATIONTYPE"] !== "FADE") { 82 options.direction = 83 arAsproOptions["THEME"]["BIGBANNER_ANIMATIONTYPE"] === "SLIDE_VERTICAL" ? "vertical" : "horizontal"; 84 }*/ 85 } 86 87 if ("CURRENT_BANNER_INDEX" in arAsproOptions && arAsproOptions["CURRENT_BANNER_INDEX"]) { 88 currentBannerIndex = arAsproOptions["CURRENT_BANNER_INDEX"] - 1; 89 if (currentBannerIndex < options.countSlides) { 90 options.initialSlide = currentBannerIndex; 91 // options.autoplay = false; 92 } 93 } 94 95 if (!options.on) { 96 options.on = {} 97 } 98 99 options.on.autoplayTimeLeft = (swiper, time, progress) => { 100 if (progressBar) { 101 progressBar.value = 1 - progress; 102 } 103 } 104 } 105}); 106 107BX.addCustomEvent("onSlideChanges", function (eventdata) { 108 if ("slider" in eventdata && eventdata.slider) { 109 const slider = eventdata.slider; 110 if (slider && slider.params) { 111 if ("type" in slider.params && slider.params.type === "main_banner") { 112 setTimeout(function () { 113 checkNavColor($(slider.el)); 114 }, 100); 115 116 if ( 117 slider.pagination 118 && slider.pagination.bullets 119 && slider.pagination.bullets[slider.activeIndex] 120 ) { 121 slider.pagination.el.querySelector('.swiper-pagination-bullet-active').append(progressBar); 122 } 123 } 124 } 125 } 126}); 127 128BX.addCustomEvent('onInitSlider', (eventdata) => { 129 if (!eventdata.options) return; 130 131 if ("type" in eventdata.options && eventdata.options.type === "main_banner") { 132 progressBar = document.querySelector(".autoplay-progress"); 133 134 if ( 135 eventdata.slider 136 && eventdata.slider.pagination 137 && eventdata.slider.pagination.bullets 138 && eventdata.slider.pagination.bullets[0] 139 ) { 140 eventdata.slider.pagination.bullets[0].append(progressBar); 141 } 142 } 143});
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.