0.0.7 • Published 5 years ago

react-scroll-rotate v0.0.7

Weekly downloads
55
License
ISC
Repository
github
Last release
5 years ago

react-scroll-rotate (demo)

Very simple react component for rotate element based on scroll position

NPM

Install

npm install --save react-scroll-rotate

Usage

import React, { Component } from 'react';
import  { ScrollRotate } from 'react-scroll-rotate';

function MyTitleComp(props) {
    return (<MyTitleWrapper>
        Hello <ScrollRotate><span>world</span></ScrollRotate>
    </MyTitleWrapper>)
}

Props

PropertyTypeDefaultDescription
targetstringnullTarget element id. By default it will use window scroll
throttlenumbernullUse 'throttle' prop to invoke the update once in X seconds
fromnumber0Rotation start point
tonumber360Rotation end point
methodstring'px'Use 'perc' to change rotation based on scroll percantges.
loopsnumber1When using method 'perc', define how many loops component will do while scrolling to bottom
animationDurationnumber0.1Animation duration

License

MIT

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago