@axe/animate

0.3.2 • Public • Published

animate

version

a javascript library for animation or transition with css3 feature.

Installation

npm install @axe/animate

Usage

HTMLElement

import Animate from '@axe/animate'

const el = document.getElementById('animate')
const animate = new Animate(el)

animate.style({
  transition: 'transform 1s',
  transform: 'translateX(600px)'
}).done(() => {
  animate.style({
    transition: '',
    transform: 'translateX(0)'
  })

  console.info('transition end')
})

API

Animate

创建动画实例

参数:

  • el:HTMLElement或者字符串选择器

animate.style

自定义样式,会自动判断是否需要增加css前缀

参数:

  • style:[Object] 样式

animate.done

  • callback:[Function] 在transition或animation结束时触发

Build Setup

# serve with hot reload at localhost:5000
fle dev

# build for production with minification
fle build

For detailed explanation, consult the docs for fle-cli.

Readme

Keywords

Package Sidebar

Install

npm i @axe/animate

Weekly Downloads

0

Version

0.3.2

License

MIT

Unpacked Size

7.03 kB

Total Files

7

Last publish

Collaborators

  • ansenhuang