First Diversion 009
Policy: e73030...af47
Owner:
Metadata:
{ "name": "First Diversion 009", "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=10117,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=parse", "Int(b,16))>>16&255)+','+(b>>8&255)+','+(255&b)+')',CANV=cH(250,5", "0,10,1),WALL=cHx('171b3b'),SHDW=cHx('4a769e'),TAG='D1-009',FPS=3", "0,CERT={Piece:'9 of 289',Name:'First Diversion 009',Description:", "['Diversions in feel, form and flow. A project powered by a Sola", "r Journey'],Properties:'Glimmer, Heavy, Radial, Spectral, Base, ", "Smooth, Fractured',Medium:'Fully On-Chain Generative Art CNFT',A", "rtist:'Charles Machin',Seed:SEED},uSET=(RN,CX,CV)=>{ENV=p=>{var ", "a=p[0],b=p[1],c=p[2],d=p[3],i=p[4],o=p[5],M=Mapf;return 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=V2t(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.length){for(i=", "1;i<min(l,p.q);i++)n=n>=l?0:n,l--,A.push(I[n]),I.splice(n,1),A.l", "ength>=p.b&&(A=[0],B.push(A));n+=p.s}return B}};class FL2{constr", "uctor(p){var n,e,a,E=[],g=V2(),v=(V2(),V2()),r=V2();this.eff=(x,", "y,c,d,s)=>E.push([x,y,c,d,s]),this.get=(x,y)=>{for(g.set(),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=RN.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)*TA", "U*1).mul(sin(40*v)),A0={n:1e3,f:sf,p:b,m:1,l:1,r:[1,1],s:[440,44", "0]};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=>{fo", "r(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('wh", "ite',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)&&ELI(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.pu", "sh({...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()};t", "his.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:1e3,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},{...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:[-2,-2],d:[-0,0],s:[1,4],D:.2},{sm:2,v:100,p:1,n:8", "0,f:0,m:[0,1],c:[-2,-2],d:[-0,0],s:[.5,1],D:.8},{sm:4,v:0,p:1,n:", "1,f:1,m:[0,1],c:[2,2],d:[-0,0],s:[.5,1],D:0}],DC:[{h:[300,[150,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:[200,[30,2]],s:[55,[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:[300,[", "130,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,d", "c:1,r:r2,v:0,p:8,n:280,f:0,s:[8,.3],l:[90,90],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.getContex", "t('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),CLW(18),CST(),CTA('cen", "ter'),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),C", "MT(-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,3", "73-W,O,.7*O,0),CFL(),CST(),CSS(cH(360,70,60,.3)),CBP(),Tr(220,37", "5-W,.88*O,.62*O,0),CST(),CBP(),Tr(220,410-W,.44*O,.31*O,0,0,1),C", "ST(),CBP(),Tr(220,335-W,0,.32*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)})))}))})),CBP(),C", "FS(cH(255,10,5,.4)),Tr(500,100,2,1.5,0,0,0),CST(),CFL(),Y=310-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", "==9)?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++)fo", "r(i=0;i<3;i++)X=10*Wrap(n,0,200),Y=n/300*10,S=cH(250,25,x?50: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),C", "SS(cHx('dbccb8')),CLW(82),CST(),CBP(),CRE(0,0,PX,PX),W=cHx('9d8c", "78'),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()),console", ".log(c,d),CSB(3*r),CSC(s),TXT(cM(255,.35),10,c,x,y)};MK('U',1,33", ",36),MK('B',2,r,36),MK('A',4,33,970),MK('B',3,r,970),x=500,y=320", ";var k,n=0;for(const[k,t]of Object.entries(CERT))if(y+=31,FNT(13", "),CFS(cM(0,.8)),CFT(k,x,y),y+=23,CFS(cM(0,.5)),FNT(19),Array.isA", "rray(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,BTN=(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),CC", "X=c=>ctx=c||CTX,CFT=(...p)=>ctx.fillText(...p),FNT=f=>ctx.font=`", "${f}px Arial`,TXT=(s,f,...a)=>{CFS(s),FNT(f),CFT(...a)},CTA=a=>c", "tx.textAlign=a,CTB=b=>ctx.textBaseline=b,CSB=b=>ctx.shadowBlur=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.line", "Width=s,CSS=v=>ctx.strokeStyle=v,CST=v=>ctx.stroke(),CGC=m=>ctx.", "globalCompositeOperation=m,ADD=()=>CGC('screen'),MUL=()=>CGC('so", "urce-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.fill", "Style=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=>Rect(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.web", "kitImageSmoothingEnabled=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.d", "iv(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)}}V2=(x,", "y)=>new v2(x,y),V2t=t=>V2(t[0],t[1]),Lerp=(a,b,n)=>(1-n)*a+n*b,W", "rap=(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,Ease=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.getOwnPropertyNames(M", "ath),(i=>eval(`${i}=Math.${i}`))),TAU=2*PI;class RNG{constructor", "(s){var t=this,a=4294967295,b=123456789+s&a,r=987654321-s&a,c=65", "535;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.length)]}", "}SIG=(x,y,s)=>{CBP(),SIGN(x,y,s,((a,b,c,d)=>{CLT(c,d)})),CST()},", "SIGN=(()=>{var a,b,n,D=d=>{var o=[];for(n=0;n<d.length;n++)o.pus", "h('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ123456789", "0'.indexOf(d[n])-31);return o},X=D('EEBBBCABAAABBCCDEGLNKJJKKKLL", "LKLKKJJHCBEEEEEFEEEFFFFKSPIrpmoqxQVXXTLKJJIIHGGFFDDCCCCCDDFFGHII", "IIHHGGEFEFFGGIHIHHHGGFGFGIN'),Y=D('ldwPPSUWYYYYXWTT07UCvwtrpnnlm", "lmnoqsua7RUWXZZZZYXUSPTnhnDIJKJMEEBytspljjlnszGNSX1232ZWRLEuojhi", "kpxHSZ431SIxokhjovHSZ31VLm');return(x,y,s,fn)=>{for(n=0;n<X.leng", "th;n++)a=X[n]*s,b=Y[n]*s,fn(x,y,x+a,y+b),x+=a,y+=b}})(),cnv=docu", "ment.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=D", "CE('canvas'),c=v.getContext('2d'),s=cM(150,1),G=()=>{CSB(8*r),MU", "L(),CSC(CANV),CSS(s),SIG(965,945,.15),SIG(965,945,.15),CFS(s),FN", "T(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(),()=>(CC", "X(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.prev", "entDefault(),e.stopPropagation()},d=e=>MMV(e.clientX,e.clientY),", "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.addEventLi", "stener(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=ART(RS", "),cer=CER(min(RS,4))})));_B.push(BTN(HX,880,25,String.fromCharCo", "de(8595),0,(a=>CAP()))),NF()},CAP=r=>{var l=DCE('a');l.download=", "CERT.Name,l.href=art().toDataURL(),l.click(),l.delete},BD=1,NF=(", ")=>{setTimeout((a=>{window.requestAnimationFrame(NF);var n=0,e=B", "D?20:0,w=PX-2*e,b=WALL,s=SHDW;CCX(),setFR(0,b),CSC(s),CSB(55),CF", "S(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,set", "FR=(b,f,g)=>{CTR(1,0,0,1,0,0),window.innerWidth==WI&&window.inne", "rHeight==HI||(cnv.width=WI=window.innerWidth,cnv.height=HI=windo", "w.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 009", "mediaType": "text/html" } ], "image": "ipfs://QmNS6G5D1p6pDiN3v7BSsM57BVQ53Z3QUSLNaYDbfAGUUA", "artist": "Charles Machin", "medium": "Fully On-Chain Generative CNFT", "twitter": "@CM_GenArt", "auth NFT": "9c8896f65af58f4091bcfd8ee8282a1c5353c93d6c641166550e0f746400c67f", "mediaType": "image/png", "properties": { "Form": "Radial", "State": "Fractured", "Colour": "Spectral", "Groove": "Smooth", "Weight": "Heavy", "Special": "Glimmer", "Elevation": "Base" }, "description": [ "Diversions in feel, form and flow.", "A project powered by a Solar Journey" ] }