_script
Contract variable
within
Slot
0x0000000000000000000000000000000000000000000000000000000000000010 Offset
0 Type
string
Value
let pg,seed=parseInt(tokenData.hash.slice(0,16),16);const firework=[],colors=['#c33f3f','#ffe63f','#609f65','#ff893f','#ad4dd0','#00c0f8','#636363','#FFFFFF','#2e40a9','#222222'],ccA=['#F085F2','#C55CF2','#7732D9','#F27E63','#F25252'],ccB=['#C33A32','#006E46','#F6B221','#880D53','#1E428A'];let gravity,rdn,count,frame,posX=[],num=[],type=[],dis=[],hh=[];const ss=150;let bg,pg2,pg3,colorId,frameStyle,branch,branchIdx,doBranch,step=0,fireColor=0;const json={},snap=isToSnap;function preload(){compose()}function setup(){createCanvas(600,600,WEBGL),noSmooth(),pg=createGraphics(ss,ss,WEBGL),pg2=createGraphics(600,600),pg3=createGraphics(600,600),canvas.imageSmoothingEnabled=!1,this._renderer.getTexture(pg).setInterpolation(NEAREST,NEAREST),pg.angleMode(DEGREES),pg.noSmooth(),pg.clear(),pg.background(0),pg2.clear(),pg2.image(bg,0,0),pg3.clear(),pg3.image(tree,0,0),gravity=createVector(0,.004)}function echo(){const e=color(colors[colorId]),o=red(e),t=red(e),r=red(e);pg.fill(o,t,r,10),pg.noStroke(),pg.rectMode(CENTER),pg.rect(0,0,ss,ss)}function noEcho(){background(0),pg.clear()}function doFire(e){if(null!=num[e])for(let o=0;o<num[e];o++)firework.push(new Ball(o,pos(posX[e]),type[e],num[e],dis[e],hh[e]))}function draw(){if(150==++step)pg2.clear(),pg2.image(bg,0,0),pg3.clear(),pg3.image(tree,0,0),doBranch<5&&pg3.image(branch,0,0);else if(step>160){if(echo(),5==(count=frameCount%500)?(doFire(0),doFire(10)):20==count?(doFire(1),doFire(11)):40==count?(doFire(2),doFire(12)):60==count?(doFire(3),doFire(13)):80==count?(doFire(4),doFire(14)):100==count?(doFire(5),doFire(15)):120==count?(doFire(6),doFire(16)):140==count?(doFire(7),doFire(17)):160==count?(doFire(8),doFire(18)):180==count&&(doFire(9),doFire(19)),firework.length>0)for(let e=0;e<firework.length;e++)firework[e].show(),firework[e].move(),firework[e].applyForce(gravity),firework[e].vel.y>0&&firework[e].boom(),firework[e].isDead()&&firework.splice(e,1);imageMode(CENTER),image(pg2,0,0,500,500),image(pg,0,0,500,500),blendMode(BLEND),image(pg3,0,0,500,500),noFill(),image(frame,0,0)}800==step&&snap&&(save(`${tokenData.tokenId}.png`),saveJSON(json,`${tokenData.tokenId}.json`),window.emitMetadataDownloaded&&setTimeout(()=>{window.emitMetadataDownloaded()},1e4))}class Ball{constructor(e,o,t,r,i,n){this.pos=createVector(o,88),this.vel=createVector(0,-.01),this.acel=createVector(0,-1),this.s=1,this.t=t,this.aux=!0,this.a=255,this.life=random(3,10),this.id=e,this.num=r,this.c=null,this.dis=i,this.hh=n}show(){pg.noStroke(),fireColor>1?(this.c=colors[colorId],pg.fill(this.c)):(this.cc=ccB[this.id%ccB.length],this.c=color(this.cc),pg.fill(this.c)),pg.ellipse(this.pos.x,this.pos.y,this.s,this.s),this.aux||(this.a-=random(2,this.life))}move(){this.vel.add(this.acel),this.vel.limit(this.hh),this.pos.add(this.vel),this.acel.mult(0)}applyForce(e){this.acel.add(e)}boom(){0==this.t?this.aux&&(this.x=cos(this.id/this.num*6.28),this.y=sin(this.id/this.num*6.28),this.acel=createVector(this.x,this.y),this.acel.normalize(),this.acel.mult(this.dis),this.aux=!1):1==this.t?this.aux&&(this.acel=p5.Vector.random2D(),this.acel.normalize(),this.acel.mult(random(this.dis)),this.aux=!1):2==this.t&&(this.acel=p5.Vector.random2D(),this.acel.normalize(),this.acel.mult(this.dis),this.aux=!1)}isDead(){return this.a<10}}function compose(){step=0,(rdn=new Random(seed)).random_dec(),colorId=rdn.random_int(0,10);const e=rdn.random_int(0,10);let o;o=!((fireColor=rdn.random_int(0,10))>1),branchIdx=0;let t,r,i,n,s=!1,a=!1;n=colors[colorId];const d=rdn.random_num(0,1);if(frameStyle=d>.95?5:d>.9?4:d>.8?3:d>.66?2:d>.33?1:0,frame=loadImage(`${imgBaseUrl}/frame_${frameStyle}.png`),e<7){s=!1;const e=rdn.random_int(0,9);t=e;const o=rdn.random_int(0,9);r=o,i=branchIdx=rdn.random_int(0,9),bg=loadImage(`${imgBaseUrl}/moon_${e}.png`),tree=loadImage(`${imgBaseUrl}/tree_${o}.png`)}else s=!0,bg=loadImage(`${imgBaseUrl}/moon_${colorId}.png`),tree=loadImage(`${imgBaseUrl}/tree_${colorId}.png`),branchIdx=colorId,t=colorId,r=colorId,i=colorId;(doBranch=rdn.random_int(0,10))<5?(branch=loadImage(`${imgBaseUrl}/t_${branchIdx}.png`),a=!0):i=null;c Size
32 bytes Last txn
Txn hash | Block number | Date | From | Value before | Value after |
---|---|---|---|---|---|
13384529 | -- | "http://localhost:3001/api/tokens/ " |