bling-paper
v1.3.3
Published
[![Version](https://img.shields.io/badge/npm-1.1.0-yellow.svg) <div align = "center"> <img src="paper.gif" width="300" height="510" /> </div> npm adduser ### 前言 缤纷纸片,技术是canvas,适用于各种欢乐的场合~
Downloads
6
Readme
[
调用方法
<html>
<head>
<meta charset="utf-8">
<title>缤纷纸片</title>
<style>
body{
background:url("img/background.jpg") no-repeat top;
}
</style>
</head>
<body>
<div id="app"></div>
<script src="./index.js"></script>
<script>
var a = new Paper({
params:{
width: 1024,//背景图的宽
height: 1344, //背景图的高,
isLoop:false
}
})
setTimeout(function(){
a =null
},8000)
</script>
</body>
</html>
Paper
| 参数 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | elm | 定义父组件,传父组件的id | String | document.body | | width | 最基础的canvas的宽度(必填) | Number | | | height | 最基础的canvas的高度(必填) | Number | | | length | 纸片个数 | Number | 500 | | yRange | 定位时y的范围 | Number | 基础canvas高度的2倍 | | duration | 时常 | Number | 8000 | | rotationRange | 旋转角度 | Number | 10 | | speedRange | 旋转速度 | Number | 10 | | isLoop | 是否循环(必传) | boolean | |