Comparing version 1.7.1 to 1.7.3
/*! | ||
* MoveTo - A lightweight scroll animation javascript library without any dependency. | ||
* Version 1.7.1 (22-10-2017 02:28) | ||
* Version 1.7.3 (03-05-2018 10:05) | ||
* Licensed under MIT | ||
* Copyright 2017 Hasan Aydoğdu <hsnaydd@gmail.com> | ||
* Copyright 2018 Hasan Aydoğdu <hsnaydd@gmail.com> | ||
*/ | ||
@@ -7,0 +7,0 @@ |
/*! | ||
* MoveTo - A lightweight scroll animation javascript library without any dependency. | ||
* Version 1.7.1 (22-10-2017 02:28) | ||
* Version 1.7.3 (03-05-2018 10:05) | ||
* Licensed under MIT | ||
* Copyright 2017 Hasan Aydoğdu <hsnaydd@gmail.com> | ||
* Copyright 2018 Hasan Aydoğdu <hsnaydd@gmail.com> | ||
*/ | ||
"use strict";var MoveTo=function(){function t(t,e,n,o){return t/=o,t--,-n*(t*t*t*t-1)+e}function e(t,e){var n={};return Object.keys(t).forEach(function(e){n[e]=t[e]}),Object.keys(e).forEach(function(t){n[t]=e[t]}),n}function n(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}function o(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.options=e(r,n),this.easeFunctions=e({easeOutQuart:t},o)}function i(t,e){var o={};return Object.keys(e).forEach(function(e){var i=t.getAttribute("data-mt-"+n(e));i&&(o[e]=isNaN(i)?i:parseInt(i,10))}),o}var r={tolerance:0,duration:800,easing:"easeOutQuart",callback:function(){}};return o.prototype.registerTrigger=function(t,n){var o=this;if(t){var r=t.getAttribute("href")||t.getAttribute("data-target"),a=r&&"#"!==r?document.getElementById(r.substring(1)):document.body,u=e(this.options,i(t,this.options));"function"==typeof n&&(u.callback=n);var c=function(t){t.preventDefault(),o.move(a,u)};return t.addEventListener("click",c,!1),function(){return t.removeEventListener("click",c,!1)}}},o.prototype.move=function(t){var n=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(0===t||t){o=e(this.options,o);var i="number"==typeof t?t:t.getBoundingClientRect().top,r=window.pageYOffset,a=null,u=void 0;i-=o.tolerance;var c=function e(c){var s=window.pageYOffset;a||(a=c-1);var f=c-a;if(u&&(i>0&&u>s||i<0&&u<s))return o.callback(t);u=s;var d=n.easeFunctions[o.easing](f,r,i,o.duration);window.scroll(0,d),f<o.duration?window.requestAnimationFrame(e):(window.scroll(0,i+r),o.callback(t))};window.requestAnimationFrame(c)}},o.prototype.addEaseFunction=function(t,e){this.easeFunctions[t]=e},o}();"undefined"!=typeof module?module.exports=MoveTo:window.MoveTo=MoveTo; | ||
"use strict";var MoveTo=function(){var n={tolerance:0,duration:800,easing:"easeOutQuart",callback:function(){}};function o(t,e,n,o){return t/=o,-n*(--t*t*t*t-1)+e}function l(e,n){var o={};return Object.keys(e).forEach(function(t){o[t]=e[t]}),Object.keys(n).forEach(function(t){o[t]=n[t]}),o}function t(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};this.options=l(n,t),this.easeFunctions=l({easeOutQuart:o},e)}return t.prototype.registerTrigger=function(t,e){var n=this;if(t){var o,i,r,a=t.getAttribute("href")||t.getAttribute("data-target"),u=a&&"#"!==a?document.getElementById(a.substring(1)):document.body,c=l(this.options,(o=t,i=this.options,r={},Object.keys(i).forEach(function(t){var e=o.getAttribute("data-mt-"+t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()}));e&&(r[t]=isNaN(e)?e:parseInt(e,10))}),r));"function"==typeof e&&(c.callback=e);var s=function(t){t.preventDefault(),n.move(u,c)};return t.addEventListener("click",s,!1),function(){return t.removeEventListener("click",s,!1)}}},t.prototype.move=function(r){var a=this,u=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{};if(0===r||r){u=l(this.options,u);var c="number"==typeof r?r:r.getBoundingClientRect().top,s=window.pageYOffset,f=null,d=void 0;c-=u.tolerance;window.requestAnimationFrame(function t(e){var n=window.pageYOffset;f||(f=e-1);var o=e-f;if(d&&(0<c&&n<d||c<0&&d<n))return u.callback(r);d=n;var i=a.easeFunctions[u.easing](o,s,c,u.duration);window.scroll(0,i),o<u.duration?window.requestAnimationFrame(t):(window.scroll(0,c+s),u.callback(r))})}},t.prototype.addEaseFunction=function(t,e){this.easeFunctions[t]=e},t}();"undefined"!=typeof module?module.exports=MoveTo:window.MoveTo=MoveTo; |
{ | ||
"name": "moveto", | ||
"version": "1.7.1", | ||
"version": "1.7.3", | ||
"description": "A lightweight scroll animation javascript library without any dependency.", | ||
@@ -30,21 +30,21 @@ "main": "dist/moveTo.js", | ||
"devDependencies": { | ||
"ava": "^0.18.2", | ||
"babel-core": "^6.23.1", | ||
"babel-eslint": "^7.1.1", | ||
"ava": "^0.25.0", | ||
"babel-core": "^6.26.3", | ||
"babel-eslint": "^8.2.3", | ||
"babel-preset-es2015": "^6.22.0", | ||
"browser-sync": "^2.18.8", | ||
"eslint": "^3.16.1", | ||
"eslint-config-google": "^0.7.1", | ||
"browser-sync": "^2.24.2", | ||
"eslint": "^4.19.1", | ||
"eslint-config-google": "^0.9.1", | ||
"gulp": "^3.9.1", | ||
"gulp-babel": "^6.1.2", | ||
"gulp-eslint": "^3.0.1", | ||
"gulp-header": "^1.8.8", | ||
"gulp-babel": "^7.0.1", | ||
"gulp-eslint": "^4.0.2", | ||
"gulp-header": "^2.0.5", | ||
"gulp-load-plugins": "^1.5.0", | ||
"gulp-rename": "^1.2.2", | ||
"gulp-uglify": "^2.0.1", | ||
"gulp-uglify": "^3.0.0", | ||
"gulp-util": "^3.0.8", | ||
"jsdom": "9.11.0", | ||
"jsdom-global": "2.1.1", | ||
"jsdom": "11.10.0", | ||
"jsdom-global": "3.0.2", | ||
"lazypipe": "^1.0.1", | ||
"run-sequence": "^1.2.2" | ||
"run-sequence": "^2.2.1" | ||
}, | ||
@@ -51,0 +51,0 @@ "ava": { |
@@ -1,2 +0,2 @@ | ||
# MoveTo [![npm version](https://badge.fury.io/js/moveto.svg)](https://badge.fury.io/js/moveto) [![Bower version](https://badge.fury.io/bo/moveTo.svg)](https://badge.fury.io/bo/moveTo) [![Build Status](https://travis-ci.org/hsnaydd/moveTo.svg?branch=master)](https://travis-ci.org/hsnaydd/moveTo.js) | ||
# MoveTo [![npm version](https://badge.fury.io/js/moveto.svg)](https://badge.fury.io/js/moveto) [![Bower version](https://badge.fury.io/bo/moveTo.svg)](https://badge.fury.io/bo/moveTo) [![CDNJS version](https://img.shields.io/cdnjs/v/moveTo.svg)](https://cdnjs.com/libraries/moveTo) [![Build Status](https://travis-ci.org/hsnaydd/moveTo.svg?branch=master)](https://travis-ci.org/hsnaydd/moveTo.js) | ||
@@ -3,0 +3,0 @@ A lightweight (only 1kb gzipped) scroll animation javascript library without any dependency. |
Sorry, the diff of this file is not supported yet
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
226417