扫一扫分享
css 动效库。试着在页面打开后滚动鼠标滚轮,你会发现有趣的事情正在发生,它就是一个收集了大量趣味 CSS 动效库的网站
$ npm install --save choreographer-js
const Choreographer = require('choreographer-js')
let choreographer = new Choreographer({
animations: [
{
range: [-1, 1000],
selector: '#box',
type: 'scale',
style: 'opacity',
from: 0,
to: 1
}
]
})
window.addEventListener('mousemove', function(e) {
choreographer.runAnimationsAt(e.clientX)
})
手机预览