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

react-parallax-mousemove

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-parallax-mousemove

Parallax elements based on mousemovement inspired by react-springy-parallax

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
278
decreased by-11.18%
Maintainers
1
Weekly downloads
 
Created
Source

React Parallax Mousemove

A simple react wrapper component which takes an arbitrary number of children as layers. Layers are affected by the position of the mouse pointer in relation to the center of the window. This project was inspired by react-springy-parallax.

Getting Started

Clone repo

git clone https://github.com/adamwade2384/react-parallax-mousemove.git

Install dependencies

npm install or yarn install

Start development server

npm start or yarn start

Runs the demo app in development mode. Open http://localhost:3000 to view it in the browser.

Demo app

Is located inside src/demo directory, here you can test your library while developing

Usage

import ParallaxMousemove from 'react-parallax-mousemove'

The library provides you with two (2) components - A container component and layer component(s). The container component ParallaxMousemove takes the ParallaxMousemove.Layer component as children.

<ParallaxMousemove>
  <ParallaxMousemove.Layer></ParallaxMousemove.Layer>
  <ParallaxMousemove.Layer></ParallaxMousemove.Layer>
</ParallaxMousemove>

The props for each component is as follows:

Container Component

proptyperequired
containerStyleObjoptional
fullHeightBooloptional

Layer Component

proptyperequired
configObjrequired

Layer Configuration Options

optiontypedescription
xFactorIntA percentage of the mousemove distance from the center of the screen on the x axis
yFactorIntA percentage of the mousemove distance from the center of the screen on the y axis
springSettingsObjThe spring configuration settings for react-motion.

Spring Settings object

optiontypedescription
stiffnessIntThe response and speed of layers in relation to mouse movements
dampingIntThe spring and rebound of layers in relation to mouse movements

FAQs

Package last updated on 05 Oct 2017

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