react-scroll-parallax
Advanced tools
Comparing version 2.0.0-alpha.6 to 2.0.0-beta.0
@@ -14,2 +14,8 @@ "use strict"; | ||
var _Bounds = _interopRequireDefault(require("./Bounds")); | ||
var _Rect = _interopRequireDefault(require("./Rect")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
@@ -37,3 +43,2 @@ | ||
this.offsets = (0, _index2.getOffsets)(this.props); | ||
this.cache = null; | ||
this.isInView = null; | ||
@@ -54,8 +59,4 @@ this.percent = 0; | ||
value: function setCachedAttributes(view, scroll) { | ||
this.cache = (0, _index2.getCache)({ | ||
element: this.elOuter, | ||
offsets: this.offsets, | ||
view: view, | ||
scroll: scroll | ||
}); | ||
this.rect = new _Rect.default(this.elOuter, view, scroll); | ||
this.bounds = new _Bounds.default(this.rect, this.offsets, view); | ||
return this; | ||
@@ -66,5 +67,5 @@ } | ||
value: function _updatePositionHorizontal(view, scroll) { | ||
this.isInView = (0, _index2.isElementInView)(this.cache.left, this.cache.right, view.width, scroll.x); | ||
this.isInView = (0, _index2.isElementInView)(this.bounds.left, this.bounds.right, view.width, scroll.x); | ||
if (!this.isInView) return this; | ||
this.percent = (0, _index2.percentMoved)(this.cache.originLeft, this.cache.originTotalDistX, view.width, scroll.x); | ||
this.percent = (0, _index2.percentMoved)(this.rect.left, this.rect.originTotalDistX, view.width, scroll.x); | ||
(0, _index2.setParallaxStyles)(this.elInner, this.offsets, this.percent); | ||
@@ -76,5 +77,5 @@ return this; | ||
value: function _updatePositionVertical(view, scroll) { | ||
this.isInView = (0, _index2.isElementInView)(this.cache.top, this.cache.bottom, view.height, scroll.y); | ||
this.isInView = (0, _index2.isElementInView)(this.bounds.top, this.bounds.bottom, view.height, scroll.y); | ||
if (!this.isInView) return this; | ||
this.percent = (0, _index2.percentMoved)(this.cache.originTop, this.cache.originTotalDistY, view.height, scroll.y); | ||
this.percent = (0, _index2.percentMoved)(this.rect.top, this.rect.originTotalDistY, view.height, scroll.y); | ||
(0, _index2.setParallaxStyles)(this.elInner, this.offsets, this.percent); | ||
@@ -81,0 +82,0 @@ return this; |
@@ -48,8 +48,2 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "getCache", { | ||
enumerable: true, | ||
get: function get() { | ||
return _getCache2.default; | ||
} | ||
}); | ||
@@ -68,4 +62,2 @@ var _ParallaxContext2 = _interopRequireDefault(require("./ParallaxContext")); | ||
var _getCache2 = _interopRequireDefault(require("./getCache")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
@@ -30,8 +30,2 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "ParallaxController", { | ||
enumerable: true, | ||
get: function get() { | ||
return _ParallaxController2.default; | ||
} | ||
}); | ||
@@ -46,4 +40,2 @@ var _withController2 = _interopRequireDefault(require("./components/withController")); | ||
var _ParallaxController2 = _interopRequireDefault(require("./classes/ParallaxController")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } |
{ | ||
"name": "react-scroll-parallax", | ||
"version": "2.0.0-alpha.6", | ||
"version": "2.0.0-beta.0", | ||
"description": "React components to create parallax scroll effects for banners, images or any other DOM elements.", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
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
96114
41
1896
0