<!DOCTYPE html> <html > <head> <meta charset="UTF-8"> <title>canvas粒子喷泉动画</title> <meta name="keywords" content=" canvas粒子喷泉动画" /> <meta name="description" content=" canvas粒子喷泉动画" /> <link rel="stylesheet" href="css/style.css"> </head> <body> <div>鼠标点击,增加粒子喷泉效果</div> <canvas id="fireworks"></canvas> <script src="js/index.js"></script> </body> </html> Css部分: body, html, canvas { margin: 0; padding: 0; background-color: #111; overflow: hidden; } canvas { background-color: transparent; position: relative; z-index: 2; } .text { position: absolute; left: 0; top: 20px; width: 100%; text-align: center; font-size: 3.7vw; color: #fff; z-index: 1; opacity: 0.2; }
以上就是用canvas做出粒子喷泉动画的全过程,有兴趣的朋友可以自己动手操作一下,更多精彩请关注php中文网其它相关文章!
相关阅读:
以上就是怎样用canvas做出粒子喷泉动画的效果的详细内容,更多请关注php中文网其它相关文章!
![php中文网最新课程二维码](/static/images/article_wechat2021.jpg?1111)
声明:本文原创发布php中文网,转载请注明出处,感谢您的尊重!如有疑问,请联系admin@php.cn处理
网友评论
文明上网理性发言,请遵守 新闻评论服务协议
我要评论