vue2-smooth-scroll
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VueSmoothScroll=t():e.VueSmoothScroll=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(n){if(o[n])return o[n].exports;var r=o[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var o={};return t.m=e,t.c=o,t.d=function(e,o,n){t.o(e,o)||Object.defineProperty(e,o,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var o=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(o,"a",o),o},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,o){"use strict";function n(e){return e<.5?4*e*e*e:(e-1)*(2*e-2)*(2*e-2)+1}Object.defineProperty(t,"__esModule",{value:!0});var 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},i=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){window.setTimeout(e,16)},u={duration:500,offset:0,container:window},f=function(e,t){return"HTML"===e.nodeName?-t:e.getBoundingClientRect().top+t};t.default={install:function(e){e.directive("smooth-scroll",{inserted:function(e,t){if("object"===("undefined"==typeof window?"undefined":r(window))&&void 0!==window.pageYOffset){var o=t.value,c=o.duration,s=o.offset,a=o.container;c=c||u.duration,s=s||u.offset,a=a||u.container,"string"==typeof a&&(a=document.querySelector(a)),e.addEventListener("click",function(e){e.preventDefault();var t=document.getElementById(this.hash.substring(1));if(t){window.history.pushState&&location.hash!==this.hash&&window.history.pushState("","",this.hash);var o=a.scrollTop||window.pageYOffset,r=f(t,o);r+=s;var u=Date.now();!function e(){var f=Date.now()-u,s=r;f<c?(s=o+(r-o)*n(f/c),i(e)):location.replace("#"+t.id),a===window?a.scrollTo(0,s):a.scrollTop=s}()}})}}})}}}])}); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.VueSmoothScroll=t():e.VueSmoothScroll=t()}(window,function(){return function(e){var t={};function o(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,o),r.l=!0,r.exports}return o.m=e,o.c=t,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)o.d(n,r,function(t){return e[t]}.bind(null,r));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=0)}([function(e,t,o){"use strict";function n(e){return(n="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})(e)}o.r(t);var r={install:function(e){e.directive("smooth-scroll",{inserted:function(e,t){if("object"===("undefined"==typeof window?"undefined":n(window))&&void 0!==window.pageYOffset){var o={duration:500,offset:0,container:window},r=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){window.setTimeout(e,16)},i=t.value||{},u=i.duration,f=i.offset,c=i.container;u=u||o.duration,f=f||o.offset,"string"==typeof(c=c||o.container)&&(c=document.querySelector(c)),e.addEventListener("click",function(e){e.preventDefault();var t=document.getElementById(this.hash.substring(1));if(t){window.history.pushState&&location.hash!==this.hash&&window.history.pushState("","",this.hash);var o,n,i=c.scrollTop||window.pageYOffset,d=(n=i,"HTML"===(o=t).nodeName?-n:o.getBoundingClientRect().top+n);d+=f;var a=Date.now();!function e(){var o,n=Date.now()-a,f=d;n<u?(f=i+(d-i)*((o=n/u)<.5?4*o*o*o:(o-1)*(2*o-2)*(2*o-2)+1),r(e)):location.replace("#"+t.id),c===window?c.scrollTo(0,f):c.scrollTop=f}()}})}}})}};t.default=r,"undefined"!=typeof window&&window.Vue&&window.Vue.use(r)}])}); |
v1.0.5 / 2019-02-16 | ||
================== | ||
* deps: update dependencies | ||
* fix: there is no need to explicit register plugin | ||
v1.0.4 / 2019-02-08 | ||
@@ -3,0 +9,0 @@ ================== |
{ | ||
"name": "vue2-smooth-scroll", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "Simple vue smooth scroll", | ||
@@ -8,3 +8,3 @@ "main": "dist/vue-smooth-scroll.min.js", | ||
"lint": "eslint src", | ||
"build": "webpack --progress -p" | ||
"build": "webpack" | ||
}, | ||
@@ -30,8 +30,8 @@ "repository": { | ||
"devDependencies": { | ||
"babel-core": "^6.26.0", | ||
"babel-loader": "^7.1.2", | ||
"babel-preset-env": "^1.6.1", | ||
"eslint": "^4.15.0", | ||
"webpack": "^3.10.0" | ||
"@babel/core": "^7.3.3", | ||
"@babel/preset-env": "^7.3.1", | ||
"babel-loader": "^8.0.5", | ||
"eslint": "^5.14.0", | ||
"webpack": "^4.29.4" | ||
} | ||
} |
@@ -57,8 +57,9 @@ # Vue2 Smooth Scroll | ||
<div id="app"> | ||
<a href="#app" v-smooth-scroll>Anchor</a> | ||
<a href="#bottom" v-smooth-scroll>click me will scroll to bottom!</a> | ||
<div style="height: 2000px;"></div> | ||
<span id="bottom">bottom</span> | ||
</div> | ||
<script src="https://unpkg.com/vue/dist/vue.js"></script> | ||
<script src="https://unpkg.com/vue2-smooth-scroll@1.0.0"></script> | ||
<script src="https://unpkg.com/vue2-smooth-scroll"></script> | ||
<script> | ||
Vue.use(VueSmoothScroll) | ||
var app = new Vue({ | ||
@@ -76,2 +77,2 @@ el: '#app', | ||
MIT | ||
[MIT](./LICENSE) |
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
6757
77