PageSourceSearch

https://firstsportz.com/wp-content/themes/FS/assets/js/simple-header.js?ver=2

js firstsportz.com collected 2026-09-24 18:15:58 UTC 2,305 bytes, 73 lines download raw bytes

1document.addEventListener('DOMContentLoaded', function () {
2  const openButton = document.querySelector('#menu-burger');
3  const closeButton = document.getElementById('close-menu');
4  const sideNavigation = document.getElementById('side-navigation');
5
6  if (openButton && closeButton && sideNavigation) {
7    openButton.addEventListener('click', function () {
8      sideNavigation.classList.add('is-open');
9    });
10
11    closeButton.addEventListener('click', function () {
12      sideNavigation.classList.remove('is-open');
13    });
14  }
15
16  const searchIcon = document.querySelector('.nav-search');
17  const exitSearch = document.getElementById('close-search');
18  const searchOverlay = document.querySelector('#search-box');
19  const sliderNav = document.querySelector('#slider-nav');
20
21  if (searchIcon && exitSearch && searchOverlay && sliderNav) {
22    searchIcon.addEventListener('click', function () {
23      searchOverlay.classList.add('active');
24      sliderNav.classList.add('inactive');
25
26      window.scrollTo({
27        top: 0,
28        behavior: 'smooth'
29      });
30    });
31
32    exitSearch.addEventListener('click', function () {
33      searchOverlay.classList.remove('active');
34      sliderNav.classList.remove('inactive');
35    });
36  }
37});
38
39let lastScrollTop = 0;
40
41window.addEventListener("scroll", function() {
42  let currentScroll = window.pageYOffset || document.documentElement.scrollTop;
43
44  const fixedHeader = document.querySelector('.fixed-header');
45  if (fixedHeader) {
46    if (currentScroll > lastScrollTop) {
47      fixedHeader.style.transform = 'translateY(-200px)';
48    } else {
49      fixedHeader.style.transform = 'unset';
50    }
51  }
52
53  lastScrollTop = currentScroll <= 0 ? 0 : currentScroll;
54}, false);
55
56
57function loadGoogleLoginForm() {
58    jQuery.post(googleLoginAjax.ajax_url, { action: "load_google_login_form" }, (response) => {
59      let div = document.createElement("div");
60      div.innerHTML = response;
61      document.body.appendChild(div);
62    });
63  }
64
65function closeGoogleLoginForm() {
66      document.getElementById("google-login-form").remove();
67    }
68
69    document.addEventListener("click", function(event) {
70      if (!document.getElementById("google-login-form").contains(event.target) && event.target.className !== "loginClose") {
71        closeGoogleLoginForm();
72      }
73    });

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.