First Diversion 001
Policy: e73030...af47
Owner:
Metadata:
{ "name": "First Diversion 001", "files": [ { "src": [ "data:text/html;utf8,<html><head><meta http-equiv='Content-Type' ", "content='text/html; charset=UTF-8'></head><body style='margin:0;", "'><canvas style='padding:auto; margin: auto; display:block;' id=", "'tc' width='639' height='639' tabindex='1'><a id='link'></a><scr", "ipt>console.log('starting up'),SEED=4812,sR=s=>eval('(a,b,c,d)=>", "`'+s+'`'),cR=sR('rgba(${a},${b},${c},${d})'),cM=(v,a)=>cR(v,v,v,", "a),cH=sR('hsla(${a},${b}%,${c}%,${d})'),cHx=b=>'rgb('+((b=parseI", "nt(b,16))>>16&255)+','+(b>>8&255)+','+(255&b)+')',CANV=cH(250,50", ",10,1),WALL=cHx('171b3b'),SHDW=cHx('4a769e'),TAG='D1-001',FPS=30", ",CERT={Piece:'1 of 289',Name:'First Diversion 001',Description:[", "'Diversions in feel, form and flow. A project powered by a Solar", " Journey'],Properties:'Connector, Heavy, Inward, Amethyst, Base,", " Smooth, Fractured, Partial',Medium:'Fully On-Chain Generative A", "rt CNFT',Artist:'Charles Machin',Seed:SEED},uSET=(RN,CX,CV)=>{EN", "V=p=>{var a=p[0],b=p[1],c=p[2],d=p[3],i=p[4],o=p[5],M=Mapf;retur", "n v=>v>o?M(v,o,1,c,d):v>i?M(v,i,o,b,c):M(v,0,i,a,b)},FLP=(x,y,s)", "=>{var v,t,n=0;return(f,d,m,c)=>{for(t=1/c;c>0&&n<s;)n+=t,c--,v=", "f.get(x,y),v.len(),v.norm(),x+=v.x*m,y+=v.y*m,d(x,y,n,v,Clamp(n/", "s,0,1))}},WVM=(p,i)=>t=>{var n,r=p[0];for(n=1;n<p.length;n++)r+=", "sin(t*p[n][1])*p[n][0];return i?floor(r):r},WCM=p=>{var M=WVM,h=", "M(p.h,1),s=M(p.s,1),v=M(p.v,1),a=M(p.a,0);return(t,A)=>cH(Wrap(h", "(t),0,360),s(t),v(t),a(t)*A)},SHP=p=>{var f=(p={n:3,l:1,m:1,r:[1", ",1],p:[.5,.5],s:[.5,.5],...p}).f||(v=>V2().circ(v*TAU)),r=[],P=V", "2t(p.p),S=V2t(p.s);return For(0,p.n,((n,t)=>r.push(f(t*p.m).mul(", "Lerp(p.r[0],p.r[1],t)).mv(S).add(P)))),p.l&&r.push(r[0]),r},PTH=", "p=>{var a,b,I,i,d;return t=>(t=Wrap(t,0,.999),I=t*(p.length-1),i", "=floor(I),d=I-i,a=p[i],b=p[i+1],V2(Lerp(a.x,b.x,d),Lerp(a.y,b.y,", "d)))},bEM=(p,I)=>{var i,l,n=0,A=[0],B=[A];return()=>{if(l=I.leng", "th){for(i=1;i<min(l,p.q);i++)n=n>=l?0:n,l--,A.push(I[n]),I.splic", "e(n,1),A.length>=p.b&&(A=[0],B.push(A));n+=p.s}return B}};class ", "FL2{constructor(p){var n,e,a,E=[],g=V2(),v=(V2(),V2()),r=V2();th", "is.eff=(x,y,c,d,s)=>E.push([x,y,c,d,s]),this.get=(x,y)=>{for(g.s", "et(),n=0;n<E.length;n++)e=E[n],v.set(x-e[0],y-e[1]),a=e[4]/v.len", "(),v.norm(),r.set(v.x,v.y).perp(),g.add(v.mul(e[3]).add(r.mul(e[", "2])).mul(a));return g}}}CFS(CANV),CFR(0,0,1e3,1e3),CFL();let R=R", "N.f(1.95,2),r0=.6*R,r1=.25*R,r2=.4*R,r3=1*R,r4=.4*R,I=.5+.5*(1-1", "/7),a=[500,727],b=[500,603],os=RN.f(0,90),sf=v=>V2().circ(os+pow", "(v,.25)*TAU*1).mul(sin(40*v)),A0={n:1e3,f:sf,p:b,m:1,l:1,r:[1,1]", ",s:[440,440]};fm=new class{constructor(p,oC,rn){var i,j,v,n,s,a,", "r,c,b,F=[],A=[],C=[],P=[],rV=l=>V2().circ(rn.r()*TAU).mul(l);FoE", "(p.FG,(g=>F.push(new FL2(g)))),FoE(p.SM,(s=>P.push(PTH(SHP(s))))", "),FoE(p.DC,(d=>C.push({c:WCM(d),s:ENV(d.S),a:ENV(d.S)}))),FoE(p.", "FD,(f=>{for(s=P[f.sm],j=F[f.f],v=rn.fr,n=0;n<f.n;n++)c=n/f.n,(a=", "s(Mapf(c,0,1,f.m[0],f.m[1]))).add(rV(pow(rn.r(),f.p)*f.v)),r=v(f", ".s),j.eff(a.x,a.y,v(f.c),v(f.d),r),b=f.D,CSC('white'),CSB(5*RS),", "b&&ELI('white',a.x,a.y,2*r*b,2*r*b,0,0,TAU),CSB(0)})),FoE(p.AD,(", "f=>{for(s=P[f.sm],j=[],c=C[f.dc],n=0;n<f.n;n++)v=n/f.n,(a=s(Mapf", "(v,0,1,f.m[0],f.m[1]))).add(rV(pow(rn.r(),f.p)*f.v)),(b=f.D)&&EL", "I(C[f.dc].c(0,1),a.x,a.y,2*b,2*b,0,0,TAU),j.push(FLP(a.x,a.y,f.l", "[0]));A.push({...c,l:0,p:f,e:bEM(f.e,j),f:F[f.f]})}));var S,_ag,", "R,drw=(X,Y,N,V,F)=>{S=_ag.p.r*_ag.s(F),CBP(),CEL(X,Y,S,S,0,0,TAU", "),CFL()};this.upd=()=>{for(R=1,p.M?MUL():ADD(),n=0;n<A.length;n+", "+)for((a=A[n]).l++,_ag=a,s=a.e(),i=s.length-1;i>=0;i--)if((b=s[i", "])[0]++,(v=b[0]/a.p.l[1])>1)s.splice(i,1);else for(c=.01*a.l,CFS", "(a.c(c,a.a(v))),R=0,r=1;r<b.length;r++)(j=b[r])(a.f,drw,a.p.s[1]", ",a.p.s[0]);return oC&&R&&(oC=oC()),R}}}({M:1,FG:[{},{}],SM:[{n:1", "e3,f:sf,p:a,m:1,l:1,r:[1,1],s:[60*I,60*I*1]},{n:4e3,f:sf,p:a,m:4", ",l:1,r:[.7,1],s:[100*I,100*I*1]},{...A0,s:[0,340]},{...A0,s:[470", ",470]},{...A0,p:[a[0],a[1]-30],s:[0,0]},{...A0,s:[455,455]}],FD:", "[{sm:1,v:0,p:2,n:50,f:0,m:[0,1],c:[-1,1],d:[-1,-.6],s:[1,4],D:.2", "},{sm:2,v:100,p:1,n:80,f:0,m:[0,1],c:[1,-1],d:[-1,-.6],s:[.5,1],", "D:.8},{sm:4,v:0,p:1,n:1,f:1,m:[0,1],c:[-1,1],d:[1,.6],s:[.5,1],D", ":0}],DC:[{h:[250,[30,2]],s:[100,[10,2]],v:[60,[20,3],[10,25]],a:", "[.3],S:[0,1,.75,0,.01,.6],A:[1,1,1,0,.2,.5]},{h:[250,[20,2]],s:[", "95,[5,2]],v:[70,[20,5],[10,25]],a:[.5],S:[0,1,1,0,.01,.6],A:[1,1", ",1,0,.2,.5]},{h:[170,[20,2]],s:[95,[5,2]],v:[70],a:[1],S:[0,1,.2", ",0,.01,.6],A:[1,1,1,0,.2,.5]}],AD:[{sm:0,dc:0,r:r0,v:0,p:8,n:1e3", ",f:1,s:[3,5.3],l:[30,30],m:[0,3],e:{q:3,s:0,b:60},D:.4},{sm:1,dc", ":1,r:r1,v:0,p:8,n:250,f:0,s:[5,-.6],l:[80,80],m:[1,-1],e:{q:2,s:", "0,b:30},D:.4},{sm:2,dc:1,r:r2,v:0,p:8,n:280,f:0,s:[8,.3],l:[90,9", "0],m:[0,-1],e:{q:2,s:0,b:20},D:.4},{sm:5,dc:0,r:r3,v:0,p:8,n:100", ",f:0,s:[8,.3],l:[190,190],m:[.25,.75],e:{q:2,s:0,b:20}},{sm:3,dc", ":2,r:r4,v:0,p:8,n:280,f:0,s:[5,-1.3],l:[70,70],m:[0,-1],e:{q:2,s", ":0,b:10},D:.4}]},(()=>{console.log('done')}),RN),uDRW=()=>fm.upd", "()},CER=r=>{var v=DCE('canvas'),R=PX*r,RN=new RNG(SEED),b=20;CWH", "(v,R),CCX(v.getContext('2d')),CTR(r,0,0,r,0,0);let X,Y,S,H,W,O,x", ",y,i,bg=cH(50,2,80,1);for(CFS(bg),Rect(0,0,PX,PX),S={n:6,l:1,m:1", ",r:[1,1],p:[500,500],s:[746,746]},X=[...SHP({...S,r:[.5,.5]}),..", ".SHP(S)],CBP(),x=0;x<13;x++)for(a=X[x],y=0;y<13;y++)b=X[y],CMT(a", ".x,a.y),CLT(b.x,b.y);CSS(cH(200,0,85,1)),CLW(20),CST(),CSS(bg),C", "LW(18),CST(),CTA('center'),CLW(1.5),CBP(),CSB(0),CSS(cH(255,10,5", ",.4)),SIG(495,200,.3,4,2,1);var Tr=(x,y,X,Y,c,r,l)=>{CVS(),CXT(x", ",y),CXS(X,Y),CXR(r),CMT(-1,1),CLT(c,-1),CLT(1,1),l??CCP(),CVR()}", ";for(W=70,O=110,CBP(),CSS(cH(255,10,5,.3)),CFS(bg),Tr(220,373-W,", "O,.7*O,0),Tr(PX-220,373-W,O,.7*O,0),CFL(),CST(),CSS(cH(360,70,60", ",.3)),CBP(),Tr(220,375-W,.88*O,.62*O,0),CST(),For(0,4,(n=>{For(0", ",1+n,(i=>{CBP(),a=2==n&&1==i,CSS(cH(0,10,5,a?.4:.1)),X=780-50*i+", "25*n,Y=35*n-W,Tr(X,322+Y,25,18,0),CST(),a&&(CBP(),CFS(cH(250,10,", "60,1)),Tr(X,323.5+Y,18,13,0),CFL(),CST(),For(0,6,(v=>{S=1.5*pow(", "RN.f(0,1),2),v=V2().circ(RN.f(-TAU,TAU)).mul(8.5*pow(RN.f(0,1),1", ".2)),ELI(cM(255,1),X+v.x,327.5+Y+v.y-1,S,S,0,0,TAU)})))}))})),CB", "P(),CFS(cH(255,10,5,.4)),Tr(500,100,2,1.5,0,0,0),CST(),CFL(),Y=3", "10-W,n=0,i=1;i<4;i++)for(y=0;y<17;y++)for(x=0;x<1+2*y;x++)s=((k=", "289-n==1)?3:2)/i,ELI(cH(0,k?30:100,k?30:0,k?.3:.1),220-6*x+6*y,Y", "+8.3*y,s,s+(k?i:0),0,0,TAU),n++;For(0,6e4,((n,t)=>{for(x=0;x<2;x", "++)for(i=0;i<3;i++)X=10*Wrap(n,0,200),Y=n/300*10,S=cH(250,25,x?5", "0:100,.05),W=H=RN.i(-10,10),O=RN.i(-1,1),RN.c(.25)?H=O:W=O,Rect(", "X-4*x,Y+5*x,2*H,W,S)})),CSC('black'),CSB(30*r),CBP(),CRE(0,0,PX,", "PX),CSS(cHx('dbccb8')),CLW(82),CST(),CBP(),CRE(0,0,PX,PX),W=cHx(", "'9d8c78'),CSS(W),CLW(78),CST(),CSB(6*r),CSS(CANV),CLW(50),CST();", "r=966;var s=cM(0,.15),MK=(c,d,x,y)=>{0!=d&&(CBP(),CSS(cM(0,.3)),", "CLW(4),5==d?Tr(x,y-3,3,-3,0,0):Tr(x,y-3,3,3,-1,PI*d/2),CST()),co", "nsole.log(c,d),CSB(3*r),CSC(s),TXT(cM(255,.35),10,c,x,y)};MK('D'", ",1,33,36),MK('K',2,r,36),MK('U',4,33,970),MK('Y',3,r,970),x=500,", "y=320;var k,n=0;for(const[k,t]of Object.entries(CERT))if(y+=31,F", "NT(13),CFS(cM(0,.8)),CFT(k,x,y),y+=23,CFS(cM(0,.5)),FNT(19),Arra", "y.isArray(t))for(i=0;i<t.length;i++)CFT(t[i],x,y),y+=21;else CFT", "(t,x,y);return CSB(0),CCX(),a=>v},_X=_Y=0,PX=1e3,HX=PX/2,RS=1,BT", "N=(x,y,r,t,v,f)=>{var m,a,s,p=V2(x,y);return _R.push((b=>{a&&f(v", ")})),(v,h)=>{m=V2(_X,_Y).mul(-1).add(p),a=m.len()<2*r,s=a?2:5,v&", "&(ELI(a||h?'white':'grey',x,y,r+s,r+s,0,0,TAU),ELI(cM(200,1),x,y", ",r,r,0,0,TAU),CTA('center'),CFS('black'),FNT(r-3),CFT(t,x,y+6))}", "},DCE=e=>document.createElement(e),CDI=(...a)=>ctx.drawImage(...", "a),CCX=c=>ctx=c||CTX,CFT=(...p)=>ctx.fillText(...p),FNT=f=>ctx.f", "ont=`${f}px Arial`,TXT=(s,f,...a)=>{CFS(s),FNT(f),CFT(...a)},CTA", "=a=>ctx.textAlign=a,CTB=b=>ctx.textBaseline=b,CSB=b=>ctx.shadowB", "lur=b,CSC=c=>ctx.shadowColor=c,CEL=(...v)=>ctx.ellipse(...v),ELI", "=(s,...a)=>{CFS(s),CBP(),CEL(...a),CFL()},CBP=v=>ctx.beginPath()", ",CCP=v=>ctx.closePath(),CMT=(...p)=>ctx.moveTo(...p),CLT=(...p)=", ">ctx.lineTo(...p),CBC=(...v)=>ctx.bezierCurveTo(...v),CLW=s=>ctx", ".lineWidth=s,CSS=v=>ctx.strokeStyle=v,CST=v=>ctx.stroke(),CGC=m=", ">ctx.globalCompositeOperation=m,ADD=()=>CGC('screen'),MUL=()=>CG", "C('source-over'),CVS=()=>ctx.save(),CVR=()=>ctx.restore(),CTR=(.", "..v)=>ctx.setTransform(...v),CXT=(...p)=>ctx.translate(...p),CXS", "=(...p)=>ctx.scale(...p),CXR=(...p)=>ctx.rotate(...p),CFS=v=>ctx", ".fillStyle=v,CFR=(...p)=>ctx.fillRect(...p),CRE=(...p)=>ctx.rect", "(...p),CFL=v=>ctx.fill(),CWH=(v,n)=>v.width=v.height=n,BG=f=>Rec", "t(0,0,WI,HI,f),Rect=(x,y,w,h,f)=>{CBP(),CFS(f),CFR(x,y,w,h),CFL(", ")},AA=(c,v)=>c.imageSmoothingEnabled=c.mozImageSmoothingEnabled=", "c.webkitImageSmoothingEnabled=v;class v2{constructor(x,y){var t=", "this,s=(x,y)=>(t.x=x||0,t.y=y||0,t);t.set=s,s(x,y),t.cross=v=>t.", "x*v.y-t.y*v.x,t.circ=r=>s(sin(r),-cos(r)),t.perp=a=>s(t.y,-t.x),", "t.len=a=>sqrt(t.x*t.x+t.y*t.y),t.dot=a=>t.x*a.x+t.y*a.y,t.norm=a", "=>t.div(t.len()),t.rad=a=>atan2(t.x,-t.y),t.add=v=>s(t.x+v.x,t.y", "+v.y),t.mv=v=>s(t.x*v.x,t.y*v.y),t.inc=a=>s(t.x+a,t.y+a),t.mul=v", "=>s(t.x*v,t.y*v),t.div=v=>s(t.x/v,t.y/v),t.cpy=v=>V2(t.x,t.y)}}V", "2=(x,y)=>new v2(x,y),V2t=t=>V2(t[0],t[1]),Lerp=(a,b,n)=>(1-n)*a+", "n*b,Wrap=(x,l,h)=>x<l?h-(l-x)%(h-l):l+(x-l)%(h-l),Mapf=(v,a,b,c,", "d)=>b-a==0?c:c+(v-a)/(b-a)*(d-c),Clamp=(v,l,h)=>v<l?l:v>h?h:v,Ea", "se=t=>t>.5?4*pow(t-1,3)+1:4*pow(t,3),For=(s,e,f)=>{for(s=s;s<e;s", "++)f(s,s/e)},FoE=(a,f)=>a.forEach(f),FoE(Object.getOwnPropertyNa", "mes(Math),(i=>eval(`${i}=Math.${i}`))),TAU=2*PI;class RNG{constr", "uctor(s){var t=this,a=4294967295,b=123456789+s&a,r=987654321-s&a", ",c=65535;t.r=x=>(((r=36969*(r&c)+(r>>>16)&a)<<16)+((b=18e3*(b&c)", "+(b>>>16)&a)&c)>>>0)/(a+1),t.f=(l,h)=>l+t.r()*(h-l),t.fr=r=>t.f(", "r[0],r[1]),t.i=(l,h)=>floor(t.f(l,h)),t.ir=r=>t.i(r[0],r[1]+1),t", ".c=c=>t.r()<c,t.flip=x=>t.c(x||.5)?-1:1,t.item=l=>l[t.i(0,l.leng", "th)]}}SIG=(x,y,s)=>{CBP(),SIGN(x,y,s,((a,b,c,d)=>{CLT(c,d)})),CS", "T()},SIGN=(()=>{var a,b,n,D=d=>{var o=[];for(n=0;n<d.length;n++)", "o.push('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234", "567890'.indexOf(d[n])-31);return o},X=D('EEBBBCABAAABBCCDEGLNKJJ", "KKKLLLKLKKJJHCBEEEEEFEEEFFFFKSPIrpmoqxQVXXTLKJJIIHGGFFDDCCCCCDDF", "FGHIIIIHHGGEFEFFGGIHIHHHGGFGFGIN'),Y=D('ldwPPSUWYYYYXWTT07UCvwtr", "pnnlmlmnoqsua7RUWXZZZZYXUSPTnhnDIJKJMEEBytspljjlnszGNSX1232ZWRLE", "uojhikpxHSZ431SIxokhjovHSZ31VLm');return(x,y,s,fn)=>{for(n=0;n<X", ".length;n++)a=X[n]*s,b=Y[n]*s,fn(x,y,x+a,y+b),x+=a,y+=b}})(),cnv", "=document.getElementById('tc'),ctx=CTX=cnv.getContext('2d');var ", "_R=[],_B=[],_S=0,_L=[1,2,4,8,16],ART=r=>{RC=0;var R=new RNG(SEED", "),v=DCE('canvas'),c=v.getContext('2d'),s=cM(150,1),G=()=>{CSB(8*", "r),MUL(),CSC(CANV),CSS(s),SIG(965,945,.15),SIG(965,945,.15),CFS(", "s),FNT(1==r?10:8),CTA('center'),CFT(TAG,967,990),CSB(0)};return ", "CWH(v,r*PX),CCX(c),AA(v,1),CTR(r,0,0,r,0,0),uSET(R,c,v,r),G(),()", "=>(CCX(c),CTR(r,0,0,r,0,0),RC||(RC=uDRW(),RC&&G()),CCX(),v)};IN=", "()=>{art=ART(1),cer=CER(1);var q,n,x,t='touch',m='mouse',o=e=>{e", ".preventDefault(),e.stopPropagation()},d=e=>MMV(e.clientX,e.clie", "ntY),p=e=>{PS=1,d(e),o(e)},u=e=>{PS=0,_R.forEach((p=>p())),d(e)}", ";for(FoE([[t+'start',e=>{p(),o(e)}],[t+'move',e=>{d(e),o(e)}],[t", "+'end',e=>u],[m+'down',p],[m+'move',d],[m+'up',u]],(e=>cnv.addEv", "entListener(e[0],e[1]))),q=_L.length,n=0;n<q;n++)x=HX-80*q/2+80*", "(n+.5),_B.push(BTN(x,790,22,_L[n]+'k',n,(a=>{_S=a,RS=_L[a],art=A", "RT(RS),cer=CER(min(RS,4))})));_B.push(BTN(HX,880,25,String.fromC", "harCode(8595),0,(a=>CAP()))),NF()},CAP=r=>{var l=DCE('a');l.down", "load=CERT.Name,l.href=art().toDataURL(),l.click(),l.delete},BD=1", ",NF=()=>{setTimeout((a=>{window.requestAnimationFrame(NF);var n=", "0,e=BD?20:0,w=PX-2*e,b=WALL,s=SHDW;CCX(),setFR(0,b),CSC(s),CSB(5", "5),CFS(b),Rect(e,e,w,w),CSB(0),CDI(art(),e,e,w,w),PS&&CDI(cer(),", "e,e,w,w),FoE(_B,(b=>{b(PS,_S==n),n++}))}),1e3/FPS)},PS=MX=WI=HI=", "0,setFR=(b,f,g)=>{CTR(1,0,0,1,0,0),window.innerWidth==WI&&window", ".innerHeight==HI||(cnv.width=WI=window.innerWidth,cnv.height=HI=", "window.innerHeight,g&&BG(g));var mx=WI/2,my=HI/2,sz=min(mx,my)-b", ",apx=floor(2*sz);MX=apx/PX,f&&BG(f),CXT(mx-sz,my-sz),CXS(MX,MX)}", ",MMV=(X,Y)=>{var B=cnv.getBoundingClientRect(),x=X-B.left,y=Y-B.", "top,T=ctx.getTransform().invertSelf();_X=x*T.a+y*T.c+T.e,_Y=x*T.", "b+y*T.d+T.f},AA(ctx,1),IN();</script></canvas></body></html>" ], "name": "First Diversion 001", "mediaType": "text/html" } ], "image": "ipfs://QmXUyCYM41X3z9TFok686wQw8oWBECYCmxEy1W9hEWHAmX", "artist": "Charles Machin", "medium": "Fully On-Chain Generative CNFT", "twitter": "@CM_GenArt", "auth NFT": "9c8896f65af58f4091bcfd8ee8282a1c5353c93d6c641166550e0f746400c67f", "mediaType": "image/png", "properties": { "Form": "Inward", "State": "Fractured", "Surge": "Partial", "Colour": "Amethyst", "Groove": "Smooth", "Weight": "Heavy", "Special": "Connector", "Elevation": "Base" }, "description": [ "Diversions in feel, form and flow.", "A project powered by a Solar Journey" ] }