mirror of https://github.com/lukechilds/Agama.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
34 KiB
1 lines
34 KiB
/*jRoll - https://fitsbach.github.io/jRoll/ //Version - 0.1.5//Licensed unter the GNU General Public License - gnu.org/licenses/gpl.html////Copyright (c) 2016 Jimmy Fitzback */function HexToRGB(i){var s=/^#([\da-fA-F]{2})([\da-fA-F]{2})([\da-fA-F]{2})$/,r=s.exec(i),a="rgb("+parseInt(r[1],16)+","+parseInt(r[2],16)+","+parseInt(r[3],16)+");";return a}!function(i){i.fn.jRoll=function(s){var r=i.extend({radius:100,animation:"heartbeat",colors:["#003056","#04518C","#00A1D9","#47D9BF","#F2D03B"],monocolor:!1},s);switch(r.colors.length){case 0:r.colors=["#003056","#04518C","#00A1D9","#47D9BF","#F2D03B"];break;case 1:r.colors[1]="#04518C",r.colors[2]="#00A1D9";break;case 2:r.colors[2]="#00A1D9",r.colors[3]="#47D9BF",r.colors[4]="#F2D03B";break;case 3:r.colors[3]="#47D9BF",r.colors[4]="#F2D03B";break;case 4:r.colors[4]="#F2D03B"}switch(1==r.monocolor&&(r.colors[1]=r.colors[0],r.colors[2]=r.colors[0],r.colors[3]=r.colors[0],r.colors[4]=r.colors[0]),r.animation){case"heartbeat":i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden");var a="animation: heartbeatIn 1s linear 0s infinite;",e="animation: heartbeatMid 1s linear 0.3s infinite;",t="animation: heartbeatOut 1s linear 0.315s infinite;",d=r.radius/4,l=r.radius/3,n=r.radius/2,c=i('<svg height="'+2*r.radius+'" width="'+2*r.radius+'" id="jRollInRing" style="'+a+'"><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+d+'" stroke="'+r.colors[0]+'" stroke-width="6" fill="'+r.colors[4]+'"></circle></svg>'),o=i('<svg height="'+2*r.radius+'" width="'+2*r.radius+'" id="jRollMidRing" style="'+e+'"><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+l+'" stroke="'+r.colors[1]+'" stroke-width="3" fill="transparent"></circle></svg>'),u=i('<svg height="'+2*r.radius+'" width="'+2*r.radius+'" id="jRollOutRing" style="'+t+'"><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+(r.radius/2-0)+'" stroke="'+r.colors[2]+'" stroke-width="4" fill="transparent"></circle></svg>');i(this).append(c).append(o).append(u);break;case"pulse":i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden");var a="animation: pulseIn 1s linear 0s infinite;",e="animation: pulseMid 1s linear 0s infinite;",t="animation: pulseOut 1s linear 0s infinite;",d=r.radius/4,l=r.radius/3,n=r.radius/2,p=r.radius/12,c=i('<svg height="'+2*r.radius+'" width="'+2*r.radius+'" style="'+a+'"><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+d+'" stroke="'+r.colors[0]+'" stroke-width="'+p+'" fill="#64d4ce"></circle></svg>'),o=i('<svg height="'+2*r.radius+'" width="'+2*r.radius+'" style="'+e+'"><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+l+'" stroke="'+r.colors[1]+'" stroke-width="'+p+'" fill="transparent"></circle></svg>'),u=i('<svg height="'+2*r.radius+'" width="'+2*r.radius+'" style="'+t+'"><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+n+'" stroke="'+r.colors[2]+'" stroke-width="2" fill="transparent"></circle></svg>');i(this).append(c).append(o).append(u);break;case"slicedspinner":i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden"),i(this).css("animation","slicedspinner 1s linear 0s infinite");var h=i('<svg height="'+r.radius+'" width="'+r.radius+'" ><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+(r.radius-2)+'" stroke="'+r.colors[0]+'" stroke-width="2" fill="transparent"></circle></svg>'),g=i('<svg height="'+r.radius+'" width="'+r.radius+'" style="left:'+r.radius+'px; transform: rotate(90deg);" ><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+(r.radius-2)+'" stroke="'+r.colors[1]+'" stroke-width="2" fill="transparent"></circle></svg>'),f=i('<svg height="'+r.radius+'" width="'+r.radius+'" style="left:'+r.radius+"px; top:"+r.radius+'px; transform: rotate(180deg);" ><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+(r.radius-2)+'" stroke="'+r.colors[0]+'" stroke-width="2" fill="transparent"></svg>'),x=i('<svg height="'+r.radius+'" width="'+r.radius+'" style="top:'+r.radius+'px; transform: rotate(270deg);" ><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+(r.radius-2)+'" stroke="'+r.colors[1]+'" stroke-width="2" fill="transparent"></svg>');i(this).append(h).append(g).append(f).append(x);break;case"halfslicedspinner":i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden"),i(this).css("animation","slicedspinner 1s linear 0s infinite");var h=i('<svg height="'+r.radius+'" width="'+r.radius+'" ><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+(r.radius-2)+'" stroke="'+r.colors[0]+'" stroke-width="2" fill="transparent"></circle></svg>'),g=i('<svg height="'+r.radius+'" width="'+r.radius+'" style="left:'+r.radius+"px; top:"+r.radius+'px; transform: rotate(180deg);" ><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+(r.radius-2)+'" stroke="'+r.colors[0]+'" stroke-width="2" fill="transparent"></svg>');i(this).append(h).append(g);break;case"gyroscope":i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden").css("animation","gyroscope3D 2s linear 0s infinite");var a="animation: gyroscopeIn 2s linear 0s infinite;z-index:1;",t="animation: gyroscopeOut 2s linear 0s infinite;z-index:2;",d=r.radius/4,n=r.radius/2,p=r.radius/12,c=i('<svg height="'+2*r.radius+'" width="'+2*r.radius+'" style="'+a+'"><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+(r.radius-4*p-p)+'" stroke="'+r.colors[0]+'" stroke-width="'+p+'" fill="transparent"></circle></svg>'),u=i('<svg height="'+2*r.radius+'" width="'+2*r.radius+'" style="'+t+'"><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+(r.radius-4*p)+'" stroke="'+r.colors[1]+'" stroke-width="'+p+'" fill="transparent"></circle></svg>');i(this).append(c).append(u);break;case"wave":r.colors.length<=3&&(r.colors[3]="#DB9E36"),i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden");var v="animation: waveOut 1.5s linear 0s infinite;",y="animation: waveMid 1.5s linear 0s infinite;",m="animation: waveIn 1.5s linear 0s infinite;",w="animation: waveCenter 1.5s linear 0s infinite;",p=r.radius/12,k=i('<svg height="'+2*r.radius+'" width="'+2*r.radius+'" style="'+v+'"><circle cx="'+r.radius+'" cy="'+2*r.radius+'" r="'+(r.radius-2*p)+'" stroke="'+r.colors[0]+'" stroke-width="'+p+'" fill="transparent"></circle></svg>'),b=i('<svg height="'+2*r.radius+'" width="'+2*r.radius+'" style="'+y+'"><circle cx="'+r.radius+'" cy="'+2*r.radius+'" r="'+(r.radius-4*p)+'" stroke="'+r.colors[1]+'" stroke-width="'+p+'" fill="transparent"></circle></svg>'),q=i('<svg height="'+2*r.radius+'" width="'+2*r.radius+'" style="'+m+'"><circle cx="'+r.radius+'" cy="'+2*r.radius+'" r="'+(r.radius-6*p)+'" stroke="'+r.colors[2]+'" stroke-width="'+p+'" fill="transparent"></circle></svg>'),R=i('<svg height="'+2*r.radius+'" width="'+2*r.radius+'" style="'+w+'"><circle cx="'+r.radius+'" cy="'+2*r.radius+'" r="'+(r.radius-8*p)+'" stroke="'+r.colors[3]+'" stroke-width="'+p+'" fill="'+r.colors[0]+'"></circle></svg>');i(this).append(k).append(b).append(q).append(R);break;case"jumpdots":r.colors.length<=3&&(r.colors[3]="#DB9E36",r.colors[4]="#BD4932"),i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden").css("animation","jumpdotdiv 2s linear 1s infinite");var D="animation: jumpdots 2s linear 0s infinite;margin-left:calc(50% - "+r.radius/12*8+"px);margin-top:"+r.radius+"px;",j="animation: jumpdots 2s linear 0.2s infinite;margin-left:calc(50% - "+r.radius/12*4+"px);margin-top:"+r.radius+"px;",B="animation: jumpdots 2s linear 0.4s infinite;margin-left:calc(50%);margin-top:"+r.radius+"px;",F="animation: jumpdots 2s linear 0.6s infinite;margin-left:calc(50% - "+r.radius/12*-4+"px);margin-top:"+r.radius+"px;",z="animation: jumpdots 2s linear 0.8s infinite;margin-left:calc(50% - "+r.radius/12*-8+"px);margin-top:"+r.radius+"px;",G=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+D+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[0]+'"></circle></svg>'),I=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+j+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[1]+'"></circle></svg>'),Z=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+B+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[2]+'"></circle></svg>'),A=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+F+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[3]+'"></circle></svg>'),O=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+z+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[4]+'"></circle></svg>');i(this).append(G).append(I).append(Z).append(A).append(O);break;case"3dots":i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden");var D="animation: suspensionpoint 3s linear -2s infinite;margin-left:calc(50% - "+r.radius/4/2*4+"px);margin-top: calc(50% - "+r.radius/4/2+"px);",j="animation: suspensionpoint 3s linear -1s infinite;margin-left:calc(50% - "+r.radius/4/2*4+"px);margin-top: calc(50% - "+r.radius/4/2+"px);",B="animation: suspensionpoint 3s linear 0s infinite;margin-left:calc(50% - "+r.radius/4/2*4+"px);margin-top: calc(50% - "+r.radius/4/2+"px);",G=i('<svg height="'+r.radius/4+'" width="'+r.radius/4+'" style="'+D+'"><circle style="transform-origin: '+r.radius/8+"px "+r.radius/8+'px; animation: suspensionpointcircle 3s linear -2s infinite" cx="50%" cy="50%" r="'+r.radius/8+'" fill="rgba(0,0,0,0)" stroke="'+r.colors[3]+'"></circle></svg>'),I=i('<svg height="'+r.radius/4+'" width="'+r.radius/4+'" style="'+j+'"><circle style="transform-origin: '+r.radius/8+"px "+r.radius/8+'px; animation: suspensionpointcircle 3s linear -1s infinite" cx="50%" cy="50%" r="'+r.radius/8+'" fill="rgba(0,0,0,0)" stroke="'+r.colors[2]+'"></circle></svg>'),Z=i('<svg height="'+r.radius/4+'" width="'+r.radius/4+'" style="'+B+'"><circle style="transform-origin: '+r.radius/8+"px "+r.radius/8+'px; animation: suspensionpointcircle 3s linear 0s infinite" cx="50%" cy="50%" r="'+r.radius/8+'" fill="rgba(0,0,0,0)" stroke="'+r.colors[1]+'"></circle></svg>');i(this).append(G).append(I).append(Z);break;case"popdot":i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden");var G=i('<svg height="'+2*r.radius+'" width="'+2*r.radius+'"><circle style="transform-origin: '+r.radius+"px "+r.radius+'px; animation: popdot 1.5s linear 0s infinite" cx="50%" cy="50%" r="'+r.radius/2+'" fill="rgba(0,0,0,0)" stroke="'+r.colors[0]+'"></circle></svg>');i(this).append(G);break;case"hordots":i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden");var D="animation: spreaddot1-hor 1s linear 0s infinite;margin-left:"+r.radius+"px;margin-top:"+r.radius+"px;",j="animation: spreaddot2-hor 1s linear 0.5s infinite;margin-left:"+r.radius+"px;margin-top:"+r.radius+"px;",B="animation: spreaddot3-hor 1s linear 0s infinite;margin-left:"+r.radius+"px;margin-top:"+r.radius+"px;z-index:100",F="animation: spreaddot4-hor 1s linear 0.5s infinite;margin-left:"+r.radius+"px;margin-top:"+r.radius+"px;",z="animation: spreaddot5-hor 1s linear 0s infinite;margin-left:"+r.radius+"px;margin-top:"+r.radius+"px;",G=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+D+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[0]+'"></circle></svg>'),I=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+j+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[1]+'"></circle></svg>'),Z=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+B+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[2]+'"></circle></svg>'),A=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+F+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[3]+'"></circle></svg>'),O=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+z+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[4]+'"></circle></svg>');i(this).append(G).append(I).append(Z).append(A).append(O);break;case"verdots":i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden");var D="animation: spreaddot1-ver 1s linear 0s infinite;margin-left:calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;",j="animation: spreaddot2-ver 1s linear 0.5s infinite;margin-left:calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;",B="animation: spreaddot3-ver 1s linear 0s infinite;margin-left:calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;z-index:100",F="animation: spreaddot4-ver 1s linear 0.5s infinite;margin-left:calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;",z="animation: spreaddot5-ver 1s linear 0s infinite;margin-left:calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;",G=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+D+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[0]+'"></circle></svg>'),I=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+j+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[1]+'"></circle></svg>'),Z=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+B+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[2]+'"></circle></svg>'),A=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+F+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[3]+'"></circle></svg>'),O=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+z+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[4]+'"></circle></svg>');i(this).append(G).append(I).append(Z).append(A).append(O);break;case"spreaddots":i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden");var D="animation: spreaddot1-all 1s linear 0s infinite;margin-left: calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;",j="animation: spreaddot2-all 1s linear 0s infinite;margin-left: calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;",B="animation: spreaddot3-all 1s linear 0s infinite;margin-left: calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;z-index:100",F="animation: spreaddot4-all 1s linear 0s infinite;margin-left: calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;",z="animation: spreaddot5-all 1s linear 0s infinite;margin-left: calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;",G=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+D+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[0]+'"></circle></svg>'),I=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+j+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[1]+'"></circle></svg>'),Z=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+B+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[2]+'"></circle></svg>'),A=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+F+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[3]+'"></circle></svg>'),O=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+z+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[4]+'"></circle></svg>');i(this).append(G).append(I).append(Z).append(A).append(O);break;case"trailedspreaddots":var X=HexToRGB(r.colors[0]),S=HexToRGB(r.colors[1]),C=HexToRGB(r.colors[4]),H=HexToRGB(r.colors[3]);console.log(X),i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden");var D="animation: spreaddot1-all 1s linear 0s infinite;margin-left: calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;",M="animation: trailedspreadrect1-all 1s linear 0s infinite;margin-left: calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;transform: rotateZ(45deg);z-index:-100;",j="animation: spreaddot2-all 1s linear 0s infinite;margin-left: calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;",T="animation: trailedspreadrect2-all 1s linear 0s infinite;margin-left: calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;transform: rotateZ(45deg);z-index:-100;",B="animation: dspreaddot3-all 1s linear 0s infinite;margin-left: calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;z-index:100",F="animation: spreaddot4-all 1s linear 0s infinite;margin-left: calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;",E="animation: trailedspreadrect4-all 1s linear 0s infinite;margin-left: calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;transform: rotateZ(45deg);z-index:-100;",z="animation: spreaddot5-all 1s linear 0s infinite;margin-left: calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;",Q="animation: trailedspreadrect5-all 1s linear 0s infinite;margin-left: calc(50% - "+r.radius/12+"px);margin-top:"+r.radius+"px;transform: rotateZ(45deg);z-index:-100;",G=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+D+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[0]+'"></circle></svg>'),$=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+M+'"><defs><linearGradient id="grad1" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" style="stop-color:'+X+';stop-opacity:1" /><stop offset="100%" style="stop-color:rgb(255,255,255);stop-opacity:0" /></linearGradient></defs><rect x="0" y="0" width="'+(r.radius/6+1)/2+'" height="'+(r.radius/6+1)+'" fill="url(#grad1)" /></svg>'),I=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+j+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[1]+'"></circle></svg>'),J=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+T+'"><defs><linearGradient id="grad2" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" style="stop-color:'+S+';stop-opacity:1" /><stop offset="100%" style="stop-color:rgb(255,255,255);stop-opacity:0" /></linearGradient></defs><rect x="0" y="0" width="'+(r.radius/6+1)/2+'" height="'+(r.radius/6+1)+'" fill="url(#grad2)" /></svg>'),Z=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+B+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[2]+'"></circle></svg>'),A=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+F+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[3]+'"></circle></svg>'),K=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+E+'"><defs><linearGradient id="grad3" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" style="stop-color:'+C+';stop-opacity:1" /><stop offset="100%" style="stop-color:rgb(255,255,255);stop-opacity:0" /></linearGradient></defs><rect x="0" y="0" width="'+(r.radius/6+1)/2+'" height="'+(r.radius/6+1)+'" fill="url(#grad3)" /></svg>'),O=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+z+'"><circle cx="50%" cy="50%" r="'+r.radius/12+'" fill="'+r.colors[4]+'"></circle></svg>'),L=i('<svg height="'+(r.radius/6+1)+'" width="'+(r.radius/6+1)+'" style="'+Q+'"><defs><linearGradient id="grad4" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" style="stop-color:'+H+';stop-opacity:1" /><stop offset="100%" style="stop-color:rgb(255,255,255);stop-opacity:0" /></linearGradient></defs><rect x="0" y="0" width="'+(r.radius/6+1)/2+'" height="'+(r.radius/6+1)+'" fill="url(#grad4)" /></svg>');i(this).append(G).append($).append(I).append(J).append(Z).append(A).append(K).append(O).append(L);break;case"circledots":i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden").css("animation","circledotdiv 3s linear 0s infinite");var D="animation: circledot1 1.5s linear 0s infinite;margin-left:"+(r.radius-r.radius/16)+"px;margin-top:"+(r.radius-r.radius/16)+"px;",j="animation: circledot2 1.5s linear 0s infinite;margin-left:"+(r.radius-r.radius/16)+"px;margin-top:"+(r.radius-r.radius/16)+"px;",B="animation: circledot3 1.5s linear 0s infinite;margin-left:"+(r.radius-r.radius/16)+"px;margin-top:"+(r.radius-r.radius/16)+"px;z-index:100",F="animation: circledot4 1.5s linear 0s infinite;margin-left:"+(r.radius-r.radius/16)+"px;margin-top:"+(r.radius-r.radius/16)+"px;",z="animation: circledot5 1.5s linear 0s infinite;margin-left:"+(r.radius-r.radius/16)+"px;margin-top:"+(r.radius-r.radius/16)+"px;",N="animation: circledot6 1.5s linear 0s infinite;margin-left:"+(r.radius-r.radius/16)+"px;margin-top:"+(r.radius-r.radius/16)+"px;",P="animation: circledot7 1.5s linear 0s infinite;margin-left:"+(r.radius-r.radius/16)+"px;margin-top:"+(r.radius-r.radius/16)+"px;",U="animation: circledot8 1.5s linear 0s infinite;margin-left:"+(r.radius-r.radius/16)+"px;margin-top:"+(r.radius-r.radius/16)+"px;",G=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+D+'"><circle cx="50%" cy="50%" r="'+r.radius/16+'" fill="'+r.colors[0]+'"></circle></svg>'),I=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+j+'"><circle cx="50%" cy="50%" r="'+r.radius/16+'" fill="'+r.colors[1]+'"></circle></svg>'),Z=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+B+'"><circle cx="50%" cy="50%" r="'+r.radius/16+'" fill="'+r.colors[2]+'"></circle></svg>'),A=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+F+'"><circle cx="50%" cy="50%" r="'+r.radius/16+'" fill="'+r.colors[3]+'"></circle></svg>'),O=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+z+'"><circle cx="50%" cy="50%" r="'+r.radius/16+'" fill="'+r.colors[0]+'"></circle></svg>'),V=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+N+'"><circle cx="50%" cy="50%" r="'+r.radius/16+'" fill="'+r.colors[1]+'"></circle></svg>'),W=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+P+'"><circle cx="50%" cy="50%" r="'+r.radius/16+'" fill="'+r.colors[2]+'"></circle></svg>'),Y=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+U+'"><circle cx="50%" cy="50%" r="'+r.radius/16+'" fill="'+r.colors[3]+'"></circle></svg>');i(this).append(G).append(I).append(Z).append(A).append(O).append(V).append(W).append(Y);break;case"squares":i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden");var D="animation: squares 4.5s linear 0s infinite;margin-left:"+(r.radius-r.radius/16*4)+"px;margin-top:"+(r.radius-r.radius/16*4)+"px;",j="animation: squares 4.5s linear 0.5s infinite;margin-left:"+(r.radius-r.radius/16)+"px;margin-top:"+(r.radius-r.radius/16*4)+"px;",B="animation: squares 4.5s linear 1s infinite;margin-left:"+(r.radius-r.radius/16*-2)+"px;margin-top:"+(r.radius-r.radius/16*4)+"px;z-index:100",F="animation: squares 4.5s linear 1.5s infinite;margin-left:"+(r.radius-r.radius/16*4)+"px;margin-top:"+(r.radius-r.radius/16)+"px;",_="animation: squares 4.5s linear 2s infinite;margin-left:"+(r.radius-r.radius/16)+"px;margin-top:"+(r.radius-r.radius/16)+"px;",N="animation: squares 4.5s linear 2.5s infinite;margin-left:"+(r.radius-r.radius/16*-2)+"px;margin-top:"+(r.radius-r.radius/16)+"px;",P="animation: squares 4.5s linear 3s infinite;margin-left:"+(r.radius-r.radius/16*4)+"px;margin-top:"+(r.radius-r.radius/16*-2)+"px;",U="animation: squares 4.5s linear 3.5s infinite;margin-left:"+(r.radius-r.radius/16)+"px;margin-top:"+(r.radius-r.radius/16*-2)+"px;",ii="animation: squares 4.5s linear 4s infinite;margin-left:"+(r.radius-r.radius/16*-2)+"px;margin-top:"+(r.radius-r.radius/16*-2)+"px;",G=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+D+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[0]+';" /></svg>'),I=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+j+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[1]+';" /></svg>'),Z=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+B+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[0]+';" /></svg>'),A=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+F+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[2]+';" /></svg>'),si=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+_+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[3]+';" /></svg>'),V=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+N+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[2]+';" /></svg>'),W=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+P+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[0]+';" /></svg>'),Y=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+U+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[1]+';" /></svg>'),ri=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+ii+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[0]+';" /></svg>');i(this).append(G).append(I).append(Z).append(A).append(si).append(V).append(W).append(Y).append(ri);break;case"3Dsquares":i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden").css("animation","threedsqdiv 1s linear 0s infinite");var D="margin-left:"+(r.radius-r.radius/16*4)+"px;margin-top:"+(r.radius-r.radius/16*4)+"px;",j="margin-left:"+(r.radius-r.radius/16)+"px;margin-top:"+(r.radius-r.radius/16*4)+"px;",B="margin-left:"+(r.radius-r.radius/16*-2)+"px;margin-top:"+(r.radius-r.radius/16*4)+"px;z-index:100",F="margin-left:"+(r.radius-r.radius/16*4)+"px;margin-top:"+(r.radius-r.radius/16)+"px;",_="margin-left:"+(r.radius-r.radius/16)+"px;margin-top:"+(r.radius-r.radius/16)+"px;",N="margin-left:"+(r.radius-r.radius/16*-2)+"px;margin-top:"+(r.radius-r.radius/16)+"px;",P="margin-left:"+(r.radius-r.radius/16*4)+"px;margin-top:"+(r.radius-r.radius/16*-2)+"px;",U="margin-left:"+(r.radius-r.radius/16)+"px;margin-top:"+(r.radius-r.radius/16*-2)+"px;",ii="margin-left:"+(r.radius-r.radius/16*-2)+"px;margin-top:"+(r.radius-r.radius/16*-2)+"px;",ai=i("<div>",{id:"jRoll3DSquareFace1"}),ei=i("<div>",{id:"jRoll3DSquareFace2"});i(this).append(ai).append(ei),i("#jRoll3DSquareFace1").css("animation","threedsqf1 1s linear 0s infinite").css("transform","perspective(200px)").css("transform-origin","50% 50% 0px"),i("#jRoll3DSquareFace2").css("animation","threedsqf2 1s linear 0s infinite").css("transform","perspective(200px)").css("transform-origin","50% "+(r.radius+r.radius/8*2)+"px 0px");var G=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+D+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[0]+';" /></svg>'),I=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+j+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[1]+';" /></svg>'),Z=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+B+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[0]+';" /></svg>'),A=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+F+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[2]+';" /></svg>'),si=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+_+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[3]+';" /></svg>'),V=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+N+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[2]+';" /></svg>'),W=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+P+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[0]+';" /></svg>'),Y=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+U+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[1]+';" /></svg>'),ri=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+ii+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[0]+';" /></svg>'),ti=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+D+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[0]+';" /></svg>'),di=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+j+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[1]+';" /></svg>'),li=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+B+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[0]+';" /></svg>'),ni=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+F+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[2]+';" /></svg>'),ci=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+_+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[3]+';" /></svg>'),oi=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+N+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[2]+';" /></svg>'),ui=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+P+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[0]+';" /></svg>'),pi=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+U+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[1]+';" /></svg>'),hi=i('<svg height="'+r.radius/8+'" width="'+r.radius/8+'" style="'+ii+'"><rect width="'+r.radius/8+'" height="'+r.radius/8+'" style="fill:'+r.colors[0]+';" /></svg>');i("#jRoll3DSquareFace1").append(G).append(I).append(Z).append(A).append(si).append(V).append(W).append(Y).append(ri),i("#jRoll3DSquareFace2").append(ti).append(di).append(li).append(ni).append(ci).append(oi).append(ui).append(pi).append(hi);break;case"stackedsquares":i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden");var gi="animation: stackedsquare 1.5s linear 0s infinite;transform: perspective(500px)rotateX(90deg)rotateZ(-45deg)translateZ(0px);position:absolute;opacity:0;left:25%;",fi="animation: stackedsquare 1.5s linear 0.5s infinite;transform: perspective(500px)rotateX(90deg)rotateZ(-45deg)translateZ(-50px);position:absolute;opacity:0;left:25%;",xi="animation: stackedsquare 1.5s linear 1s infinite;transform: perspective(500px)rotateX(90deg)rotateZ(-45deg)translateZ(-100px);position:absolute;opacity:0;left:25%;",vi=i('<svg height="'+r.radius+'" width="'+r.radius+'" style="'+gi+'"><rect width="'+r.radius+'" height="'+r.radius+'" style="fill:'+r.colors[2]+';" /></svg>'),yi=i('<svg height="'+r.radius+'" width="'+r.radius+'" style="'+fi+'"><rect width="'+r.radius+'" height="'+r.radius+'" style="fill:'+r.colors[1]+';" /></svg>'),mi=i('<svg height="'+r.radius+'" width="'+r.radius+'" style="'+xi+'"><rect width="'+r.radius+'" height="'+r.radius+'" style="fill:'+r.colors[0]+';" /></svg>');i(this).append(vi).append(yi).append(mi);break;case"waterdrop":i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden");var wi="animation: waterdropdrop 1.5s linear 0s infinite;",ki="transform:perspective(500px)rotateX(50deg)scale(1,1);animation: waterdropwave 3s linear 0s infinite;",bi="transform:perspective(500px)rotateX(50deg)scale(1,1);animation: waterdropwaveIn 3s linear 0s infinite;",qi="transform:perspective(500px)rotateX(50deg)scale(1,1);opacity:0;animation: waterdropwave 3s linear 1.5s infinite;",Ri="transform:perspective(500px)rotateX(50deg)scale(1,1);opacity:0;animation: waterdropwaveIn 3s linear 1.5s infinite;",Di=i('<svg height="'+r.radius/4+'" width="'+2*r.radius+'" viewBox="518.234 280.146 200 200" style="'+wi+'"><path fill="'+r.colors[0]+'" stroke="'+r.colors[3]+'" stroke-width="10" stroke-miterlimit="10" d="M618.235,468.333c-37.982,0-45.104-29.489-45.104-29.489c-10.739-48.237,45.29-145.826,45.29-145.826s54.219,93.03,45.29,145.826C663.712,438.844,656.217,468.333,618.235,468.333z"/></svg>'),u=i('<svg height="'+2*r.radius+'" width="'+2*r.radius+'" id="jRollOutRing" style="'+ki+'"><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+(r.radius/2-0)+'" stroke="'+r.colors[2]+'" stroke-width="2" fill="transparent"></circle></svg>'),ji=i('<svg height="'+2*r.radius+'" width="'+2*r.radius+'" id="jRollInRing" style="'+bi+'"><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+(r.radius/4-0)+'" stroke="'+r.colors[2]+'" stroke-width="1" fill="transparent"></circle></svg>'),Bi=i('<svg height="'+2*r.radius+'" width="'+2*r.radius+'" id="jRollOutRing" style="'+qi+'"><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+(r.radius/2-0)+'" stroke="'+r.colors[2]+'" stroke-width="2" fill="transparent"></circle></svg>'),Fi=i('<svg height="'+2*r.radius+'" width="'+2*r.radius+'" id="jRollInRing" style="'+Ri+'"><circle cx="'+r.radius+'" cy="'+r.radius+'" r="'+(r.radius/4-0)+'" stroke="'+r.colors[2]+'" stroke-width="1" fill="transparent"></circle></svg>');i(this).append(Di).append(u).append(ji).append(Bi).append(Fi);break;case"eq":i(this).css("width",2*r.radius+"px").css("height",2*r.radius+"px").css("overflow","hidden");var zi="animation: eq 2s linear -1s infinite;margin-left:calc(50% - "+r.radius/12*2.5+"px);top:calc(50% - "+r.radius/4+"px );",Gi="animation: eq 2s linear 0s infinite;margin-left:calc(50% - "+r.radius/12*1.25+"px);top:calc(50% - "+r.radius/4+"px );",Ii="animation: eq 2s linear -0.8s infinite;margin-left:50%;top:calc(50% - "+r.radius/4+"px );",Zi="animation: eq 2s linear -1.2s infinite;margin-left:calc(50% + "+r.radius/12*1.25+"px);top:calc(50% - "+r.radius/4+"px );",Ai="animation: eq 2s linear -0.4s infinite;margin-left:calc(50% + "+r.radius/12*2.5+"px);top:calc(50% - "+r.radius/4+"px );",Oi=i('<svg height="'+r.radius/2+'" width="'+2*r.radius+'" style="'+zi+'"><rect x="0" y="0" rx="4" ry="4" width="'+r.radius/12+'" height="'+r.radius/2+'" style="fill:'+r.colors[3]+';opacity:0.5" /></svg>'),Xi=i('<svg height="'+r.radius/2+'" width="'+2*r.radius+'" style="'+Gi+'"><rect x="0" y="0" rx="4" ry="4" width="'+r.radius/12+'" height="'+r.radius/2+'" style="fill:'+r.colors[1]+';opacity:0.5" /></svg>'),Si=i('<svg height="'+r.radius/2+'" width="'+2*r.radius+'" style="'+Ii+'"><rect x="0" y="0" rx="4" ry="4" width="'+r.radius/12+'" height="'+r.radius/2+'" style="fill:'+r.colors[0]+';opacity:0.5" /></svg>'),Ci=i('<svg height="'+r.radius/2+'" width="'+2*r.radius+'" style="'+Zi+'"><rect x="0" y="0" rx="4" ry="4" width="'+r.radius/12+'" height="'+r.radius/2+'" style="fill:'+r.colors[2]+';opacity:0.5" /></svg>'),Hi=i('<svg height="'+r.radius/2+'" width="'+2*r.radius+'" style="'+Ai+'"><rect x="0" y="0" rx="4" ry="4" width="'+r.radius/12+'" height="'+r.radius/2+'" style="fill:'+r.colors[4]+';opacity:0.5" /></svg>');i(this).append(Oi).append(Xi).append(Si).append(Ci).append(Hi)}}}(jQuery);
|