canvas实现多种炸弹爆炸动画效果代码
代码语言:html
所属分类:动画
代码描述:canvas实现多种炸弹爆炸动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body { display: flex; flex-direction: row; } #buttons { margin: 10px; /* padding: 10px; */ display: flex; flex-direction: column; } #colors { margin: 10px; /* padding: 10px; */ display: flex; flex-direction: row; justify-content: space-evenly; /* background: grey; */ } .box { width: 20px; height: 20px; } .red { background: red; } .green { background: green; } .blue { background: blue; } </style> </head> <body> <div> <canvas id="canvas" width=800 height=600></canvas> </div> <div id="buttons"> <button id="explosion">Explosion</button> <button id="fallout">Nuclear Fallout</button> <button id="spin">Galaxy formation</button> <button id="amoeba">Amoeba</button> <div id="colors"> <div class="red box"></div> <div class="green box"></div> <div class="blue box"></div> </div> <button>Number of particles:<br><i id="particles">0</i></button> <input type="range" min="1" max="10000" value="2000" id="slider"> </div> <script> class PixelManipulation { constructor(.........完整代码请登录后点击上方下载按钮下载查看
网友评论0