4 const menuButton = document.getElementById('menu-button');
5 const menuDropDown = document.querySelector('#header .main-nav');
7 menuButton.addEventListener('click', function(event) {
8 menuDropDown.classList.toggle('showing');
9 event.stopPropagation();
12 document.body.addEventListener('click', function(event) {
13 menuDropDown.classList.remove('showing');
14 event.stopPropagation();
18 // Handle video click to play
19 const videos = document.querySelectorAll('video');
20 for (let i = 0; i < videos.length; i++) {
21 videos[i].addEventListener('click', videoClick)
24 function videoClick() {
25 if (typeof InstallTrigger !== 'undefined') return;
26 this.paused ? this.play() : this.pause();
29 // Header double click URL reference
30 document.body.addEventListener('dblclick', event => {
31 const isHeader = event.target.matches('h1, h2, h3, h4, h5, h6');
32 if (isHeader && event.target.id) {
33 window.location.hash = event.target.id;