
最新下载
24小时阅读排行榜
- 1 微博的浏览记录会同步吗_微博浏览记录同步规则说明
- 2 如何在Windows中配置JavaFX开发环境
- 3 如何通过css工具Sass实现循环生成类
- 4 python错误类型捕获的方法
- 5 PHP一键环境为什么不能发送邮件_邮件发送功能配置
- 6 彻底格式化硬盘并进行纯净Windows安装
- 7 Linux用户权限怎么管理_Linux用户权限管理的详细操作教程
- 8 PHPWebSocket怎么通信_PHP结合GatewayWorker实现WebSocket实时通信
- 9 抖音tiktok官方网址入口官方版 抖音tiktok官网首页快速直达
- 10 小强阅读app怎么删除书架上的书_小强阅读app已存书籍如何从书架删除详细方法
- 11 Linux SSH授权密钥与权限设置
- 12 阴阳师一起捉咪藏第三天攻略-阴阳师一起捉咪藏第三天在哪找
- 13 PHP代码怎么实现验证码生成_PHP验证码图片生成与验证步骤
- 14 css初级项目导航栏下拉效果优化
- 15 OFX代购大额汇款优势在哪里_OFX代购大额汇款优势解读
最新教程
-
- Node.js 教程
- 5815 2025-08-28
-
- CSS3 教程
- 849500 2025-08-27
-
- Rust 教程
- 9231 2025-08-27
-
- Vue 教程
- 11322 2025-08-22
-
- PostgreSQL 教程
- 8857 2025-08-21
-
- Git 教程
- 4695 2025-08-21
html5 canvas海底水草动画特效是一款深海底冒泡的海藻动画场景特效
var canvas, ctx, width, height, stems, bubbles;
stems = [];
bubbles = [];
function Bubble(x, y, radius) {
this.x = x;
this.y = y;
this.radius = radius;
this.vy = -Math.random() * 5;
this.opacity = 0.2 + Math.random() * 0.5;
this.oldY = y;
}
Bubble.prototype.draw = function() {
var strokeColor, fillColor;
strokeColor = 'rgba(255, 255, 255,' + this.opacity + ')';
fillColor = 'rgba(255, 255, 255,' + (this.opacity / 2) + ')';
ctx.save();
ctx.lineWidth = 0.8;
ctx.strokeStyle = strokeColor;
ctx.fillStyle = fillColor;
ctx.beginPath();
ctx.arc(this.x, this.y, this.radius, 0, Math.PI * 2, true);
ctx.closePath();
ctx.fill();
ctx.stroke();
ctx.restore();
}

