document.addEventListener('DOMContentLoaded', () => {
  modMenu();
});

// Habilita el menú de hamburguesa y que esté fijo 
function modMenu() {
  document.getElementById('nav').classList.add('is-fixed-top');
  document.getElementById('menu').classList.remove('force-display');
  // Cfr: https://bulma.io/documentation/components/navbar/#navbar-burger
  const $navbarBurgers = Array.prototype.slice.call(document.querySelectorAll('.navbar-burger'), 0);
  $navbarBurgers.forEach( el => {
    el.addEventListener('click', () => {
      const target = el.dataset.target;
      const $target = document.getElementById(target);
      el.classList.toggle('is-active');
      $target.classList.toggle('is-active');
    });
  });
}
