function clearModal() {
  var modalList = document.querySelectorAll('.modal');
  for (i = 0; i < modalList.length; i++) {
      modalList[i].style.animation = 'quote-finish-transition 0.8s ease';
      modalList[i].style.visibility = 'hidden';
  }  
}

function openModal() {
  var hash = window.location.hash;
  switch (hash) {
    case '#contact': openModalContactWindow(); break;
    case '#about': openModalAboutWindow(); break;
    case '#software': openModalSoftwareWindow(); break;
    case '#design': openModalDesignWindow(); break;
  }
}

openModal();

window.addEventListener("hashchange", function() {
  clearModal();
  openModal();
}, false);


@@ -645,12 +645,174 @@
 %7D, false);%0A%0A
+window.addEventListener(%22keydown%22, function(keyPressed) %7B%0A  if (keyPressed.keyCode == 27) %7B%0A      window.location.hash = %22#%22;%0A      clearModal();%0A  %7D%0A%7D, false);%0A%0A

Add support to close modal windows using escape key