//use strict; import * as Farapp from './fara.js'; let landing = new RegExp(/(https?:\S+\/$|index.html$)/); if (landing.test(window.location.href)) { window.addEventListener('load', () => { Farapp.sliderBg(); }); } if (!window.location.href.includes('video')) { document.addEventListener('readystatechange', () => { Farapp.activeNav(); Farapp.menuKeys(); Farapp.mobileNav(); }); window.addEventListener('scroll', event => { Farapp.navOnScroll(); }); } /** * For itinerario.html... * @todo What about the interactive map?!? */ if (window.location.href.includes('itinerario')) { let vidLinks = document.querySelectorAll('a[href="#open-vid"]'); vidLinks.forEach(a => { a.addEventListener('click', () => { Farapp.openVideo(a); }); }) } /** * For videos... */ if (window.location.href.includes('video')) { document.addEventListener('readystatechange', () => { let vStr = localStorage.getItem('vidURI'); let vidTitle = localStorage.getItem('vidTitle'); console.log(vStr, vidTitle); document.querySelector('h1').innerHTML = vidTitle; let close = document.querySelector('a[title="Close"]'); close.addEventListener('click', () => { window.location.href = 'itinerario.html'; }); let source = document.querySelector('source'); let video = source.parentNode; source.src = `assets/video/${vStr}`; video.load(); }); }