/** * Copyright (c) 2011-2013 Felix Gnass * Licensed under the MIT license */ (function(a,b){if(typeof exports=="object"){module.exports=b()}else{if(typeof define=="function"&&define.amd){define(b)}else{a.Spinner=b()}}}(this,function(){var e=["webkit","Moz","ms","O"],p={},o;function g(q,t){var r=document.createElement(q||"div"),s;for(s in t){r[s]=t[s]}return r}function h(r){for(var q=1,s=arguments.length;q>1):parseInt(r.left,10)+C)+"px",top:(r.top=="auto"?B.y-E.y+(z.offsetHeight>>1):parseInt(r.top,10)+C)+"px"})}s.setAttribute("role","progressbar");D.lines(s,D.opts);if(!o){var w=0,q=(r.lines-1)*(1-r.direction)/2,v,t=r.fps,y=t/r.speed,x=(1-r.opacity)/(y*r.trail/100),A=y/r.lines;(function u(){w++;for(var F=0;F>1)+"px"})}for(;r',r)}i.addRule(".spin-vml","behavior:url(#default#VML)");b.prototype.lines=function(v,u){var t=u.length+u.width,B=2*t;function A(){return f(q("group",{coordsize:B+" "+B,coordorigin:-t+" "+-t}),{width:B,height:B})}var w=-(u.width+u.length)*2+"px",z=f(A(),{position:"absolute",top:w,left:w}),y;function x(s,r,C){h(z,h(f(A(),{rotation:360/u.lines*s+"deg",left:~~r}),h(f(q("roundrect",{arcsize:u.corners}),{width:t,height:u.width,left:u.radius,top:-u.width>>1,filter:C}),q("fill",{color:n(u.color,s),opacity:u.opacity}),q("stroke",{opacity:0}))))}if(u.shadow){for(y=1;y<=u.lines;y++){x(y,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)")}}for(y=1;y<=u.lines;y++){x(y)}return h(v,z)};b.prototype.opacity=function(s,r,u,t){var v=s.firstChild;t=t.shadow&&t.lines||0;if(v&&r+t