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 line
34 KiB
1 line
34 KiB
8 years ago
|
/*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"></s
|