1// sb-bootstrap.js 2(function(){ 3 function init(){ 4 // Ð¡Ð»Ð°Ð¹Ð´ÐµÑ Ð¿Ð¾ÑÑов 5 document.querySelectorAll('.sb-swiper').forEach(function(el){ 6 var autoplay = el.dataset.autoplay === '1'; 7 var interval = parseInt(el.dataset.interval||'3500',10); 8 new Swiper(el,{ 9 loop:true, 10 autoplay: autoplay ? {delay:interval} : false, 11 slidesPerView:1, spaceBetween:16, 12 breakpoints:{640:{slidesPerView:2},960:{slidesPerView:3},1280:{slidesPerView:4}}, 13 pagination: { 14 el: el.querySelector('.swiper-pagination'), 15 clickable: true, 16 type: (el.dataset.pagination || 'bullets') 17 }, 18 navigation:{nextEl:el.querySelector('.swiper-button-next'),prevEl:el.querySelector('.swiper-button-prev')} 19 }); 20 }); 21 22 // ÐаÑÑÑÐµÐ»Ñ ÑÑбÑик 23 document.querySelectorAll('.sb-term-swiper').forEach(function(el){ 24 new Swiper(el,{ 25 loop:true, 26 slidesPerView:2, spaceBetween:12, 27 breakpoints:{480:{slidesPerView:3},768:{slidesPerView:5},1024:{slidesPerView:7}}, 28 autoplay:{delay:2500}, 29 pagination: { 30 el: el.querySelector('.swiper-pagination'), 31 clickable: true, 32 type: (el.dataset.pagination || 'bullets') 33 }, 34 }); 35 }); 36 37 // Ð¡Ð»Ð°Ð¹Ð´ÐµÑ Ð² Hero-блоке 38 document.querySelectorAll('.sb-hero-swiper').forEach(function(el) { 39 new Swiper(el, { 40 loop: true, 41 effect: el.dataset.effect || 'slide', // 'slide', 'fade', 'coverflow' etc. 42 autoplay: { 43 delay: parseInt(el.dataset.delay || '5000', 10), 44 disableOnInteraction: false, 45 }, 46 pagination: { 47 el: el.querySelector('.swiper-pagination'), 48 clickable: true, 49 }, 50 navigation: { 51 nextEl: el.querySelector('.swiper-button-next'), 52 prevEl: el.querySelector('.swiper-button-prev'), 53 }, 54 }); 55 }); 56 57 // Ð¡Ð»Ð°Ð¹Ð´ÐµÑ Ð² Intro-блоке 58 document.querySelectorAll('.sb-intro-swiper').forEach(function(el) { 59 let effect = el.dataset.effect || 'slide'; 60 let swiperOptions = { 61 loop: true, 62 effect: effect, 63 autoplay: { 64 delay: parseInt(el.dataset.delay || '4000', 10), 65 disableOnInteraction: false, 66 }, 67 pagination: { 68 el: el.querySelector('.swiper-pagination'), 69 clickable: true, 70 }, 71 navigation: { 72 nextEl: el.querySelector('.swiper-button-next'), 73 prevEl: el.querySelector('.swiper-button-prev'), 74 }, 75 }; 76 77 if (effect === 'coverflow') { 78 swiperOptions.grabCursor = true; 79 swiperOptions.centeredSlides = true; 80 swiperOptions.slidesPerView = '3'; 81 swiperOptions.coverflowEffect = { 82 rotate: 50, 83 stretch: 0, 84 depth: 100, 85 modifier: 1, 86 slideShadows: true, 87 }; 88 } 89 90 if (effect === 'fade') { 91 swiperOptions.fadeEffect = { crossFade: true }; 92 } 93 94 new Swiper(el, swiperOptions); 95 }); 96 97 // ÐÐÐЫРÐÐÐЦÐÐÐÐÐÐТÐÐ ÐÐЯ СÐТÐЧÐÐÐРСÐÐÐÐÐÐ Ð 98 document.querySelectorAll('.sb-swiper-grid').forEach(function(el){ 99 var autoplay = el.dataset.autoplay === '1'; 100 var interval = parseInt(el.dataset.interval||'4000',10); 101 new Swiper(el, { 102 loop: false, // Loop не ÑекомендÑеÑÑÑ Ð´Ð»Ñ Ð³Ñида, но 6 поÑÑов должно Ñ Ð²Ð°ÑиÑÑ 103 autoplay: autoplay ? {delay:interval} : false, 104 slidesPerView: 1, 105 spaceBetween: 16, 106 // ÐпÑÐ¸Ñ Ð´Ð»Ñ ÑÐ¾Ð·Ð´Ð°Ð½Ð¸Ñ ÑеÑки 107 grid: { 108 rows: 2, 109 fill: 'row', 110 }, 111 // ÐдапÑивнÑе ÑоÑки Ð´Ð»Ñ ÑеÑки 112 breakpoints: { 113 601: { 114 slidesPerView: 2, 115 spaceBetween: 20, 116 }, 117 901: { 118 slidesPerView: 3, 119 spaceBetween: 30, 120 } 121 }, 122 pagination: { 123 el: el.querySelector('.swiper-pagination'), 124 clickable: true, 125 }, 126 navigation: { 127 nextEl: el.querySelector('.swiper-button-next'), 128 prevEl: el.querySelector('.swiper-button-prev'), 129 } 130 }); 131 });
132 133 } 134 135 (document.readyState!=='loading')?init():document.addEventListener('DOMContentLoaded',init); 136 137 // FAQ: only one open at a time 138 document.querySelectorAll('.sb-faq').forEach(function(faq){ 139 faq.addEventListener('toggle', function(e){ 140 var el = e.target; 141 if (el.tagName === 'DETAILS' && el.open){ 142 faq.querySelectorAll('details.sb-accordion[open]').forEach(function(d){ 143 if (d !== el) d.open = false; 144 }); 145 } 146 }, true); 147 }); 148 149 //инÑеÑакÑивнÑй поиÑк в Ñапке (минималиÑÑиÑнÑй ÑÑилÑ) 150 document.querySelectorAll('.sb-header--minimal-search .sb-search-icon').forEach(function(searchBlock) { 151 const searchButton = searchBlock.querySelector('.wp-block-search__button'); 152 const searchInput = searchBlock.querySelector('.wp-block-search__input'); 153 154 if (searchButton && searchInput) { 155 searchButton.addEventListener('click', function(e) { 156 // ÐÑли поле поиÑка неакÑивно, акÑивиÑÑем его и пÑедоÑвÑаÑаем оÑпÑÐ°Ð²ÐºÑ ÑоÑÐ¼Ñ 157 if (!searchBlock.classList.contains('is-active')) { 158 e.preventDefault(); 159 searchBlock.classList.add('is-active'); 160 searchInput.focus(); 161 } 162 // ÐÑли поле акÑивно, но пÑÑÑое, Ñакже пÑедоÑвÑаÑаем оÑпÑÐ°Ð²ÐºÑ 163 else if (searchInput.value.trim() === '') { 164 e.preventDefault(); 165 searchBlock.classList.remove('is-active'); 166 } 167 // ÐÑли поле акÑивно и непÑÑÑое, ÑоÑма оÑпÑавиÑÑÑ ÐºÐ°Ðº обÑÑно 168 }); 169 170 // СкÑÑваем поле, еÑли полÑзоваÑÐµÐ»Ñ ÐºÐ»Ð¸ÐºÐ½Ñл вне его 171 document.addEventListener('click', function(e) { 172 if (!searchBlock.contains(e.target)) { 173 searchBlock.classList.remove('is-active'); 174 } 175 }); 176 } 177 }); 178 179 180document.addEventListener('DOMContentLoaded', function() { 181 const burgerBtn = document.querySelector('.burger-btn'); 182 const closeBtn = document.querySelector('.close-btn'); 183 const menu = document.querySelector('.header-nav'); 184 const overlay = document.querySelector('.menu-overlay'); 185 const menuLinks = document.querySelectorAll('.header-nav__link'); 186 187 // ÐÑкÑÑÑие Ð¼ÐµÐ½Ñ 188 burgerBtn.addEventListener('click', function() { 189 menu.classList.add('active'); 190 overlay.classList.add('active'); 191 burgerBtn.classList.add('active'); 192 document.body.style.overflow = 'hidden'; // ÐлокиÑÑем ÑкÑолл ÑÑÑаниÑÑ 193 }); 194 195 // ÐакÑÑÑие Ð¼ÐµÐ½Ñ 196 function closeMenu() { 197 menu.classList.remove('active'); 198 overlay.classList.remove('active'); 199 burgerBtn.classList.remove('active'); 200 document.body.style.removeProperty('overflow'); 201 } 202 203 // ÐакÑÑÑие по кнопке 204 closeBtn.addEventListener('click', closeMenu); 205 206 // ÐакÑÑÑие по овеÑÐ»ÐµÑ 207 overlay.addEventListener('click', closeMenu); 208 209 // ÐакÑÑÑие пÑи клике на ÑÑÑÐ»ÐºÑ (опÑионалÑно) 210 menuLinks.forEach(link => { 211 link.addEventListener('click', closeMenu); 212 }); 213 214 // ÐакÑÑÑие по ESC 215 document.addEventListener('keydown', function(e) { 216 if (e.key === 'Escape') { 217 closeMenu(); 218 } 219 }); 220}); 221 222})(); 223 224
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.