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

react-simple-parallax

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-simple-parallax

A simple React Component for parallax effect.

  • 0.2.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-68.42%
Maintainers
1
Weekly downloads
 
Created
Source

react-simple-parallax

A simple React Component for parallax effect on the front layer.

alt tag

Install

npm install -S react-simple-parallax

Usage

import Parallax from 'react-simple-parallax';

class App extends React.Component {
  render () {
	return (
		<section>
		  	<Parallax className="parallax" speedDivider="5">
		  		<div>Hello World!</div>
		  	</Parallax>
		</section>
	);
  }
}

Basic styling

    section {
        text-align: center;
    }
    
    /* .react-simple-parallax-bg is generate by the component */
    section .react-simple-parallax-bg {
        background-image: url('http://tinyurl.com/zaz7bp4');
        height: 750px;
    }
    
    section .parallax {
        top: 200px;
        margin: auto;
    }

Attributes

  • speedDivider: controle translation speed (default: 5)
  • backgroundStyle: to set the style of the background element with a javascript object (optional)
Example
  render () {
	var background = {
		height: "1000px",
		backgroundImage: 'url(http://tinyurl.com/zaz7bp4)'
	}
	return (
		<section>
		  	<Parallax speedDivider="3" backgroundStyle={background}>

Build the exemple

Initial set up

npm install

Install Webpack

npm install webpack -g

Build the exemple

webpack

Open /src/index.html

License

MIT

Keywords

FAQs

Package last updated on 09 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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