@bolt/components-smooth-scroll
Advanced tools
Comparing version 0.1.0-beta.2 to 0.1.0-beta.4
{ | ||
"name": "Bolt Manifest", | ||
"bolt-smooth-scroll.min.js": "/bolt-smooth-scroll.min.js" | ||
"bolt-smooth-scroll.min.js": "/bolt-smooth-scroll.min.js", | ||
"bolt-smooth-scroll.min.js.map": "/bolt-smooth-scroll.min.js.map" | ||
} |
@@ -1,2 +0,918 @@ | ||
!function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/scripts/",t(t.s=0)}([function(e,t,n){"use strict";var o=new(function(e){return e&&e.__esModule?e:{default:e}}(n(1)).default);document.querySelectorAll('a[href*="#"]').forEach(function(e){var t=e,n={ignore:"[data-scroll-ignore]",header:".js-bolt-smooth-scroll-offset",speed:500,offset:0,easing:"easeInOutCubic",before:function(){},after:function(){}},r=t.getAttribute("href");r=r.replace("#","");var i=document.getElementById(r);i&&t.addEventListener("click",function(){o.animateScroll(i,t,n)})})},function(e,t,n){"use strict";(function(n){var o,r;"function"==typeof Symbol&&Symbol.iterator;/*! smooth-scroll v12.1.5 | (c) 2017 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/smooth-scroll */ | ||
!function(n,i){void 0!==(r=function(){return i(n)}.apply(t,o=[]))&&(e.exports=r)}(void 0!==n?n:"undefined"!=typeof window?window:void 0,function(e){var t="querySelector"in document&&"addEventListener"in e&&"requestAnimationFrame"in e&&"closest"in e.Element.prototype,n={ignore:"[data-scroll-ignore]",header:null,speed:500,offset:0,easing:"easeInOutCubic",customEasing:null,before:function(){},after:function(){}},o=function(){for(var e={},t=0,n=arguments.length;t<n;t++){var o=arguments[t];!function(t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])}(o)}return e},r=function(e){"#"===e.charAt(0)&&(e=e.substr(1));for(var t,n=String(e),o=n.length,r=-1,i="",a=n.charCodeAt(0);++r<o;){if(0===(t=n.charCodeAt(r)))throw new InvalidCharacterError("Invalid character: the input contains U+0000.");i+=t>=1&&t<=31||127==t||0===r&&t>=48&&t<=57||1===r&&t>=48&&t<=57&&45===a?"\\"+t.toString(16)+" ":t>=128||45===t||95===t||t>=48&&t<=57||t>=65&&t<=90||t>=97&&t<=122?n.charAt(r):"\\"+n.charAt(r)}return"#"+i},i=function(t){return t?function(t){return parseInt(e.getComputedStyle(t).height,10)}(t)+t.offsetTop:0};return function(a,u){var c,l,s,f,d,m,h,p={};p.cancelScroll=function(){cancelAnimationFrame(h)},p.animateScroll=function(t,r,a){var u=o(c||n,a||{}),l="[object Number]"===Object.prototype.toString.call(t),s=l||!t.tagName?null:t;if(l||s){var m=e.pageYOffset;u.header&&!f&&(f=document.querySelector(u.header)),d||(d=i(f));var h,g,y,v=l?t:function(e,t,n){var o=0;if(e.offsetParent)do{o+=e.offsetTop,e=e.offsetParent}while(e);return o=Math.max(o-t-n,0)}(s,d,parseInt("function"==typeof u.offset?u.offset():u.offset,10)),b=v-m,S=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight),E=0,O=function(n,o){var i=e.pageYOffset;if(n==o||i==o||(m<o&&e.innerHeight+i)>=S)return p.cancelScroll(),function(t,n,o){o||(t.focus(),document.activeElement.id!==t.id&&(t.setAttribute("tabindex","-1"),t.focus(),t.style.outline="none"),e.scrollTo(0,n))}(t,o,l),u.after(t,r),h=null,!0},w=function t(n){h||(h=n),g=(E+=n-h)/parseInt(u.speed,10),y=m+b*function(e,t){var n;return"easeInQuad"===e.easing&&(n=t*t),"easeOutQuad"===e.easing&&(n=t*(2-t)),"easeInOutQuad"===e.easing&&(n=t<.5?2*t*t:(4-2*t)*t-1),"easeInCubic"===e.easing&&(n=t*t*t),"easeOutCubic"===e.easing&&(n=--t*t*t+1),"easeInOutCubic"===e.easing&&(n=t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1),"easeInQuart"===e.easing&&(n=t*t*t*t),"easeOutQuart"===e.easing&&(n=1- --t*t*t*t),"easeInOutQuart"===e.easing&&(n=t<.5?8*t*t*t*t:1-8*--t*t*t*t),"easeInQuint"===e.easing&&(n=t*t*t*t*t),"easeOutQuint"===e.easing&&(n=1+--t*t*t*t*t),"easeInOutQuint"===e.easing&&(n=t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t),e.customEasing&&(n=e.customEasing(t)),n||t}(u,g=g>1?1:g),e.scrollTo(0,Math.floor(y)),O(y,v)||(e.requestAnimationFrame(t),h=n)};0===e.pageYOffset&&e.scrollTo(0,0),u.before(t,r),p.cancelScroll(),e.requestAnimationFrame(w)}};var g=function(e){l&&(l.id=l.getAttribute("data-scroll-id"),p.animateScroll(l,s),l=null,s=null)},y=function(t){if(!("matchMedia"in e&&e.matchMedia("(prefers-reduced-motion)").matches)&&0===t.button&&!t.metaKey&&!t.ctrlKey&&(s=t.target.closest(a))&&"a"===s.tagName.toLowerCase()&&!t.target.closest(c.ignore)&&s.hostname===e.location.hostname&&s.pathname===e.location.pathname&&/#/.test(s.href)){var n;try{n=r(decodeURIComponent(s.hash))}catch(e){n=r(s.hash)}if("#"===n){t.preventDefault();var o=(l=document.body).id?l.id:"smooth-scroll-top";return l.setAttribute("data-scroll-id",o),l.id="",void(e.location.hash.substring(1)===o?g():e.location.hash=o)}(l=document.querySelector(n))&&(l.setAttribute("data-scroll-id",l.id),l.id="",s.hash===e.location.hash&&(t.preventDefault(),g()))}},v=function(e){m||(m=setTimeout(function(){m=null,d=i(f)},66))};return p.destroy=function(){c&&(document.removeEventListener("click",y,!1),e.removeEventListener("resize",v,!1),p.cancelScroll(),c=null,l=null,s=null,f=null,d=null,m=null,h=null)},p.init=function(r){t&&(p.destroy(),c=o(n,r||{}),f=c.header?document.querySelector(c.header):null,d=i(f),document.addEventListener("click",y,!1),e.addEventListener("hashchange",g,!1),f&&e.addEventListener("resize",v,!1))},p.init(u),p}})}).call(t,n(2))},function(e,t,n){"use strict";var o,r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};o=function(){return this}();try{o=o||Function("return this")()||(0,eval)("this")}catch(e){"object"===("undefined"==typeof window?"undefined":r(window))&&(o=window)}e.exports=o}]); | ||
/******/ (function(modules) { // webpackBootstrap | ||
/******/ function hotDisposeChunk(chunkId) { | ||
/******/ delete installedChunks[chunkId]; | ||
/******/ } | ||
/******/ var parentHotUpdateCallback = window["webpackHotUpdate"]; | ||
/******/ window["webpackHotUpdate"] = | ||
/******/ function webpackHotUpdateCallback(chunkId, moreModules) { // eslint-disable-line no-unused-vars | ||
/******/ hotAddUpdateChunk(chunkId, moreModules); | ||
/******/ if(parentHotUpdateCallback) parentHotUpdateCallback(chunkId, moreModules); | ||
/******/ } ; | ||
/******/ | ||
/******/ function hotDownloadUpdateChunk(chunkId) { // eslint-disable-line no-unused-vars | ||
/******/ var head = document.getElementsByTagName("head")[0]; | ||
/******/ var script = document.createElement("script"); | ||
/******/ script.type = "text/javascript"; | ||
/******/ script.charset = "utf-8"; | ||
/******/ script.src = __webpack_require__.p + "" + chunkId + "." + hotCurrentHash + ".hot-update.js"; | ||
/******/ ; | ||
/******/ head.appendChild(script); | ||
/******/ } | ||
/******/ | ||
/******/ function hotDownloadManifest(requestTimeout) { // eslint-disable-line no-unused-vars | ||
/******/ requestTimeout = requestTimeout || 10000; | ||
/******/ return new Promise(function(resolve, reject) { | ||
/******/ if(typeof XMLHttpRequest === "undefined") | ||
/******/ return reject(new Error("No browser support")); | ||
/******/ try { | ||
/******/ var request = new XMLHttpRequest(); | ||
/******/ var requestPath = __webpack_require__.p + "" + hotCurrentHash + ".hot-update.json"; | ||
/******/ request.open("GET", requestPath, true); | ||
/******/ request.timeout = requestTimeout; | ||
/******/ request.send(null); | ||
/******/ } catch(err) { | ||
/******/ return reject(err); | ||
/******/ } | ||
/******/ request.onreadystatechange = function() { | ||
/******/ if(request.readyState !== 4) return; | ||
/******/ if(request.status === 0) { | ||
/******/ // timeout | ||
/******/ reject(new Error("Manifest request to " + requestPath + " timed out.")); | ||
/******/ } else if(request.status === 404) { | ||
/******/ // no update available | ||
/******/ resolve(); | ||
/******/ } else if(request.status !== 200 && request.status !== 304) { | ||
/******/ // other failure | ||
/******/ reject(new Error("Manifest request to " + requestPath + " failed.")); | ||
/******/ } else { | ||
/******/ // success | ||
/******/ try { | ||
/******/ var update = JSON.parse(request.responseText); | ||
/******/ } catch(e) { | ||
/******/ reject(e); | ||
/******/ return; | ||
/******/ } | ||
/******/ resolve(update); | ||
/******/ } | ||
/******/ }; | ||
/******/ }); | ||
/******/ } | ||
/******/ | ||
/******/ | ||
/******/ | ||
/******/ var hotApplyOnUpdate = true; | ||
/******/ var hotCurrentHash = "87b56faecf914a806750"; // eslint-disable-line no-unused-vars | ||
/******/ var hotRequestTimeout = 10000; | ||
/******/ var hotCurrentModuleData = {}; | ||
/******/ var hotCurrentChildModule; // eslint-disable-line no-unused-vars | ||
/******/ var hotCurrentParents = []; // eslint-disable-line no-unused-vars | ||
/******/ var hotCurrentParentsTemp = []; // eslint-disable-line no-unused-vars | ||
/******/ | ||
/******/ function hotCreateRequire(moduleId) { // eslint-disable-line no-unused-vars | ||
/******/ var me = installedModules[moduleId]; | ||
/******/ if(!me) return __webpack_require__; | ||
/******/ var fn = function(request) { | ||
/******/ if(me.hot.active) { | ||
/******/ if(installedModules[request]) { | ||
/******/ if(installedModules[request].parents.indexOf(moduleId) < 0) | ||
/******/ installedModules[request].parents.push(moduleId); | ||
/******/ } else { | ||
/******/ hotCurrentParents = [moduleId]; | ||
/******/ hotCurrentChildModule = request; | ||
/******/ } | ||
/******/ if(me.children.indexOf(request) < 0) | ||
/******/ me.children.push(request); | ||
/******/ } else { | ||
/******/ console.warn("[HMR] unexpected require(" + request + ") from disposed module " + moduleId); | ||
/******/ hotCurrentParents = []; | ||
/******/ } | ||
/******/ return __webpack_require__(request); | ||
/******/ }; | ||
/******/ var ObjectFactory = function ObjectFactory(name) { | ||
/******/ return { | ||
/******/ configurable: true, | ||
/******/ enumerable: true, | ||
/******/ get: function() { | ||
/******/ return __webpack_require__[name]; | ||
/******/ }, | ||
/******/ set: function(value) { | ||
/******/ __webpack_require__[name] = value; | ||
/******/ } | ||
/******/ }; | ||
/******/ }; | ||
/******/ for(var name in __webpack_require__) { | ||
/******/ if(Object.prototype.hasOwnProperty.call(__webpack_require__, name) && name !== "e") { | ||
/******/ Object.defineProperty(fn, name, ObjectFactory(name)); | ||
/******/ } | ||
/******/ } | ||
/******/ fn.e = function(chunkId) { | ||
/******/ if(hotStatus === "ready") | ||
/******/ hotSetStatus("prepare"); | ||
/******/ hotChunksLoading++; | ||
/******/ return __webpack_require__.e(chunkId).then(finishChunkLoading, function(err) { | ||
/******/ finishChunkLoading(); | ||
/******/ throw err; | ||
/******/ }); | ||
/******/ | ||
/******/ function finishChunkLoading() { | ||
/******/ hotChunksLoading--; | ||
/******/ if(hotStatus === "prepare") { | ||
/******/ if(!hotWaitingFilesMap[chunkId]) { | ||
/******/ hotEnsureUpdateChunk(chunkId); | ||
/******/ } | ||
/******/ if(hotChunksLoading === 0 && hotWaitingFiles === 0) { | ||
/******/ hotUpdateDownloaded(); | ||
/******/ } | ||
/******/ } | ||
/******/ } | ||
/******/ }; | ||
/******/ return fn; | ||
/******/ } | ||
/******/ | ||
/******/ function hotCreateModule(moduleId) { // eslint-disable-line no-unused-vars | ||
/******/ var hot = { | ||
/******/ // private stuff | ||
/******/ _acceptedDependencies: {}, | ||
/******/ _declinedDependencies: {}, | ||
/******/ _selfAccepted: false, | ||
/******/ _selfDeclined: false, | ||
/******/ _disposeHandlers: [], | ||
/******/ _main: hotCurrentChildModule !== moduleId, | ||
/******/ | ||
/******/ // Module API | ||
/******/ active: true, | ||
/******/ accept: function(dep, callback) { | ||
/******/ if(typeof dep === "undefined") | ||
/******/ hot._selfAccepted = true; | ||
/******/ else if(typeof dep === "function") | ||
/******/ hot._selfAccepted = dep; | ||
/******/ else if(typeof dep === "object") | ||
/******/ for(var i = 0; i < dep.length; i++) | ||
/******/ hot._acceptedDependencies[dep[i]] = callback || function() {}; | ||
/******/ else | ||
/******/ hot._acceptedDependencies[dep] = callback || function() {}; | ||
/******/ }, | ||
/******/ decline: function(dep) { | ||
/******/ if(typeof dep === "undefined") | ||
/******/ hot._selfDeclined = true; | ||
/******/ else if(typeof dep === "object") | ||
/******/ for(var i = 0; i < dep.length; i++) | ||
/******/ hot._declinedDependencies[dep[i]] = true; | ||
/******/ else | ||
/******/ hot._declinedDependencies[dep] = true; | ||
/******/ }, | ||
/******/ dispose: function(callback) { | ||
/******/ hot._disposeHandlers.push(callback); | ||
/******/ }, | ||
/******/ addDisposeHandler: function(callback) { | ||
/******/ hot._disposeHandlers.push(callback); | ||
/******/ }, | ||
/******/ removeDisposeHandler: function(callback) { | ||
/******/ var idx = hot._disposeHandlers.indexOf(callback); | ||
/******/ if(idx >= 0) hot._disposeHandlers.splice(idx, 1); | ||
/******/ }, | ||
/******/ | ||
/******/ // Management API | ||
/******/ check: hotCheck, | ||
/******/ apply: hotApply, | ||
/******/ status: function(l) { | ||
/******/ if(!l) return hotStatus; | ||
/******/ hotStatusHandlers.push(l); | ||
/******/ }, | ||
/******/ addStatusHandler: function(l) { | ||
/******/ hotStatusHandlers.push(l); | ||
/******/ }, | ||
/******/ removeStatusHandler: function(l) { | ||
/******/ var idx = hotStatusHandlers.indexOf(l); | ||
/******/ if(idx >= 0) hotStatusHandlers.splice(idx, 1); | ||
/******/ }, | ||
/******/ | ||
/******/ //inherit from previous dispose call | ||
/******/ data: hotCurrentModuleData[moduleId] | ||
/******/ }; | ||
/******/ hotCurrentChildModule = undefined; | ||
/******/ return hot; | ||
/******/ } | ||
/******/ | ||
/******/ var hotStatusHandlers = []; | ||
/******/ var hotStatus = "idle"; | ||
/******/ | ||
/******/ function hotSetStatus(newStatus) { | ||
/******/ hotStatus = newStatus; | ||
/******/ for(var i = 0; i < hotStatusHandlers.length; i++) | ||
/******/ hotStatusHandlers[i].call(null, newStatus); | ||
/******/ } | ||
/******/ | ||
/******/ // while downloading | ||
/******/ var hotWaitingFiles = 0; | ||
/******/ var hotChunksLoading = 0; | ||
/******/ var hotWaitingFilesMap = {}; | ||
/******/ var hotRequestedFilesMap = {}; | ||
/******/ var hotAvailableFilesMap = {}; | ||
/******/ var hotDeferred; | ||
/******/ | ||
/******/ // The update info | ||
/******/ var hotUpdate, hotUpdateNewHash; | ||
/******/ | ||
/******/ function toModuleId(id) { | ||
/******/ var isNumber = (+id) + "" === id; | ||
/******/ return isNumber ? +id : id; | ||
/******/ } | ||
/******/ | ||
/******/ function hotCheck(apply) { | ||
/******/ if(hotStatus !== "idle") throw new Error("check() is only allowed in idle status"); | ||
/******/ hotApplyOnUpdate = apply; | ||
/******/ hotSetStatus("check"); | ||
/******/ return hotDownloadManifest(hotRequestTimeout).then(function(update) { | ||
/******/ if(!update) { | ||
/******/ hotSetStatus("idle"); | ||
/******/ return null; | ||
/******/ } | ||
/******/ hotRequestedFilesMap = {}; | ||
/******/ hotWaitingFilesMap = {}; | ||
/******/ hotAvailableFilesMap = update.c; | ||
/******/ hotUpdateNewHash = update.h; | ||
/******/ | ||
/******/ hotSetStatus("prepare"); | ||
/******/ var promise = new Promise(function(resolve, reject) { | ||
/******/ hotDeferred = { | ||
/******/ resolve: resolve, | ||
/******/ reject: reject | ||
/******/ }; | ||
/******/ }); | ||
/******/ hotUpdate = {}; | ||
/******/ var chunkId = 0; | ||
/******/ { // eslint-disable-line no-lone-blocks | ||
/******/ /*globals chunkId */ | ||
/******/ hotEnsureUpdateChunk(chunkId); | ||
/******/ } | ||
/******/ if(hotStatus === "prepare" && hotChunksLoading === 0 && hotWaitingFiles === 0) { | ||
/******/ hotUpdateDownloaded(); | ||
/******/ } | ||
/******/ return promise; | ||
/******/ }); | ||
/******/ } | ||
/******/ | ||
/******/ function hotAddUpdateChunk(chunkId, moreModules) { // eslint-disable-line no-unused-vars | ||
/******/ if(!hotAvailableFilesMap[chunkId] || !hotRequestedFilesMap[chunkId]) | ||
/******/ return; | ||
/******/ hotRequestedFilesMap[chunkId] = false; | ||
/******/ for(var moduleId in moreModules) { | ||
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) { | ||
/******/ hotUpdate[moduleId] = moreModules[moduleId]; | ||
/******/ } | ||
/******/ } | ||
/******/ if(--hotWaitingFiles === 0 && hotChunksLoading === 0) { | ||
/******/ hotUpdateDownloaded(); | ||
/******/ } | ||
/******/ } | ||
/******/ | ||
/******/ function hotEnsureUpdateChunk(chunkId) { | ||
/******/ if(!hotAvailableFilesMap[chunkId]) { | ||
/******/ hotWaitingFilesMap[chunkId] = true; | ||
/******/ } else { | ||
/******/ hotRequestedFilesMap[chunkId] = true; | ||
/******/ hotWaitingFiles++; | ||
/******/ hotDownloadUpdateChunk(chunkId); | ||
/******/ } | ||
/******/ } | ||
/******/ | ||
/******/ function hotUpdateDownloaded() { | ||
/******/ hotSetStatus("ready"); | ||
/******/ var deferred = hotDeferred; | ||
/******/ hotDeferred = null; | ||
/******/ if(!deferred) return; | ||
/******/ if(hotApplyOnUpdate) { | ||
/******/ // Wrap deferred object in Promise to mark it as a well-handled Promise to | ||
/******/ // avoid triggering uncaught exception warning in Chrome. | ||
/******/ // See https://bugs.chromium.org/p/chromium/issues/detail?id=465666 | ||
/******/ Promise.resolve().then(function() { | ||
/******/ return hotApply(hotApplyOnUpdate); | ||
/******/ }).then( | ||
/******/ function(result) { | ||
/******/ deferred.resolve(result); | ||
/******/ }, | ||
/******/ function(err) { | ||
/******/ deferred.reject(err); | ||
/******/ } | ||
/******/ ); | ||
/******/ } else { | ||
/******/ var outdatedModules = []; | ||
/******/ for(var id in hotUpdate) { | ||
/******/ if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) { | ||
/******/ outdatedModules.push(toModuleId(id)); | ||
/******/ } | ||
/******/ } | ||
/******/ deferred.resolve(outdatedModules); | ||
/******/ } | ||
/******/ } | ||
/******/ | ||
/******/ function hotApply(options) { | ||
/******/ if(hotStatus !== "ready") throw new Error("apply() is only allowed in ready status"); | ||
/******/ options = options || {}; | ||
/******/ | ||
/******/ var cb; | ||
/******/ var i; | ||
/******/ var j; | ||
/******/ var module; | ||
/******/ var moduleId; | ||
/******/ | ||
/******/ function getAffectedStuff(updateModuleId) { | ||
/******/ var outdatedModules = [updateModuleId]; | ||
/******/ var outdatedDependencies = {}; | ||
/******/ | ||
/******/ var queue = outdatedModules.slice().map(function(id) { | ||
/******/ return { | ||
/******/ chain: [id], | ||
/******/ id: id | ||
/******/ }; | ||
/******/ }); | ||
/******/ while(queue.length > 0) { | ||
/******/ var queueItem = queue.pop(); | ||
/******/ var moduleId = queueItem.id; | ||
/******/ var chain = queueItem.chain; | ||
/******/ module = installedModules[moduleId]; | ||
/******/ if(!module || module.hot._selfAccepted) | ||
/******/ continue; | ||
/******/ if(module.hot._selfDeclined) { | ||
/******/ return { | ||
/******/ type: "self-declined", | ||
/******/ chain: chain, | ||
/******/ moduleId: moduleId | ||
/******/ }; | ||
/******/ } | ||
/******/ if(module.hot._main) { | ||
/******/ return { | ||
/******/ type: "unaccepted", | ||
/******/ chain: chain, | ||
/******/ moduleId: moduleId | ||
/******/ }; | ||
/******/ } | ||
/******/ for(var i = 0; i < module.parents.length; i++) { | ||
/******/ var parentId = module.parents[i]; | ||
/******/ var parent = installedModules[parentId]; | ||
/******/ if(!parent) continue; | ||
/******/ if(parent.hot._declinedDependencies[moduleId]) { | ||
/******/ return { | ||
/******/ type: "declined", | ||
/******/ chain: chain.concat([parentId]), | ||
/******/ moduleId: moduleId, | ||
/******/ parentId: parentId | ||
/******/ }; | ||
/******/ } | ||
/******/ if(outdatedModules.indexOf(parentId) >= 0) continue; | ||
/******/ if(parent.hot._acceptedDependencies[moduleId]) { | ||
/******/ if(!outdatedDependencies[parentId]) | ||
/******/ outdatedDependencies[parentId] = []; | ||
/******/ addAllToSet(outdatedDependencies[parentId], [moduleId]); | ||
/******/ continue; | ||
/******/ } | ||
/******/ delete outdatedDependencies[parentId]; | ||
/******/ outdatedModules.push(parentId); | ||
/******/ queue.push({ | ||
/******/ chain: chain.concat([parentId]), | ||
/******/ id: parentId | ||
/******/ }); | ||
/******/ } | ||
/******/ } | ||
/******/ | ||
/******/ return { | ||
/******/ type: "accepted", | ||
/******/ moduleId: updateModuleId, | ||
/******/ outdatedModules: outdatedModules, | ||
/******/ outdatedDependencies: outdatedDependencies | ||
/******/ }; | ||
/******/ } | ||
/******/ | ||
/******/ function addAllToSet(a, b) { | ||
/******/ for(var i = 0; i < b.length; i++) { | ||
/******/ var item = b[i]; | ||
/******/ if(a.indexOf(item) < 0) | ||
/******/ a.push(item); | ||
/******/ } | ||
/******/ } | ||
/******/ | ||
/******/ // at begin all updates modules are outdated | ||
/******/ // the "outdated" status can propagate to parents if they don't accept the children | ||
/******/ var outdatedDependencies = {}; | ||
/******/ var outdatedModules = []; | ||
/******/ var appliedUpdate = {}; | ||
/******/ | ||
/******/ var warnUnexpectedRequire = function warnUnexpectedRequire() { | ||
/******/ console.warn("[HMR] unexpected require(" + result.moduleId + ") to disposed module"); | ||
/******/ }; | ||
/******/ | ||
/******/ for(var id in hotUpdate) { | ||
/******/ if(Object.prototype.hasOwnProperty.call(hotUpdate, id)) { | ||
/******/ moduleId = toModuleId(id); | ||
/******/ var result; | ||
/******/ if(hotUpdate[id]) { | ||
/******/ result = getAffectedStuff(moduleId); | ||
/******/ } else { | ||
/******/ result = { | ||
/******/ type: "disposed", | ||
/******/ moduleId: id | ||
/******/ }; | ||
/******/ } | ||
/******/ var abortError = false; | ||
/******/ var doApply = false; | ||
/******/ var doDispose = false; | ||
/******/ var chainInfo = ""; | ||
/******/ if(result.chain) { | ||
/******/ chainInfo = "\nUpdate propagation: " + result.chain.join(" -> "); | ||
/******/ } | ||
/******/ switch(result.type) { | ||
/******/ case "self-declined": | ||
/******/ if(options.onDeclined) | ||
/******/ options.onDeclined(result); | ||
/******/ if(!options.ignoreDeclined) | ||
/******/ abortError = new Error("Aborted because of self decline: " + result.moduleId + chainInfo); | ||
/******/ break; | ||
/******/ case "declined": | ||
/******/ if(options.onDeclined) | ||
/******/ options.onDeclined(result); | ||
/******/ if(!options.ignoreDeclined) | ||
/******/ abortError = new Error("Aborted because of declined dependency: " + result.moduleId + " in " + result.parentId + chainInfo); | ||
/******/ break; | ||
/******/ case "unaccepted": | ||
/******/ if(options.onUnaccepted) | ||
/******/ options.onUnaccepted(result); | ||
/******/ if(!options.ignoreUnaccepted) | ||
/******/ abortError = new Error("Aborted because " + moduleId + " is not accepted" + chainInfo); | ||
/******/ break; | ||
/******/ case "accepted": | ||
/******/ if(options.onAccepted) | ||
/******/ options.onAccepted(result); | ||
/******/ doApply = true; | ||
/******/ break; | ||
/******/ case "disposed": | ||
/******/ if(options.onDisposed) | ||
/******/ options.onDisposed(result); | ||
/******/ doDispose = true; | ||
/******/ break; | ||
/******/ default: | ||
/******/ throw new Error("Unexception type " + result.type); | ||
/******/ } | ||
/******/ if(abortError) { | ||
/******/ hotSetStatus("abort"); | ||
/******/ return Promise.reject(abortError); | ||
/******/ } | ||
/******/ if(doApply) { | ||
/******/ appliedUpdate[moduleId] = hotUpdate[moduleId]; | ||
/******/ addAllToSet(outdatedModules, result.outdatedModules); | ||
/******/ for(moduleId in result.outdatedDependencies) { | ||
/******/ if(Object.prototype.hasOwnProperty.call(result.outdatedDependencies, moduleId)) { | ||
/******/ if(!outdatedDependencies[moduleId]) | ||
/******/ outdatedDependencies[moduleId] = []; | ||
/******/ addAllToSet(outdatedDependencies[moduleId], result.outdatedDependencies[moduleId]); | ||
/******/ } | ||
/******/ } | ||
/******/ } | ||
/******/ if(doDispose) { | ||
/******/ addAllToSet(outdatedModules, [result.moduleId]); | ||
/******/ appliedUpdate[moduleId] = warnUnexpectedRequire; | ||
/******/ } | ||
/******/ } | ||
/******/ } | ||
/******/ | ||
/******/ // Store self accepted outdated modules to require them later by the module system | ||
/******/ var outdatedSelfAcceptedModules = []; | ||
/******/ for(i = 0; i < outdatedModules.length; i++) { | ||
/******/ moduleId = outdatedModules[i]; | ||
/******/ if(installedModules[moduleId] && installedModules[moduleId].hot._selfAccepted) | ||
/******/ outdatedSelfAcceptedModules.push({ | ||
/******/ module: moduleId, | ||
/******/ errorHandler: installedModules[moduleId].hot._selfAccepted | ||
/******/ }); | ||
/******/ } | ||
/******/ | ||
/******/ // Now in "dispose" phase | ||
/******/ hotSetStatus("dispose"); | ||
/******/ Object.keys(hotAvailableFilesMap).forEach(function(chunkId) { | ||
/******/ if(hotAvailableFilesMap[chunkId] === false) { | ||
/******/ hotDisposeChunk(chunkId); | ||
/******/ } | ||
/******/ }); | ||
/******/ | ||
/******/ var idx; | ||
/******/ var queue = outdatedModules.slice(); | ||
/******/ while(queue.length > 0) { | ||
/******/ moduleId = queue.pop(); | ||
/******/ module = installedModules[moduleId]; | ||
/******/ if(!module) continue; | ||
/******/ | ||
/******/ var data = {}; | ||
/******/ | ||
/******/ // Call dispose handlers | ||
/******/ var disposeHandlers = module.hot._disposeHandlers; | ||
/******/ for(j = 0; j < disposeHandlers.length; j++) { | ||
/******/ cb = disposeHandlers[j]; | ||
/******/ cb(data); | ||
/******/ } | ||
/******/ hotCurrentModuleData[moduleId] = data; | ||
/******/ | ||
/******/ // disable module (this disables requires from this module) | ||
/******/ module.hot.active = false; | ||
/******/ | ||
/******/ // remove module from cache | ||
/******/ delete installedModules[moduleId]; | ||
/******/ | ||
/******/ // when disposing there is no need to call dispose handler | ||
/******/ delete outdatedDependencies[moduleId]; | ||
/******/ | ||
/******/ // remove "parents" references from all children | ||
/******/ for(j = 0; j < module.children.length; j++) { | ||
/******/ var child = installedModules[module.children[j]]; | ||
/******/ if(!child) continue; | ||
/******/ idx = child.parents.indexOf(moduleId); | ||
/******/ if(idx >= 0) { | ||
/******/ child.parents.splice(idx, 1); | ||
/******/ } | ||
/******/ } | ||
/******/ } | ||
/******/ | ||
/******/ // remove outdated dependency from module children | ||
/******/ var dependency; | ||
/******/ var moduleOutdatedDependencies; | ||
/******/ for(moduleId in outdatedDependencies) { | ||
/******/ if(Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)) { | ||
/******/ module = installedModules[moduleId]; | ||
/******/ if(module) { | ||
/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId]; | ||
/******/ for(j = 0; j < moduleOutdatedDependencies.length; j++) { | ||
/******/ dependency = moduleOutdatedDependencies[j]; | ||
/******/ idx = module.children.indexOf(dependency); | ||
/******/ if(idx >= 0) module.children.splice(idx, 1); | ||
/******/ } | ||
/******/ } | ||
/******/ } | ||
/******/ } | ||
/******/ | ||
/******/ // Not in "apply" phase | ||
/******/ hotSetStatus("apply"); | ||
/******/ | ||
/******/ hotCurrentHash = hotUpdateNewHash; | ||
/******/ | ||
/******/ // insert new code | ||
/******/ for(moduleId in appliedUpdate) { | ||
/******/ if(Object.prototype.hasOwnProperty.call(appliedUpdate, moduleId)) { | ||
/******/ modules[moduleId] = appliedUpdate[moduleId]; | ||
/******/ } | ||
/******/ } | ||
/******/ | ||
/******/ // call accept handlers | ||
/******/ var error = null; | ||
/******/ for(moduleId in outdatedDependencies) { | ||
/******/ if(Object.prototype.hasOwnProperty.call(outdatedDependencies, moduleId)) { | ||
/******/ module = installedModules[moduleId]; | ||
/******/ if(module) { | ||
/******/ moduleOutdatedDependencies = outdatedDependencies[moduleId]; | ||
/******/ var callbacks = []; | ||
/******/ for(i = 0; i < moduleOutdatedDependencies.length; i++) { | ||
/******/ dependency = moduleOutdatedDependencies[i]; | ||
/******/ cb = module.hot._acceptedDependencies[dependency]; | ||
/******/ if(cb) { | ||
/******/ if(callbacks.indexOf(cb) >= 0) continue; | ||
/******/ callbacks.push(cb); | ||
/******/ } | ||
/******/ } | ||
/******/ for(i = 0; i < callbacks.length; i++) { | ||
/******/ cb = callbacks[i]; | ||
/******/ try { | ||
/******/ cb(moduleOutdatedDependencies); | ||
/******/ } catch(err) { | ||
/******/ if(options.onErrored) { | ||
/******/ options.onErrored({ | ||
/******/ type: "accept-errored", | ||
/******/ moduleId: moduleId, | ||
/******/ dependencyId: moduleOutdatedDependencies[i], | ||
/******/ error: err | ||
/******/ }); | ||
/******/ } | ||
/******/ if(!options.ignoreErrored) { | ||
/******/ if(!error) | ||
/******/ error = err; | ||
/******/ } | ||
/******/ } | ||
/******/ } | ||
/******/ } | ||
/******/ } | ||
/******/ } | ||
/******/ | ||
/******/ // Load self accepted modules | ||
/******/ for(i = 0; i < outdatedSelfAcceptedModules.length; i++) { | ||
/******/ var item = outdatedSelfAcceptedModules[i]; | ||
/******/ moduleId = item.module; | ||
/******/ hotCurrentParents = [moduleId]; | ||
/******/ try { | ||
/******/ __webpack_require__(moduleId); | ||
/******/ } catch(err) { | ||
/******/ if(typeof item.errorHandler === "function") { | ||
/******/ try { | ||
/******/ item.errorHandler(err); | ||
/******/ } catch(err2) { | ||
/******/ if(options.onErrored) { | ||
/******/ options.onErrored({ | ||
/******/ type: "self-accept-error-handler-errored", | ||
/******/ moduleId: moduleId, | ||
/******/ error: err2, | ||
/******/ orginalError: err, // TODO remove in webpack 4 | ||
/******/ originalError: err | ||
/******/ }); | ||
/******/ } | ||
/******/ if(!options.ignoreErrored) { | ||
/******/ if(!error) | ||
/******/ error = err2; | ||
/******/ } | ||
/******/ if(!error) | ||
/******/ error = err; | ||
/******/ } | ||
/******/ } else { | ||
/******/ if(options.onErrored) { | ||
/******/ options.onErrored({ | ||
/******/ type: "self-accept-errored", | ||
/******/ moduleId: moduleId, | ||
/******/ error: err | ||
/******/ }); | ||
/******/ } | ||
/******/ if(!options.ignoreErrored) { | ||
/******/ if(!error) | ||
/******/ error = err; | ||
/******/ } | ||
/******/ } | ||
/******/ } | ||
/******/ } | ||
/******/ | ||
/******/ // handle errors in accept handlers and self accepted module load | ||
/******/ if(error) { | ||
/******/ hotSetStatus("fail"); | ||
/******/ return Promise.reject(error); | ||
/******/ } | ||
/******/ | ||
/******/ hotSetStatus("idle"); | ||
/******/ return new Promise(function(resolve) { | ||
/******/ resolve(outdatedModules); | ||
/******/ }); | ||
/******/ } | ||
/******/ | ||
/******/ // The module cache | ||
/******/ var installedModules = {}; | ||
/******/ | ||
/******/ // The require function | ||
/******/ function __webpack_require__(moduleId) { | ||
/******/ | ||
/******/ // Check if module is in cache | ||
/******/ if(installedModules[moduleId]) { | ||
/******/ return installedModules[moduleId].exports; | ||
/******/ } | ||
/******/ // Create a new module (and put it into the cache) | ||
/******/ var module = installedModules[moduleId] = { | ||
/******/ i: moduleId, | ||
/******/ l: false, | ||
/******/ exports: {}, | ||
/******/ hot: hotCreateModule(moduleId), | ||
/******/ parents: (hotCurrentParentsTemp = hotCurrentParents, hotCurrentParents = [], hotCurrentParentsTemp), | ||
/******/ children: [] | ||
/******/ }; | ||
/******/ | ||
/******/ // Execute the module function | ||
/******/ modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId)); | ||
/******/ | ||
/******/ // Flag the module as loaded | ||
/******/ module.l = true; | ||
/******/ | ||
/******/ // Return the exports of the module | ||
/******/ return module.exports; | ||
/******/ } | ||
/******/ | ||
/******/ | ||
/******/ // expose the modules object (__webpack_modules__) | ||
/******/ __webpack_require__.m = modules; | ||
/******/ | ||
/******/ // expose the module cache | ||
/******/ __webpack_require__.c = installedModules; | ||
/******/ | ||
/******/ // define getter function for harmony exports | ||
/******/ __webpack_require__.d = function(exports, name, getter) { | ||
/******/ if(!__webpack_require__.o(exports, name)) { | ||
/******/ Object.defineProperty(exports, name, { | ||
/******/ configurable: false, | ||
/******/ enumerable: true, | ||
/******/ get: getter | ||
/******/ }); | ||
/******/ } | ||
/******/ }; | ||
/******/ | ||
/******/ // getDefaultExport function for compatibility with non-harmony modules | ||
/******/ __webpack_require__.n = function(module) { | ||
/******/ var getter = module && module.__esModule ? | ||
/******/ function getDefault() { return module['default']; } : | ||
/******/ function getModuleExports() { return module; }; | ||
/******/ __webpack_require__.d(getter, 'a', getter); | ||
/******/ return getter; | ||
/******/ }; | ||
/******/ | ||
/******/ // Object.prototype.hasOwnProperty.call | ||
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; | ||
/******/ | ||
/******/ // __webpack_public_path__ | ||
/******/ __webpack_require__.p = "/scripts/"; | ||
/******/ | ||
/******/ // __webpack_hash__ | ||
/******/ __webpack_require__.h = function() { return hotCurrentHash; }; | ||
/******/ | ||
/******/ // Load entry module and return exports | ||
/******/ return hotCreateRequire(0)(__webpack_require__.s = 0); | ||
/******/ }) | ||
/************************************************************************/ | ||
/******/ ([ | ||
/* 0 */ | ||
/***/ (function(module, __webpack_exports__, __webpack_require__) { | ||
"use strict"; | ||
Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_smooth_scroll__ = __webpack_require__(1); | ||
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_smooth_scroll___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_smooth_scroll__); | ||
var scroll = new __WEBPACK_IMPORTED_MODULE_0_smooth_scroll___default.a(); | ||
var defaultScrollOffset = 0; | ||
var defaultScrollSpeed = 500; | ||
var customScrollElems = document.querySelectorAll('a[href*="#"]'); | ||
customScrollElems.forEach(function (elem) { | ||
var scrollElem = elem; | ||
var scrollOffset = defaultScrollOffset; | ||
var scrollSpeed = defaultScrollSpeed; | ||
// In the future, we could add support for links to modify options like scrollOffset, scrollOffset, etc. However, | ||
// we should provide options carefully-- only enable these after considering whether the use case that requires them | ||
// is justified. | ||
// | ||
// const scrollOffset = scrollElem.dataset.scrollOffset ? scrollElem.dataset.scrollOffset : defaultScrollOffset; | ||
// const scrollSpeed = scrollElem.dataset.scrollSpeed ? scrollElem.dataset.scrollSpeed : defaultScrollSpeed; | ||
var scrollOptions = { | ||
ignore: '[data-scroll-ignore]', // Selector for links to ignore (must be a valid CSS selector) | ||
header: '.js-bolt-smooth-scroll-offset', // Selector for fixed headers (must be a valid CSS selector) | ||
// Speed & Easing | ||
speed: scrollSpeed, // Integer. How fast to complete the scroll in milliseconds | ||
offset: scrollOffset, // Integer or Function returning an integer. How far to offset the scrolling anchor location in pixels | ||
easing: 'easeInOutCubic', // Easing pattern to use | ||
// Callback API | ||
before: function before() {}, // Callback to run before scroll | ||
after: function after() {} // Callback to run after scroll | ||
}; | ||
var scrollElemHref = scrollElem.getAttribute('href'); | ||
scrollElemHref = scrollElemHref.replace('#', ''); | ||
var scrollTarget = document.getElementById(scrollElemHref); | ||
if (scrollTarget) { | ||
scrollElem.addEventListener('click', function () { | ||
scroll.animateScroll(scrollTarget, scrollElem, scrollOptions); | ||
}); | ||
} | ||
}); | ||
/***/ }), | ||
/* 1 */ | ||
/***/ (function(module, exports, __webpack_require__) { | ||
/* WEBPACK VAR INJECTION */(function(global) {var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
/*! smooth-scroll v12.1.5 | (c) 2017 Chris Ferdinandi | MIT License | http://github.com/cferdinandi/smooth-scroll */ | ||
!function (e, t) { | ||
true ? !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function () { | ||
return t(e); | ||
}).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), | ||
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : "object" == (typeof exports === "undefined" ? "undefined" : _typeof(exports)) ? module.exports = t(e) : e.SmoothScroll = t(e); | ||
}("undefined" != typeof global ? global : "undefined" != typeof window ? window : this, function (e) { | ||
"use strict"; | ||
var t = "querySelector" in document && "addEventListener" in e && "requestAnimationFrame" in e && "closest" in e.Element.prototype, | ||
n = { ignore: "[data-scroll-ignore]", header: null, speed: 500, offset: 0, easing: "easeInOutCubic", customEasing: null, before: function before() {}, after: function after() {} }, | ||
o = function o() { | ||
for (var e = {}, t = 0, n = arguments.length; t < n; t++) { | ||
var o = arguments[t];!function (t) { | ||
for (var n in t) { | ||
t.hasOwnProperty(n) && (e[n] = t[n]); | ||
} | ||
}(o); | ||
}return e; | ||
}, | ||
a = function a(t) { | ||
return parseInt(e.getComputedStyle(t).height, 10); | ||
}, | ||
r = function r(e) { | ||
"#" === e.charAt(0) && (e = e.substr(1));for (var t, n = String(e), o = n.length, a = -1, r = "", i = n.charCodeAt(0); ++a < o;) { | ||
if (0 === (t = n.charCodeAt(a))) throw new InvalidCharacterError("Invalid character: the input contains U+0000.");t >= 1 && t <= 31 || 127 == t || 0 === a && t >= 48 && t <= 57 || 1 === a && t >= 48 && t <= 57 && 45 === i ? r += "\\" + t.toString(16) + " " : r += t >= 128 || 45 === t || 95 === t || t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 ? n.charAt(a) : "\\" + n.charAt(a); | ||
}return "#" + r; | ||
}, | ||
i = function i(e, t) { | ||
var n;return "easeInQuad" === e.easing && (n = t * t), "easeOutQuad" === e.easing && (n = t * (2 - t)), "easeInOutQuad" === e.easing && (n = t < .5 ? 2 * t * t : (4 - 2 * t) * t - 1), "easeInCubic" === e.easing && (n = t * t * t), "easeOutCubic" === e.easing && (n = --t * t * t + 1), "easeInOutCubic" === e.easing && (n = t < .5 ? 4 * t * t * t : (t - 1) * (2 * t - 2) * (2 * t - 2) + 1), "easeInQuart" === e.easing && (n = t * t * t * t), "easeOutQuart" === e.easing && (n = 1 - --t * t * t * t), "easeInOutQuart" === e.easing && (n = t < .5 ? 8 * t * t * t * t : 1 - 8 * --t * t * t * t), "easeInQuint" === e.easing && (n = t * t * t * t * t), "easeOutQuint" === e.easing && (n = 1 + --t * t * t * t * t), "easeInOutQuint" === e.easing && (n = t < .5 ? 16 * t * t * t * t * t : 1 + 16 * --t * t * t * t * t), e.customEasing && (n = e.customEasing(t)), n || t; | ||
}, | ||
u = function u() { | ||
return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight); | ||
}, | ||
c = function c(e, t, n) { | ||
var o = 0;if (e.offsetParent) do { | ||
o += e.offsetTop, e = e.offsetParent; | ||
} while (e);return o = Math.max(o - t - n, 0); | ||
}, | ||
s = function s(e) { | ||
return e ? a(e) + e.offsetTop : 0; | ||
}, | ||
l = function l(t, n, o) { | ||
o || (t.focus(), document.activeElement.id !== t.id && (t.setAttribute("tabindex", "-1"), t.focus(), t.style.outline = "none"), e.scrollTo(0, n)); | ||
}, | ||
f = function f(t) { | ||
return !!("matchMedia" in e && e.matchMedia("(prefers-reduced-motion)").matches); | ||
};return function (a, d) { | ||
var m, | ||
h, | ||
g, | ||
p, | ||
v, | ||
b, | ||
y, | ||
S = {};S.cancelScroll = function () { | ||
cancelAnimationFrame(y); | ||
}, S.animateScroll = function (t, a, r) { | ||
var f = o(m || n, r || {}), | ||
d = "[object Number]" === Object.prototype.toString.call(t), | ||
h = d || !t.tagName ? null : t;if (d || h) { | ||
var g = e.pageYOffset;f.header && !p && (p = document.querySelector(f.header)), v || (v = s(p));var b, | ||
y, | ||
E, | ||
I = d ? t : c(h, v, parseInt("function" == typeof f.offset ? f.offset() : f.offset, 10)), | ||
O = I - g, | ||
A = u(), | ||
C = 0, | ||
w = function w(n, o) { | ||
var r = e.pageYOffset;if (n == o || r == o || (g < o && e.innerHeight + r) >= A) return S.cancelScroll(), l(t, o, d), f.after(t, a), b = null, !0; | ||
}, | ||
Q = function Q(t) { | ||
b || (b = t), C += t - b, y = C / parseInt(f.speed, 10), y = y > 1 ? 1 : y, E = g + O * i(f, y), e.scrollTo(0, Math.floor(E)), w(E, I) || (e.requestAnimationFrame(Q), b = t); | ||
};0 === e.pageYOffset && e.scrollTo(0, 0), f.before(t, a), S.cancelScroll(), e.requestAnimationFrame(Q); | ||
} | ||
};var E = function E(e) { | ||
h && (h.id = h.getAttribute("data-scroll-id"), S.animateScroll(h, g), h = null, g = null); | ||
}, | ||
I = function I(t) { | ||
if (!f() && 0 === t.button && !t.metaKey && !t.ctrlKey && (g = t.target.closest(a)) && "a" === g.tagName.toLowerCase() && !t.target.closest(m.ignore) && g.hostname === e.location.hostname && g.pathname === e.location.pathname && /#/.test(g.href)) { | ||
var n;try { | ||
n = r(decodeURIComponent(g.hash)); | ||
} catch (e) { | ||
n = r(g.hash); | ||
}if ("#" === n) { | ||
t.preventDefault(), h = document.body;var o = h.id ? h.id : "smooth-scroll-top";return h.setAttribute("data-scroll-id", o), h.id = "", void (e.location.hash.substring(1) === o ? E() : e.location.hash = o); | ||
}h = document.querySelector(n), h && (h.setAttribute("data-scroll-id", h.id), h.id = "", g.hash === e.location.hash && (t.preventDefault(), E())); | ||
} | ||
}, | ||
O = function O(e) { | ||
b || (b = setTimeout(function () { | ||
b = null, v = s(p); | ||
}, 66)); | ||
};return S.destroy = function () { | ||
m && (document.removeEventListener("click", I, !1), e.removeEventListener("resize", O, !1), S.cancelScroll(), m = null, h = null, g = null, p = null, v = null, b = null, y = null); | ||
}, S.init = function (a) { | ||
t && (S.destroy(), m = o(n, a || {}), p = m.header ? document.querySelector(m.header) : null, v = s(p), document.addEventListener("click", I, !1), e.addEventListener("hashchange", E, !1), p && e.addEventListener("resize", O, !1)); | ||
}, S.init(d), S; | ||
}; | ||
}); | ||
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2))) | ||
/***/ }), | ||
/* 2 */ | ||
/***/ (function(module, exports) { | ||
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; | ||
var g; | ||
// This works in non-strict mode | ||
g = function () { | ||
return this; | ||
}(); | ||
try { | ||
// This works if eval is allowed (see CSP) | ||
g = g || Function("return this")() || (1, eval)("this"); | ||
} catch (e) { | ||
// This works if the window reference is available | ||
if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window; | ||
} | ||
// g can still be undefined, but nothing to do about it... | ||
// We return undefined, instead of nothing here, so it's | ||
// easier to handle this case. if(!global) { ...} | ||
module.exports = g; | ||
/***/ }) | ||
/******/ ]); | ||
//# sourceMappingURL=bolt-smooth-scroll.min.js.map |
@@ -11,3 +11,3 @@ { | ||
], | ||
"version": "0.1.0-beta.2", | ||
"version": "0.1.0-beta.4", | ||
"maintainers": [ | ||
@@ -43,3 +43,3 @@ { | ||
"devDependencies": { | ||
"@bolt/build-webpack": "^0.5.0-beta.2" | ||
"@bolt/build-webpack": "^0.5.0-beta.4" | ||
}, | ||
@@ -46,0 +46,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
91456
9
939
1