@invision-www/scroll-to
Advanced tools
Comparing version 1.0.3 to 1.0.8-y.0
@@ -1,15 +0,2 @@ | ||
'use strict'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
var _scrollTo; | ||
function _load_scrollTo() { | ||
return _scrollTo = _interopRequireDefault(require('./scrollTo')); | ||
} | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
exports.default = (_scrollTo || _load_scrollTo()).default; | ||
import scrollTo from './scrollTo'; | ||
export default scrollTo; |
@@ -1,24 +0,4 @@ | ||
'use strict'; | ||
import raf from 'raf'; | ||
import eases from 'eases'; // ----------------------------------------------- | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = scrollTo; | ||
var _raf; | ||
function _load_raf() { | ||
return _raf = _interopRequireDefault(require('raf')); | ||
} | ||
var _eases; | ||
function _load_eases() { | ||
return _eases = _interopRequireDefault(require('eases')); | ||
} | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
// ----------------------------------------------- | ||
/** | ||
@@ -35,3 +15,4 @@ * ScrollTo | ||
*/ | ||
function scrollTo(options) { | ||
export default function scrollTo(options) { | ||
if (typeof window === 'undefined') { | ||
@@ -47,10 +28,10 @@ return; | ||
var time = speed / 1000; | ||
var tick = function tick() { | ||
currentTime += 1 / 60; | ||
var p = currentTime / time, | ||
t = (_eases || _load_eases()).default[easing](p); | ||
t = eases[easing](p); | ||
if (p < 1) { | ||
(0, (_raf || _load_raf()).default)(tick); | ||
raf(tick); | ||
window.scrollTo(0, scrollY + (scrollTargetY - scrollY) * t); | ||
@@ -72,3 +53,3 @@ } else { | ||
window.isScrolling = true; | ||
(0, (_raf || _load_raf()).default)(tick); | ||
} | ||
raf(tick); | ||
} |
{ | ||
"name": "@invision-www/scroll-to", | ||
"version": "1.0.3", | ||
"version": "1.0.8-y.0", | ||
"description": "", | ||
"main": "dist/scrollTo.js", | ||
"browser": "dist/scrollTo.js", | ||
"main": "build/scrollTo.js", | ||
"browser": "build-es5/scrollTo.js", | ||
"scripts": { | ||
@@ -8,0 +8,0 @@ "test": "echo \"Error: no test specified\" && exit 1" |
@@ -0,0 +0,0 @@ jest.mock('raf'); |
import scrollTo from './scrollTo'; | ||
export default scrollTo; |
@@ -0,0 +0,0 @@ import raf from 'raf'; |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
10361
173
3
2