/*! * Chirpy v5.6.1 (https://github.com/cotes2020/jekyll-theme-chirpy/) * © 2019 Cotes Chung * MIT Licensed */ !function(){"use strict";var o=$(".mode-toggle");function e(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function t(o,e){for(var t=0;t0}},{key:"topbarLocked",value:function(){return!0===o.topbarIsLocked}},{key:"unlockTopbar",value:function(){o.topbarIsLocked=!1}},{key:"getTopbarHeight",value:function(){return H.outerHeight()}},{key:"orientationLocked",value:function(){return!0===o.orientationIsLocked}},{key:"lockOrientation",value:function(){o.orientationIsLocked=!0}},{key:"unLockOrientation",value:function(){o.orientationIsLocked=!1}}]),o}();r(M,"scrollUpCount",0),r(M,"topbarIsLocked",!1),r(M,"orientationIsLocked",!1);var N,R=$("#search-input"),q=M.getTopbarHeight(),A=0;function Y(){0!==$(window).scrollTop()&&(M.lockOrientation(),M.hideTopbar())}function z(){var o=screen.orientation;o?o.onchange=function(){var e=o.type;"landscape-primary"!==e&&"landscape-secondary"!==e||Y()}:$(window).on("orientationchange",(function(){$(window).width()<$(window).height()&&Y()})),$(window).on("scroll",(function(){N||(N=!0)})),setInterval((function(){N&&(!function(){var o=$(window).scrollTop();if(!(Math.abs(A-o)<=q)){if(o>A)M.hideTopbar(),R.is(":focus")&&R.trigger("blur");else if(o+$(window).height()<$(document).height()){if(M.hasScrollUpTask())return;M.topbarLocked()?M.unlockTopbar():M.orientationLocked()?M.unLockOrientation():M.showTopbar()}A=o}}(),N=!1)}),250)}$(window).on("scroll",(function(){$(window).scrollTop()>50&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()})),$("#back-to-top").on("click",(function(){return $("body,html").animate({scrollTop:0},800),!1})),$('[data-toggle="tooltip"]').tooltip(),0!==o.length&&o.off().on("click",(function(o){var e=$(o.target),t=e.prop("tagName")==="button".toUpperCase()?e:e.parent();modeToggle.flipMode(),t.trigger("blur")})),$("#sidebar-trigger").on("click",s.toggle),$("#mask").on("click",s.toggle),function(){if(0!==u.length&&!u.hasClass("dynamic-title")&&!f.is(":hidden")){var o=u.text().trim(),e=!1,t=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(o)&&(o=o.replace(/[0-9]/g,"").trim()),u.offset().top<$(window).scrollTop()&&f.text(o),new IntersectionObserver((function(n){if(e){var r=$(window).scrollTop(),i=t