memoscan
← all memos

Memo 0x095de0fc…39f6de on Ethereum

var DEFAULT_SIZE=1e3,WIDTH=window.innerWidth,HEIGHT=window.innerHeight;let hashhash=tokenData.hash.slice(2,66);const hashcombo=hashhash+[...hashhash].reverse().join("");let hashPairs=[];for(let a=0;a<64;a++)hashPairs.push(hashcombo.slice(0+2*a,2+2*a));let hashIndex=0,hashData=hashPairs.map(a=>parseInt(a,16)/255),allcombi=Object.keys(chroma.brewer);function setup(){createCanvas(WIDTH,HEIGHT)}function draw(){hashIndex=hashData.length-1;let a=.45*Math.min(WIDTH,HEIGHT),e=width/2,h=height/2;translate(e,h);let t=round(map(hashData[inc()],0,1,1,12)),s=round(map(hashData[inc()],0,1,1,20));background(0);let r=[],c=[];var n;n=mouseIsPressed?millis()/1e4*map(mouseX,0,WIDTH/2,.05,1,!0)*map(mouseX,WIDTH/2,WIDTH,1,20,!0):millis()/1e4;let o,i=100*hashData[inc()];i<=10?o=0:i<=20?o=1:i<=30?o=2:i<=40?o=3:i<=47?o=4:i<=54?o=5:i<=61?o=6:i<=68?o=7:i<=85?o=8:i<=92?o=9:i<=96?o=10:i<=100&&(o=11);const l=hashData[inc()]<.5;let b=floor(hashData[inc()]*allcombi.length),p=allcombi[b],D=chroma.scale(p).mode("lab").colors(t);if(hashData[inc()]<.3)for(let a=D.length-1;a>0;a--){const e=Math.floor(hashData[inc()]*a),h=D[a];D[a]=D[e],D[e]=h}let d,m=100*hashData[inc()];m<=20?d=0:m<=40?d=1:m<=60?(D=chroma.scale(allcombi[b]).mode("lab").colors(30),d=2):m<=65?d=3:m<=70?d=4:m<=75?d=5:m<=80?d=6:m<=85?d=7:m<=90?d=8:m<=100&&(d=9);let u=Math.round(map(hashData[inc()],0,1,50,255)),k=Math.round(map(hashData[inc()],0,1,50,255)),I=Math.round(map(hashData[inc()],0,1,50,255)),P=[1,2,3,4,0,5,6,7,8],T={1:"tringle",2:"square",3:"pentagon",4:"hexagon",0:"circle",5:"star_1",6:"star_2",7:"star_3",8:"star_4"};if(hashData[inc()]<.5)for(let a=P.length-1;a>0;a--){const e=Math.floor(hashData[inc()]*a),h=P[a];P[a]=P[e],P[e]=h}let W,f=floor(map(hashData[inc()],0,1,2,9)),_=100*hashData[inc()],O=[];P.slice(0,f).forEach(a=>O.push(T[a])),_<=20?W=0:_<=28?W=1:_<=36?W=2:_<=44?W=3:_<=52?W=4:_<=60?W=5:_<=68?W=6:_<=76?W=7:_<=84?W=8:_<=90?W=9:_<=95?W=10:_<=97?W=11:_<=99?W=12:_<=100&&(W=13);for(let e=0;e<t;e++){let h,i,b=e/t*a,p=a-b;h=hashData[inc()]<.5?round(map(hashData[inc()],0,1,1,20)):s,r.push(h);let m=hashData[inc()];i=h>s?h:m<.2?s:h,c.push(m<.2?"no":"yes");let T=map(hashData[inc()],0,1,.1,10),_=map(hashData[inc()],0,1,.1,10),O=2*round(hashData[inc()])-1,w=Math.round(map(hashData[inc()],0,1,50,255)),M=Math.round(map(hashData[inc()],0,1,50,255)),g=Math.round(map(hashData[inc()],0,1,50,255));for(let t=0;t<h;t++){distributeColors(d,t,e,D,w,M,g,u,k,I);let h=b+p,r=b+p;h+=p*Math.sin(t/i*PI*2),r+=p*Math.sin(t/s*PI*2-PI/2);let c=2*round(hashData[inc()])-1;push(),rotationChoice(o,e,t,i,n,T,_,1,O,c),translate(p,0),13!=W&&l&&(.5<hashData[inc()]?rotate(millis()/1e3):rotate(millis()/1e3*-1)),drawShape(W,P,f,t,e,a),pop()}}}function inc(){return hashIndex=(hashIndex+1)%hashData.length}function distributeColors(a,e,h,t,s,r,c,n,o,i){let l;switch(a){case 0:l=color(t[e%t.length]);break;case 1:l=color(t[h%t.length]);break;case 2:l=color(t[round(hashData[inc()]*(t.length-1))]);break;case 3:l=color(Math.round(map(hashData[inc()],0,1,200,255)),Math.round(255*hashData[inc()]),Math.round(255*hashData[inc()]));break;case 4:l=color(Math.round(255*hashData[inc()]),Math.round(map(hashData[inc()],0,1,200,255)),Math.round(255*hashData[inc()]));break;case 5:l=color(Math.round(255*hashData[inc()]),Math.round(255*hashData[inc()]),Math.round(map(hashData[inc()],0,1,200,255)));break;case 6:l=color(Math.round(map(hashData[inc()],0,1,50,255)),Math.round(map(hashData[inc()],0,1,50,255)),Math.round(map(hashData[inc()],0,1,50,255)));break;case 7:l=color(Math.round(map(hashData[inc()],0,1,50,255)));break;case 8:l=color(s,r,c);break;case 9:l=color(n,o,i)}fill(l)}function drawShape(a,e,h,t,s,r){switch(a){case 0:shapes(0,r);break;case 1:shapes(1,r);break;case 2:shapes(2,r);break;case 3:shapes(3,r);break;case 4:shapes(4,r);break;case 5:shapes(5,r);break;case 6:shapes(6,r);break;case 7:shapes(7,r);break;case 8:shapes(8,r);break;case 9:shapes(e[s%h],r);break;case 10:shapes(e[t%h],r);break;case 11:shapes(9,r);break;case 12:shapes(10,r);break;case 13:shapes(11,r)}}function drawPolygon(a,e){let h=TWO_PI/a;beginShape();for(let a=0;a<TWO_PI;a+=h){let h=0+cos(a)*(e/25),t=0+sin(a)*(e/25);vertex(h,t)}endShape(CLOSE)}function drawStar(a,e,h){let t=TWO_PI/h,s=t/2;beginShape();for(let h=0;h<TWO_PI;h+=t){let t=cos(h)*e,r=sin(h)*e;vertex(t,r),t=cos(h+s)*a,r=sin(h+s)*a,vertex(t,r)}endShape(CLOSE)}function heart(a,e,h){beginShape(),vertex(a,e),bezierVertex(a-h/2,e-h/2,a-h,e+h/3,a,e+h),bezierVertex(a+h,e+h/3,a+h/2,e-h/2,a,e),endShape(CLOSE)}function shapes(a,e,h){let t,s;switch(a){case 0:ellipse(0,0,e/12.5,e/12.5);break;case 1:drawPolygon(3,e);break;case 2:drawPolygon(4,e);break;case 3:drawPolygon(5,e);break;case 4:drawPolygon(6,e);break;case 5:drawStar(s=.4*(t=e/25),t,3);break;case 6:drawStar(s=.6*(t=e/25),t,4);break;case 7:drawStar(s=.6*(t=e/25),t,5);break;case 8:drawStar(s=.6*(t=e/25),t,12);break;case 9:let h=millis()/1e3*map(hashData[inc()],0,1,.05,2);switch(floor(h/TWO_PI%2)){case 0:arc(0,0,e/12.5,e/12.5,0,h,PIE);break;case 1:arc(0,0,e/12.5,e/12.5,h,0,PIE)}break;case 10:triangle(map(hashData[inc()],0,1,0,e/6.25),map(hashData[inc()],0,1,0,e/6.25),map(hashData[inc()],0,1,0,e/6.25),map(hashData[inc()],0,1,0,e/6.25),map(hashData[inc()],0,1,0,e/6.25),map(hashData[inc()],0,1,0,e/6.25));break;case 11:heart(0,0,e/15)}}function rotationChoice(a,e,h,t,s,r,c,n,o,i){switch(a){case 0:rotate(5*s+TWO_PI*h/t);break;case 1:rotate(-1*(5*s+TWO_PI*h/t));break;case 2:e%2==0?rotate(s+TWO_PI*h/t):rotate(-1*(s+TWO_PI*h/t));break;case 3:e%2==0?rotate(-1*(s+TWO_PI*h/t)):rotate(s+TWO_PI*h/t);break;case 4:e%2==0?rotate(s*r+TWO_PI*h/t):rotate(-1*(s*c+TWO_PI*h/t));break;case 5:e%2==0?rotate(-1*(s*c+TWO_PI*h/t)):rotate(s*r+TWO_PI*h/t);break;case 6:rotate(s*r+TWO_PI*h/t);break;case 7:rotate(-1*(s*r+TWO_PI*h/t));break;case 8:rotate((s+TWO_PI*h/t)*o);break;case 9:rotate((s*c+TWO_PI*h/t)*o);break;case 10:rotate(s*(e+1)*n+TWO_PI*h/t);break;case 11:rotate(-1*(s*(e+1)*n+TWO_PI*h/t))}}