1.1.0 • Published 7 years ago

rc-scroll-animate v1.1.0

Weekly downloads
4
License
ISC
Repository
github
Last release
7 years ago

rc-scroll-animate

Simple react component for animating DOM elements on scroll with animate.css or custom classes.


Getting start

Install
$ npm install --save rc-scroll-animate
Usage

Link Animate.css in your index.html

import React, { Component } from 'react'
import ScrollAnimate from 'rc-scroll-animate'

export default class Example extends Component {
  render () {
    return (
      <div>
        <h1>Hello World!</h1>
        <ScrollAnimate animationClassName='fadeInUp' percentage={50} >
          <p>Some text.. some text..</p>
        </ScrollAnimate>
      </div>
    )
  }
}
Options
PropsTypeDescription
percentagenumber, Default: 50 (min: 0, max: 100)Percentage of element position in window size when start animation
animationClassNamestring, RequiredName of the class that will be added when animation trigger
hiddenboolean, Default: trueHide element if animation not fired
loopboolean, Default: falseAnimation loop on scrolling
Customize

If you want to customize animation timing and some else or you do not want to use Animate.css , just insert in your css class .animated and a class for animating DOM Element.

.animated {
  -webkit-animation-duration: .5s;
  animation-duration: .5s;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* This will be animationClassName */
.fadeIn {
  -webkit-animation-name: fadeIn;
  animation-name: fadeIn;
}
1.1.0

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago