Achieve transition animation
$ npm install universal-transition --save
import transition from 'universal-transition';
transition(document.querySelector('#box'), {
transform: 'translate(10px, 20px) scale(1.5, 1.5) rotate(90deg)',
opacity: '0.5'
}, {
timingFunction: 'ease',
delay: 0,
duration: 1000
}, function() {
console.log('animation end');
});
- domNode: Required, DOMNode
- styles: Required, Object, transition styles
- options: Optional, Object, options attributes:
- timingFunction: default ease,
- delay: default 0,
- duration: default 0,
- callback: Optional, Function, after animation end