// jQuery to collapse the navbar on scroll
function collapseNavbar() {
    if ($(".navbar").offset().top > 50) {
        $(".navbar-fixed-top").addClass("top-nav-collapse");
    } else {
        $(".navbar-fixed-top").removeClass("top-nav-collapse");
    }
}

$(window).scroll(collapseNavbar);
$(document).ready(collapseNavbar);

// jQuery for page scrolling feature - requires jQuery Easing plugin
$(function() {
    $('a.page-scroll').bind('click', function(event) {
        var $anchor = $(this);
        $('html, body').stop().animate({
            scrollTop: $($anchor.attr('href')).offset().top
        }, 1500, 'easeInOutExpo');
        event.preventDefault();
    });
});

// Closes the Responsive Menu on Menu Item Click
$('.navbar-collapse ul li a').click(function() {
  if ($(this).attr('class') != 'dropdown-toggle active' && $(this).attr('class') != 'dropdown-toggle') {
    $('.navbar-toggle:visible').click();
  }
});

// Activates floating label headings for the contact form.
$("body").on("input propertychange", ".floating-label-form-group", function(e) {
    $(this).toggleClass("floating-label-form-group-with-value", !!$(e.target).val());
}).on("focus", ".floating-label-form-group", function() {
    $(this).addClass("floating-label-form-group-with-focus");
}).on("blur", ".floating-label-form-group", function() {
    $(this).removeClass("floating-label-form-group-with-focus");
});

function loadProjectSlider() {
  $('.flexslider').flexslider({
    animation: "slide",
    directionNav: true,
    prevText: "",
    nextText: "",
    controlNav: false,
    slideshowSpeed: 5000,
    animationSpeed: 1000,
    smoothHeight: true
  });

  $('.flexslider-imac').flexslider({
    animation: "slide",
    directionNav: true,
    prevText: "",
    nextText: "",
    controlNav: false,
    slideshowSpeed: 5000,
    animationSpeed: 1000,
    smoothHeight: true
  });
};

$(document).ready(function() {
  'use strict';

    // Open Project
    $('.popup-gallery').on('click', '.portfolio-box', function(event) {
        event.preventDefault();
        var $projectUrl = $(this).attr("href");
        var request = $.get($projectUrl, function(data) {
          $('#project-extended').html(data);
          loadProjectSlider();
          var $project = $('#project');
          $('html, body').stop().animate({
                 scrollTop: $project.offset().top
             }, 1500, 'easeInOutExpo');
          event.preventDefault();
        }, "html");
    });

    // Close Project
    $('#project-extended').on('click', '.fa-times-circle-o', function(event){
      var $portfolio = $('#portfolio');
      $('html, body').stop().animate({
             scrollTop: $portfolio.offset().top
         }, 1500, 'easeInOutExpo');
      $('#project-extended').html('');
    });

    $('#contact').on('click', '#send-message', function(event) {
      event.preventDefault();
      var $data = $('#message-form').serialize();
      var url = 'https://formspree.io/jbkaplan@outlook.com';
      var request = $.ajax({
        url: url,
        method: 'POST',
        data: $data,
        dataType: 'JSON'
      });
      request.done(function(response){
        $('#contact-form').html(`
          <h3>Thanks for reaching out to me!</h3> 
          <p>I'll try to get back to you as soon as possible.</p>
          <p><a href="blog/index.html" class="btn btn-overlay btn-lg"><i class="fa fa-envelope fa-fw"></i> Send me another message</a></p>
        `);
      });
    });
});

@@ -2611,24 +2611,39 @@
 lio');%0A     
+ var scrollUp =
  $('html, bo
@@ -2741,27 +2741,43 @@
 seInOutExpo'
-);%0A
+, function() %7B%0A    
       $('#pr
@@ -2799,24 +2799,37 @@
 ).html('');%0A
+         %7D);%0A
     %7D);%0A%0A   

Fix user experience issues in project items