用DIV写出样式。用来表示烟花的燃放效果。
利用js运动知识来完成这一运动效果动画。
<style>
#container{
width: 80%;
height: 600px;
border: 2px solid red;
background: #000;
margin:20px auto;
cursor: pointer;
position: relative;
overflow: hidden;
}
.fire{
width: 10px;
height:10px;
position: absolute;
bottom: 0;
}
.small-fire{
width: 10px;
height:10px;
position: absolute;
border-radius: 50%;
}
</style>
<body>
<div id="container"></div>
</body>
<script src="move.2.0.js"></script>
<script>
// 一 烟花上升的主体
class fire{
constructor(pos){
this.cont=document.getElementById("container")
this.x=pos.x;
this.y=pos.y;
}
// 创建上升烟花DIV以及设置烟花上升的样式。
create(){
this.f=document.createElement("div");
thi