PageSourceSearch

https://milliard-v-bane.ru/wp-content/themes/reboot-child/assets/scripts/new-header.js

js milliard-v-bane.ru collected 2026-10-09 23:09:23 UTC 1,832 bytes, 51 lines download raw bytes

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.