css实现等离子球体动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现等离子球体动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> * { margin: 0; background: #141a29; } canvas { position: absolute; top: 50%; left: 50%; margin: -300px 0 0 -300px; } </style> </head> <body > <canvas width="600" height="600"></canvas> <script > var canvas = document.querySelector('canvas'); var ctx = canvas.getContext('2d'); var width = canvas.width; var height = canvas.height; var cx = width / 2; var cy = height / 2; var points = []; function generatePoints() { var data = [ { count: 90, position: 290, index: 0 }, { count: 90, position: 280, index: 0 }, { count: 90, position: 270, index: 0 }, { count: 70, position: 200, index: 1 }, { count: 70, position: 190, index: 1 }, { count: 70, position: 180, index: 1 }, { count: 50, position: 110, index: 2 }, { count: 50, position: 100, index: 2 }, { count: 30, position: 30, index: 3 }]; for (var i = 0, len = data.length; i < len; ++i) { var item = data[i]; for (var j = 0; j < item.count; ++j) { var speed.........完整代码请登录后点击上方下载按钮下载查看
网友评论0