memoscan
← all memos

Memo 0x436af0de…e8369d on Ethereum

class Random{constructor(hash){this.useA=!1;const sfc32=function(uint128Hex){let a=parseInt(uint128Hex.substr(0,8),16);let b=parseInt(uint128Hex.substr(8,8),16);let c=parseInt(uint128Hex.substr(16,8),16);let d=parseInt(uint128Hex.substr(24,8),16);return function(){a|=0;b|=0;c|=0;d|=0;let t=(((a+b)|0)+d)|0;d=(d+1)|0;a=b^(b>>>9);b=(c+(c<<3))|0;c=(c<<21)|(c>>>11);c=(c+t)|0;return(t>>>0)/4294967296}};this.prngA=new sfc32(hash.substr(2,32));this.prngB=new sfc32(hash.substr(34,32));for(let i=0;i<1e6;i+=2){this.prngA();this.prngB()}} random_dec(){this.useA=!this.useA;return this.useA?this.prngA():this.prngB()} random_num(a,b){return a+(b-a)*this.random_dec()} random_int(a,b){return Math.floor(this.random_num(a,b+1))} random_bool(p){return this.random_dec()<p} random_choice(list){return list[this.random_int(0,list.length-1)]}} let _=new Random(tokenData.hash);function dpt(mrgn){const nscl=20;const pxlSz=(width-mrgn*2)*0.0011;const mlt=12;const amt=43*mlt;for(let x=0;x<amt;x++){const pctx=x/amt;const posx=map(pctx,0,1,0,width);for(let y=0;y<amt;y++){const pcty=y/amt;const posy=map(pcty,0,1,0,height);cg.erase(noise(pctx*nscl,pcty*nscl)*noise(1+(pctx*nscl)/2,1+(pcty*nscl)/2)*200);cg.rect(posx,posy,pxlSz,pxlSz);cg.noErase();if(x%mlt===0&&y%mlt===0){cg.erase(noise(pctx*nscl,pcty*nscl)*30);cg.rect(posx,posy,pxlSz,pxlSz);cg.noErase()}}} cg.erase(40);for(let i=0;i<100;i++){cg.rect(_.random_int(0,width),_.random_int(0,height),1,1)} cg.noErase()} function ppprt(amt){loadPixels();for(let i=0;i<pixels.length;i+=4){let grn=_.random_int(-amt,amt);pixels[i]=pixels[i]+grn;pixels[i+1]=pixels[i+1]+grn;pixels[i+2]=pixels[i+2]+grn;pixels[i+3]=pixels[i+3]+grn} updatePixels()} const bezPt=(a1,a2,pct)=>{const a=(v)=>pow(v,2);const b=(v)=>1.7*pow(v,2);const bez1fn=(v)=>v*a(v)+(1-v)*b(v);const c=(v)=>-pow(v-1,2)+1;const d=(v)=>1.7*-pow(1-v,2)+1;const bez2fn=(v)=>v*d(v)+(1-v)*c(v);return bezierPoint(0,bez1fn(a1),bez2fn(a2),1,bezierPoint(0,bez1fn(a1),bez2fn(a2),1,bezierPoint(0,bez1fn(a1),bez2fn(a2),1,pct)))};const cosNorm=(v)=>(cos(v)+1)/2;function nearest(v,min,max,steps){var zerone=Math.round(((v-min)*steps)/(max-min))/steps;zerone=Math.min(Math.max(zerone,0),1);return zerone*(max-min)+min} function dtri(points,idx=0){cg.beginShape();for(let i=0;i<3;i++){let{x,y}=points[(i+idx)%4];cg.vertex(x,y)} cg.endShape(CLOSE)} function dar(rect,idx=0,strokeWeight=0){idx=(idx+1)%4;const diff=p5.Vector.sub(rect[0],rect[2]).mult(2).sub(-strokeWeight,-strokeWeight);const{x,y}=rect[idx];cg.arc(x,y,diff.x,diff.y,HALF_PI*idx,HALF_PI+HALF_PI*idx,PIE)} function darInv(points,idx,detail=50){idx=(idx+1)%4;cg.beginShape();const pt=points[idx%points.length];const ptn=points[(idx+1)%points.length];const ptp=points[(idx+3)%points.length];const pto=points[(idx+2)%points.length];const diff=p5.Vector.sub(pt,pto);cg.vertex(ptp.x,ptp.y);cg.vertex(pt.x,pt.y);cg.vertex(ptn.x,ptn.y);for(let i=0;i<detail;i++){const pct=i/(detail-1);const a=pct*HALF_PI;let posx=cos(a)*diff.x+pto.x;let posy=sin(a)*diff.y+pto.y;if(idx%2===0){posx=sin(a)*diff.x+pto.x;posy=cos(a)*diff.y+pto.y} cg.vertex(posx,posy)} cg.endShape(CLOSE)} function setup(){let w=window.innerWidth;let h=window.innerHeight;w<h?(h=round(1.385*w)):(w=round(h/1.385));sz=min(w,h);createCanvas(w,h);cg=createGraphics(width,height);mrgn=sz*0.07;noiseDetail(3,0.5);noLoop()} function draw(){noiseSeed(_.random_int(0,1e4));noStroke();cg.noStroke();const bw=_.random_num(0,1)>0.7;blendMode(bw?SCREEN:MULTIPLY);background(bw?40:[232,224,209]);cg.fill(bw?[232,224,209]:[25]);const minClipRagSize=14;const axis=_.random_int(0,1)>0.25?'x':'y';const amty=_.random_int(3,37);const freq1=_.random_num(0,2)*TAU*2;const off1=HALF_PI+_.random_num(0,1)*TAU;const amp1=_.random_num(0,1);const freq2=_.random_num(0,2)*TAU*2;const off2=HALF_PI+_.random_num(0,1)*TAU;const amp2=_.random_num(0,1);const ampy1=_.random_num(0.25,0.75);const ampy2=_.random_num(0.25,0.75);const fxnd=axis==='x'?0.85:0.65;const slaff1=_.random_num(0,Math.PI);const slaoff2=_.random_num(0,Math.PI);const fnxp=(v,amp,freq,slampoff,off)=>{const dec=amp>0.5||freq>20?cosNorm(PI+v*PI+slampoff):1;return 0.5+(cosNorm(v*freq+off)-0.5)*amp*fxnd*dec};const fnx=(pct,v)=>bezPt(fnxp(v,amp1,freq1,slaff1,off1),fnxp(v,amp2,freq2,slaoff2,off2),pct);const fnyp=(v)=>0.5+(v-0.5)*1;const fny=(pct)=>bezPt(fnyp(ampy1),fnyp(ampy2),pct);const idxOff=floor(_.random_num(0,4));const unlockMrgn={s:amty>7&&_.random_num(0,1)>0.25,e:amty>7&&_.random_num(0,1)>0.25,};for(let y=0;y<amty;y++){const pcty=nearest(fny(y/amty),0,1,200);const pctyn=nearest(fny((y+1)/amty),0,1,200);if(pcty===pctyn)continue;const amtx=ceil((1/(pctyn-pcty))*(axis==='x'?min(width,height)/max(width,height):max(width,height)/min(width,height)));for(let x=0;x<amtx;x++){const getDec=(amp,freq,slampoff)=>amp>0.5||freq>20?cosNorm(PI+pcty*PI+slampoff):1;let dec2=1;if(amp2>0.5||freq2>20){dec2=cosNorm(PI+pcty*PI+slaoff2)} const mrgns=!unlockMrgn.s?0:cosNorm(pcty*freq1+off1)*amp1*getDec(amp1,freq1,slaff1)*0.2;const mrgne=!unlockMrgn.e?0:cosNorm(pcty*freq2+off2)*amp2*getDec(amp2,freq2,slaoff2)*0.2;const ogpctx=x/amtx;const nrst=floor(1/(pctyn-pcty))*4;const pctx=nearest(fnx(ogpctx,pcty),mrgns,1-mrgne,nrst);const pctxn=nearest(fnx((x+1)/amtx,pcty),mrgns,1-mrgne,nrst);if(pcty===pctyn||pctx===pctxn)continue;let posx,posxn,posy,posyn;if(axis==='x'){posx=map(pctx,0,1,mrgn,width-mrgn);posxn=map(pctxn,0,1,mrgn,width-mrgn);posy=map(pcty,0,1,mrgn,height-mrgn);posyn=map(pctyn,0,1,mrgn,height-mrgn)}else{posy=map(pctx,0,1,mrgn,height-mrgn);posyn=map(pctxn,0,1,mrgn,height-mrgn);posx=map(pcty,0,1,mrgn,width-mrgn);posxn=map(pctyn,0,1,mrgn,width-mrgn)} let points=[createVector(posx-0.35,posy-0.35),createVector(posxn+0.35,posy-0.35),createVector(posxn+0.35,posyn+0.35),createVector(posx-0.35,posyn+0.35),];if(!unlockMrgn.s&&!unlockMrgn.e){points=points.map((pt)=>{const mlt=amtx<minClipRagSize?0.04:0.009;const nx=(noise(pcty*3,0)*noise(3+pcty*10,0)-0.5)*sz*mlt;return axis==='x'?pt.add(nx,0):pt.add(0,nx)})} const fns=[dtri,dar];const dfx=abs(pctxn-pctx);const dfy=abs(pctyn-pcty);const ar=min(dfx,dfy)/max(dfx,dfy);if(ar>0.1)fns.push(darInv);if(amty>20)fns.unshift(dtri,dar);const shFn=fns[round(noise(pctx*0.75,pcty*10)*(fns.length-1))];const gidx=()=>{const i=idxOff+y+floor(ogpctx*2)+round(noise(pcty*10)*2);const idxs=[0,1,2,3];if(noise(pctx*2,pcty*2)>0.5)idxs.reverse();return idxs[i%4]};noise(0,pcty*2)>0.75?darInv(points,abs(gidx())):shFn(points,abs(gidx()))}} dpt(mrgn);ppprt(bw?19:11);image(cg,0,0)}