whisper.cat/weboasis/weather/js/skycons.min.js

1 line
7.8 KiB
JavaScript
Raw Normal View History

2023-10-05 23:28:32 +11:00
!function(t){"use strict";var n,i,e,a;e=t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame,a=t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||t.msCancelAnimationFrame,e&&a?(n=function(n){var i={value:null};return function t(){i.value=e(t),n()}(),i},i=function(t){a(t.value)}):(n=setInterval,i=clearInterval);var d=.08,I=2*Math.PI,u=2/Math.sqrt(2);function b(t,n,i,e,a){t.beginPath(),t.moveTo(n,i),t.lineTo(e,a),t.stroke()}function h(t,n,i,e,a,o,r,l){var s,h,c,u,v=Math.cos(n*I),f=Math.sin(n*I);h=i-f*a,c=e+v*o+.5*(l-=r),u=r+(1-.5*v)*l,(s=t).beginPath(),s.arc(h,c,u,0,I,!1),s.fill()}function m(t,n,i,e,a,o,r,l){var s;for(s=5;s--;)h(t,n+s/5,i,e,a,o,r,l)}function r(t,n,i,e,a,o,r){n/=3e4;var l=.21*a,s=.12*a,h=.24*a,c=.28*a;t.fillStyle=r,m(t,n,i,e,l,s,h,c),t.globalCompositeOperation="destination-out",m(t,n,i,e,l,s,h-o,c-o),t.globalCompositeOperation="source-over"}function l(t,n,i,e,a,o,r){n/=12e4;var l,s,h,c,u=.25*a-.5*o,v=.32*a+.5*o,f=.5*a-.5*o;for(t.strokeStyle=r,t.lineWidth=o,t.lineCap="round",t.lineJoin="round",t.beginPath(),t.arc(i,e,u,0,I,!1),t.stroke(),l=8;l--;)s=(n+l/8)*I,b(t,i+(h=Math.cos(s))*v,e+(c=Math.sin(s))*v,i+h*f,e+c*f)}function s(t,n,i,e,a,o,r){n/=15e3;var l=.29*a-.5*o,s=.05*a,h=Math.cos(n*I),c=h*I/-16;t.strokeStyle=r,t.lineWidth=o,t.lineCap="round",t.lineJoin="round",i+=h*s,t.beginPath(),t.arc(i,e,l,c+I/8,c+7*I/8,!1),t.arc(i+Math.cos(c)*l*u,e+Math.sin(c)*l*u,l,c+5*I/8,c+3*I/8,!0),t.closePath(),t.stroke()}var O=[[-.75,-.18,-.7219,-.1527,-.6971,-.1225,-.6739,-.091,-.6516,-.0588,-.6298,-.0262,-.6083,.0065,-.5868,.0396,-.5643,.0731,-.5372,.1041,-.5033,.1259,-.4662,.1406,-.4275,.1493,-.3881,.153,-.3487,.1526,-.3095,.1488,-.2708,.1421,-.2319,.1342,-.1943,.1217,-.16,.1025,-.129,.0785,-.1012,.0509,-.0764,.0206,-.0547,-.012,-.0378,-.0472,-.0324,-.0857,-.0389,-.1241,-.0546,-.1599,-.0814,-.1876,-.1193,-.1964,-.1582,-.1935,-.1931,-.1769,-.2157,-.1453,-.229,-.1085,-.2327,-.0697,-.224,-.0317,-.2064,.0033,-.1853,.0362,-.1613,.0672,-.135,.0961,-.1051,.1213,-.0706,.1397,-.0332,.1512,.0053,.158,.0442,.1624,.0833,.1636,.1224,.1615,.1613,.1565,.1999,.15,.2378,.1402,.2749,.1279,.3118,.1147,.3487,.1015,.3858,.0892,.4236,.0787,.4621,.0715,.5012,.0702,.5398,.0766,.5768,.089,.6123,.1055,.6466,.1244,.6805,.144,.7147,.163,.75,.18],[-.75,0,-.7033,.0195,-.6569,.0399,-.6104,.06,-.5634,.0789,-.5155,.0954,-.4667,.1089,-.4174,.1206,-.3676,.1299,-.3174,.1365,-.2669,.1398,-.2162,.1391,-.1658,.1347,-.1157,.1271,-.0661,.1169,-.017,.1046,.0316,.0903,.0791,.0728,.1259,.0534,.1723,.0331,.2188,.0129,.2656,-.0064,.3122,-.0263,.3586,-.0466,.4052,-.0665,.4525,-.0847,.5007,-.1002,.5497,-.113,.5991,-.124,.6491,-.1325,.6994,-.138,.75,-.14]],D=[{start:.36,end:.11},{start:.56,end:.16}];function c(t,n,i,e,a,o,r,l,s){var h,c,u,v,f,d,m,g,M,p,C,w,y,b,k,A,P=O[r],T=((n/=2500)+r-D[r].start)%l,F=(n+r-D[r].end)%l,S=(n+r)%l;if(t.strokeStyle=s,t.lineWidth=o,t.lineCap="round",t.lineJoin="round",T<1){if(t.beginPath(),T*=P.length/2-1,T-=h=Math.floor(T),h*=2,h+=2,t.moveTo(i+(P[h-2]*(1-T)+P[h]*T)*a,e+(P[h-1]*(1-T)+P[h+1]*T)*a),F<1){for(F*=P.length/2-1,F-=c=Math.floor(F),c*=2,c+=2,v=h;v!==c;v+=2)t.lineTo(i+P[v]*a,e+P[v+1]*a);t.lineTo(i+(P[c-2]*(1-F)+P[c]*F)*a,e+(P[c-1]*(1-F)+P[c+1]*F)*a)}else for(v=h;v!==P.length;v+=2)t.lineTo(i+P[v]*a,e+P[v+1]*a);t.stroke()}else if(F<1){for(t.beginPath(),F*=P.length/2-1,F-=c=Math.floor(F),c*=2,c+=2,t.moveTo(i+P[0]*a,e+P[1]*a),v=2;v!==c;v+=2)t.lineTo(i+P[v]*a,e+P[v+1]*a);t.lineTo(i+(P[c-2]*(1-F)+P[c]*F)*a,e+(P[c-1]*(1-F)+P[c+1]*F)*a),t.stroke()}S<1&&(S*=P.length/2-1,S-=u=Math.floor(S),u*=2,f=t,d=n,m=i+(P[(u+=2)-2]*(1-S)+P[u]*S)*a,g=e+(P[u-1]*(1-S)+P[u+1]*S)*a,M=o,p=s,y=2*(w=(C=a/8)/3),b=d%1*I,k=Math.cos(b),A=Math.sin(b),f.fillStyle=p,f.strokeStyle=p,f.lineWidth=M,f.lineCap="round",f.lineJoin="round",f.beginPath(),f.arc(m,g,C,b,b+Math.PI,!1),f.arc(m-w*k,g-w*A,y,b+Math.PI,b,!1),f.arc(m+y*k,g+y*A,w,b+Math.PI,b,!0),f.globalCompositeOperation="destination-out",f.fill(),f.globalCompositeOperation="source-over",f.