Socket
Socket
Sign inDemoInstall

react-parallax-mousemove

Package Overview
Dependencies
5
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-parallax-mousemove

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


Version published
Weekly downloads
254
decreased by-0.78%
Maintainers
1
Created
Weekly downloads
 

Readme

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

Last updated on 05 Oct 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc