text: 'use strict'
  
  function init() {
      gProjs = createPorjects();
      renderGallery();
  }
  
  function renderGallery() {
      var projs = gProjs;
      var i=0;
      var strHtml = projs.map(function (item) {
          return `
          <div class="col-md-4 col-sm-6 portfolio-item">
          <a class="portfolio-link" data-toggle="modal" href="#portfolioModal" onclick="renderModal(${i++})">
          <div class="portfolio-hover">
          <div class="portfolio-hover-content">
          <i class="fa fa-plus fa-3x"></i>
          </div>
          </div>
          <img class="img-fluid" src="img/portfolio/${item.id}.png" > </a>
          <div class="portfolio-caption">
          <h4>${item.name}</h4>
          <p class="text-muted">${item.desc}</p>
          </div>
          </div>
          `
      })
      $('.grid-container').html(strHtml);
  }
  
  function renderModal(projIndex) {
      var proj = gProjs[projIndex];
      var strHtml=`
      <div class="modal-dialog">
      <div class="modal-content">
      <div class="close-modal" data-dismiss="modal">
      <div class="lr">
      <div class="rl"></div>
      </div>
      </div>
      <div class="container">
      <div class="row">
      <div class="col-lg-8 mx-auto">
      <div class="modal-body">
      <!-- Project Details Go Here -->
      <h2>${proj.name}  <span class="badge badge-secondary">${proj.labels}</span></h2>
      <p class="item-intro text-muted">${proj.title}</p>
      <img class="img-fluid d-block mx-auto" src="img/portfolio/${proj.id}.png" alt="">
      <p>${proj.desc}</p>
      <button type="button" class="btn btn-primary" onclick="aClickToProj('${proj.url}')">See Project</button>
      <button class="btn btn-primary" data-dismiss="modal" type="button">
      <i class="fa fa-times"></i>
      Close Project</button>
      </div>
      </div>
      </div>
      </div>
      </div>
      </div>
      `
      $('.modal').html(strHtml);
  }
  
  function onASubmit() {
      var $subject = $('.subject').val();
      var $msg = $('.msg').val();
      submitEmail($subject,$msg)
  }
  
  function aClickToProj(projId) {
      openProj(projId);
  }
  