1document.addEventListener('DOMContentLoaded', function() { 2 let headerOpen = document.querySelector('.header-upd-mobile-open'); 3 let headerClose = document.querySelector('.header-upd-mobile-close'); 4 let headerFullWidth = document.querySelector('.mobile-fullwidth-menu'); 5 6 if (headerOpen && headerClose && headerFullWidth) { 7 headerOpen.addEventListener('click', function() { 8 headerFullWidth.classList.add('-open'); 9 }) 10 headerClose.addEventListener('click', function() { 11 headerFullWidth.classList.remove('-open'); 12 }) 13 } 14 15 let newHeader = document.querySelector('header.header_update'); 16 let checkTopBar = document.querySelector('.top-bar'); 17 18 // ФÑнкÑÐ¸Ñ Ð´Ð»Ñ Ð¾Ð±ÑабоÑки ÑкÑолла 19 function handleScroll() { 20 if (window.scrollY > 60) { 21 newHeader.classList.add('scrolled'); 22 } else { 23 newHeader.classList.remove('scrolled'); 24 } 25 } 26 27 // СлÑÑаем ÑобÑÑие ÑкÑолла 28 window.addEventListener('scroll', handleScroll); 29 30 // ÐÑовеÑÑем позиÑÐ¸Ñ Ð¿Ñи загÑÑзке ÑÑÑаниÑÑ 31 handleScroll(); 32 33 if (checkTopBar) { 34 35 if (!checkTopBar.classList.contains('top-bar--closed')) { 36 newHeader.classList.add('top-bar-show'); 37 } 38 39 new MutationObserver(function() { 40 // Ð¡Ð¸Ð½Ñ ÑонизиÑÑем клаÑÑÑ 41 ['top-bar--fixed', 'top-bar--closed'].forEach(className => { 42 checkTopBar.classList.contains(className) ? 43 newHeader.classList.add(className) : 44 newHeader.classList.remove(className); 45 }); 46 }).observe(checkTopBar, { 47 attributes: true, 48 attributeFilter: ['class'] 49 }); 50 } 51});
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.