tsparticles模拟粒子碰撞复制效果
代码语言:html
所属分类:粒子
代码描述:tsparticles模拟粒子碰撞复制效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> /* ---- reset ---- */ body { margin: 0; font: normal 75% Arial, Helvetica, sans-serif; } canvas { display: block; vertical-align: bottom; } /* ---- tsparticles container ---- */ #tsparticles { position: absolute; width: 100%; height: 100%; background-color: #0d47a1; background-image: url(""); background-repeat: no-repeat; background-size: cover; background-position: 50% 50%; } </style> </head> <body translate="no"> <div id="tsparticles"></div> <script type="text/javascript" src="http://repo.bfw.wiki/bfwrepo/js/tsparticles.min.js"></script> <script > tsParticles.load("tsparticles", { fpsLimit: 60, infection: { enable: true, infections: 10, cure: true, stages: [ { color: "#ff0000", duration: 1 }, { color: "#ffa500", duration: 1, rate: 2 }, { color: "#ffff00", duration: 1, rate: 2 }, { color: "#008000", duration: 1, rate: 3 }, { color: "#0000ff", duration: 1, rate: 4 }, { color: "#4b0082", duration: 1, rate: 5 }, { color: "#ee82ee", duration: 1, rate: 6, infectedStage: 0 }] }, particles: { number: { value: 400, density: { enable: true, value_area: 800 } }, color: { value: "#.........完整代码请登录后点击上方下载按钮下载查看
网友评论0