npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ezreal

v0.1.0

Published

a useful tool for react animation effects

Downloads

9

Readme

Ezreal.js

a useful tool for react animation effects

Install

use npm: npm install ezreal --save

Usage

With ES6/import

import Ezreal from 'ezreal';

With CommonJS/require

const Ezreal = require('ezreal');

Appear Animation

Appear animation is for component that show with page render

<Ezreal type="fade-appear" duration={ 500 }>
    <YourComponent/>
</Ezreal>

Enter And Leave Animation

Enter/leave animation is for the component, which you can control it to be showed or not. So you should pass boolean property display to emit Enter or Leave action

class App extends React.Component {
    constructor (props) {
        super(props);
        this.state = {
            show: false
        };
        this.handleClick = this.handleClick.bind(this);
    }
    render () {
        return (
            <div>
                <p>{ this.props.type }</p>
                <button onClick={ this.handleClick }>{ this.state.show ? 'hidden' : 'show' }</button>
                <br/>
                <Ezreal display={ this.state.show } type="fade-enter-leave" duration={ 500 }>
                    <YourComponent/>
                </Ezreal>
            </div>
        );
    }
    handleClick () {
        this.setState({ show: !this.state.show });
    }
}

You can also use single enter or leave animation. Such as fade-enter or fade-leave

Custom Animation

You can pass property animations to Ezreal component. Your animation action should be contained in the property animations

example:

const animations = {
    componentWillAppear: {
        0: {
            transform: 'scale(2)'
        },
        100: {
            transform: 'scale(1)'
        }
    },
}
 
<Ezreal type="custom-appear" duration={ 500 }>
    <YourComponent/>
</Ezreal>

The animations contain 6 status:

  1. componentWillAppear
  2. componentDidAppear
  3. componentWillEnter
  4. componentDidEnter
  5. componentWillLeave
  6. componentDidLeave

Available Type

  • fade
  • scale
  • wave
  • rotate
  • drop
  • fly
  • custom

Container Element

You component will be warpped in a div (animation container) and a span (react addon element). Some times, thest elements will affect your component layout. So you can pass style and containerStyle to control the style of these elements. style is for outer span. containerStyle is for inner div

example:

onst styles = {
    outerSpan: {
        flex: 1
    },
    innerDiv: {
        display: flex
    },
    container: {
        display: flex
    },
    yourComponent: {
        flex: 1
    }
}

<div style={ styles.container }>
    <Ezreal type="fade-appear" style={ styles.outerSpan } containerStyle={ styles.innerDiv }>
        <YourComponent/>
    </Ezreal>
</div>

Such as, your component will continue to apply the correct properties

Contribute

  1. Fork it
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -m 'feat|fix|refactor|doc(modified area): a short description'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request