Just 做 IT

求知若饥 虚心若愚 안년하세요 (•‾̑⌣‾̑•)

Snow

3 years ago 0



	<!DOCTYPE html>
<html>
<head>

</head>
	<body style="background:#000;">
<script>
(function(){var i=[{src:"https://safeimg.jd.com/da/g14/M04/09/0A/rBEhVVK6OvsIAAAAAAD3oewBE7sAAHUMAPyLyMAAPe5685.png", ext:"", width:"511"},{ src:"https://safeimg.jd.com/da/g15/M04/1D/05/rBEhWVKxGI4IAAAAAAMxegDkquEAAG6EAGOx5EAAzGS874.png", ext:"", width:"511"}]; function r(arr){ var _temp=0,_random=0,_weight,_newArr=[];       for (var i=0;i<arr.length;i++){ _weight=arr[i].ext?parseInt(arr[i].ext):1; _newArr[i]=[];_newArr[i].push(_temp); _temp+=_weight; _newArr[i].push(_temp); } _random=Math.ceil(_temp*Math.random()); for (var i=0;i<_newArr.length;i++){if(_random>_newArr[i][0]&&_random<=_newArr[i][1]){return arr[i]}}}; var c=r(i);!function(a){function b(a,b){this.parent=document.body,this.createEl(this.parent,a),this.size=5*Math.random()+5,this.el.style.width=Math.round(this.size)+"px",this.el.style.height=Math.round(this.size)+"px",this.maxLeft=document.body.offsetWidth-1.5*this.size,this.left=Math.random()*this.maxLeft,this.top=c().top+(b?f()*Math.random():1),this.angle=1.4+.2*Math.random(),this.minAngle=1.4,this.maxAngle=1.6,this.angleDelta=.01*Math.random(),this.speed=2+Math.random(),this.wind=3}function c(){var a={};for(type in{Top:"",Left:""}){var b="Top"==type?"Y":"X";"undefined"!=typeof window["page"+b+"Offset"]?a[type.toLowerCase()]=window["page"+b+"Offset"]:(b=document.documentElement.clientHeight?document.documentElement:document.body,a[type.toLowerCase()]=b["scroll"+type])}return a}function d(b){if("function"!=typeof a.onload)a.onload=b;else{var c=a.onload;a.onload=function(){c(),b()}}}function e(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)}function f(){var b,c=document.body;return a.innerHeight?b=a.innerHeight:c.parentElement.clientHeight?b=c.parentElement.clientHeight:c&&c.clientHeight&&(b=c.clientHeight),b}b.prototype={createEl:function(a,b){this.el=document.createElement("img"),this.el.setAttribute("src",b[Math.round(Math.random()*(b.length-1))]),this.el.style.position="absolute",this.el.style.display="block",this.el.style.zIndex="99999",this.el.setAttribute("class","snow-animate"),a.appendChild(this.el)},move:function(){(this.angle<this.minAngle||this.angle>
        this.maxAngle)&&(this.angleDelta=-this.angleDelta),this.angle+=this.angleDelta,this.left+=this.speed*Math.cos(this.angle*Math.PI)+this.wind,this.top-=this.speed*Math.sin(this.angle*Math.PI),this.left
        <0?this.left=this.maxLeft:this.left>
            this.maxLeft&&(this.left=0)},draw:function(){this.el.style.top=Math.round(this.top)+"px",this.el.style.left=Math.round(this.left)+"px"},remove:function(){this.parent.removeChild(this.el),this.parent=this.el=null}},b.running=!0,b.isloaded=!1,d(function(){b.isloaded=!0}),a.startSnow=function(a,g){if(b.isloaded){for(var h=[],j=setInterval(function(){b.running&&g>h.length&&400*Math.random()
            <g&&h.push(new b(a)),!b.running&&!h.length&&clearInterval(j);for(var d=c().top,e=f(),i=h.length-1;i>=0;i--)h[i]&&(h[i].top<d||h[i].top+h[i].size+5>d+e?(h[i].remove(),h[i]=null,h.splice(i,1)):(h[i].move(),h[i].draw()))},36),k=0;.5*g>k;k++)h.push(new b(a,!0));e(window,"scroll",function(){for(var a=h.length-1;a>=0;a--)h[a].draw()}),e(window,"resize",function(){for(i=h.length-1;i>=0;i--)h[i]&&(h[i].maxLeft=document.body.offsetWidth-h[i].size)})}else d(function(){startSnow(a,g)})},a.stopSnow=function(){b.running=!1}}(window);startSnow(['https://safeimg.jd.com/da/g14/M02/06/15/rBEhVlKpIaMIAAAAAAADWILhZ1gAAGy3gP_3tQAAANw522.gif',              'https://safeimg.jd.com/da/g13/M0A/0B/0D/rBEhUlKpIdQIAAAAAAADWG4Ds_4AAGsVQP_rXUAAANw518.gif',              'https://safeimg.jd.com/da/g13/M03/0B/0D/rBEhVFKpIfMIAAAAAAADWGMVxvgAAGsVgP_0PEAAANw847.gif',              'https://safeimg.jd.com/da/g14/M03/06/15/rBEhVlKpIggIAAAAAAADWG4Ds_4AAGy3wO5AVUAAANw374.gif'], 256);})();

    </script>
</html>

    	<style></style>
	    		<script></script>
	
<!-- Generated by RunJS (Sun Jul 31 15:07:20 CST 2016) 0ms -->

Write a Comment