Socket
Socket
Sign inDemoInstall

basicscroll

Package Overview
Dependencies
3
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.5 to 1.2.0

6

CHANGELOG.md

@@ -7,2 +7,8 @@ # Changelog

## [1.2.0] - 2018-01-18
### New
- `inside` and `outside` callbacks now receive the calculated properties
## [1.1.5] - 2017-12-17

@@ -9,0 +15,0 @@

2

dist/basicScroll.min.js

@@ -1,1 +0,1 @@

!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).basicScroll=t()}}(function(){return function t(n,e,r){function o(i,c){if(!e[i]){if(!n[i]){var a="function"==typeof require&&require;if(!c&&a)return a(i,!0);if(u)return u(i,!0);var f=new Error("Cannot find module '"+i+"'");throw f.code="MODULE_NOT_FOUND",f}var s=e[i]={exports:{}};n[i][0].call(s.exports,function(t){var e=n[i][1][t];return o(e||t)},s,s.exports,t,n,e,r)}return e[i].exports}for(var u="function"==typeof require&&require,i=0;i<r.length;i++)o(r[i]);return o}({1:[function(t,n,e){"use strict";n.exports=function(t){var n=2.5949095;return(t*=2)<1?t*t*((n+1)*t-n)*.5:.5*((t-=2)*t*((n+1)*t+n)+2)}},{}],2:[function(t,n,e){"use strict";n.exports=function(t){return t*t*(2.70158*t-1.70158)}},{}],3:[function(t,n,e){"use strict";n.exports=function(t){return--t*t*(2.70158*t+1.70158)+1}},{}],4:[function(t,n,e){"use strict";var r=t("./bounce-out");n.exports=function(t){return t<.5?.5*(1-r(1-2*t)):.5*r(2*t-1)+.5}},{"./bounce-out":6}],5:[function(t,n,e){"use strict";var r=t("./bounce-out");n.exports=function(t){return 1-r(1-t)}},{"./bounce-out":6}],6:[function(t,n,e){"use strict";n.exports=function(t){var n=t*t;return t<4/11?7.5625*n:t<8/11?9.075*n-9.9*t+3.4:t<.9?4356/361*n-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72}},{}],7:[function(t,n,e){"use strict";n.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},{}],8:[function(t,n,e){"use strict";n.exports=function(t){return 1-Math.sqrt(1-t*t)}},{}],9:[function(t,n,e){"use strict";n.exports=function(t){return Math.sqrt(1- --t*t)}},{}],10:[function(t,n,e){"use strict";n.exports=function(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}},{}],11:[function(t,n,e){"use strict";n.exports=function(t){return t*t*t}},{}],12:[function(t,n,e){"use strict";n.exports=function(t){var n=t-1;return n*n*n+1}},{}],13:[function(t,n,e){"use strict";n.exports=function(t){return t<.5?.5*Math.sin(13*Math.PI/2*2*t)*Math.pow(2,10*(2*t-1)):.5*Math.sin(-13*Math.PI/2*(2*t-1+1))*Math.pow(2,-10*(2*t-1))+1}},{}],14:[function(t,n,e){"use strict";n.exports=function(t){return Math.sin(13*t*Math.PI/2)*Math.pow(2,10*(t-1))}},{}],15:[function(t,n,e){"use strict";n.exports=function(t){return Math.sin(-13*(t+1)*Math.PI/2)*Math.pow(2,-10*t)+1}},{}],16:[function(t,n,e){"use strict";n.exports=function(t){return 0===t||1===t?t:t<.5?.5*Math.pow(2,20*t-10):-.5*Math.pow(2,10-20*t)+1}},{}],17:[function(t,n,e){"use strict";n.exports=function(t){return 0===t?t:Math.pow(2,10*(t-1))}},{}],18:[function(t,n,e){"use strict";n.exports=function(t){return 1===t?t:1-Math.pow(2,-10*t)}},{}],19:[function(t,n,e){"use strict";n.exports={backInOut:t("./back-in-out"),backIn:t("./back-in"),backOut:t("./back-out"),bounceInOut:t("./bounce-in-out"),bounceIn:t("./bounce-in"),bounceOut:t("./bounce-out"),circInOut:t("./circ-in-out"),circIn:t("./circ-in"),circOut:t("./circ-out"),cubicInOut:t("./cubic-in-out"),cubicIn:t("./cubic-in"),cubicOut:t("./cubic-out"),elasticInOut:t("./elastic-in-out"),elasticIn:t("./elastic-in"),elasticOut:t("./elastic-out"),expoInOut:t("./expo-in-out"),expoIn:t("./expo-in"),expoOut:t("./expo-out"),linear:t("./linear"),quadInOut:t("./quad-in-out"),quadIn:t("./quad-in"),quadOut:t("./quad-out"),quartInOut:t("./quart-in-out"),quartIn:t("./quart-in"),quartOut:t("./quart-out"),quintInOut:t("./quint-in-out"),quintIn:t("./quint-in"),quintOut:t("./quint-out"),sineInOut:t("./sine-in-out"),sineIn:t("./sine-in"),sineOut:t("./sine-out")}},{"./back-in":2,"./back-in-out":1,"./back-out":3,"./bounce-in":5,"./bounce-in-out":4,"./bounce-out":6,"./circ-in":8,"./circ-in-out":7,"./circ-out":9,"./cubic-in":11,"./cubic-in-out":10,"./cubic-out":12,"./elastic-in":14,"./elastic-in-out":13,"./elastic-out":15,"./expo-in":17,"./expo-in-out":16,"./expo-out":18,"./linear":20,"./quad-in":22,"./quad-in-out":21,"./quad-out":23,"./quart-in":25,"./quart-in-out":24,"./quart-out":26,"./quint-in":28,"./quint-in-out":27,"./quint-out":29,"./sine-in":31,"./sine-in-out":30,"./sine-out":32}],20:[function(t,n,e){"use strict";n.exports=function(t){return t}},{}],21:[function(t,n,e){"use strict";n.exports=function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)}},{}],22:[function(t,n,e){"use strict";n.exports=function(t){return t*t}},{}],23:[function(t,n,e){"use strict";n.exports=function(t){return-t*(t-2)}},{}],24:[function(t,n,e){"use strict";n.exports=function(t){return t<.5?8*Math.pow(t,4):-8*Math.pow(t-1,4)+1}},{}],25:[function(t,n,e){"use strict";n.exports=function(t){return Math.pow(t,4)}},{}],26:[function(t,n,e){"use strict";n.exports=function(t){return Math.pow(t-1,3)*(1-t)+1}},{}],27:[function(t,n,e){"use strict";n.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},{}],28:[function(t,n,e){"use strict";n.exports=function(t){return t*t*t*t*t}},{}],29:[function(t,n,e){"use strict";n.exports=function(t){return--t*t*t*t*t+1}},{}],30:[function(t,n,e){"use strict";n.exports=function(t){return-.5*(Math.cos(Math.PI*t)-1)}},{}],31:[function(t,n,e){"use strict";n.exports=function(t){var n=Math.cos(t*Math.PI*.5);return Math.abs(n)<1e-14?1:1-n}},{}],32:[function(t,n,e){"use strict";n.exports=function(t){return Math.sin(t*Math.PI/2)}},{}],33:[function(t,n,e){(function(t){"use strict";function r(t,n){return t.set(n[0],n[1]),t}function o(t,n){return t.add(n),t}function u(t,n,e,r){var o=-1,u=t?t.length:0;for(r&&u&&(e=t[++o]);++o<u;)e=n(e,t[o],o,t);return e}function i(t){var n=!1;if(null!=t&&"function"!=typeof t.toString)try{n=!!(t+"")}catch(t){}return n}function c(t){var n=-1,e=Array(t.size);return t.forEach(function(t,r){e[++n]=[r,t]}),e}function a(t,n){return function(e){return t(n(e))}}function f(t){var n=-1,e=Array(t.size);return t.forEach(function(t){e[++n]=t}),e}function s(t){var n=-1,e=t?t.length:0;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function l(t){var n=-1,e=t?t.length:0;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function p(t){var n=-1,e=t?t.length:0;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function d(t){this.__data__=new l(t)}function h(t,n){var e=Kt(t)||function(t){return function(t){return function(t){return!!t&&"object"==(void 0===t?"undefined":P(t))}(t)&&q(t)}(t)&&wt.call(t,"callee")&&(!Et.call(t,"callee")||xt.call(t)==F)}(t)?function(t,n){for(var e=-1,r=Array(t);++e<t;)r[e]=n(e);return r}(t.length,String):[],r=e.length,o=!!r;for(var u in t)!n&&!wt.call(t,u)||o&&("length"==u||function(t,n){return!!(n=null==n?$:n)&&("number"==typeof t||ct.test(t))&&t>-1&&t%1==0&&t<n}(u,r))||e.push(u);return e}function b(t,n,e){var r=t[n];wt.call(t,n)&&M(r,e)&&(void 0!==e||n in t)||(t[n]=e)}function v(t,n){for(var e=t.length;e--;)if(M(t[e][0],n))return e;return-1}function y(t,n,e,a,s,l,p){var h;if(a&&(h=l?a(t,s,l,p):a(t)),void 0!==h)return h;if(!A(t))return t;var v=Kt(t);if(v){if(h=function(t){var n=t.length,e=t.constructor(n);n&&"string"==typeof t[0]&&wt.call(t,"index")&&(e.index=t.index,e.input=t.input);return e}(t),!n)return function(t,n){var e=-1,r=t.length;n||(n=Array(r));for(;++e<r;)n[e]=t[e];return n}(t,h)}else{var _=Jt(t),w=_==z||_==B;if(Qt(t))return function(t,n){if(n)return t.slice();var e=new t.constructor(t.length);return t.copy(e),e}(t,n);if(_==C||_==F||w&&!l){if(i(t))return l?t:{};if(h=function(t){return"function"!=typeof t.constructor||j(t)?{}:function(t){return A(t)?At(t):{}}(It(t))}(w?{}:t),!n)return function(t,n){return g(t,Gt(t),n)}(t,function(t,n){return t&&g(n,E(n),t)}(h,t))}else{if(!at[_])return l?t:{};h=function(t,n,e,i){var a=t.constructor;switch(n){case J:return m(t);case U:case D:return new a(+t);case K:return function(t,n){var e=n?m(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)}(t,i);case Q:case X:case Y:case Z:case tt:case nt:case et:case rt:case ot:return function(t,n){var e=n?m(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)}(t,i);case N:return function(t,n,e){return u(n?e(c(t),!0):c(t),r,new t.constructor)}(t,i,e);case T:case V:return new a(t);case L:return function(t){var n=new t.constructor(t.source,ut.exec(t));return n.lastIndex=t.lastIndex,n}(t);case H:return function(t,n,e){return u(n?e(f(t),!0):f(t),o,new t.constructor)}(t,i,e);case W:return function(t){return Wt?Object(Wt.call(t)):{}}(t)}}(t,_,y,n)}}p||(p=new d);var x=p.get(t);if(x)return x;if(p.set(t,h),!v)var O=e?function(t){return function(t,n,e){var r=n(t);return Kt(t)?r:function(t,n){for(var e=-1,r=n.length,o=t.length;++e<r;)t[o+e]=n[e];return t}(r,e(t))}(t,E,Gt)}(t):E(t);return function(t,n){for(var e=-1,r=t?t.length:0;++e<r&&!1!==n(t[e],e,t););}(O||t,function(r,o){O&&(r=t[o=r]),b(h,o,y(r,n,e,a,o,t,p))}),h}function _(t){if(!A(t)||function(t){return!!mt&&mt in t}(t))return!1;return(I(t)||i(t)?jt:it).test(O(t))}function m(t){var n=new t.constructor(t.byteLength);return new qt(n).set(new qt(t)),n}function g(t,n,e,r){e||(e={});for(var o=-1,u=n.length;++o<u;){var i=n[o],c=r?r(e[i],t[i],i,e,t):void 0;b(e,i,void 0===c?t[i]:c)}return e}function w(t,n){var e=t.__data__;return function(t){var n=void 0===t?"undefined":P(t);return"string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==t:null===t}(n)?e["string"==typeof n?"string":"hash"]:e.map}function x(t,n){var e=function(t,n){return null==t?void 0:t[n]}(t,n);return _(e)?e:void 0}function j(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||yt)}function O(t){if(null!=t){try{return gt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function M(t,n){return t===n||t!=t&&n!=n}function q(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=$}(t.length)&&!I(t)}function I(t){var n=A(t)?xt.call(t):"";return n==z||n==B}function A(t){var n=void 0===t?"undefined":P(t);return!!t&&("object"==n||"function"==n)}function E(t){return q(t)?h(t):function(t){if(!j(t))return $t(t);var n=[];for(var e in Object(t))wt.call(t,e)&&"constructor"!=e&&n.push(e);return n}(t)}var P="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},k=200,S="__lodash_hash_undefined__",$=9007199254740991,F="[object Arguments]",U="[object Boolean]",D="[object Date]",z="[object Function]",B="[object GeneratorFunction]",N="[object Map]",T="[object Number]",C="[object Object]",R="[object Promise]",L="[object RegExp]",H="[object Set]",V="[object String]",W="[object Symbol]",G="[object WeakMap]",J="[object ArrayBuffer]",K="[object DataView]",Q="[object Float32Array]",X="[object Float64Array]",Y="[object Int8Array]",Z="[object Int16Array]",tt="[object Int32Array]",nt="[object Uint8Array]",et="[object Uint8ClampedArray]",rt="[object Uint16Array]",ot="[object Uint32Array]",ut=/\w*$/,it=/^\[object .+?Constructor\]$/,ct=/^(?:0|[1-9]\d*)$/,at={};at[F]=at["[object Array]"]=at[J]=at[K]=at[U]=at[D]=at[Q]=at[X]=at[Y]=at[Z]=at[tt]=at[N]=at[T]=at[C]=at[L]=at[H]=at[V]=at[W]=at[nt]=at[et]=at[rt]=at[ot]=!0,at["[object Error]"]=at[z]=at[G]=!1;var ft="object"==(void 0===t?"undefined":P(t))&&t&&t.Object===Object&&t,st="object"==("undefined"==typeof self?"undefined":P(self))&&self&&self.Object===Object&&self,lt=ft||st||Function("return this")(),pt="object"==(void 0===e?"undefined":P(e))&&e&&!e.nodeType&&e,dt=pt&&"object"==(void 0===n?"undefined":P(n))&&n&&!n.nodeType&&n,ht=dt&&dt.exports===pt,bt=Array.prototype,vt=Function.prototype,yt=Object.prototype,_t=lt["__core-js_shared__"],mt=function(){var t=/[^.]+$/.exec(_t&&_t.keys&&_t.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),gt=vt.toString,wt=yt.hasOwnProperty,xt=yt.toString,jt=RegExp("^"+gt.call(wt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ot=ht?lt.Buffer:void 0,Mt=lt.Symbol,qt=lt.Uint8Array,It=a(Object.getPrototypeOf,Object),At=Object.create,Et=yt.propertyIsEnumerable,Pt=bt.splice,kt=Object.getOwnPropertySymbols,St=Ot?Ot.isBuffer:void 0,$t=a(Object.keys,Object),Ft=x(lt,"DataView"),Ut=x(lt,"Map"),Dt=x(lt,"Promise"),zt=x(lt,"Set"),Bt=x(lt,"WeakMap"),Nt=x(Object,"create"),Tt=O(Ft),Ct=O(Ut),Rt=O(Dt),Lt=O(zt),Ht=O(Bt),Vt=Mt?Mt.prototype:void 0,Wt=Vt?Vt.valueOf:void 0;s.prototype.clear=function(){this.__data__=Nt?Nt(null):{}},s.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},s.prototype.get=function(t){var n=this.__data__;if(Nt){var e=n[t];return e===S?void 0:e}return wt.call(n,t)?n[t]:void 0},s.prototype.has=function(t){var n=this.__data__;return Nt?void 0!==n[t]:wt.call(n,t)},s.prototype.set=function(t,n){return this.__data__[t]=Nt&&void 0===n?S:n,this},l.prototype.clear=function(){this.__data__=[]},l.prototype.delete=function(t){var n=this.__data__,e=v(n,t);return!(e<0||(e==n.length-1?n.pop():Pt.call(n,e,1),0))},l.prototype.get=function(t){var n=this.__data__,e=v(n,t);return e<0?void 0:n[e][1]},l.prototype.has=function(t){return v(this.__data__,t)>-1},l.prototype.set=function(t,n){var e=this.__data__,r=v(e,t);return r<0?e.push([t,n]):e[r][1]=n,this},p.prototype.clear=function(){this.__data__={hash:new s,map:new(Ut||l),string:new s}},p.prototype.delete=function(t){return w(this,t).delete(t)},p.prototype.get=function(t){return w(this,t).get(t)},p.prototype.has=function(t){return w(this,t).has(t)},p.prototype.set=function(t,n){return w(this,t).set(t,n),this},d.prototype.clear=function(){this.__data__=new l},d.prototype.delete=function(t){return this.__data__.delete(t)},d.prototype.get=function(t){return this.__data__.get(t)},d.prototype.has=function(t){return this.__data__.has(t)},d.prototype.set=function(t,n){var e=this.__data__;if(e instanceof l){var r=e.__data__;if(!Ut||r.length<k-1)return r.push([t,n]),this;e=this.__data__=new p(r)}return e.set(t,n),this};var Gt=kt?a(kt,Object):function(){return[]},Jt=function(t){return xt.call(t)};(Ft&&Jt(new Ft(new ArrayBuffer(1)))!=K||Ut&&Jt(new Ut)!=N||Dt&&Jt(Dt.resolve())!=R||zt&&Jt(new zt)!=H||Bt&&Jt(new Bt)!=G)&&(Jt=function(t){var n=xt.call(t),e=n==C?t.constructor:void 0,r=e?O(e):void 0;if(r)switch(r){case Tt:return K;case Ct:return N;case Rt:return R;case Lt:return H;case Ht:return G}return n});var Kt=Array.isArray,Qt=St||function(){return!1};n.exports=function(t){return y(t,!0,!0)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],34:[function(t,n,e){"use strict";n.exports=function(t,n){n||(n=[0,""]),t=String(t);var e=parseFloat(t,10);return n[0]=e,n[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",n}},{}],35:[function(t,n,e){"use strict";function r(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.create=void 0;var o=r(t("parse-unit")),u=r(t("lodash.clonedeep")),i=r(t("eases")),c=[],a=function(){return(document.scrollingElement||document.documentElement).scrollTop},f=function(t){return!0!==isNaN((0,o.default)(t)[0])},s=function(t){var n=(0,o.default)(t);return{value:n[0],unit:n[1]}},l=function(t){return null!==String(t).match(/^[a-z]+-[a-z]+$/)},p=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a(),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window.innerHeight||window.outerHeight,o=n.getBoundingClientRect(),u=t.match(/^[a-z]+/)[0],i=t.match(/[a-z]+$/)[0],c=0;return"top"===i&&(c-=0),"middle"===i&&(c-=r/2),"bottom"===i&&(c-=r),"top"===u&&(c+=o.top+e),"middle"===u&&(c+=o.top+e+o.height/2),"bottom"===u&&(c+=o.top+e+o.height),c+"px"},d=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a(),e=t.getData(),r=e.to.value-e.from.value,o=(n-e.from.value)/(r/100),u=o<0||o>100;return!0===(o>=0&&o<=100)&&e.inside(t,o),!0===u&&e.outside(t,o),o<0&&(o=0),o>100&&(o=100),Object.keys(e.props).map(function(t){var n=e.props[t],r=!0===n.direct?e.elem:document.documentElement,u=n.from.unit||n.to.unit,i=n.from.value-n.to.value,c=n.timing(o/100),a=n.from.value-i*c;return{elem:r,key:t,value:Math.round(100*a)/100+u}})},h=function(t,n){t.style.setProperty(n.key,n.value)};e.create=function(t){var n=null,e=!1,r={isActive:function(){return e},getData:function(){return n},calculate:function(){n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null==(t=(0,u.default)(t)).from)throw new Error("Missing property `from`");if(null==t.to)throw new Error("Missing property `to`");if(null==t.inside&&(t.inside=function(){}),null==t.outside&&(t.outside=function(){}),"function"!=typeof t.inside)throw new Error("Property `inside` must be a function");if("function"!=typeof t.outside)throw new Error("Property `outside` must be a function");if(null==t.elem){if(!1===f(t.from))throw new Error("Property `from` must be a absolute value when no `elem` has been provided");if(!1===f(t.to))throw new Error("Property `to` must be a absolute value when no `elem` has been provided")}else!0===l(t.from)&&(t.from=p(t.from,t.elem)),!0===l(t.to)&&(t.to=p(t.to,t.elem));return t.from=s(t.from),t.to=s(t.to),null==t.props&&(t.props={}),Object.keys(t.props).forEach(function(n){var e=t.props[n];if(!1===f(e.from))throw new Error("Property `from` of prop must be a absolute value");if(!1===f(e.to))throw new Error("Property `from` of prop must be a absolute value");if(e.from=s(e.from),e.to=s(e.to),"string"==typeof e.timing&&null==i.default[e.timing])throw new Error("Unknown timing for property `timing` of prop");if(null==e.timing&&(e.timing=i.default.linear),"string"==typeof e.timing&&(e.timing=i.default[e.timing]),!0===e.direct&&null==t.elem)throw new Error("Property `elem` required when `direct` is true");!0!==e.direct&&(e.direct=!1)}),t}(t)},update:function(){var t=d(r);return t.forEach(function(t){return h(t.elem,t)}),t},start:function(){e=!0},stop:function(){e=!1}};return c.push(r),r.calculate(),r};!function t(n,e){var r,o=function(){requestAnimationFrame(function(){return t(n,e)})},u=function(t){return t.filter(function(t){return t.isActive()})}(c);if(0===u.length)return o();var i=a();if(e===i)return o();e=i;var f=u.map(function(t){return d(t,i)});(r=[]).concat.apply(r,function(t){if(Array.isArray(t)){for(var n=0,e=Array(t.length);n<t.length;n++)e[n]=t[n];return e}return Array.from(t)}(f)).forEach(function(t){return h(t.elem,t)}),o()}()},{eases:19,"lodash.clonedeep":33,"parse-unit":34}]},{},[35])(35)});
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).basicScroll=t()}}(function(){return function t(n,e,r){function o(i,c){if(!e[i]){if(!n[i]){var a="function"==typeof require&&require;if(!c&&a)return a(i,!0);if(u)return u(i,!0);var s=new Error("Cannot find module '"+i+"'");throw s.code="MODULE_NOT_FOUND",s}var f=e[i]={exports:{}};n[i][0].call(f.exports,function(t){var e=n[i][1][t];return o(e||t)},f,f.exports,t,n,e,r)}return e[i].exports}for(var u="function"==typeof require&&require,i=0;i<r.length;i++)o(r[i]);return o}({1:[function(t,n,e){"use strict";n.exports=function(t){var n=2.5949095;return(t*=2)<1?t*t*((n+1)*t-n)*.5:.5*((t-=2)*t*((n+1)*t+n)+2)}},{}],2:[function(t,n,e){"use strict";n.exports=function(t){var n=1.70158;return t*t*((n+1)*t-n)}},{}],3:[function(t,n,e){"use strict";n.exports=function(t){var n=1.70158;return--t*t*((n+1)*t+n)+1}},{}],4:[function(t,n,e){"use strict";var r=t("./bounce-out");n.exports=function(t){return t<.5?.5*(1-r(1-2*t)):.5*r(2*t-1)+.5}},{"./bounce-out":6}],5:[function(t,n,e){"use strict";var r=t("./bounce-out");n.exports=function(t){return 1-r(1-t)}},{"./bounce-out":6}],6:[function(t,n,e){"use strict";n.exports=function(t){var n=t*t;return t<4/11?7.5625*n:t<8/11?9.075*n-9.9*t+3.4:t<.9?4356/361*n-35442/1805*t+16061/1805:10.8*t*t-20.52*t+10.72}},{}],7:[function(t,n,e){"use strict";n.exports=function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}},{}],8:[function(t,n,e){"use strict";n.exports=function(t){return 1-Math.sqrt(1-t*t)}},{}],9:[function(t,n,e){"use strict";n.exports=function(t){return Math.sqrt(1- --t*t)}},{}],10:[function(t,n,e){"use strict";n.exports=function(t){return t<.5?4*t*t*t:.5*Math.pow(2*t-2,3)+1}},{}],11:[function(t,n,e){"use strict";n.exports=function(t){return t*t*t}},{}],12:[function(t,n,e){"use strict";n.exports=function(t){var n=t-1;return n*n*n+1}},{}],13:[function(t,n,e){"use strict";n.exports=function(t){return t<.5?.5*Math.sin(13*Math.PI/2*2*t)*Math.pow(2,10*(2*t-1)):.5*Math.sin(-13*Math.PI/2*(2*t-1+1))*Math.pow(2,-10*(2*t-1))+1}},{}],14:[function(t,n,e){"use strict";n.exports=function(t){return Math.sin(13*t*Math.PI/2)*Math.pow(2,10*(t-1))}},{}],15:[function(t,n,e){"use strict";n.exports=function(t){return Math.sin(-13*(t+1)*Math.PI/2)*Math.pow(2,-10*t)+1}},{}],16:[function(t,n,e){"use strict";n.exports=function(t){return 0===t||1===t?t:t<.5?.5*Math.pow(2,20*t-10):-.5*Math.pow(2,10-20*t)+1}},{}],17:[function(t,n,e){"use strict";n.exports=function(t){return 0===t?t:Math.pow(2,10*(t-1))}},{}],18:[function(t,n,e){"use strict";n.exports=function(t){return 1===t?t:1-Math.pow(2,-10*t)}},{}],19:[function(t,n,e){"use strict";n.exports={backInOut:t("./back-in-out"),backIn:t("./back-in"),backOut:t("./back-out"),bounceInOut:t("./bounce-in-out"),bounceIn:t("./bounce-in"),bounceOut:t("./bounce-out"),circInOut:t("./circ-in-out"),circIn:t("./circ-in"),circOut:t("./circ-out"),cubicInOut:t("./cubic-in-out"),cubicIn:t("./cubic-in"),cubicOut:t("./cubic-out"),elasticInOut:t("./elastic-in-out"),elasticIn:t("./elastic-in"),elasticOut:t("./elastic-out"),expoInOut:t("./expo-in-out"),expoIn:t("./expo-in"),expoOut:t("./expo-out"),linear:t("./linear"),quadInOut:t("./quad-in-out"),quadIn:t("./quad-in"),quadOut:t("./quad-out"),quartInOut:t("./quart-in-out"),quartIn:t("./quart-in"),quartOut:t("./quart-out"),quintInOut:t("./quint-in-out"),quintIn:t("./quint-in"),quintOut:t("./quint-out"),sineInOut:t("./sine-in-out"),sineIn:t("./sine-in"),sineOut:t("./sine-out")}},{"./back-in":2,"./back-in-out":1,"./back-out":3,"./bounce-in":5,"./bounce-in-out":4,"./bounce-out":6,"./circ-in":8,"./circ-in-out":7,"./circ-out":9,"./cubic-in":11,"./cubic-in-out":10,"./cubic-out":12,"./elastic-in":14,"./elastic-in-out":13,"./elastic-out":15,"./expo-in":17,"./expo-in-out":16,"./expo-out":18,"./linear":20,"./quad-in":22,"./quad-in-out":21,"./quad-out":23,"./quart-in":25,"./quart-in-out":24,"./quart-out":26,"./quint-in":28,"./quint-in-out":27,"./quint-out":29,"./sine-in":31,"./sine-in-out":30,"./sine-out":32}],20:[function(t,n,e){"use strict";n.exports=function(t){return t}},{}],21:[function(t,n,e){"use strict";n.exports=function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)}},{}],22:[function(t,n,e){"use strict";n.exports=function(t){return t*t}},{}],23:[function(t,n,e){"use strict";n.exports=function(t){return-t*(t-2)}},{}],24:[function(t,n,e){"use strict";n.exports=function(t){return t<.5?8*Math.pow(t,4):-8*Math.pow(t-1,4)+1}},{}],25:[function(t,n,e){"use strict";n.exports=function(t){return Math.pow(t,4)}},{}],26:[function(t,n,e){"use strict";n.exports=function(t){return Math.pow(t-1,3)*(1-t)+1}},{}],27:[function(t,n,e){"use strict";n.exports=function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)}},{}],28:[function(t,n,e){"use strict";n.exports=function(t){return t*t*t*t*t}},{}],29:[function(t,n,e){"use strict";n.exports=function(t){return--t*t*t*t*t+1}},{}],30:[function(t,n,e){"use strict";n.exports=function(t){return-.5*(Math.cos(Math.PI*t)-1)}},{}],31:[function(t,n,e){"use strict";n.exports=function(t){var n=Math.cos(t*Math.PI*.5);return Math.abs(n)<1e-14?1:1-n}},{}],32:[function(t,n,e){"use strict";n.exports=function(t){return Math.sin(t*Math.PI/2)}},{}],33:[function(t,n,e){(function(t){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=200,u="__lodash_hash_undefined__",i=9007199254740991,c="[object Arguments]",a="[object Boolean]",s="[object Date]",f="[object Function]",l="[object GeneratorFunction]",p="[object Map]",d="[object Number]",h="[object Object]",v="[object Promise]",b="[object RegExp]",y="[object Set]",_="[object String]",m="[object Symbol]",g="[object WeakMap]",w="[object ArrayBuffer]",x="[object DataView]",j="[object Float32Array]",O="[object Float64Array]",M="[object Int8Array]",q="[object Int16Array]",I="[object Int32Array]",A="[object Uint8Array]",E="[object Uint8ClampedArray]",P="[object Uint16Array]",k="[object Uint32Array]",S=/\w*$/,$=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,U={};U[c]=U["[object Array]"]=U[w]=U[x]=U[a]=U[s]=U[j]=U[O]=U[M]=U[q]=U[I]=U[p]=U[d]=U[h]=U[b]=U[y]=U[_]=U[m]=U[A]=U[E]=U[P]=U[k]=!0,U["[object Error]"]=U[f]=U[g]=!1;var D="object"==(void 0===t?"undefined":r(t))&&t&&t.Object===Object&&t,z="object"==("undefined"==typeof self?"undefined":r(self))&&self&&self.Object===Object&&self,B=D||z||Function("return this")(),N="object"==(void 0===e?"undefined":r(e))&&e&&!e.nodeType&&e,T=N&&"object"==(void 0===n?"undefined":r(n))&&n&&!n.nodeType&&n,C=T&&T.exports===N;function R(t,n){return t.set(n[0],n[1]),t}function L(t,n){return t.add(n),t}function H(t,n,e,r){var o=-1,u=t?t.length:0;for(r&&u&&(e=t[++o]);++o<u;)e=n(e,t[o],o,t);return e}function V(t){var n=!1;if(null!=t&&"function"!=typeof t.toString)try{n=!!(t+"")}catch(t){}return n}function W(t){var n=-1,e=Array(t.size);return t.forEach(function(t,r){e[++n]=[r,t]}),e}function G(t,n){return function(e){return t(n(e))}}function J(t){var n=-1,e=Array(t.size);return t.forEach(function(t){e[++n]=t}),e}var K,Q=Array.prototype,X=Function.prototype,Y=Object.prototype,Z=B["__core-js_shared__"],tt=(K=/[^.]+$/.exec(Z&&Z.keys&&Z.keys.IE_PROTO||""))?"Symbol(src)_1."+K:"",nt=X.toString,et=Y.hasOwnProperty,rt=Y.toString,ot=RegExp("^"+nt.call(et).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ut=C?B.Buffer:void 0,it=B.Symbol,ct=B.Uint8Array,at=G(Object.getPrototypeOf,Object),st=Object.create,ft=Y.propertyIsEnumerable,lt=Q.splice,pt=Object.getOwnPropertySymbols,dt=ut?ut.isBuffer:void 0,ht=G(Object.keys,Object),vt=Tt(B,"DataView"),bt=Tt(B,"Map"),yt=Tt(B,"Promise"),_t=Tt(B,"Set"),mt=Tt(B,"WeakMap"),gt=Tt(Object,"create"),wt=Vt(vt),xt=Vt(bt),jt=Vt(yt),Ot=Vt(_t),Mt=Vt(mt),qt=it?it.prototype:void 0,It=qt?qt.valueOf:void 0;function At(t){var n=-1,e=t?t.length:0;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function Et(t){var n=-1,e=t?t.length:0;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function Pt(t){var n=-1,e=t?t.length:0;for(this.clear();++n<e;){var r=t[n];this.set(r[0],r[1])}}function kt(t){this.__data__=new Et(t)}function St(t,n){var e,o,u,i=Gt(t)||(u=o=e=t)&&"object"==(void 0===u?"undefined":r(u))&&Jt(o)&&et.call(e,"callee")&&(!ft.call(e,"callee")||rt.call(e)==c)?function(t,n){for(var e=-1,r=Array(t);++e<t;)r[e]=n(e);return r}(t.length,String):[],a=i.length,s=!!a;for(var f in t)!n&&!et.call(t,f)||s&&("length"==f||Lt(f,a))||i.push(f);return i}function $t(t,n,e){var r=t[n];et.call(t,n)&&Wt(r,e)&&(void 0!==e||n in t)||(t[n]=e)}function Ft(t,n){for(var e=t.length;e--;)if(Wt(t[e][0],n))return e;return-1}function Ut(t,n,e,r,o,u,i){var v;if(r&&(v=u?r(t,o,u,i):r(t)),void 0!==v)return v;if(!Xt(t))return t;var g,$,F,D,z,B,N=Gt(t);if(N){if(v=function(t){var n=t.length,e=t.constructor(n);n&&"string"==typeof t[0]&&et.call(t,"index")&&(e.index=t.index,e.input=t.input);return e}(t),!n)return function(t,n){var e=-1,r=t.length;n||(n=Array(r));for(;++e<r;)n[e]=t[e];return n}(t,v)}else{var T=Rt(t),C=T==f||T==l;if(Kt(t))return function(t,n){if(n)return t.slice();var e=new t.constructor(t.length);return t.copy(e),e}(t,n);if(T==h||T==c||C&&!u){if(V(t))return u?t:{};if(v="function"!=typeof(z=C?{}:t).constructor||Ht(z)?{}:Xt(B=at(z))?st(B):{},!n)return g=t,D=t,$=(F=v)&&Bt(D,Yt(D),F),Bt(g,Ct(g),$)}else{if(!U[T])return u?t:{};v=function(t,n,e,r){var o=t.constructor;switch(n){case w:return zt(t);case a:case s:return new o(+t);case x:return g=t,$=r?zt(g.buffer):g.buffer,new g.constructor($,g.byteOffset,g.byteLength);case j:case O:case M:case q:case I:case A:case E:case P:case k:return h=t,v=r?zt(h.buffer):h.buffer,new h.constructor(v,h.byteOffset,h.length);case p:return l=t,H(r?e(W(l),!0):W(l),R,new l.constructor);case d:case _:return new o(t);case b:return(f=new(c=t).constructor(c.source,S.exec(c))).lastIndex=c.lastIndex,f;case y:return i=t,H(r?e(J(i),!0):J(i),L,new i.constructor);case m:return u=t,It?Object(It.call(u)):{}}var u;var i;var c,f;var l;var h,v;var g,$}(t,T,Ut,n)}}i||(i=new kt);var G,K,Q,X=i.get(t);if(X)return X;if(i.set(t,v),!N)var Y=e?(K=Ct,Q=Yt(G=t),Gt(G)?Q:function(t,n){for(var e=-1,r=n.length,o=t.length;++e<r;)t[o+e]=n[e];return t}(Q,K(G))):Yt(t);return function(t,n){for(var e=-1,r=t?t.length:0;++e<r&&!1!==n(t[e],e,t););}(Y||t,function(o,u){Y&&(o=t[u=o]),$t(v,u,Ut(o,n,e,r,u,t,i))}),v}function Dt(t){return!(!Xt(t)||tt&&tt in t)&&(Qt(t)||V(t)?ot:$).test(Vt(t))}function zt(t){var n=new t.constructor(t.byteLength);return new ct(n).set(new ct(t)),n}function Bt(t,n,e,r){e||(e={});for(var o=-1,u=n.length;++o<u;){var i=n[o],c=r?r(e[i],t[i],i,e,t):void 0;$t(e,i,void 0===c?t[i]:c)}return e}function Nt(t,n){var e,o,u=t.__data__;return("string"==(o=void 0===(e=n)?"undefined":r(e))||"number"==o||"symbol"==o||"boolean"==o?"__proto__"!==e:null===e)?u["string"==typeof n?"string":"hash"]:u.map}function Tt(t,n){var e,r=null==(e=t)?void 0:e[n];return Dt(r)?r:void 0}At.prototype.clear=function(){this.__data__=gt?gt(null):{}},At.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},At.prototype.get=function(t){var n=this.__data__;if(gt){var e=n[t];return e===u?void 0:e}return et.call(n,t)?n[t]:void 0},At.prototype.has=function(t){var n=this.__data__;return gt?void 0!==n[t]:et.call(n,t)},At.prototype.set=function(t,n){return this.__data__[t]=gt&&void 0===n?u:n,this},Et.prototype.clear=function(){this.__data__=[]},Et.prototype.delete=function(t){var n=this.__data__,e=Ft(n,t);return!(e<0||(e==n.length-1?n.pop():lt.call(n,e,1),0))},Et.prototype.get=function(t){var n=this.__data__,e=Ft(n,t);return e<0?void 0:n[e][1]},Et.prototype.has=function(t){return Ft(this.__data__,t)>-1},Et.prototype.set=function(t,n){var e=this.__data__,r=Ft(e,t);return r<0?e.push([t,n]):e[r][1]=n,this},Pt.prototype.clear=function(){this.__data__={hash:new At,map:new(bt||Et),string:new At}},Pt.prototype.delete=function(t){return Nt(this,t).delete(t)},Pt.prototype.get=function(t){return Nt(this,t).get(t)},Pt.prototype.has=function(t){return Nt(this,t).has(t)},Pt.prototype.set=function(t,n){return Nt(this,t).set(t,n),this},kt.prototype.clear=function(){this.__data__=new Et},kt.prototype.delete=function(t){return this.__data__.delete(t)},kt.prototype.get=function(t){return this.__data__.get(t)},kt.prototype.has=function(t){return this.__data__.has(t)},kt.prototype.set=function(t,n){var e=this.__data__;if(e instanceof Et){var r=e.__data__;if(!bt||r.length<o-1)return r.push([t,n]),this;e=this.__data__=new Pt(r)}return e.set(t,n),this};var Ct=pt?G(pt,Object):function(){return[]},Rt=function(t){return rt.call(t)};function Lt(t,n){return!!(n=null==n?i:n)&&("number"==typeof t||F.test(t))&&t>-1&&t%1==0&&t<n}function Ht(t){var n=t&&t.constructor;return t===("function"==typeof n&&n.prototype||Y)}function Vt(t){if(null!=t){try{return nt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Wt(t,n){return t===n||t!=t&&n!=n}(vt&&Rt(new vt(new ArrayBuffer(1)))!=x||bt&&Rt(new bt)!=p||yt&&Rt(yt.resolve())!=v||_t&&Rt(new _t)!=y||mt&&Rt(new mt)!=g)&&(Rt=function(t){var n=rt.call(t),e=n==h?t.constructor:void 0,r=e?Vt(e):void 0;if(r)switch(r){case wt:return x;case xt:return p;case jt:return v;case Ot:return y;case Mt:return g}return n});var Gt=Array.isArray;function Jt(t){return null!=t&&("number"==typeof(n=t.length)&&n>-1&&n%1==0&&n<=i)&&!Qt(t);var n}var Kt=dt||function(){return!1};function Qt(t){var n=Xt(t)?rt.call(t):"";return n==f||n==l}function Xt(t){var n=void 0===t?"undefined":r(t);return!!t&&("object"==n||"function"==n)}function Yt(t){return Jt(t)?St(t):function(t){if(!Ht(t))return ht(t);var n=[];for(var e in Object(t))et.call(t,e)&&"constructor"!=e&&n.push(e);return n}(t)}n.exports=function(t){return Ut(t,!0,!0)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],34:[function(t,n,e){"use strict";n.exports=function(t,n){n||(n=[0,""]),t=String(t);var e=parseFloat(t,10);return n[0]=e,n[1]=t.match(/[\d.\-\+]*\s*(.*)/)[1]||"",n}},{}],35:[function(t,n,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.create=void 0;var r=i(t("parse-unit")),o=i(t("lodash.clonedeep")),u=i(t("eases"));function i(t){return t&&t.__esModule?t:{default:t}}var c=[],a=function(){return(document.scrollingElement||document.documentElement).scrollTop},s=function(t){return!1===isNaN((0,r.default)(t)[0])},f=function(t){var n=(0,r.default)(t);return{value:n[0],unit:n[1]}},l=function(t){return null!==String(t).match(/^[a-z]+-[a-z]+$/)},p=function(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a(),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:window.innerHeight||window.outerHeight,o=n.getBoundingClientRect(),u=t.match(/^[a-z]+/)[0],i=t.match(/[a-z]+$/)[0],c=0;return"top"===i&&(c-=0),"middle"===i&&(c-=r/2),"bottom"===i&&(c-=r),"top"===u&&(c+=o.top+e),"middle"===u&&(c+=o.top+e+o.height/2),"bottom"===u&&(c+=o.top+e+o.height),c+"px"},d=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a(),e=t.getData(),r=e.to.value-e.from.value,o=(n-e.from.value)/(r/100),u=Math.min(Math.max(o,0),100),i=Object.keys(e.props).map(function(t){var n=e.props[t],r=!0===n.direct?e.elem:document.documentElement,o=n.from.unit||n.to.unit,i=n.from.value-n.to.value,c=n.timing(u/100),a=n.from.value-i*c;return{elem:r,key:t,value:Math.round(100*a)/100+o}}),c=o<0||o>100;return!0===(o>=0&&o<=100)&&e.inside(t,o,i),!0===c&&e.outside(t,o,i),i},h=function(t,n){t.style.setProperty(n.key,n.value)};e.create=function(t){var n=null,e=!1,r={isActive:function(){return e},getData:function(){return n},calculate:function(){n=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(null==(t=(0,o.default)(t)).from)throw new Error("Missing property `from`");if(null==t.to)throw new Error("Missing property `to`");if(null==t.inside&&(t.inside=function(){}),null==t.outside&&(t.outside=function(){}),"function"!=typeof t.inside)throw new Error("Property `inside` must be a function");if("function"!=typeof t.outside)throw new Error("Property `outside` must be a function");if(null==t.elem){if(!1===s(t.from))throw new Error("Property `from` must be a absolute value when no `elem` has been provided");if(!1===s(t.to))throw new Error("Property `to` must be a absolute value when no `elem` has been provided")}else!0===l(t.from)&&(t.from=p(t.from,t.elem)),!0===l(t.to)&&(t.to=p(t.to,t.elem));return t.from=f(t.from),t.to=f(t.to),null==t.props&&(t.props={}),Object.keys(t.props).forEach(function(n){var e=t.props[n];if(!1===s(e.from))throw new Error("Property `from` of prop must be a absolute value");if(!1===s(e.to))throw new Error("Property `from` of prop must be a absolute value");if(e.from=f(e.from),e.to=f(e.to),"string"==typeof e.timing&&null==u.default[e.timing])throw new Error("Unknown timing for property `timing` of prop");if(null==e.timing&&(e.timing=u.default.linear),"string"==typeof e.timing&&(e.timing=u.default[e.timing]),!0===e.direct&&null==t.elem)throw new Error("Property `elem` required when `direct` is true");!0!==e.direct&&(e.direct=!1)}),t}(t)},update:function(){var t=d(r);return t.forEach(function(t){return h(t.elem,t)}),t},start:function(){e=!0},stop:function(){e=!1}};return c.push(r),r.calculate(),r};!function t(n,e){var r,o=function(){requestAnimationFrame(function(){return t(n,e)})},u=c.filter(function(t){return t.isActive()});if(0===u.length)return o();var i=a();if(e===i)return o();e=i;var s=u.map(function(t){return d(t,i)});(r=[]).concat.apply(r,function(t){if(Array.isArray(t)){for(var n=0,e=Array(t.length);n<t.length;n++)e[n]=t[n];return e}return Array.from(t)}(s)).forEach(function(t){return h(t.elem,t)}),o()}()},{eases:19,"lodash.clonedeep":33,"parse-unit":34}]},{},[35])(35)});
{
"name": "basicscroll",
"moduleName": "basicScroll",
"version": "1.1.5",
"version": "1.2.0",
"authors": [

@@ -6,0 +6,0 @@ "Tobias Reich <tobias@electerious.com>"

@@ -152,6 +152,6 @@ # basicScroll

to: 'bottom-middle',
inside: (instance, percentage) => {
inside: (instance, percentage, props) => {
console.log('viewport is inside from and to')
},
outside: (instance, percentage) => {
outside: (instance, percentage, props) => {
console.log('viewport is outside from and to')

@@ -264,4 +264,4 @@ }

*/
inside: (instance, percentage) => {},
outside: (instance, percentage) => {},
inside: (instance, percentage, props) => {},
outside: (instance, percentage, props) => {},
/*

@@ -349,3 +349,3 @@ * Props.

Both callbacks receive the current instance and a percentage:
Both callbacks receive the current instance, a percentage and the calculated properties:

@@ -362,4 +362,4 @@ - < 0% percent = Scroll position is below `from`

/* ... */
inside: (instance, percentage) => {},
outside: (instance, percentage) => {},
inside: (instance, percentage, props) => {},
outside: (instance, percentage, props) => {},
/* ... */

@@ -366,0 +366,0 @@ }

@@ -47,3 +47,3 @@ import parseUnit from 'parse-unit'

return (isNaN(parseUnit(value)[0])===true ? false : true)
return isNaN(parseUnit(value)[0])===false

@@ -76,3 +76,3 @@ }

return (String(value).match(/^[a-z]+-[a-z]+$/)===null ? false : true)
return String(value).match(/^[a-z]+-[a-z]+$/)!==null

@@ -184,24 +184,12 @@ }

// Pixel already scrolled
// Pixel scrolled
const current = scrollTop - data.from.value
// Percent already scrolled
let percentage = current / (total / 100)
// Percent scrolled
const precisePercentage = current / (total / 100)
const normalizedPercentage = Math.min(Math.max(precisePercentage, 0), 100)
// Use unnormalized percentage to check if the viewport is between from and to.
// Would always return true when using the normalize percentage.
const isInside = (percentage>=0 && percentage<=100)
const isOutside = (percentage<0 || percentage>100)
// Generate an array with all updated props
const props = Object.keys(data.props).map((key) => {
// Execute callbacks
if (isInside===true) data.inside(instance, percentage)
if (isOutside===true) data.outside(instance, percentage)
// Normalize percentage
if (percentage<0) percentage = 0
if (percentage>100) percentage = 100
// Return an array with all updated props
return Object.keys(data.props).map((key) => {
const prop = data.props[key]

@@ -222,3 +210,3 @@

// Typically a value between 0 and 1, and it returns a new float that has been eased.
const time = prop.timing(percentage / 100)
const time = prop.timing(normalizedPercentage / 100)

@@ -240,4 +228,13 @@ const value = prop.from.value - diff * time

return values
// Use precise percentage to check if the viewport is between from and to.
// Would always return true when using the normalized percentage.
const isInside = (precisePercentage>=0 && precisePercentage<=100)
const isOutside = (precisePercentage<0 || precisePercentage>100)
// Execute callbacks
if (isInside===true) data.inside(instance, precisePercentage, props)
if (isOutside===true) data.outside(instance, precisePercentage, props)
return props
}

@@ -261,2 +258,3 @@

* @param {?Integer} previousScrollTop
* @returns {?*}
*/

@@ -263,0 +261,0 @@ const loop = function(style, previousScrollTop) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc