1.1.0 • Published 7 years ago

react-parallax-mousemove v1.1.0

Weekly downloads
245
License
MIT
Repository
github
Last release
7 years ago

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
1.1.0

7 years ago

1.0.0

7 years ago

0.9.0

7 years ago

0.8.0

7 years ago

0.7.0

7 years ago

0.6.0

7 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago