tethys/public/js/scripts.js

1 line
90 KiB
JavaScript
Raw Normal View History

!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s=140)}({140:function(e,t,n){e.exports=n(145)},141:function(e,t){"function"!=typeof Object.create&&(Object.create=function(e){function t(){}return t.prototype=e,new t}),function(e,t,n,r){"use strict";var i={init:function(n,r){this.options=e.extend({},e.fn.singlePageNav.defaults,n),this.container=r,this.$container=e(r),this.$links=this.$container.find("a"),""!==this.options.filter&&(this.$links=this.$links.filter(this.options.filter)),this.$window=e(t),this.$htmlbody=e("html, body"),this.$links.on("click.singlePageNav",e.proxy(this.handleClick,this)),this.didScroll=!1,this.checkPosition(),this.setTimer()},handleClick:function(t){var n=this,r=t.currentTarget,i=e(r.hash);t.preventDefault(),i.length&&(n.clearTimer(),"function"==typeof n.options.beforeStart&&n.options.beforeStart(),n.setActiveLink(r.hash),n.scrollTo(i,(function(){n.options.updateHash&&history.pushState&&history.pushState(null,null,r.hash),n.setTimer(),"function"==typeof n.options.onComplete&&n.options.onComplete()})))},scrollTo:function(e,t){var n=this.getCoords(e).top,r=!1;this.$htmlbody.stop().animate({scrollTop:n},{duration:this.options.speed,easing:this.options.easing,complete:function(){"function"!=typeof t||r||t(),r=!0}})},setTimer:function(){var e=this;e.$window.on("scroll.singlePageNav",(function(){e.didScroll=!0})),e.timer=setInterval((function(){e.didScroll&&(e.didScroll=!1,e.checkPosition())}),250)},clearTimer:function(){clearInterval(this.timer),this.$window.off("scroll.singlePageNav"),this.didScroll=!1},checkPosition:function(){var e=this.$window.scrollTop(),t=this.getCurrentSection(e);null!==t&&this.setActiveLink(t)},getCoords:function(e){return{top:Math.round(e.offset().top)-this.options.offset}},setActiveLink:function(e){var t=this.$container.find("a[href$='"+e+"']");t.hasClass(this.options.currentClass)||(this.$links.removeClass(this.options.currentClass),t.addClass(this.options.currentClass))},getCurrentSection:function(r){var i,o,a;for(i=0;i<this.$links.length;i++)o=this.$links[i].hash,e(o).length&&r>=this.getCoords(e(o)).top-this.options.threshold&&(a=o);if(r==e(n).height()-e(t).height()){var s=this.$links.length;s>0&&(a=this.$links[s-1].hash)}return a||(0===this.$links.length?null:this.$links[0].hash)}};e.fn.singlePageNav=function(e){return this.each((function(){Object.create(i).init(e,this)}))},e.fn.singlePageNav.defaults={offset:0,threshold:120,speed:400,currentClass:"current",easing:"swing",updateHash:!1,filter:"",onComplete:!1,beforeStart:!1}}(jQuery,window,document)},145:function(e,t,n){"use strict";n.r(t);var r=n(22),i=n.n(r);window.jQuery=i.a,window.$=i.a;n(141);$(document).ready((function(){var e=$(".hero");e.height(window.innerHeight),$(window).resize((function(){e.height(window.innerHeight)}));var t=$(".menu-icon"),n=$(".navigation");$(".menu"),$(".menu a");"/"==location.pathname&&$(window).scroll((function(){window.scrollY>window.outerHeight?t.addClass("active"):t.removeClass("active")})),t.click((function(e){e.preventDefault(),n.toggleClass("active")}))}))},22:function(e,t,n){var r;!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with