-
Notifications
You must be signed in to change notification settings - Fork 6
/
jquery.flurry.min.js
10 lines (10 loc) · 1.07 KB
/
jquery.flurry.min.js
1
2
3
4
5
6
7
8
9
10
/**
* Flurry jQuery Plugin
*
* Flurry is an easy-to-use animated snow plugin for jQuery inspired by jSnow.
*
* @link https://github.com/joshmcrty/Flurry
* @author Josh McCarty <[email protected]>
* @copyright 2013 Josh McCarty
* @license https://github.com/joshmcrty/Flurry/blob/master/LICENSE GPLv2
*/(function(e){e.fn.flurry=function(t){var n=e.extend({height:150,density:100,speed:3e3,small:12,large:20,wind:40,variance:20,preventScroll:!0,container:'body'},t);n.preventScroll===!0&&e("html").css({"overflow-x":"hidden"});var r=e(window).width();e(window).resize(function(){r=e(window).width()});var i=function(e,t){return Math.random()*(t-e)+e},s=function(){var t=i(0-Math.abs(n.wind),r+Math.abs(n.wind)),s="<span>•</span>";e(s).css({color:"#FFF","font-size":i(n.small,n.large)+"px",position:"absolute",top:"-"+n.large+"px",left:t+"px","z-index":"999"}).appendTo(n.container).animate({top:n.height+"px",left:t+i(n.wind-n.variance,n.wind+n.variance)+"px",opacity:0},i(n.speed-400,n.speed+400),"linear",function(){e(this).remove()})};setInterval(s,n.density)}})(jQuery);