3.0.5 • Published 6 years ago

preact-animate v3.0.5

Weekly downloads
107
License
MIT
Repository
github
Last release
6 years ago

preact-animate


animate preact or react element easily

Feature

  • support ie8,ie8+,chrome,firefox,safari

install

npm i preact-animate

Usage

preact

import Animate from 'preact-animate';

preact.render(
  <Animate animation={{ ... }}>
    <p key="1">1</p>
    <p key="2">2</p>
  </Animate>
, mountNode);

react

set webpack alias

module.exports = {
  resolve: {
    alias: {
      "preact-animate": "preact-animate/dist/react-animate.js"
    }
  }
}

or rollup alias

const alias = require('rollup-plugin-alias')
module.exports = {
  plugins: [new alias({
    'preact-animate': 'preact-animate/dist/react-animate.js'
  })]
}

API

props

animation format

with appear, enter and leave as keys. for example:

  {
    appear: function(node, done){
      node.style.display='none';
      $(node).slideUp(done);
      return {
        stop:function(){
          // jq will call done on finish
          $(node).stop(true);
        }
      };
    },
    enter: function(){
      this.appear.apply(this,arguments);
    },
    leave: function(node, done){
      node.style.display='';
      $(node).slideDown(done);
      return {
        stop:function(){
          // jq will call done on finish
          $(node).stop(true);
        }
      };
    }
  }

License

preact-animate is released under the MIT license.

Thank

fork by rc-animate

3.0.5

6 years ago

3.0.4

6 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.7.2

6 years ago

2.7.1

6 years ago

2.6.1

6 years ago

2.6.0

6 years ago

2.5.0

6 years ago

2.4.0

6 years ago

2.3.0

6 years ago

2.2.0

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

1.5.1

6 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.1

6 years ago

1.1.0

7 years ago

1.0.0

7 years ago