// JavaScript Document

$(function(){

    $(window).scroll(function (){
      var animTrigger = $('.anim');
      $(animTrigger).each(function(){
        var scroll = $(window).scrollTop(),
            elemTop = $(this).offset().top,
            windowHeight = $(window).height();

        if (scroll > elemTop - windowHeight + 200){
          $(this).addClass('is-animated');
        }
      });
    });
    $(window).trigger('scroll');

  });

/*-- show --*/
$(function () {
  $(window).scroll(function () {
    $('.show').each(function () {
      const targetElement = $(this).offset().top;
      const scroll = $(window).scrollTop();
      const windowHeight = $(window).height();
      if (scroll > targetElement - windowHeight) {
        $(this).addClass('add-show');
      }
    });
  });
});