Socket
Socket
Sign inDemoInstall

react-scroll-parallax

Package Overview
Dependencies
Maintainers
1
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-scroll-parallax - npm Package Compare versions

Comparing version 3.0.0-beta.8 to 3.0.0-beta.9

2

dist/react-scroll-parallax.cjs.development.js

@@ -47,3 +47,3 @@ 'use strict';

rootMargin: props.rootMargin,
shouldStartAnimationInitialInView: props.shouldStartAnimationInitialInView,
shouldAlwaysCompleteAnimation: props.shouldAlwaysCompleteAnimation,
onProgressChange: props.onProgressChange,

@@ -50,0 +50,0 @@ onChange: props.onChange,

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("parallax-controller"),r=require("react"),n=(e=r)&&"object"==typeof e&&"default"in e?e.default:e;function a(e){return t={speed:e.speed,translateX:e.translateX,translateY:e.translateY,disabled:e.disabled,rotate:e.rotate,rotateX:e.rotateX,rotateY:e.rotateY,rotateZ:e.rotateZ,scale:e.scale,scaleX:e.scaleX,scaleY:e.scaleY,scaleZ:e.scaleZ,opacity:e.opacity,easing:e.easing,rootMargin:e.rootMargin,shouldStartAnimationInitialInView:e.shouldStartAnimationInitialInView,onProgressChange:e.onProgressChange,onChange:e.onChange,onEnter:e.onEnter,onExit:e.onExit,startScroll:e.startScroll,endScroll:e.endScroll,targetElement:e.targetElement},Object.keys(t).forEach((function(e){return void 0===t[e]?delete t[e]:{}})),t;var t}var o=n.createContext(null);function l(){var e=r.useContext(o);if("undefined"==typeof window)return null;if(!e)throw new Error("Could not find `react-scroll-parallax` context value. Please ensure the component is wrapped in a <ParallaxProvider>");return e}function s(e){var n=l(),o=r.useRef(null);!function(e){r.useEffect((function(){if(!("undefined"==typeof window||e||e instanceof t.ParallaxController))throw new Error("Must wrap your application's <Parallax /> components in a <ParallaxProvider />.")}),[e])}(n);var s=r.useState(),i=s[0],c=s[1];return r.useEffect((function(){var t;if(!(o.current instanceof HTMLElement))throw new Error("You must assign the ref returned by the useParallax() hook to an HTML Element.");var r={el:o.current,props:a(e)};return t=null==n?void 0:n.createElement(r),c(t),function(){t&&(null==n||n.removeElementById(t.id))}}),[]),r.useEffect((function(){if(i)if(e.disabled)null==n||n.resetElementStyles(i);else{var t=a(e);null==n||n.updateElementPropsById(i.id,t)}}),[e.disabled,e.translateX,e.translateY,e.rotate,e.rotateX,e.rotateY,e.rotateZ,e.scale,e.scaleX,e.scaleY,e.scaleZ,e.speed,e.opacity,e.easing,e.rootMargin,e.onProgressChange,e.onChange,e.onEnter,e.onExit,e.targetElement]),{ref:o,controller:n,element:i}}function i(e){var t=e.tag||"div",r=s(e);return n.createElement(t,{className:e.className,style:e.style,ref:r.ref},e.children)}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var d={position:"relative",overflow:"hidden",width:"100%",height:"50vh"},p={position:"absolute",top:0,right:0,bottom:0,left:0},f=function(e){var r,a;function l(r){var n;return(n=e.call(this,r)||this).controller="undefined"==typeof window?null:t.ParallaxController.init({scrollAxis:r.scrollAxis,scrollContainer:r.scrollContainer}),n}a=e,(r=l).prototype=Object.create(a.prototype),r.prototype.constructor=r,u(r,a);var s=l.prototype;return s.componentDidUpdate=function(e){e.scrollContainer!==this.props.scrollContainer&&this.controller.updateScrollContainer(this.props.scrollContainer)},s.componentWillUnmount=function(){this.controller=this.controller.destroy()},s.render=function(){return n.createElement(o.Provider,{value:this.controller},this.props.children)},l}(r.Component);f.defaultProps={scrollAxis:t.ScrollAxis.vertical},Object.defineProperty(exports,"EasingPreset",{enumerable:!0,get:function(){return t.EasingPreset}}),exports.Parallax=i,exports.ParallaxBanner=function(e){var t=e.children,r=e.className,a=e.layers,o=e.disabled;return n.createElement("div",{style:c({},d,e.style),className:"parallax-banner"+(r?" "+r:"")},a.map((function(e,t){var r=e.speed,a=e.children,l=e.expanded,s=void 0===l||l,u=e.image,d=e.props,f=void 0===d?{}:d,h=f.style||{},v=f.className||"";delete f.style,delete f.className;var m="parallax-banner-layer-"+t+(v?" "+v:""),x=s?{top:10*Math.abs(r)*-1+"px",bottom:10*Math.abs(r)*-1+"px"}:{},y="layer-"+t;return n.createElement(i,{key:y,speed:r,style:p,disabled:o},n.createElement("div",Object.assign({"data-testid":y,className:m,style:c({},u?{backgroundImage:"url("+u+")",backgroundPosition:"center",backgroundSize:"cover"}:{},p,x,h)},f),a))})),t)},exports.ParallaxContext=o,exports.ParallaxProvider=f,exports.useController=l,exports.useParallax=s;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("parallax-controller"),r=require("react"),n=(e=r)&&"object"==typeof e&&"default"in e?e.default:e;function a(e){return t={speed:e.speed,translateX:e.translateX,translateY:e.translateY,disabled:e.disabled,rotate:e.rotate,rotateX:e.rotateX,rotateY:e.rotateY,rotateZ:e.rotateZ,scale:e.scale,scaleX:e.scaleX,scaleY:e.scaleY,scaleZ:e.scaleZ,opacity:e.opacity,easing:e.easing,rootMargin:e.rootMargin,shouldAlwaysCompleteAnimation:e.shouldAlwaysCompleteAnimation,onProgressChange:e.onProgressChange,onChange:e.onChange,onEnter:e.onEnter,onExit:e.onExit,startScroll:e.startScroll,endScroll:e.endScroll,targetElement:e.targetElement},Object.keys(t).forEach((function(e){return void 0===t[e]?delete t[e]:{}})),t;var t}var o=n.createContext(null);function l(){var e=r.useContext(o);if("undefined"==typeof window)return null;if(!e)throw new Error("Could not find `react-scroll-parallax` context value. Please ensure the component is wrapped in a <ParallaxProvider>");return e}function s(e){var n=l(),o=r.useRef(null);!function(e){r.useEffect((function(){if(!("undefined"==typeof window||e||e instanceof t.ParallaxController))throw new Error("Must wrap your application's <Parallax /> components in a <ParallaxProvider />.")}),[e])}(n);var s=r.useState(),i=s[0],c=s[1];return r.useEffect((function(){var t;if(!(o.current instanceof HTMLElement))throw new Error("You must assign the ref returned by the useParallax() hook to an HTML Element.");var r={el:o.current,props:a(e)};return t=null==n?void 0:n.createElement(r),c(t),function(){t&&(null==n||n.removeElementById(t.id))}}),[]),r.useEffect((function(){if(i)if(e.disabled)null==n||n.resetElementStyles(i);else{var t=a(e);null==n||n.updateElementPropsById(i.id,t)}}),[e.disabled,e.translateX,e.translateY,e.rotate,e.rotateX,e.rotateY,e.rotateZ,e.scale,e.scaleX,e.scaleY,e.scaleZ,e.speed,e.opacity,e.easing,e.rootMargin,e.onProgressChange,e.onChange,e.onEnter,e.onExit,e.targetElement]),{ref:o,controller:n,element:i}}function i(e){var t=e.tag||"div",r=s(e);return n.createElement(t,{className:e.className,style:e.style,ref:r.ref},e.children)}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var d={position:"relative",overflow:"hidden",width:"100%",height:"50vh"},p={position:"absolute",top:0,right:0,bottom:0,left:0},f=function(e){var r,a;function l(r){var n;return(n=e.call(this,r)||this).controller="undefined"==typeof window?null:t.ParallaxController.init({scrollAxis:r.scrollAxis,scrollContainer:r.scrollContainer}),n}a=e,(r=l).prototype=Object.create(a.prototype),r.prototype.constructor=r,u(r,a);var s=l.prototype;return s.componentDidUpdate=function(e){e.scrollContainer!==this.props.scrollContainer&&this.controller.updateScrollContainer(this.props.scrollContainer)},s.componentWillUnmount=function(){this.controller=this.controller.destroy()},s.render=function(){return n.createElement(o.Provider,{value:this.controller},this.props.children)},l}(r.Component);f.defaultProps={scrollAxis:t.ScrollAxis.vertical},Object.defineProperty(exports,"EasingPreset",{enumerable:!0,get:function(){return t.EasingPreset}}),exports.Parallax=i,exports.ParallaxBanner=function(e){var t=e.children,r=e.className,a=e.layers,o=e.disabled;return n.createElement("div",{style:c({},d,e.style),className:"parallax-banner"+(r?" "+r:"")},a.map((function(e,t){var r=e.speed,a=e.children,l=e.expanded,s=void 0===l||l,u=e.image,d=e.props,f=void 0===d?{}:d,h=f.style||{},m=f.className||"";delete f.style,delete f.className;var v="parallax-banner-layer-"+t+(m?" "+m:""),y=s?{top:10*Math.abs(r)*-1+"px",bottom:10*Math.abs(r)*-1+"px"}:{},x="layer-"+t;return n.createElement(i,{key:x,speed:r,style:p,disabled:o},n.createElement("div",Object.assign({"data-testid":x,className:v,style:c({},u?{backgroundImage:"url("+u+")",backgroundPosition:"center",backgroundSize:"cover"}:{},p,y,h)},f),a))})),t)},exports.ParallaxContext=o,exports.ParallaxProvider=f,exports.useController=l,exports.useParallax=s;
//# sourceMappingURL=react-scroll-parallax.cjs.production.min.js.map

@@ -41,3 +41,3 @@ import { ParallaxController, ScrollAxis } from 'parallax-controller';

rootMargin: props.rootMargin,
shouldStartAnimationInitialInView: props.shouldStartAnimationInitialInView,
shouldAlwaysCompleteAnimation: props.shouldAlwaysCompleteAnimation,
onProgressChange: props.onProgressChange,

@@ -44,0 +44,0 @@ onChange: props.onChange,

{
"name": "react-scroll-parallax",
"version": "3.0.0-beta.8",
"version": "3.0.0-beta.9",
"description": "React components to create parallax scroll effects for banners, images or any other DOM elements.",

@@ -89,3 +89,3 @@ "keywords": [

"dependencies": {
"parallax-controller": "^1.1.1"
"parallax-controller": "^1.2.0"
},

@@ -92,0 +92,0 @@ "devDependencies": {

@@ -23,3 +23,3 @@ import { ParallaxElementConfig } from 'parallax-controller';

rootMargin: props.rootMargin,
shouldStartAnimationInitialInView: props.shouldStartAnimationInitialInView,
shouldAlwaysCompleteAnimation: props.shouldAlwaysCompleteAnimation,
onProgressChange: props.onProgressChange,

@@ -26,0 +26,0 @@ onChange: props.onChange,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc