Comments: The special effects of raindrops must have been seen by everyone. The special effects described in this article are implemented using HTML5. These effects are crystal clear and interesting. You can try to run them.
The Code is as follows:
<Html>
<Head>
<Title> effects of HTML5 raindrops </title>
<Style media = "screen" type = "text/css">
Img {display: none ;}
Body {overflow: hidden ;}
# Canvas {position: absolute; top: 0px; left: 0px ;}
</Style>
<Script src = "/jscss/demoimg/201401/rainyday. js" type = "text/javascript"> </script>
<Script type = "text/javascript">
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 );
}
</Script>
</Head>
<Body onload = "demo ();">
<Div id = "cholder">
<Canvas id = "canvas"> </canvas>
</Div>
</Body>
</Html>