const nav = document.querySelector('nav');
const nav_links = nav.querySelectorAll('ul li a');
const theme_toggle = nav.querySelector('button');

nav_links.forEach((el) => {
  el.addEventListener('click', () => {
    el.preventDefault();
    if ('startViewTransition' in document) {
      document.startViewTransition(() => {
        window.location.href = el.getAttribute('href');
      });
    } else {
      window.location.href = el.getAttribute('href');
    }
  });
});
