canvas能量发射释放光圈射线动画效果代码
代码语言:html
所属分类:动画
代码描述:canvas能量发射释放光圈射线动画效果代码
代码标签: canvas 能量 发射 释放 光圈 射线 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> html,body { height: 100%;padding:0;margin:0;}body { background: #000; background: radial-gradient(#181818, #000); overflow: hidden;}body:after { background: #181818; background: radial-gradient(#000, #555); border-radius: 50%; bottom: 0; content: ''; left: 0; margin: auto; position: absolute; right: 0; top: 0; width: 50px; height: 50px; will-change: transform;}canvas { display: block;} </style> </head> <body> <script > var $ = {}; $.rand = function(d, c) { return Math.random() * (c - d) + d }; $.Part = function() { this.reset() }; $.Part.prototype.reset = function() { this.x = 0; this.y = 0; this.z = 0; this.vx = $.rand(-0.5, 0.5); this.vy = $.rand(-0.5, 0.5); this.vz = $.rand(-0.25, 0.5); .........完整代码请登录后点击上方下载按钮下载查看
网友评论0