// zoom popup

$(document).ready(function() {
 $('.gallery-link').magnificPopup({
    type: 'image',
    gallery: {
    enabled: true 
    }
 });
});

// Get A Quote Form validation

(function () {
  "use strict";
  var forms = document.querySelectorAll(".needs-validation");
  // Loop over them and prevent submission
  Array.prototype.slice.call(forms).forEach(function (form) {
    form.addEventListener(
      "submit",
      function (event) {
        if (!form.checkValidity()) {
          event.preventDefault();
          event.stopPropagation();
        }

        form.classList.add("was-validated");
      },
      false
    );
  });
})();

// modalContainer.addEventListener('click', () => {
//   modalContainer.classList.remove('active'); 
// });
// Sticky header

window.addEventListener("scroll", function () {
  var header = document.querySelector("header");
  header.classList.toggle("sticky", window.scrollY > 0);
})

// end Sticky header


// document.addEventListener('DOMContentLoaded', function () {
//   // Get all nav-link elements
//   var navLinks = document.querySelectorAll('.nav-link');

//   navLinks.forEach(function (link) {
//     link.addEventListener('click', function () {
//       // Remove 'active' class from all nav links
//       navLinks.forEach(function (link) {
//         link.classList.remove('active');
//       });

//       // Add 'active' class to the clicked link
//       this.classList.add('active');
//     });
//   });
// });

