代码如下:
img { display: none; }
body { overflow: hidden; }
#canvas { position: absolute; top: 0px; left: 0px; }
function demo() {
var engine = new rainyday('canvas','demo1', window.innerwidth, window.innerheight);
engine.gravity = engine.gravity_non_linear;
engine.trail = engine.trail_drops;
engine.rain([
engine.preset(0, 2, 500)
]);
engine.rain([
engine.preset(3, 3, 0.88),
engine.preset(5, 5, 0.9),
engine.preset(6, 2, 1),
], 100);
}