vue2-smooth-scroll
Advanced tools
Comparing version 1.5.1 to 1.6.0
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueSmoothScroll=e():t.VueSmoothScroll=e()}(this,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";function o(t){return(o="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})(t)}var r;n.r(e);function i(){return{duration:500,offset:0,container:window,updateHistory:!0,easingFunction:null}}var u=Symbol("smoothScrollCtx");function c(t){var e=t.scrollTo,n=t.offset,o=t.duration,i=t.container,u=t.updateHistory,c=t.hash,f=t.easingFunction;r||(r=window.requestAnimationFrame||function(t){window.setTimeout(t,16)}),u&&window.history.pushState&&location.hash!==c&&window.history.pushState("","",c);var l,s,d=i.scrollTop||window.pageYOffset,p=(s=d,"HTML"===(l=e).nodeName?-s:l.getBoundingClientRect().top+s);p+=n;var y=Date.now(),b="function"==typeof f&&f||a;!function t(){var n=Date.now()-y,c=p;n<o?(c=d+(p-d)*b(n/o),r(t)):u&&location.replace("#"+e.id),i===window?i.scrollTo(0,c):i.scrollTop=c}()}var f={install:function(t,e){t.directive("smooth-scroll",{inserted:function(t,n,r){if("object"===("undefined"==typeof window?"undefined":o(window))&&void 0!==window.pageYOffset){var f=Object.assign({},i());e&&Object.assign(f,e);var a=n.value||{},l=a.duration,s=a.offset,d=a.container,p=a.updateHistory,y=a.easingFunction;l=l||f.duration,s=s||f.offset,d=d||f.container,p=void 0!==p?p:f.updateHistory,y=y||f.easingFunction,"string"==typeof d&&(d=document.querySelector(d));var b=function(t){t.preventDefault();var e=r.data.attrs.href,n=document.getElementById(e.substring(1));n&&c({scrollTo:n,offset:s,duration:l,container:d,updateHistory:p,hash:e,easingFunction:y})};t.addEventListener("click",b),t[u]={clickHandler:b}}},unbind:function(t){t.removeEventListener("click",t[u].clickHandler),t[u]=null}}),t.prototype.$smoothScroll=function(t){return c(Object.assign({},i(),e,t))}}};function a(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1}e.default=f,"undefined"!=typeof window&&window.Vue&&window.Vue.use(f)}])})); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueSmoothScroll=e():t.VueSmoothScroll=e()}(this,(function(){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=0)}([function(t,e,n){"use strict";function o(t){return(o="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})(t)}var r;n.r(e);function i(){return{duration:500,offset:0,container:window,updateHistory:!0,easingFunction:null}}var u=Symbol("smoothScrollCtx");function c(t){var e=t.scrollTo,n=t.offset,o=t.duration,i=t.container,u=t.updateHistory,c=t.hash,a=t.easingFunction;r||(r=window.requestAnimationFrame||function(t){window.setTimeout(t,16)}),u&&window.history.pushState&&location.hash!==c&&window.history.pushState("","",c);var l,s,d=i.scrollTop||window.pageYOffset,p=(s=d,"HTML"===(l=e).nodeName?-s:l.getBoundingClientRect().top+s-parseInt(window.getComputedStyle(l).scrollMarginTop||0,10));p+=n;var y=Date.now(),m="function"==typeof a&&a||f;!function t(){var n=Date.now()-y,c=p;n<o?(c=d+(p-d)*m(n/o),r(t)):u&&location.replace("#"+e.id),i===window?i.scrollTo(0,c):i.scrollTop=c}()}var a={install:function(t,e){t.directive("smooth-scroll",{inserted:function(t,n,r){if("object"===("undefined"==typeof window?"undefined":o(window))&&void 0!==window.pageYOffset){var a=Object.assign({},i());e&&Object.assign(a,e);var f=n.value||{},l=f.duration,s=f.offset,d=f.container,p=f.updateHistory,y=f.easingFunction;l=l||a.duration,s=s||a.offset,d=d||a.container,p=void 0!==p?p:a.updateHistory,y=y||a.easingFunction,"string"==typeof d&&(d=document.querySelector(d));var m=function(t){t.preventDefault();var e=r.data.attrs.href,n=document.getElementById(e.substring(1));n&&c({scrollTo:n,offset:s,duration:l,container:d,updateHistory:p,hash:e,easingFunction:y})};t.addEventListener("click",m),t[u]={clickHandler:m}}},unbind:function(t){t.removeEventListener("click",t[u].clickHandler),t[u]=null}}),t.prototype.$smoothScroll=function(t){return c(Object.assign({},i(),e,t))}}};function f(t){return t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1}e.default=a,"undefined"!=typeof window&&window.Vue&&window.Vue.use(a)}])})); |
{ | ||
"name": "vue2-smooth-scroll", | ||
"version": "1.5.1", | ||
"version": "1.6.0", | ||
"description": "Simple vue smooth scroll", | ||
@@ -5,0 +5,0 @@ "main": "dist/vue-smooth-scroll.min.js", |
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
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
10827
6