PageSourceSearch

https://3pro.pl/assets/javascript/menu.js

js 3pro.pl collected 2026-10-07 07:05:27 UTC 1,079 bytes, 31 lines download raw bytes

1const nav = document.querySelector('.header__nav');
2const menuBtn = document.getElementById('hamburger');
3const header = document.querySelector('.header');
4let prevScrollpos = window.pageYOffset;
5
6innerWidth >= 768 ? (nav.style.transition = 'unset') : (nav.style.transition = 'transform 0.3s ease');
7
8menuBtn.addEventListener('click', () => {
9  header.classList.toggle('expended');
10  nav.scrollTop = 0;
11});
12
13window.onresize = () => {
14  innerWidth >= 768 ? (nav.style.transition = 'unset') : (nav.style.transition = 'transform 0.3s ease');
15};
16
17window.onscroll = () => {
18  setTimeout(() => {
19    const currentScrollPos = window.pageYOffset;
20    if (currentScrollPos - prevScrollpos >= 90 || currentScrollPos - prevScrollpos <= -90) {
21      if (prevScrollpos > currentScrollPos || currentScrollPos <= 10) {
22        document.getElementById('navbar').style.top = '0';
23      } else {
24        document.getElementById('navbar').style.top = '-70px';
25        header.classList.remove('expended');
26        nav.scrollTop = 0;
27      }
28    }
29    prevScrollpos = currentScrollPos;
30  }, 500);
31};

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.