particlesjs('particles-js', { particles: { number: { value: 8, //数量 density: { enable: !0, //启用粒子的稀密程度 value_area: 1e3 //区域散布密度大小 } }, color: { value: ["#ffc0c0", "#f3aaaa", "#e2d4d4", "#e4c4c4"] //原子的颜色 }, shape: { type: "edge", //原子的形状 "circle" ,"edge" ,"triangle" ,"polygon" ,"star" ,"image" ,["circle", "triangle", "image"] stroke: { width: 0, //原子的宽度 color: "#000000" //原子颜色 }, polygon: { nb_sides: 5 // 原子的多边形边数 }, image: { src: "../images/strawberry.png", // 原子的图片可以使用自定义图片 "assets/img/yop.svg" , "width": 47, //图片宽度 "height": 55, //图片高度 } }, opacity: { value: .5, //不透明度 random: !0, //随机不透明度 anim: { enable: !0, //渐变动画 speed: .5, // 渐变动画速度 opacity_min: .2, //渐变动画不透明度 sync: !1 } }, size: { value: 20, //原子大小 random: !0, // 原子大小随机 anim: { enable: !1, // 原子渐变 speed: 1, //原子渐变速度 size_min: 1, sync: !1 } }, line_linked: { enable: !1 //连接线 }, move: { enable: !0, //原子移动 speed: 2, //原子移动速度 direction: "none", //原子移动方向 "none" ,"top" ,"top-right" ,"right" ,"bottom-right" ,"bottom" ,"bottom-left" ,"left" ,"top-left" random: !0, //移动随机方向 straight: !1, //直接移动 out_mode: "out", //是否移动出画布 attract: { enable: !0, // 原子之间吸引 rotatex: 1e3, //原子之间吸引x水平距离 rotatey: 1e3 //原子之间吸引y水平距离 } } } });