0xfbc78f49…5acbsent to0xa7d8d9ef…d270·#12,969,151·view on Etherscan
let hash=tokenData.hash,projectNumber=Math.floor(parseInt(tokenData.tokenId)/1e6),mintNumber=parseInt(tokenData.tokenId)%(1e6*projectNumber),seed=parseInt(tokenData.hash.slice(0,16),16);class Random{constructor(t){this.seed=t}random_dec(){return this.seed^=this.seed<<13,this.seed^=this.seed>>17,this.seed^=this.seed<<5,(this.seed<0?1+~this.seed:this.seed)%1e3/1e3}random_num(t,a){return t+(a-t)*this.random_dec()}random_int(t,a){return Math.floor(this.random_num(t,a+1))}}let R=new Random(seed);var DEFAULT_SIZE=1e3,WIDTH=window.innerWidth,HEIGHT=window.innerHeight,DIM=Math.min(WIDTH,HEIGHT),M=DIM/DEFAULT_SIZE;let clrLen,whichClr,clr1Blk,clr2Blk,clrBG1,clrBG2,stageW=900,stageH=900,numItems=300,_maxSizeInit=333,_maxSize=_maxSizeInit,_minSize=3,_count=0,stageMultiplier=2,_volume=stageW*stageMultiplier*(stageH*stageMultiplier),_numTrys=111,posX=[],posY=[],posS=[],angle1=0,angle2=0,clr1=[[0,0,0],[0,0,0],[19,19,19],[25,25,25],[34,34,34],[234,30,42],[102,47,144],[64,32,88],[27,27,27],[16,16,16],[48,48,48],[78,78,78],[102,102,102],[60,60,60],[34,34,34]],clr2=[[0,0,0],[0,0,0],[255,255,255],[0,0,0],[0,0,0],[30,168,224]],clr3=[[102,102,102],[153,153,153],[236,31,39],[102,47,144],[236,31,39]],clr4=[[24,101,100],[83,196,198],[153,153,153],[169,78,137],[236,70,142],[198,30,104],[237,71,144],[226,30,45],[129,29,55],[129,29,55],[226,30,45],[236,70,142],[169,78,137],[153,153,153],[83,196,198]],clr5=[[241,90,41],[102,188,69],[247,156,34],[28,117,188],[204,204,204]],clr6=[[240,107,81],[18,85,114],[63,60,106],[25,35,72],[63,60,106],[18,85,114]],clr7=[[20,41,80],[21,123,121],[175,211,196],[248,230,221],[250,207,194],[249,190,174],[250,207,194],[248,230,221],[175,211,196],[21,123,121]],clr8=[[50,190,173],[253,232,225],[204,204,204],[253,232,225],[239,65,54]],clr9=[[241,121,94],[252,223,208],[254,245,231],[229,201,191],[102,96,115],[25,35,72],[102,96,115],[229,201,191],[254,245,231],[252,223,208]],clr0=[[17,17,17],[236,236,236],[255,51,0],[255,255,255],[255,51,0],[0,149,168],[0,97,111],[0,0,0]],clr1Num=300,clr1Cnt=-1,clr2Num=900,clr2Cnt=-1,clrL=[],clrA=[],clrB=[],_screenMouseX=0,_screenMouseY=0,rotS=.06,rotD=.6,posRX=45,posRY=0,posRotRX=posRX,posRotRXV=0,posRotRXA=0,posRotRXF=0,posRotRY=posRY,posRotRYV=0,posRotRYA=0,posRotRYF=0,a1_radius=300,a1_maxforce=.9,a1_maxspeed=10,p1_radius=500,p1_rSq=p1_radius*p1_radius,p1_spring=.05,p1_ease=.9,p1_min=1,p1_max=1.5,p1_range=p1_max-p1_min,p1_value=p1_min,p1_speed=0,p1_goal=p1_max,myBlocks=[],baseR=0,baseW=1,baseH=1,baseD=1,renderNum=1,params={whichGeom:R.random_int(0,2),whichInterI:R.random_int(0,1),whichInterR:R.random_int(0,2),whichInterS:R.random_int(0,2),whichInterM:R.random_int(1,100),whichColor:R.random_int(1,100),whichTempo:R.random_int(0,2),whichOffset:R.random_int(0,2),whichStart:100+200*R.random_int(0,4),baseM:!1};function setup(){createCanvas(WIDTH,HEIGHT,WEBGL),background("#111111"),whichClr=params.whichColor>=1&¶ms.whichColor<=5?clr1:params.whichColor>=6&¶ms.whichColor<=10?clr2:params.whichColor>=11&¶ms.whichColor<=15?clr3:params.whichColor>=16&¶ms.whichColor<=25?clr4:params.whichColor>=26&¶ms.whichColor<=35?clr5:params.whichColor>=36&¶ms.whichColor<=50?clr6:params.whichColor>=51&¶ms.whichColor<=65?clr7:params.whichColor>=66&¶ms.whichColor<=80?clr8:clr9,0==params.whichTempo?params.whichTempo=3:1==params.whichTempo?params.whichTempo=1:params.whichTempo=.5,0==params.whichOffset?params.whichOffset=.2:1==params.whichOffset?params.whichOffset=3:params.whichOffset=20,params.whichInterM<=25&&2==params.whichGeom&&2==params.whichInterS&&(params.baseM=!0),mintNumber>0?mintNumber%100==0&&(whichClr=clr0,params.whichTempo=5,params.whichGeom=0,params.whichInterI=1,params.whichInterR=1,params.whichInterS=2,params.whichOffset=10,params.baseM=!1):(whichClr=clr8,params.whichTempo=1,params.whichGeom=0,params.whichInterI=1,params.whichInterR=1,params.whichInterS=2,params.whichOffset=10,params.baseM=!1),clrLen=whichClr.length,clr1Blk=floor(clr1Num/clrLen),clr2Blk=floor(clr2Num/clrLen);for(let t=0;t<clr1Num;++t){t%clr1Blk==0&&(clr1Cnt=(clr1Cnt+1)%clrLen);let a=color(whichClr[clr1Cnt][0],whichClr[clr1Cnt][1],whichClr[clr1Cnt][2]),s=color(whichClr[(clr1Cnt+1)%clrLen][0],whichClr[(clr1Cnt+1)%clrLen][1],whichClr[(clr1Cnt+1)%clrLen][2]);clrA.push(lerpColor(a,s,map(t,clr1Cnt*clr1Blk,(clr1Cnt+1)*clr1Blk,0,1)))}for(let t=0;t<clr2Num;++t){t%clr2Blk==0&&(clr2Cnt=(clr2Cnt+1)%clrLen);let a=color(whichClr[clr2Cnt][0],whichClr[clr2Cnt][1],whichClr[clr2Cnt][2]),s=color(whichClr[(clr2Cnt+1)%clrLen][0],whichClr[(clr2Cnt+1)%clrLen][1],whichClr[(clr2Cnt+1)%clrLen][2]);clrB.push(lerpColor(a,s,map(t,clr2Cnt*clr2Blk,(clr2Cnt+1)*clr2Blk,0,1)))}for(let t=0;t<numItems;t++)runPacking()}function draw(){if(noLights(),clrBG1=clrB[floor((params.whichStart+1*frameCount)%clrB.length)],clrBG2=clrB[floor((params.whichStart+50+1*frameCount)%clrB.length)],mintNumber>0&&mintNumber%100==0&&(clrBG1="#FF3300"),background(clrBG1),push(),scale(constrain(M,0,1)),mouseIsPressed)posRotRX=map(mouseY,0,HEIGHT,-180,180),posRotRY=map(mouseX,0,WIDTH,-180,180),rotateX(radians(posRotRX)),rotateY(radians(posRotRY));else{posRotRX+=posRotRXV=rotD*(posRotRXV+(posRotRXA=(posRotRXF=-rotS*(posRotRX-posRX))/1)),posRotRY+=posRotRYV=rotD*(posRotRYV+(posRotRYA=(posRotRYF=-rotS*(posRotRY-posRY))/1)),rotateX(radians(posRotRX)),rotateY(radians(posRotRY));let t=map(sin(angle2),-1,1,0,10);rotateX(radians(t));let a=20*sin(angle1);rotate(radians(a))}_screenMouseX=map(mouseX,0,WIDTH,-WIDTH/2,WIDTH/2),_screenMouseY=map(mouseY,0,HEIGHT,-HEIGHT/2,HEIGHT/2),strokeWeight(0),noStroke(),push(),translate(0,0,-2),fill(clrBG1),rect(2*-stageW,2*-stageH,4*stageW,4*stageH),pop(),0==params.baseM&&(lights(),pointLight(255,255,255,0,-3e3,111),pointLight(127,0,0,0,100,0));for(let t=0;t<myBlocks.length;t++)myBlocks[t].draw();pop(),angle1+=.005,angle2+=.0075}function runPacking(){let t=_count;for(let t=0;t<_numTrys&&!(_count>=numItems||_maxSize<_minSize);++t){let a=R.random_num(-stageW/2,stageW/2),s=R.random_num(-stageW/2,stageW/2),e=_maxSize/2.5,r=PI*(e*e)*.9;checkCollisions(_count-1,a,s,e)||(posX.push(a),posY.push(s),posS.push(_maxSize),myBlocks.push(new Block(t,a,s,_maxSize,R.random_int(0,360),R.random_int(0,360),R.random_int(0,360),R.random_int(1,3))),(_volume-=r)/r<20&&(_maxSize*=.95),++_count)}t==_count&&(_maxSize*=.95)}function checkCollisions(t,a,s,e){let r=!1,i=0,o=0;var n=posX.length;for(let t=0;t<n;t++)if((o=dist(posX[t],posY[t],a,s))>i&&(i=o),isCollision(posX[t],posY[t],a,s,posS[t]/2,e)){r=!0;break}return r}function isCollision(t,a,s,e,r,i){let o=r+i,n=t-s,h=a-e;return o*o>n*n+h*h}class Block{constructor(t,a,s,e,r,i,o,n){this.initI=t,this.initX=map(a,-stageW/2,stageW/2,-stageW,stageW),this.initY=map(s,-stageW/2,stageW/2,-stageW,stageW),this.initS=e,this.initRX=r,this.initRY=i,this.initRZ=o,mintNumber>0&&(this.initCT=mintNumber%100==0?1:n),this._x=map(a,-stageW/2,stageW/2,-stageW,stageW),this._y=map(s,-stageW/2,stageW/2,-stageW,stageW),this._s=1*e,this.origin=createVector(this._x,this._y,0),this.destination=createVector(this._x,this._y,0),this.location=this.origin.copy(),this.velocity=createVector(0,0),this.acceleration=createVector(0,0)}draw(){let t=createVector(0,0,0),a=!1,s=createVector(_screenMouseX,_screenMouseY,0),e=p5.Vector.sub(this.origin,s),r=e.mag();if(r<=a1_radius+this._s&&(a=!0,e.normalize(),e.mult(a1_radius+this._s-r),t.add(e)),this.destination=this.origin.copy(),1==a&&(this.destination.x+=t.x,this.destination.y+=t.y,this.destination.z+=t.z),p5.Vector.sub(this.destination,this.location).mag()>.01){let t=p5.Vector.sub(this.destination,this.location),a=t.mag();if(t.normalize(),a<50){let s=map(a,0,50,0,a1_maxspeed);t.mult(s)}else t.mult(a1_maxspeed);let s=p5.Vector.sub(t,this.velocity);s.limit(a1_maxforce),this.acceleration.add(s),this.velocity.add(this.acceleration),this.velocity.limit(a1_maxspeed),this.location.add(this.velocity),this.acceleration.mult(0),0==params.whichInterI&&(this._x=this.location.x,this._y=this.location.y)}let i=(this._x-_screenMouseX)*(this._x-_screenMouseX)+(this._y-_screenMouseY)*(this._y-_screenMouseY);p1_value+=p1_speed=p1_speed*p1_spring+((p1_goal=i<p1_rSq?(1-i/p1_rSq)*p1_range+p1_min:p1_min)-p1_value)*p1_ease,push(),translate(this._x,this._y,0),strokeWeight(0),noStroke(),1==this.initCT?fill(clrA[floor(((params.whichStart+this.initI)*params.whichOffset+frameCount*params.whichTempo)%clrA.length)]):fill(clrB[floor(((params.whichStart+this.initI)*params.whichOffset+frameCount*params.whichTempo)%clrB.length)]),baseR=0==params.whichInterR?1:map(p1_value,p1_min,p1_max,-.25,.25),0==params.whichInterS?(baseW=map(p1_value,p1_min,p1_max,1,1.75),baseH=map(p1_value,p1_min,p1_max,1,1.75),baseD=map(p1_value,p1_min,p1_max,1,1.75)):1==params.whichInterS?(baseW=map(p1_value,p1_min,p1_max,1,.1),baseH=map(p1_value,p1_min,p1_max,1,.1),baseD=map(p1_value,p1_min,p1_max,1,.1)):(baseW=map(p1_value,p1_min,p1_max,1,-.999),baseH=map(p1_value,p1_min,p1_max,1,-.999),baseD=map(p1_value,p1_min,p1_max,1,90)),0==params.whichGeom?(this.initS<=15&&translate(0,0,map(this.initI,0,numItems,0,1800)),rotateX(radians(this.initRX*baseR)),rotateY(radians(this.initRY*baseR)),rotateZ(radians(this.initRZ*baseR)),box(1.75*this._s*baseW,1.75*this._s*baseH,.75*this._s*baseD)):1==params.whichGeom?(this._s<=15&&translate(0,0,map(this.initI,0,numItems,0,400)),sphere((.8*this._s+1)*baseW,42,42)):(rotateX(radians(this.initRX*baseR)),rotateY(radians(this.initRY*baseR)),rotateZ(radians(this.initRZ*baseR)),1==params.baseM&&(strokeWeight(2),stroke(clrA[floor((.5*(300+this.initI)+frameCount*(.5*params.whichTempo))%clrA.length)]),fill(clrBG2)),box(1.25*this._s*baseW,1.25*this._s*baseH,1.75*this._s*baseD)),pop()}}function keyTyped(){return"s"===key&&(saveCanvas("OrganizedDisruption_"+renderNum,"jpg"),renderNum++),!1}function windowResized(){WIDTH=window.innerWidth,HEIGHT=window.innerHeight,DIM=Math.min(WIDTH,HEIGHT),M=DIM/DEFAULT_SIZE,resizeCanvas(windowWidth,windowHeight)}