"use strict"; const roamUpdateGalleries = () => { let galleryCount = 1; const galleries = document.querySelectorAll('.is-style-roam-lightbox'); if (galleries) { for (const gallery of galleries) { const galleryItems = gallery.querySelectorAll('a'); for (const galleryItem of galleryItems) { galleryItem.setAttribute('data-gall', `roam-gallery-${galleryCount}`); } galleryCount = galleryCount + 1; } } }; document.addEventListener('DOMContentLoaded', function () { // Go to top. const scrollUp = document.querySelector('.roam-to-top'); if (scrollUp) { scrollUp.addEventListener('click', e => { e.preventDefault(); window.scrollTo({ top: 0, behavior: 'smooth' }); }); } // Flyout menu. const flyOut = document.querySelector('.roam-flyout'); const flyOutContainer = document.querySelector('.flyout-menu-container'); const mainBody = document.querySelector('body'); if (flyOut) { flyOut.addEventListener('click', e => { e.preventDefault(); flyOutContainer.classList.toggle('active'); mainBody.classList.toggle('flyout-menu-active'); }); } // Gallery lightbox. roamUpdateGalleries(); // Trigger lightbox. new VenoBox({ selector: '.is-style-roam-lightbox a' }); });