This repository has been archived on 2020-05-03. You can view files and clone it, but cannot push or open issues or pull requests.
logodemo/dist-archive/logodemo.min.htm
2014-03-12 05:53:32 +00:00

13 lines
5.3 KiB
HTML

<!DOCTYPE html>
<html><head><style type="text/css">html,body{margin:0;padding:0;border:0;overflow:hidden;background:#333;}#c{width:100%;height:100%;border:0;margin:0;padding:0;}</style></head><body><canvas id="c"><script type="text/javascript">window.addEventListener("load",function(){function y(){t++;var c=300,c=t%c/c;v=p/2*Math.sin(c*Math.PI*2)+p/2;c=240;c=t%c/c;w=q/2*Math.cos(c*Math.PI*2)+q/2;c=600;c=t%c/c;s=0.75*Math.sin(c*Math.PI*2)+1;z();m.clearRect(0,0,p,q);m.beginPath();m.rect(0,0,p,q);m.fillStyle="#333";m.fill();c=e.k([v,w],A);m.beginPath();m.moveTo(c[0][0],c[0][1]);for(var d=1;d<c.length;++d)m.lineTo(c[d][0],c[d][1]);m.fillStyle="#888888";m.fill();m.beginPath();m.arc(v,w,5,0,2*Math.PI,!0);m.fillStyle="#999";m.fill();B(y)}function C(){p=
window.innerWidth;q=window.innerHeight;x.width=p;x.height=q;z()}function z(){u=[[[-1,-1],[p+1,-1],[p+1,q+1],[-1,q+1]]];for(var c=[[[93,250],[104,235],[122,224],[141,218],[166,218],[243,239],[279,244],[308,242],[327,239],[308,177],[280,128],[251,103],[223,90],[202,85],[177,66],[163,58],[153,56],[144,59],[121,77],[107,86],[91,89],[108,74],[139,50],[154,46],[172,50],[208,75],[228,81],[248,91],[263,100],[282,117],[291,127],[307,154],[319,176],[329,208],[338,241],[336,248],[313,252],[283,255],[242,251],
[167,229],[143,229],[125,233],[107,245],[93,250]],[[172,282],[188,270],[198,258],[201,247],[202,234],[190,230],[191,246],[187,257],[173,271],[164,259],[157,241],[155,224],[144,224],[145,238],[154,262],[164,277],[172,282],[172,282]]],d=(p-400*s)/2,k=(q-350*s)/2,f=0;f<c.length;++f){u[f+1]=[];for(var h=0,g=c[f].length;h!==g;++h)u[f+1].push([c[f][h][0]*s+d,c[f][h][1]*s+k])}A=e.l(u)}function e(){}var B=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||
window.msRequestAnimationFrame||function(c){window.setTimeout(c,1E3/60)}}();e.k=function(c,d){for(var k=[],f=e.n(c,d),h=Array(d.length),g=0;g<h.length;++g)h[g]=-1;for(var l=[],n=[c[0]+1,c[1]],g=0;g<d.length;++g){var r=e.d(d[g][0],c),m=e.d(d[g][1],c),p=!1;-180<r&&0>=r&&180>=m&&0<=m&&180<m-r&&(p=!0);-180<m&&0>=m&&180>=r&&0<=r&&180<r-m&&(p=!0);p&&e.i(g,l,c,d,n,h)}for(g=0;g<f.length;){var m=r=!1,p=g,n=d[f[g][0]][f[g][1]],q=l[0];do if(-1!=h[f[g][0]]?(f[g][0]==q&&(r=!0,n=d[f[g][0]][f[g][1]]),e.remove(h[f[g][0]],
l,c,d,n,h)):(e.i(f[g][0],l,c,d,n,h),l[0]!=q&&(m=!0)),++g,g==f.length)break;while(f[g][2]<f[p][2]+1E-7);r?(k.push(n),r=e.b(d[l[0]][0],d[l[0]][1],c,n),e.a(r,n)||k.push(r)):m&&(k.push(e.b(d[q][0],d[q][1],c,n)),k.push(e.b(d[l[0]][0],d[l[0]][1],c,n)))}return k};e.p=function(c,d){for(var k=0,f=0;f<d.length;++f)k=Math.min(d[f][0],k),k=Math.min(d[f][1],k);for(var k=[k-1,k-1],h=0,f=0;f<d.length;++f){var g=f+1;g==d.length&&(g=0);if(e.m(k[0],k[1],c[0],c[1],d[f][0],d[f][1],d[g][0],d[g][1])){var l=e.b(k,c,d[f],
d[g]);if(e.a(c,l))return!0;e.a(l,d[f])?180>e.e(c,k,d[g])&&++h:e.a(l,d[g])?180>e.e(c,k,d[f])&&++h:++h}}return 0!=h%2};e.l=function(c){for(var d=[],k=0;k<c.length;++k)for(var f=0;f<c[k].length;++f){var e=f+1;e==c[k].length&&(e=0);d.push([c[k][f],c[k][e]])}return d};e.o=function(){return 1E-7};e.a=function(c,d){return 1E-7>Math.abs(c[0]-d[0])&&1E-7>Math.abs(c[1]-d[1])?!0:!1};e.remove=function(c,d,k,f,h,g){g[d[c]]=-1;if(c==d.length-1)d.pop();else{d[c]=d.pop();g[d[c]]=c;var l=e.parent(c);if(0!=c&&e.c(d[c],
d[l],k,f,h))for(;0<c;){l=e.parent(c);if(!e.c(d[c],d[l],k,f,h))break;g[d[l]]=c;g[d[c]]=l;var n=d[c];d[c]=d[l];d[l]=n;c=l}else for(;;){var l=e.j(c),m=l+1;if(l<d.length&&e.c(d[l],d[c],k,f,h)&&(m==d.length||e.c(d[l],d[m],k,f,h)))g[d[l]]=c,g[d[c]]=l,n=d[l],d[l]=d[c],d[c]=n,c=l;else if(m<d.length&&e.c(d[m],d[c],k,f,h))g[d[m]]=c,g[d[c]]=m,n=d[m],d[m]=d[c],d[c]=n,c=m;else break}}};e.i=function(c,d,k,f,h,g){if(0!=e.b(f[c][0],f[c][1],k,h).length){var l=d.length;d.push(c);for(g[c]=l;0<l;){c=e.parent(l);if(!e.c(d[l],
d[c],k,f,h))break;g[d[c]]=l;g[d[l]]=c;var m=d[l];d[l]=d[c];d[c]=m;l=c}}};e.c=function(c,d,k,f,h){var g=e.b(f[c][0],f[c][1],k,h);h=e.b(f[d][0],f[d][1],k,h);if(!e.a(g,h))return e.h(g,k)<e.h(h,k);var l=0;e.a(g,f[c][0])&&(l=1);var m=0;e.a(h,f[d][0])&&(m=1);c=e.e(f[c][l],g,k);d=e.e(f[d][m],h,k);return 180>c?180<d?!0:d<c:c<d};e.parent=function(c){return Math.floor((c-1)/2)};e.j=function(c){return 2*c+1};e.e=function(c,d,k){c=e.d(c,d)-e.d(d,k);0>c&&(c+=360);360<c&&(c-=360);return c};e.n=function(c,d){for(var k=
Array(2*d.length),f=0;f<d.length;++f)for(var h=0;2>h;++h)k[2*f+h]=[f,h,e.d(d[f][h],c)];k.sort(function(c,d){return c[2]-d[2]});return k};e.d=function(c,d){return 180*Math.atan2(d[1]-c[1],d[0]-c[0])/Math.PI};e.b=function(c,d,e,f){var h=(f[0]-e[0])*(c[1]-e[1])-(f[1]-e[1])*(c[0]-e[0]);e=(f[1]-e[1])*(d[0]-c[0])-(f[0]-e[0])*(d[1]-c[1]);return 0!=e?(h/=e,[c[0]-h*(c[0]-d[0]),c[1]-h*(c[1]-d[1])]):[]};e.h=function(c,d){return(c[0]-d[0])*(c[0]-d[0])+(c[1]-d[1])*(c[1]-d[1])};e.g=function(c,d,e,f,h,g){return(c<=
h||e<=h)&&(h<=c||h<=e)&&(d<=g||f<=g)&&(g<=d||g<=f)};e.f=function(c,d,e,f,h,g){a=(h-c)*(f-d);b=(e-c)*(g-d);return a<b?-1:a>b?1:0};e.m=function(c,d,k,f,h,g,l,m){d1=e.f(h,g,l,m,c,d);d2=e.f(h,g,l,m,k,f);d3=e.f(c,d,k,f,h,g);d4=e.f(c,d,k,f,l,m);return(0<d1&&0>d2||0>d1&&0<d2)&&(0<d3&&0>d4||0>d3&&0<d4)||0==d1&&e.g(h,g,l,m,c,d)||0==d2&&e.g(h,g,l,m,k,f)||0==d3&&e.g(c,d,k,f,h,g)||0==d4&&e.g(c,d,k,f,l,m)};var p=1,q=1,u=[],A=[],s=1;window.addEventListener("resize",C);var v=109,w=109,x=document.getElementById("c"),
m=x.getContext("2d");C();var t=0;B(y)});
</script></body></html>