-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.min.84fd0088b3f2183a118cd6a9ca249ceedb90ca39c5c5678c5d31d48996351114.js
More file actions
1 lines (1 loc) · 5.1 KB
/
Copy pathmain.min.84fd0088b3f2183a118cd6a9ca249ceedb90ca39c5c5678c5d31d48996351114.js
File metadata and controls
1 lines (1 loc) · 5.1 KB
1
(()=>{var n=Object.create,e=Object.defineProperty,s=Object.getOwnPropertyDescriptor,t=Object.getOwnPropertyNames,o=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,a=(e,n)=>function(){return n||(0,e[t(e)[0]])((n={exports:{}}).exports,n),n.exports},r=(n,o,a,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let c of t(o))!i.call(n,c)&&c!==a&&e(n,c,{get:()=>o[c],enumerable:!(r=s(o,c))||r.enumerable});return n},c=(t,s,i)=>(i=t!=null?n(o(t)):{},r(s||!t||!t.__esModule?e(i,"default",{value:t,enumerable:!0}):i,t)),l=a({"ns-hugo:C:\\Users\\Jack\\Dropbox\\Employment\\website_build\\assets\\js\\headroom.js"(e,t){!function(n,s){typeof e=="object"&&typeof t!="undefined"?t.exports=s():typeof define=="function"&&define.amd?define(s):(n=n||self).Headroom=s()}(e,function(){"use strict";function t(){return typeof window!="undefined"}function s(e){return function(e){return e&&e.document&&function(e){return e.nodeType===9}(e.document)}(e)?function(e){var s=e.document,t=s.body,n=s.documentElement;return{scrollHeight:function(){return Math.max(t.scrollHeight,n.scrollHeight,t.offsetHeight,n.offsetHeight,t.clientHeight,n.clientHeight)},height:function(){return e.innerHeight||n.clientHeight||t.clientHeight},scrollY:function(){return e.pageYOffset!==void 0?e.pageYOffset:(n||t.parentNode||t).scrollTop}}}(e):function(e){return{scrollHeight:function(){return Math.max(e.scrollHeight,e.offsetHeight,e.clientHeight)},height:function(){return Math.max(e.offsetHeight,e.clientHeight)},scrollY:function(){return e.scrollTop}}}(e)}function o(e,t,n){var c,l,h=function(){var e,t=!1;try{e={get passive(){t=!0}},window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch{t=!1}return t}(),r=!1,i=s(e),a=i.scrollY(),o={};function u(){var e=Math.round(i.scrollY()),s=i.height(),c=i.scrollHeight();o.scrollY=e,o.lastScrollY=a,o.direction=a<e?"down":"up",o.distance=Math.abs(e-a),o.isOutOfBounds=e<0||c<e+s,o.top=e<=t.offset[o.direction],o.bottom=c<=e+s,o.toleranceExceeded=o.distance>t.tolerance[o.direction],n(o),a=e,r=!1}function d(){r||(r=!0,l=requestAnimationFrame(u))}return c=!!h&&{passive:!0,capture:!1},e.addEventListener("scroll",d,c),u(),{destroy:function(){cancelAnimationFrame(l),e.removeEventListener("scroll",d,c)}}}function n(e){return e===Object(e)?e:{down:e,up:e}}function e(t,s){s=s||{},Object.assign(this,e.options,s),this.classes=Object.assign({},e.options.classes,s.classes),this.elem=t,this.tolerance=n(this.tolerance),this.offset=n(this.offset),this.initialised=!1,this.frozen=!1}return e.prototype={constructor:e,init:function(){return e.cutsTheMustard&&!this.initialised&&(this.addClass("initial"),this.initialised=!0,setTimeout(function(e){e.scrollTracker=o(e.scroller,{offset:e.offset,tolerance:e.tolerance},e.update.bind(e))},100,this)),this},destroy:function(){this.initialised=!1,Object.keys(this.classes).forEach(this.removeClass,this),this.scrollTracker.destroy()},unpin:function(){!this.hasClass("pinned")&&this.hasClass("unpinned")||(this.addClass("unpinned"),this.removeClass("pinned"),this.onUnpin&&this.onUnpin.call(this))},pin:function(){this.hasClass("unpinned")&&(this.addClass("pinned"),this.removeClass("unpinned"),this.onPin&&this.onPin.call(this))},freeze:function(){this.frozen=!0,this.addClass("frozen")},unfreeze:function(){this.frozen=!1,this.removeClass("frozen")},top:function(){this.hasClass("top")||(this.addClass("top"),this.removeClass("notTop"),this.onTop&&this.onTop.call(this))},notTop:function(){this.hasClass("notTop")||(this.addClass("notTop"),this.removeClass("top"),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){this.hasClass("bottom")||(this.addClass("bottom"),this.removeClass("notBottom"),this.onBottom&&this.onBottom.call(this))},notBottom:function(){this.hasClass("notBottom")||(this.addClass("notBottom"),this.removeClass("bottom"),this.onNotBottom&&this.onNotBottom.call(this))},shouldUnpin:function(e){return e.direction==="down"&&!e.top&&e.toleranceExceeded},shouldPin:function(e){return e.direction==="up"&&e.toleranceExceeded||e.top},addClass:function(e){this.elem.classList.add.apply(this.elem.classList,this.classes[e].split(" "))},removeClass:function(e){this.elem.classList.remove.apply(this.elem.classList,this.classes[e].split(" "))},hasClass:function(e){return this.classes[e].split(" ").every(function(e){return this.classList.contains(e)},this.elem)},update:function(e){e.isOutOfBounds||this.frozen!==!0&&(e.top?this.top():this.notTop(),e.bottom?this.bottom():this.notBottom(),this.shouldUnpin(e)?this.unpin():this.shouldPin(e)&&this.pin())}},e.options={tolerance:{up:0,down:0},offset:0,scroller:t()?window:null,classes:{frozen:"headroom--frozen",pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},e.cutsTheMustard=!!(t()&&function(){}.bind&&"classList"in document.documentElement&&Object.assign&&Object.keys&&requestAnimationFrame),e})}}),d=c(l());document.addEventListener("DOMContentLoaded",function(){const e=document.querySelector("header"),t=new d.default(e,{offset:0,tolerance:{up:0,down:0},classes:{initial:"header--fixed",top:"top",notTop:"not-top"}});t.init()})})()