PageSourceSearch

https://johnlynchphotography.com/script.js

js johnlynchphotography.com collected 2026-10-08 03:27:46 UTC 2,250 bytes, 70 lines download raw bytes

1"use strict";
2
3/* ============================================================
4   Johnlynchphotography - functional JS
5   ============================================================ */
6
7document.addEventListener("DOMContentLoaded", () => {
8  /* ---------- Current year in footer ---------- */
9  const yearEl = document.getElementById("year");
10  if (yearEl) {
11    yearEl.textContent = String(new Date().getFullYear());
12  }
13
14  /* ---------- Burger menu ---------- */
15  const burger = document.getElementById("burgerBtn");
16  const menu = document.getElementById("navMenu");
17
18  if (burger && menu) {
19    const toggleMenu = () => {
20      const isOpen = menu.classList.toggle("open");
21      burger.classList.toggle("open", isOpen);
22      burger.setAttribute("aria-expanded", String(isOpen));
23    };
24
25    burger.addEventListener("click", toggleMenu);
26
27    /* Close menu after clicking a link (mobile) */
28    const links = menu.querySelectorAll("a");
29    links.forEach((link) => {
30      link.addEventListener("click", () => {
31        menu.classList.remove("open");
32        burger.classList.remove("open");
33        burger.setAttribute("aria-expanded", "false");
34      });
35    });
36  }
37
38  /* ---------- FAQ accordion ---------- */
39  const questions = document.querySelectorAll(".faq-q");
40  questions.forEach((q) => {
41    q.addEventListener("click", () => {
42      const answer = q.nextElementSibling;
43      const isActive = q.classList.contains("active");
44
45      if (isActive) {
46        q.classList.remove("active");
47        q.setAttribute("aria-expanded", "false");
48        answer.style.maxHeight = null;
49      } else {
50        q.classList.add("active");
51        q.setAttribute("aria-expanded", "true");
52        answer.style.maxHeight = answer.scrollHeight + "px";
53      }
54    });
55  });
56
57  /* ---------- Payments slider controls ---------- */
58  const slider = document.getElementById("paymentsSlider");
59  const sliderBtns = document.querySelectorAll(".slider-btn");
60
61  if (slider && sliderBtns.length) {
62    const step = 280;
63    sliderBtns.forEach((btn) => {
64      btn.addEventListener("click", () => {
65        const dir = Number(btn.getAttribute("data-dir")) || 1;
66        slider.scrollBy({ left: dir * step, behavior: "smooth" });
67      });
68    });
69  }
70});

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.