// Mobile NavBar
document.addEventListener('DOMContentLoaded', () => {
// Get all "navbar-burger" elements
const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
// Add a click event on each of them
$navbarBurgers.forEach( el => {
el.addEventListener('click', () => {
// Get the target from the "data-target" attribute
const target = el.dataset.target;
const $target = document.getElementById(target);
// Toggle the "is-active" class on both the "navbar-burger" and the "navbar-menu"
el.classList.toggle('is-active');
$target.classList.toggle('is-active');
});
});
});
// Footer copyright date
const copyDate = ( () => {
let date = new Date();
document.getElementById("year").innerHTML = " " + date.getFullYear() + " ";
} );
copyDate();
document.addEventListener("load", function () {
// Your code goes here
document.querySelectorAll("formFooter").style.display = "none";
});
document.addEventListener("DOMContentLoaded", function () {
// Close lightbox when clicking outside the image
document.querySelectorAll(".lightbox").forEach(function (lightbox) {
lightbox.addEventListener("click", function (event) {
if (event.target === lightbox) {
window.location.hash = ""; // Close lightbox
}
});
});
// Close lightbox when pressing Escape key
document.addEventListener("keydown", function (event) {
if (event.key === "Escape") {
window.location.hash = ""; // Close lightbox
}
});
});
document.addEventListener("DOMContentLoaded", function () {
let images = Array.from(document.querySelectorAll(".gallery-item a"));
let lightboxImages = images.map(img => img.getAttribute("href"));
let currentIndex = 0;
function openLightbox(index) {
currentIndex = index;
let lightbox = document.getElementById("lightbox");
if (!lightbox) {
lightbox = document.createElement("div");
lightbox.id = "lightbox";
lightbox.className = "lightbox";
lightbox.innerHTML = `
×