1// ============================= 2// SAFE HELPERS 3// ============================= 4function safeQuery(selector) { 5 return document.querySelector(selector); 6} 7function safeQueryAll(selector, context = document) { 8 return context ? context.querySelectorAll(selector) : []; 9} 10 11// ============================= 12// Sticky Box (ÐÐ ÐÐÐÐÐÐ ÐÐÐ ÐÐÐÐÐÐÐÐÐ) 13// ============================= 14function _classCallCheck(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}var Sticky=function(){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_classCallCheck(this,t),this.selector=i,this.elements=[],this.version="1.2.0",this.vp=this.getViewportSize(),this.body=document.querySelector("body"),this.options={wrap:e.wrap||!1,marginTop:e.marginTop||0,stickyFor:e.stickyFor||0,stickyClass:e.stickyClass||null,stickyContainer:e.stickyContainer||"body"},this.updateScrollTopPosition=this.updateScrollTopPosition.bind(this),this.updateScrollTopPosition(),window.addEventListener("load",this.updateScrollTopPosition),window.addEventListener("scroll",this.updateScrollTopPosition),this.run()}return t.prototype.run=function(){var t=this,i=setInterval(function(){if("complete"===document.readyState){clearInterval(i);var e=document.querySelectorAll(t.selector);t.forEach(e,function(i){return t.renderElement(i)})}},10)},t.prototype.renderElement=function(t){var i=this;t.sticky={},t.sticky.active=!1,t.sticky.marginTop=parseInt(t.getAttribute("data-margin-top"))||this.options.marginTop,t.sticky.stickyFor=parseInt(t.getAttribute("data-sticky-for"))||this.options.stickyFor,t.sticky.stickyClass=t.getAttribute("data-sticky-class")||this.options.stickyClass,t.sticky.wrap=!!t.hasAttribute("data-sticky-wrap")||this.options.wrap,t.sticky.stickyContainer=this.options.stickyContainer,t.sticky.container=this.getStickyContainer(t),t.sticky.container.rect=this.getRectangle(t.sticky.container),t.sticky.rect=this.getRectangle(t),"img"===t.tagName.toLowerCase()&&(t.onload=function(){return t.sticky.rect=i.getRectangle(t)}),t.sticky.wrap&&this.wrapElement(t),this.activate(t)},t.prototype.wrapElement=function(t){t.insertAdjacentHTML("beforebegin","<span></span>"),t.previousSibling.appendChild(t)},t.prototype.activate=function(t){t.sticky.rect.top+t.sticky.rect.height<t.sticky.container.rect.top+t.sticky.container.rect.height&&t.sticky.stickyFor<this.vp.width&&!t.sticky.active&&(t.sticky.active=!0),this.elements.indexOf(t)<0&&this.elements.push(t),t.sticky.resizeEvent||(this.initResizeEvents(t),t.sticky.resizeEvent=!0),t.sticky.scrollEvent||(this.initScrollEvents(t),t.sticky.scrollEvent=!0),this.setPosition(t)},t.prototype.initResizeEvents=function(t){var i=this;t.sticky.resizeListener=function(){return i.onResizeEvents(t)},window.addEventListener("resize",t.sticky.resizeListener)},t.prototype.destroyResizeEvents=function(t){window.removeEventListener("resize",t.sticky.resizeListener)},t.prototype.onResizeEvents=function(t){this.vp=this.getViewportSize(),t.sticky.rect=this.getRectangle(t),t.sticky.container.rect=this.getRectangle(t.sticky.container),t.sticky.rect.top+t.sticky.rect.height<t.sticky.container.rect.top+t.sticky.container.rect.height&&t.sticky.stickyFor<this.vp.width&&!t.sticky.active?t.sticky.active=!0:(t.sticky.rect.top+t.sticky.rect.height>=t.sticky.container.rect.top+t.sticky.container.rect.height||t.sticky.stickyFor>=this.vp.width&&t.sticky.active)&&(t.sticky.active=!1),this.setPosition(t)},t.prototype.initScrollEvents=function(t){var i=this;t.sticky.scrollListener=function(){return i.onScrollEvents(t)},window.addEventListener("scroll",t.sticky.scrollListener)},t.prototype.destroyScrollEvents=function(t){window.removeEventListener("scroll",t.sticky.scrollListener)},t.prototype.onScrollEvents=function(t){t.sticky.active&&this.setPosition(t)},t.prototype.setPosition=function(t){this.css(t,{position:"",width:"",top:"",left:""}),this.vp.height<t.sticky.rect.height||!t.sticky.active||(t.sticky.rect.width||(t.sticky.rect=this.getRectangle(t)),t.sticky.wrap&&this.css(t.parentNode,{display:"block",width:t.sticky.rect.width+"px",height:t.sticky.rect.height+"px"}),0===t.sticky.rect.top&&t.sticky.container===this.body?this.css(t,{position:"fixed",top:t.sticky.rect.top+"px",left:t.sticky.rect.left+"px",width:t.sticky.rect.width+"px"}):this.scrollTop>t.sticky.rect.top-t.sticky.marginTop?(this.css(t,{position:"fixed",width:t.sticky.rect.width+"px",left:t.sticky.rect.left+"px"}),this.scrollTop+t.sticky.rect.height+t.sticky.marginTop>t.sticky.container.rect.top+t.sticky.container.offsetHeight?(t.sticky.stickyClass&&t.classList.remove(t.sticky.stickyClass),this.css(t,{top:t.sticky.container.rect.top+t.sticky.container.offsetHeight-(this.scrollTop+t.sticky.rect.height)+"px"})):(t.sticky.stickyClass&&t.classList.add(t.sticky.stickyClass),this.css(t,{top:t.sticky.marginTop+"px"}))):(t.sticky.stickyClass&&t.classList.remove(t.sticky.stickyClass),this.css(t,{position:"",width:"",top:"",left:""}),t.sticky.wrap&&this.css(t.parentNode,{display:"",width:"",height:""})))},t.prototype.update=function(){var t=this;this.forEach(this.elements,function(i){i.sticky.rect=t.getRectangle(i),i.sticky.container.rect=t.getRectangle(i.sticky.container),t.activate(i),t.setPosition(i)})},t.prototype.destroy=function(){var t=this;this.forEach(this.elements,function(i){t.destroyResizeEvents(i),t.destroyScrollEvents(i),delete i.sticky})},t.prototype.getStickyContainer=function(t){for(var i=t.parentNode;!i.hasAttribute("data-sticky-container")&&!i.parentNode.querySelector(t.sticky.stickyContainer)&&i!==this.body;)i=i.parentNode;return i},t.prototype.getRectangle=function(t){this.css(t,{position:"",width:"",top:"",left:""});var i=Math.max(t.offsetWidth,t.clientWidth,t.scrollWidth),e=Math.max(t.offsetHeight,t.clientHeight,t.scrollHeight),s=0,o=0;do s+=t.offsetTop||0,o+=t.offsetLeft||0,t=t.offsetParent;while(t);return{top:s,left:o,width:i,height:e}},t.prototype.getViewportSize=function(){return{width:Math.max(document.documentElement.clientWidth,window.innerWidth||0),height:Math.max(document.documentElement.clientHeight,window.innerHeight||0)}},t.prototype.updateScrollTopPosition=function(){this.scrollTop=(window.pageYOffset||document.scrollTop)-(document.clientTop||0)||0},t.prototype.forEach=function(t,i){for(var e=0,s=t.length;e<s;e++)i(t[e])},t.prototype.css=function(t,i){for(var e in i)i.hasOwnProperty(e)&&(t.style[e]=i[e])},t}(); 15var sticky = new Sticky('[data-sticky]'); 16 17// ============================= 18// FIX: READ MORE 19// =============================
20function read_more() { 21 var readmore = $('.read-more'); 22 23 $('.collapse-content').each(function(i){ 24 var commentheight = $(this).height(); 25 var scrollcommentheight = this.scrollHeight; 26 27 if (commentheight == scrollcommentheight){ 28 $(this).siblings(readmore).hide(); 29 } else { 30 $(this).siblings(readmore).text("ÐодÑобнее"); 31 } 32 }); 33 34 readmore.on('click', function(event) { 35 event.preventDefault(); 36 var $this = $(this); 37 var content = $this.siblings('.collapse-content'); 38 39 content.toggleClass('expanded'); 40 $this.text(content.hasClass('expanded') ? "СвеÑнÑÑÑ" : "ÐодÑобнее"); 41 }); 42}; 43 44// ============================= 45// FIX: CHECKBOX TREE (обÑединено) 46// ============================= 47function initTree(formName){ 48 var t = document.forms[formName]; 49 if (!t) return; 50 51 var fieldsets = safeQueryAll('fieldset', t); 52 53 fieldsets.forEach(function(eFieldset){ 54 var main = Array.prototype.filter.call( 55 safeQueryAll('[type="checkbox"]', t), 56 function(el){ 57 return el.parentNode && el.parentNode.nextElementSibling === eFieldset; 58 } 59 ); 60 61 main.forEach(function(eMain){ 62 var all = safeQueryAll('[type="checkbox"]', eFieldset); 63 64 eFieldset.onchange = function(){ 65 var checked = safeQueryAll('[type="checkbox"]:checked', eFieldset).length; 66 eMain.checked = checked === all.length; 67 eMain.indeterminate = checked > 0 && checked < all.length; 68 }; 69 70 eMain.onclick = function(){ 71 all.forEach(function(el){ 72 el.checked = eMain.checked; 73 }); 74 }; 75 }); 76 }); 77} 78 79// ============================= 80// FIX: STICKY (обÑединено) 81// ============================= 82function initSimpleSticky(id, cls){ 83 var a = safeQuery(id); 84 if (!a) return; 85 86 var b = null, P = 40; 87 88 function Ascroll(){ 89 if (!a) return; 90 91 if (b == null){ 92 var Sa = getComputedStyle(a), s = ''; 93 for (var i=0;i<Sa.length;i++){ 94 if (Sa[i].indexOf('overflow')==0 || Sa[i].indexOf('padding')==0){ 95 s += Sa[i]+': '+Sa.getPropertyValue(Sa[i])+'; '; 96 } 97 } 98 b = document.createElement('div'); 99 b.style.cssText = s + ' box-sizing:border-box;'; 100 a.insertBefore(b,a.firstChild); 101 102 while(a.childNodes.length>1){ 103 b.appendChild(a.childNodes[1]); 104 } 105 106 a.style.height = b.getBoundingClientRect().height+'px'; 107 a.style.padding='0'; 108 a.style.border='0'; 109 } 110 111 var stop = safeQuery('#stop_sticky'); 112 if (!stop) return; 113 114 var Ra = a.getBoundingClientRect(); 115 var R = Math.round(Ra.top + b.getBoundingClientRect().height - stop.getBoundingClientRect().top + 70); 116 117 if ((Ra.top-P)<=0){ 118 if ((Ra.top-P)<=R){ 119 b.className='stop_sticky'; 120 b.style.top=-R+'px'; 121 }else{ 122 b.className=cls; 123 b.style.top=P+'px'; 124 } 125 }else{ 126 b.className=''; 127 b.style.top=''; 128 } 129 } 130 131 window.addEventListener('scroll',Ascroll); 132} 133 134// ФÑнкÑÐ¸Ñ Ð¿ÐµÑеклÑÑÐµÐ½Ð¸Ñ Ð²ÐºÐ»Ð°Ð´Ð¾Ðº (ÑегменÑов бизнеÑа) 135function switchTab(evt, tabId) { 136 var i, tabcontent, tablinks; 137 tabcontent = document.getElementsByClassName("pp__tab-content"); 138 for (i = 0; i < tabcontent.length; i++) { 139 tabcontent[i].style.display = "none"; 140 tabcontent[i].classList.remove("active"); 141 } 142 tablinks = document.getElementsByClassName("pp__tab-btn"); 143 for (i = 0; i < tablinks.length; i++) { 144 tablinks[i].classList.remove("active"); 145 } 146 document.getElementById(tabId).style.display = "block"; 147 document.getElementById(tabId).classList.add("active"); 148 evt.currentTarget.classList.add("active"); 149} 150 151// Ðогика ÑабоÑÑ Ð°ÐºÐºÐ¾Ñдеона FAQ 152function toggleFaq(button) { 153 const faqItem = button.parentElement; 154 const content = button.nextElementSibling; 155 156 if (faqItem.classList.contains('active')) { 157 content.style.maxHeight = null; 158 faqItem.classList.remove('active'); 159 } else { 160 const activeItems = document.querySelectorAll('.pp__faq-item.active'); 161 activeItems.forEach(item => { 162 item.classList.remove('active'); 163 item.querySelector('.pp__faq-content').style.maxHeight = null; 164 }); 165 166 faqItem.classList.add('active'); 167 content.style.maxHeight = content.scrollHeight + "px"; 168 } 169} 170 171// СкÑÐ¸Ð¿Ñ Ð¿ÐµÑеклÑÑÐµÐ½Ð¸Ñ Ð²ÐµÑÑикалÑнÑÑ Ñабов 172function openBenefit(evt, benefitId) { 173 var i, contentItems, tabButtons; 174 175 // СкÑÑваем вÑе блоки Ñ ÐºÐ¾Ð½ÑенÑом 176 contentItems = document.getElementsByClassName("pp__benefit-content-item"); 177 for (i = 0; i < contentItems.length; i++) { 178 contentItems[i].classList.remove("active"); 179 } 180 181 // УбиÑаем клаÑÑ active Ñ Ð²ÑÐµÑ ÐºÐ½Ð¾Ð¿Ð¾Ðº 182 tabButtons = document.getElementsByClassName("pp__benefits-tab-btn"); 183 for (i = 0; i < tabButtons.length; i++) { 184 tabButtons[i].classList.remove("active"); 185 } 186 187 // ÐоказÑваем нÑжнÑй блок и добавлÑем клаÑÑ active нажаÑой кнопке 188 document.getElementById(benefitId).classList.add("active"); 189 evt.currentTarget.classList.add("active"); 190} 191 192$(function () { 193 194 'use strict'; 195 196 const accordionEl = document.getElementsByClassName('accordion-title') 197 198 if (accordionEl.length) { 199 for (let i = 0; i < accordionEl.length; i++) { 200 accordionEl[i].addEventListener('click', function () { 201 this.parentNode.classList.toggle('is-open') 202 const panel = this.nextElementSibling 203 if (panel.style.maxHeight) { 204 panel.style.maxHeight = null 205 } else { 206 panel.style.maxHeight = `${panel.scrollHeight}px` 207 } 208 }) 209 } 210 }; 211 212 // Mobile menu 213 var siteMenuClone = function() { 214 215 $('.js-clone-nav').each(function() { 216 var $this = $(this); 217 $this.clone().attr('class', 'site-nav-wrap').appendTo('.site-mobile-menu-body'); 218 }); 219 220 setTimeout(function() { 221 222 var counter = 0; 223 $('.site-mobile-menu .has-children').each(function(){ 224 var $this = $(this); 225 226 $this.prepend('<span class="arrow-collapse collapsed fas fa-chevron-down">'); 227 228 $this.find('.arrow-collapse').attr({ 229 'data-toggle' : 'collapse', 230 'data-target' : '#collapseItem' + counter, 231 }); 232 233 $this.find('> .dropdown').attr({ 234 'class' : 'collapse', 235 'id' : 'collapseItem' + counter, 236 }); 237 238 counter++; 239 240 }); 241 242 }, 1000); 243 244 $('body').on('click', '.arrow-collapse', function(e) { 245 var $this = $(this); 246 if ( $this.closest('li').find('.collapse').hasClass('show') ) { 247 $this.removeClass('active'); 248 } else { 249 $this.addClass('active'); 250 } 251 e.preventDefault(); 252 253 }); 254 255 $(window).resize(function() { 256 var $this = $(this), 257 w = $this.width(); 258 259 if ( w > 768 ) { 260 if ( $('body').hasClass('offcanvas-menu') ) { 261 $('body').removeClass('offcanvas-menu'); 262 } 263 } 264 }) 265 266 $('body').on('click', '.js-menu-toggle', function(e) { 267 var $this = $(this); 268 e.preventDefault(); 269 270 if ( $('body').hasClass('offcanvas-menu') ) { 271 $('body').removeClass('offcanvas-menu'); 272 $('body').find('.js-menu-toggle').removeClass('active'); 273 } else { 274 $('body').addClass('offcanvas-menu'); 275 $('body').find('.js-menu-toggle').addClass('active'); 276 } 277 }) 278 279 // click outisde offcanvas 280 $(document).mouseup(function(e) { 281 var container = $(".site-mobile-menu"); 282 if (!container.is(e.target) && container.has(e.target).length === 0) { 283 if ( $('body').hasClass('offcanvas-menu') ) { 284 $('body').removeClass('offcanvas-menu'); 285 $('body').find('.js-menu-toggle').removeClass('active'); 286 } 287 } 288 }); 289 }; 290 siteMenuClone(); 291 // End Mobile menu 292 293}()); 294 295// Video Widget 296(function () { 297 298 var widget = document.getElementById('vw-widget'); 299 var video = document.getElementById('vw-video'); 300 var closeBtn = document.getElementById('vw-close'); 301 var ctaBtn = document.querySelector('.vw-cta'); 302 303 if (!widget || !video) return; 304 305 var STORAGE_KEY = 'videoWidgetClosed'; 306 307 // ÐÑли Ñже закÑÑвали в ÑÑой ÑеÑÑии 308 if (sessionStorage.getItem(STORAGE_KEY) === 'true') { 309 widget.style.display = 'none'; 310 return; 311 } 312 313 // Ðлавное поÑвление 314 window.addEventListener('load', function () { 315 setTimeout(function () { 316 widget.classList.remove('vw-preload'); 317 widget.classList.add('vw-visible'); 318 }, 300); 319 }); 320 321 // autoplay muted 322 video.play().catch(function(){}); 323 324 // ============================== 325 // Ð ÐСÐРЫТÐÐ 326 // ============================== 327 328 widget.addEventListener('click', function (e) { 329 330 if (e.target === closeBtn || e.target === ctaBtn) return; 331 332 if (!widget.classList.contains('vw-expanded')) { 333 334 widget.classList.remove('vw-small'); 335 widget.classList.add('vw-expanded'); 336 337 video.pause(); 338 video.currentTime = 0; 339 340 video.muted = false;
341 video.controls = true; 342 343 var playPromise = video.play(); 344 if (playPromise !== undefined) { 345 playPromise.catch(function(){}); 346 } 347 } 348 }); 349 350 // ============================== 351 // ФУÐÐЦÐЯ СÐÐÐ ÐЧÐÐÐÐÐЯ 352 // ============================== 353 354 function collapseToMini() { 355 356 widget.classList.remove('vw-expanded'); 357 widget.classList.add('vw-small'); 358 359 video.pause(); 360 video.currentTime = 0; 361 362 video.muted = true; 363 video.controls = false; 364 365 video.play().catch(function(){}); 366 } 367 368 // ============================== 369 // ÐÐ ÐСТÐÐ 370 // ============================== 371 372 closeBtn.addEventListener('click', function (e) { 373 374 e.stopPropagation(); 375 376 if (widget.classList.contains('vw-expanded')) { 377 378 collapseToMini(); 379 380 } else if (widget.classList.contains('vw-small')) { 381 382 video.pause(); 383 widget.classList.add('vw-hidden'); 384 sessionStorage.setItem(STORAGE_KEY, 'true'); 385 } 386 }); 387 388 // ============================== 389 // CTA ÐÐÐÐÐÐ 390 // ============================== 391 392 if (ctaBtn) { 393 ctaBtn.addEventListener('click', function () { 394 395 if (widget.classList.contains('vw-expanded')) { 396 collapseToMini(); 397 } 398 399 // пеÑÐµÑ Ð¾Ð´ в новÑÑ Ð²ÐºÐ»Ð°Ð´ÐºÑ Ð¿ÑоиÑÑ Ð¾Ð´Ð¸Ñ ÐµÑÑеÑÑвенно 400 }); 401 } 402 403})(); 404 405// ============================= 406// MAIN 407// ============================= 408$(document).ready(function(){ 409 410 // Owl Carousel for Promo 411 var owl = $("#promo-carousel"); 412 if (owl.length && $.fn.owlCarousel) { 413 owl.owlCarousel({ 414 items: 4, 415 itemsCustom: [[0, 1], [640, 2], [800, 3], [1280, 4]], 416 navigation: false, 417 rewindNav: true, 418 loop: true, 419 mouseDrag: false 420 }); 421 $(".promo-carousel_nav .next").click(function(){ 422 owl.trigger('owl.next'); 423 }); 424 $(".promo-carousel_nav .prev").click(function(){ 425 owl.trigger('owl.prev'); 426 }); 427 } 428 429 // Owl Carousel for News 430 var owl2 = $("#news-carousel"); 431 if (owl2.length && $.fn.owlCarousel) { 432 owl2.owlCarousel({ 433 singleItem: true, 434 navigation: false, 435 pagination: true, 436 transitionStyle: 'fade', 437 loop: true, 438 autoPlay: 5000, 439 stopOnHover : true 440 }); 441 $(".news-carousel_nav .next").click(function(){ 442 owl2.trigger('owl.next'); 443 }); 444 $(".news-carousel_nav .prev").click(function(){ 445 owl2.trigger('owl.prev'); 446 }); 447 } 448 449 // Owl Carousel for Cases 450 var owl3 = $("#cases-carousel"); 451 if (owl3.length && $.fn.owlCarousel) { 452 owl3.owlCarousel({ 453 items: 2, 454 itemsCustom: [[0, 1], [800, 2]], 455 navigation: false, 456 rewindNav: true, 457 loop: true, 458 autoHeight: true 459 }); 460 $(".cases-carousel_nav .next").click(function(){ 461 owl3.trigger('owl.next'); 462 }); 463 $(".cases-carousel_nav .prev").click(function(){ 464 owl3.trigger('owl.prev'); 465 }); 466 } 467 468 if ($.fn.owlCarousel) { 469 $('.cases-carousel').each(function(){ 470 $(this).owlCarousel({ 471 items: 2, 472 itemsCustom: [[0, 1], [800, 2]], 473 navigation: true, 474 pagination: true, 475 rewindNav: true, 476 autoHeight: true 477 }); 478 }); 479 $('.projects-carousel').each(function(){ 480 $(this).owlCarousel({ 481 items: 3, 482 itemsCustom: [[0, 1], [800, 2], [1024, 3]], 483 navigation: true, 484 pagination: true, 485 rewindNav: true, 486 autoHeight: true 487 }); 488 }); 489 $('.auto-carousel').each(function(){ 490 $(this).owlCarousel({ 491 singleItem: true, 492 navigation: false, 493 pagination: false, 494 loop: true, 495 autoPlay: 6000, 496 transitionStyle: "fade", 497 slideSpeed: 1000, 498 addClassActive: true 499 }); 500 }); 501 } 502 503 $('#promo-carousel').css("opacity","1"); 504 $('#news-carousel').css("opacity","1"); 505 $('#cases-carousel').css("opacity","1"); 506 $('.cases-carousel').css("opacity","1"); 507 $('.projects-carousel').css({"opacity":"1","height":"auto"}); 508 $('.auto-carousel').css("opacity","1"); 509 510 // Scroll Fix 511 $(function() { 512 $('.bg-scroll-fix').click(function() { 513 $("html").css( "overflow", "hidden" ); 514 }); 515 }); 516 $(function() { 517 $('.overlay').click(function() { 518 $("html").css( "overflow", "auto" ); 519 }); 520 }); 521 $(function() { 522 $('.popup-close').click(function() { 523 $("html").css( "overflow", "auto" ); 524 }); 525 }); 526
527 // Show-hide content 528 $(function() { 529 $('.show-more').click(function() { 530 $(this).toggleClass("show-more_active"); 531 $(this).next().slideToggle(200); 532 }); 533 }); 534 $(function() { 535 $('.hide-more').click(function() { 536 $(this).parent().slideToggle(200); 537 $(this).parents().find(".show-more").removeClass("show-more_active"); 538 }); 539 }); 540 541 // Show-hide banner 542 $(function() { 543 $('.dropdown-banner').click(function() { 544 $(this).parent().find(".dropdown-banner_content").slideToggle(200); 545 }); 546 }); 547 548 // Show-hide SEARCH 549 $(function() { 550 $('#search-open').click(function() { 551 $('.search-hidden').fadeToggle(); 552 $(this).toggleClass('active'); 553 }); 554 $('#search-close').click(function() { 555 $('.search-hidden').fadeToggle(); 556 }); 557 }); 558 559 // Show-hide CONTACTS 560 $(function() { 561 $('#contact-open').click(function() { 562 $('.contact-hidden').fadeToggle(); 563 $(this).toggleClass('active'); 564 }); 565 $('#contact-close').click(function() { 566 $('.contact-hidden').fadeToggle(); 567 }); 568 }); 569 570 // ========================================== 571 // УÐÐÐÐРСÐÐЬÐÐЯ ÐÐÐÐÐРТÐÐÐÐ 572 // ========================================== 573 function getTabContainer($tabs) { 574 // 1. ÐÑем внÑÑÑи ближайÑего обÑего ÑÑÑÑкÑÑÑного ÑодиÑÐµÐ»Ñ 575 var $parent = $tabs.closest('.flex-cols, .site-section, .row, .m-y-10, .card, [class*="-section"]'); 576 if ($parent.length) { 577 var $found = $parent.find('.tab-container'); 578 if ($found.length) return $found; 579 } 580 581 // 2. ÐÑем конÑÐµÐ¹Ð½ÐµÑ ÑÑеди пÑÑмÑÑ Ð¸Ð»Ð¸ поÑледÑÑÑÐ¸Ñ ÑоÑедей 582 var $nextContainer = $tabs.nextAll('.tab-container:first'); 583 if ($nextContainer.length) return $nextContainer; 584 585 // 3. ФолбÑк: иÑем лÑбой tab-container Ñ Ð±Ð»Ð¸Ð¶Ð°Ð¹Ñего вÑÑеÑÑоÑÑего div 586 return $tabs.closest('div').find('.tab-container:first'); 587 } 588 589 // ÐниÑиализаÑÐ¸Ñ Ñабов на ÑÑÑаниÑе 590 $(".tabs").each(function () { 591 var $tabs = $(this); 592 var $container = getTabContainer($tabs); 593 594 if (!$container.length) return; 595 596 // ÐÐ°Ñ Ð¾Ð´Ð¸Ð¼ акÑивнÑй li или беÑем ÑамÑй пеÑвÑй 597 var $activeLi = $tabs.find("li.active").length ? $tabs.find("li.active") : $tabs.find("li:first"); 598 599 $tabs.find("li").removeClass("active"); 600 $activeLi.addClass("active"); 601 602 $container.find(".tab-content").hide(); 603 604 var initialTarget = $activeLi.find("a").attr("href"); 605 if (initialTarget && $container.find(initialTarget).length) { 606 $container.find(initialTarget).show(); 607 } else { 608 $container.find(".tab-content:first").show(); 609 } 610 }); 611 612 // Ðлик по вкладкам 613 $(".tabs ul li").click(function (e) { 614 e.preventDefault(); 615 616 var $li = $(this); 617 var $tabs = $li.closest(".tabs"); 618 var $container = getTabContainer($tabs); 619 620 if (!$container.length) return; 621 622 $tabs.find("li").removeClass("active"); 623 $li.addClass("active"); 624 625 $container.find(".tab-content").hide(); 626 627 var target = $li.find("a").attr("href"); 628 var $targetContent = $container.find(target); 629 630 if (target && $targetContent.length) { 631 $targetContent.fadeIn(200, function () { 632 // ÐеÑеÑаÑÑÐµÑ Owl Carousel внÑÑÑи оÑкÑÑÑого Ñаба 633 var $carousels = $targetContent.find('.owl-carousel, .cases-carousel, .projects-carousel'); 634 if ($carousels.length && $.fn.owlCarousel) { 635 $carousels.each(function () { 636 var owlData = $(this).data('owlCarousel'); 637 if (owlData) { 638 // СовмеÑÑимоÑÑÑ Ñ Owl Carousel v1 639 if (typeof owlData.reload === 'function') { 640 owlData.reload(); 641 } else if (typeof owlData.update === 'function') { 642 owlData.update(); 643 } else { 644 $(this).trigger('owl.reinit'); 645 } 646 } else { 647 // СовмеÑÑимоÑÑÑ Ñ Owl Carousel v2 648 $(this).trigger('refresh.owl.carousel'); 649 } 650 }); 651 } 652 }); 653 } 654 }); 655 656 // Accordion 657 $('.acc-content').hide(); 658 659 $('.acc-trigger').click(function(){ 660 if( $(this).next().is(':hidden') ) { 661 $(this).toggleClass('active').next().toggleClass('active').slideDown('fast'); 662 } 663 return false; 664 }); 665 666 // MODAL VIDEO 667 var $videoSrc; 668 669 $('.video-btn').click(function(e) { 670 e.preventDefault(); 671 $videoSrc = $(this).data("src"); 672 console.log($videoSrc); 673 }); 674 675 $('#videoModal').on('shown.bs.modal', function (e) { 676 $("#video").attr('src', $videoSrc + "?autoplay=1"); 677 }); 678 679 $('#videoModal').on('hide.bs.modal', function (e) { 680 $("#video").attr('src', ''); 681 }); 682
683 read_more(); 684 685 ['Tree','Tree2','Tree3'].forEach(initTree); 686 687 initSimpleSticky('#sticky_aside','sticky'); 688 initSimpleSticky('#sticky_aside_2','sticky2'); 689 initSimpleSticky('#sticky_aside_3','sticky3'); 690 691 if ($(window).width() >= 992) { 692 $('.navbar .dropdown-toggle').on('click', function(e) { 693 e.stopPropagation(); 694 695 var href = $(this).attr('href'); 696 if (href && href !== '#') { 697 window.location.href = href; 698 } 699 }); 700 } 701 702}); 703 704$(window).on('load', function(){ 705 706 $('.single-carousel').each(function(){ 707 if ($(this).data('owlCarousel')) return; 708 709 if ($.fn.owlCarousel) { 710 $(this).owlCarousel({ 711 singleItem: true, 712 navigation: true, 713 pagination: true, 714 rewindNav: true, 715 autoHeight: true 716 }); 717 } 718 }); 719 720 $('.single-carousel').css("opacity","1"); 721 722});
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.