text: /*!
  * Start Bootstrap - Freelancer v7.0.4 (https://startbootstrap.com/theme/freelancer)
  * Copyright 2013-2021 Start Bootstrap
  * Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-freelancer/blob/master/LICENSE)
  */
  //
  // Scripts
  // 
  
  window.addEventListener('DOMContentLoaded', event => {
  
      // Navbar shrink function
      var navbarShrink = function () {
          const navbarCollapsible = document.body.querySelector('#mainNav');
          if (!navbarCollapsible) {
              return;
          }
          if (window.scrollY === 0) {
              navbarCollapsible.classList.remove('navbar-shrink')
          } else {
              navbarCollapsible.classList.add('navbar-shrink')
          }
  
      };
  
      // Shrink the navbar 
      navbarShrink();
  
      // Shrink the navbar when page is scrolled
      document.addEventListener('scroll', navbarShrink);
  
      // Activate Bootstrap scrollspy on the main nav element
      const mainNav = document.body.querySelector('#mainNav');
      if (mainNav) {
          new bootstrap.ScrollSpy(document.body, {
              target: '#mainNav',
              offset: 72,
          });
      };
  
      // Collapse responsive navbar when toggler is visible
      const navbarToggler = document.body.querySelector('.navbar-toggler');
      const responsiveNavItems = [].slice.call(
          document.querySelectorAll('#navbarResponsive .nav-link')
      );
      responsiveNavItems.map(function (responsiveNavItem) {
          responsiveNavItem.addEventListener('click', () => {
              if (window.getComputedStyle(navbarToggler).display !== 'none') {
                  navbarToggler.click();
              }
          });
      });
  
  });
  
  document.addEventListener("DOMContentLoaded", function(){
      let projects = document.getElementById("projectsGrid");
      let projectsS = [].map.call(projects.children, Object).sort(function(a,b) {
  
          a = a.children[0].getAttribute("date").split("/");
          b = b.children[0].getAttribute("date").split("/");
  
          let diff = a[1] - b[1];
          if ((a[1] - b[1]) == 0){
              diff = a[0] - b[0];
          }
  
          return diff > 0 ? 1 : diff < 0 ? -1 : 0;
      });
      
      for (let i = projects.children.length - 1; i >= 0; i--){
          let tempClass = projects.children[i].getAttribute("class");
          projects.appendChild(projectsS[i]);
          projects.children[i].setAttribute("class", tempClass);
      }
  
  });