canvas龙卷风漩涡动画效果代码
代码语言:html
所属分类:动画
代码描述:canvas龙卷风漩涡动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> html, body { margin: 0; padding: 0; overflow: hidden; } </style> </head> <body translate="no"> <canvas id="c"> <script > const c = document.querySelector('#c'); const ctx = c.getContext('2d'); const dpr = Math.min(2, window.devicePixelRatio); const makeCtx = (w, h) => { const c = document.createElement("canvas"); const ctx = c.getContext("2d"); c.width = w; c.height = h; return ctx; }; function pseudoRandom(seed) { return Math.sin(seed) * 10000 - Math.floor(Math.sin(seed) * 10000); } function noise(x, y) { const seed = x * 137 + y * 149.........完整代码请登录后点击上方下载按钮下载查看
网友评论0