Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

parallax-react-js

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parallax-react-js - npm Package Compare versions

Comparing version 1.0.5 to 1.0.6

11

build/lib/ParallaxLayer.js

@@ -12,14 +12,13 @@ import React from 'react';

var _a;
if (!props.speed)
props.speed = "100%"; //if props.speed is undefined set it to 100% (normal scroll speed)
var speed = props.speed ? props.speed : "100%"; //if props.speed is undefined set it to 100% (normal scroll speed)
//check if props.speed is a proper percentage. If not throw an error and set props.speed to 100% again
if (!props.speed.includes("%")) {
if (!speed.includes("%")) {
console.error("Value of Parallax Speed must be a percentage. Read our documentation for further information.");
props.speed = "100%";
speed = "100%";
}
(_a = thisdiv.current) === null || _a === void 0 ? void 0 : _a.setAttribute("parallaxSpeed", props.speed);
(_a = thisdiv.current) === null || _a === void 0 ? void 0 : _a.setAttribute("parallaxSpeed", speed);
//set attribute "parallaxSpeed" of the div to the same value as props.speed.
//This way you can see the value in the actual dom.
//You can also change it and directly influence the scroll speed without changing your source code.
}, [props.speed]); //Only run the checks on props.speed again if it has changed.
});
//Render chldren of this ParallaxLayer inside of a wrapper div which is part of the "Parallax-Layer" class.

@@ -26,0 +25,0 @@ //Wrapper div is referenced by the "thisdiv" ("thisdivprefetch") reference so parallaxSpeed can be set properly.

{
"name": "parallax-react-js",
"version": "1.0.5",
"version": "1.0.6",
"description": "A libary for managing scroll speed of different components in react.",

@@ -5,0 +5,0 @@ "scripts": {

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