Giter Site home page Giter Site logo

paralaxer's Introduction

Paralaxer

Introduction

A react component that will animate its nested children based on scroll position. Each child that will be animated will take an animation object containing either a to and from style object, or multiple steps from 0 - 100. The Paralaxer Wrapper takes 2 / 4 arguments start and end, which are absolute values related to the document. or tresholdStart and tresholdEnd which are relative to the Paralaxer wrappers distance from the top of the screen.

Sample at https://paralaxer.fengel.com/

Code Samples

<Paralaxer start={0} end={this.state.docHeight / 1.5}>
  <h1 
  style={{ transformOrigin: 'center'}}
  animation={{
    from:{ transform: 'rotate(360deg) skew(0deg) scale(1)'}, 
    to:{ transform: 'rotate(0deg) skew(0deg) scale(1)'},
  }}>
    <span 
      animation={{
        0:{ transform: 'translateY(0vh)'},
        50:{ transform: 'translateY(-200vh)'}, 
        100:{ transform: 'translateY(0vh)'},
      }}
      >P</span>
    <span 
      animation={{
        0:{ transform: 'translateY(0vh)'},
        50:{ transform: 'translateY(-150vh)'}, 
        100:{ transform: 'translateY(0vh)'},
      }}
      >a</span>
    <span 
      animation={{
        0:{ transform: 'translateY(0vh)'},
        50:{ transform: 'translateY(-100vh)'}, 
        100:{ transform: 'translateY(0vh)'},
      }}
      >r</span>
    <span 
      animation={{
        0:{ transform: 'translateY(0vh)'},
        50:{ transform: 'translateY(-70vh)'}, 
        100:{ transform: 'translateY(0vh)'},
      }}
      >a</span>
    <span 
    animation={{
      0:{ opacity: 1},
      50:{ opacity: 0.5}, 
      100:{ opacity: 1},
    }}
      >l</span>
    <span 
      animation={{
        0:{ transform: 'translateY(0vh)'},
        50:{ transform: 'translateY(70vh)'}, 
        100:{ transform: 'translateY(0vh)'},
      }}
      >a</span>
    <span 
      animation={{
      0:{ transform: 'translateY(0vh)'},
      50:{ transform: 'translateY(100vh)'}, 
      100:{ transform: 'translateY(0vh)'},
    }}
      >x</span>
    <span 
      animation={{
        0:{ transform: 'translateY(0vh)'},
        50:{ transform: 'translateY(150vh)'},
        100:{ transform: 'translateY(0vh)'},
      }}
      >e</span>
    <span 
      animation={{
        0:{ transform: 'translateY(0vh)'},
        50:{ transform: 'translateY(200vh)'}, 
        100:{ transform: 'translateY(0vh)'},
      }}
      >r</span>
  </h1>
</Paralaxer>

Installation

yarn add or npm install 'paralaxer'

paralaxer's People

Contributors

fengelz avatar

Stargazers

Marc avatar Rodrigo Quiñones Pichioli avatar Joen A. avatar

Watchers

 avatar James Cloos avatar

Forkers

casey-wishart

paralaxer's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.