HTML5网页背景气泡上升
代码片段:
run(now) {
var bubble, j, len, ref;
this.update(now);
this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);
ref = this.bubbles;
for (j = 0, len = ref.length; j < len; j++) {
bubble = ref[j];
this.ctx.moveTo(bubble.x, bubble.y);
this.ctx.beginPath();
this.ctx.arc(bubble.x, bubble.y, bubble.r, 0, 2 * Math.PI);
this.ctx.fill();
}
return requestAnimationFrame(() => {
return this.run(new Date().getTime());
});
}
申明:本站所有资源都是转载各大下载站,或由网友投稿发布,请自行检测软件的完整性,如有侵权请联系我们删除下架,联系方式:admin@php.cn