<!--Last updated lib on Dec 16, 2020 @vpnry-->
<!-- openssl dgst -sha512 -binary jquery-3.5.1.min.js | openssl base64 -A -->

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js" integrity="sha512-bLT0Qm9VnAYZDflyKcBaQ2gg0hSYNQrJ8RilYldYQ1FxQYoCLtUjuuRuZo+fjqhx/qtq/1itJ0C2ejDxltZVFg==" crossorigin="anonymous"></script>
<script>window.jQuery || document.write('<script src="{{ "/assets/js/jquery-3.5.1.min.js" | prepend: site.baseurl  }}"><\/script>')</script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/fitvids/1.2.0/jquery.fitvids.min.js"
  integrity="sha512-/2sZKAsHDmHNoevKR/xsUKe+Bpf692q4tHNQs9VWWz0ujJ9JBM67iFYbIEdfDV9I2BaodgT5MIg/FTUmUv3oyQ=="
  crossorigin="anonymous"></script>

<script>
  if (!($.fn.fitVids)) {document.write('<script src="{{ "/assets/js/jquery.fitvids.min.js" | prepend: site.baseurl  }}"><\/script>')}
</script>
<script type="text/javascript" src="{{ "/assets/js/index.min.js" | prepend: site.baseurl  }}"></script>
<!--<script type="text/javascript" src="{{ "/assets/js/readingTime.min.js" | prepend: site.baseurl  }}"></script>-->

<script>
  (function ($) {
    "use strict";
    $(document).ready(function () {

      var $window = $(window),
        $image = $('.post-image-image, .teaserimage-image');

      $window.on('scroll', function () {
        var top = $window.scrollTop();

        if (top < 0 || top > 1500) { return; }
        $image
          .css('transform', 'translate3d(0px, ' + top / 3 + 'px, 0px)')
          .css('opacity', 1 - Math.max(top / 700, 0));
      });
      $window.trigger('scroll');

      var height = $('.article-image').height();
      $('.post-content').css('padding-top', height + 'px');
      // $('a[href*=#]:not([href=#])').click(function() { old Jquery
      $('a[href*=\\#]:not([href=\\#])').click(function () {
        if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '')
          && location.hostname == this.hostname) {
          var target = $(this.hash);
          target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
          if (target.length) {
            $('html,body').animate({ scrollTop: target.offset().top }, 500);
            return false;
          }
        }
      });

    });
  }(jQuery));
</script>
{% if site.google_analytics %}
{% include google_analytics.html %}
{% endif %}
