JS插件

Wesley13
• 阅读 463

rainyday.js

JS插件

效果也是够帅,设计达人中有介绍。

效果演示 代码分析

<style media="screen" type="text/css">
            img { display: none; }
            body { overflow: hidden; }
            #canvas { position: absolute; top: 0px; left: 0px; }
        </style>
        <script src="js/rainyday.js" type="text/javascript"></script>
        <script type="text/javascript">
             function demo() {
                var engine = new RainyDay('canvas','demo2', window.innerWidth, window.innerHeight);
                     engine.gravity = engine.GRAVITY_NON_LINEAR;
                     engine.trail = engine.TRAIL_DROPS;
                     engine.VARIABLE_GRAVITY_ANGLE = Math.PI / 8;
                    engine.rain([
                        engine.preset(0, 2, 0.5),
                        engine.preset(4, 4, 1)
                    ], 50);
             }
        </script>

只需要在头部加上代码然后再body onload就可以

然而我下载的图片只能用BASE64图片编码,这跟的src一大串,还好有个在线图片转码工具:link

编码BASE64 

点赞
收藏
评论区
推荐文章
待兔 待兔
4个月前
手写Java HashMap源码
HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程HashMap的使用教程22
Stella981 Stella981
3年前
Linux Network Configuration
!Yolinux.comTutorial(http://static.oschina.net/uploads/img/201401/20155959_hJ26.png)(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fwww.yolinux.com%2F)LinuxNetwor
Easter79 Easter79
3年前
Thinking in Java (Java 编程思想) PDF ePub Mobi格式电子书
!Java编程思想第四版(https://static.oschina.net/uploads/img/201605/08155005_PnnT.jpg"Java编程思想第四版")本书来自网络,http://quanke.name(https://www.oschina.net/action/GoToLink?urlhttp%3A%2
Stella981 Stella981
3年前
Google Java Style
1Introduction !(http://static.oschina.net/uploads/img/201508/29173129_PABl.png)(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fgoogle.github.io%2Fstyleguide%2Fjavagu
Wesley13 Wesley13
3年前
P2P技术揭秘.P2P网络技术原理与典型系统开发
Modular.Java(2009.06)\.Craig.Walls.文字版.pdf:http://www.t00y.com/file/59501950(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fwww.t00y.com%2Ffile%2F59501950)\More.E
Stella981 Stella981
3年前
50款JavaScript图表库分享
jqPlot(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fwww.jqplot.com%2F):一款jquery绘图和图表插件、使用简单、提供了丰富的示例和强大的功能,而且开源。!jqPlot(http://static.oschina.net/uploads/img/
Stella981 Stella981
3年前
NetBeans 时事通讯(刊号 # 67
项目新闻下载NetBeansIDE6.8里程碑1!(http://static.oschina.net/uploads/img/201203/09135319_fbTD.gif)(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fwww.netbeans.info
Easter79 Easter79
3年前
Swift项目兼容Objective
!456.jpg(http://static.oschina.net/uploads/img/201509/13172704_1KcG.jpg"1433497731426906.jpg")本文是投稿文章,作者:一叶(博客(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2F00red
Stella981 Stella981
3年前
EasyIOS用Model
!(http://static.oschina.net/uploads/img/201407/23162637_k1jW.jpg)(via:BryceZhang的博客(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fwww.cnblogs.com%2Fbrycezhang%2Fp
Stella981 Stella981
3年前
Git在eclipse中的配置详细记录
一\_安装EGIT插件(https://www.oschina.net/action/GoToLink?urlhttp%3A%2F%2Fblog.csdn.net%2Flaizhenhai88%2Farticle%2Fdetails%2F7233578)!(http://static.oschina.net/uploads/img/20