canvas点状波浪动画效果代码
代码语言:html
所属分类:动画
代码描述:canvas点状波浪动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { margin: 0; overflow: hidden; } </style> </head> <body> <canvas></canvas> <script > const canvas = document.querySelector('canvas'); const ctx = canvas.getContext('2d'); const width = window.innerWidth; const height = window.innerHeight; canvas.width = width; canvas.height = height; let shift = 0; class Dot { constructor(x = 0, y = 0, yOff = 1, xOff = 1) { this.x = x; this.y = y; this.offset = Math.max(yOff, xOff) / 4 - 1; this.size = 1; } update(val) { this.size = .........完整代码请登录后点击上方下载按钮下载查看
网友评论0