memoscan
← all memos

Memo 0x2a4fb6aa…594741 on Ethereum

ass"===_.shape){for(let e=.05*-width;e<1.1*width;e+=.2*width){const t=w(e,height*M(.1,.7),e,height,200);o=[...o,...t]}for(let e=.15*-width;e<1.1*width;e+=.2*width){const t=w(e,height*M(.1,.7),e,height,200);a=[...a,...t]}o=A(o),a=A(a)}if("tree"===_.shape){const e=u(width/2,height/3.5,400,400,.2*width,90);o=[...o,...e]}let p=_.divider,x=_.angle;const{lerpColors:y,backColors:k,backColors2:v}=_;R.background(255);const C=E(v),m=M(.2,.8),F=M(.05,.15);"grass"===_.shape?(R.push(),R.noStroke(),l(R,width*M(.1,.9),height*M(.1,.3),width/2,[0,m-F,m,m+F,1],[E(v),C,C,C,E(v)]),R.rect(0,0,width,height),R.pop()):"spiral"===_.shape?(R.push(),R.noStroke(),l(R,.5*width,.5*height,width/2,[0,1],[E(v),E(v)]),R.rect(0,0,width,height),R.pop()):"structure"===_.shape?R.background(E(v)):(R.push(),R.noStroke(),c(R,width/2,0,width/2,height,[0,m-F,m,m+F,1],[E(v),C,C,C,E(v)]),R.rect(0,0,width,height),R.pop());const G=E(y),N=E(y);R.push(),R.noFill(),R.strokeWeight(20*H),R.stroke(G),R.rect(0,0,width,height),R.pop(),R.push(),R.noFill(),R.strokeWeight(2*H),R.stroke(N),R.rect(5*H,5*H,width-10*H,height-10*H),R.pop();for(let e=0;e<o.length;e+=1){const t=r,h=r,i=Math.max(t,h);let s=map(cos(e*_.waveR),-1,1,0,_.size),n,d;"tree"===_.shape?(n=P(o[e].x,o[e].y,s,t,x,width,0,1.1*height,1.1*height),d=P(o[e].x,o[e].y,s,h,x,1.1*width,.1*-width,height,.1*-height)):"grass"===_.shape?(n=P(o[e].x,o[e].y,s,t,x,width,0,1.1*height,1.1*height),d=P(a[e].x,a[e].y,s,h,x,width,0,1.1*height,1.1*height)):"structure"===_.shape?(n=P(o[e].x,o[e].y,s,t,x,width,0,height,0),d=P(o[e].x,o[e].y,s,h,x,width,0,height,0)):(n=P(o[e].x,o[e].y,s,t,x,1.1*width,.1*-width,1.1*height,_.roots?1.1*height:0),d=P(o[e].x,o[e].y,s,h,x,1.1*width,.1*-width,height,.1*-height));for(let t=0;t<i-20;t+=1)e%p==0?(R.push(),R.beginShape(),R.fill(y[t%y.length]),_.noFill&&R.noFill(),R.strokeWeight(.5*H),R.stroke(y[(t+Math.round(.1*y.length))%y.length]),_.blackStroke&&R.stroke(0),R.vertex(n[t%n.length].x,n[t%n.length].y),R.bezierVertex(n[t%n.length].x,n[t%n.length].y,n[(t+W(10))%n.length].x,n[(t+W(10))%n.length].y,n[(t+20)%n.length].x,n[(t+20)%n.length].y),R.vertex(n[t%n.length].x,n[(t+1)%n.length].y),R.vertex(n[t%n.length].x,n[(t+2)%n.length].y),R.endShape(CLOSE),e%10==0&&(R.push(),R.strokeWeight(.5*H),R.stroke(k[0]),n[t%d.length].y>0&&n[t%d.length].y<height&&R.stroke(k[Math.round(map(n[t%n.length].y,height,0,0,k.length-1))]),R.fill(k[Math.round(map(sin(5*t),-1,1,0,k.length-1))]),R.circle(n[t%n.length].x,n[t%n.length].y,M(1,5)*H),R.pop()),R.pop()):(R.push(),R.beginShape(),R.fill(k[t%k.length]),R.fill(k[Math.round(map(sin(5*t),-1,1,0,k.length-1))]),R.strokeWeight(.5*H),R.stroke(k[(t+Math.round(.1*k.length))%k.length]),R.stroke(k[0]),d[t%d.length].y>0&&d[t%d.length].y<height&&R.stroke(k[Math.round(map(d[t%d.length].y,0,height,0,k.length-1))]),"tree"!==_.shape&&"structure"!==_.shape||R.stroke(k[(t+Math.round(.1*k.length))%k.length]),R.strokeWeight(S()*H),_.bigStroke&&(R.strokeWeight(5*H),R.stroke(k[(t+Math.round(.1*k.length))%k.length])),R.vertex(d[t%d.length].x,d[t%d.length].y),R.vertex(d[(t+1)%d.length].x,d[(t+1)%d.length].y),R.vertex(d[(t+2)%d.length].x,d[(t+2)%d.length].y),R.endShape(CLOSE),R.pop()),e%10==0&&(R.push(),R.strokeWeight(.5*H),R.stroke(y[(t+Math.round(.1*y.length))%y.length]),R.fill(k[t%k.length]),"wall"===_.shape?R.circle(n[t%n.length].x,n[t%n.length].y,map(sin(10*t),-1,1,1,s/2)):R.circle(n[t%n.length].x,n[t%n.length].y,M(H,s)),R.pop())}R.push(),R.noFill(),R.strokeWeight(2*H),R.stroke(N),R.rect(5*H,5*H,width-10*H,height-10*H),R.pop(),push(),noStroke(),rect(0,0,width,height),drawingContext.clip(),image(R,0,0),pop()},G()}function B(){const e=void 0,t=D.canvas.style;let h,i;.75*window.innerHeight>=window.innerWidth?(h=window.innerWidth,i=window.innerWidth/.75):(i=window.innerHeight,h=.75*window.innerHeight),t.position="absolute",t.display="block",t.top=t.left=t.right=t.structure="0",t.width=`${h}px`,t.height=`${i}px`}function windowResized(){B()}.75*window.innerHeight>=window.innerWidth?(N=window.innerWidth,z=window.innerWidth/.75):(z=window.innerHeight,N=.75*window.innerHeight);const L=[1,2,3,4,5,6,7,8,9];window.addEventListener("keydown",(e=>{L.includes(Number(e.key))&&(R.pixelDensity(Number(e.key)),pixelDensity(Number(e.key)),F.setSeed(C),G()),"s"===e.key&&saveCanvas(tokenData.tokenId,"png")}));const P=(e,t,h,i,s,n,r,d,o)=>{const a=[];let f={x:e,y:t},l=0;for(let e=0;e<i;e+=1){let t;t=$(f,e%2==0?h:h*_.weeds,l,n,r,d,o),f=t,a.push(t),l+=s}return a},$=(e,t,h,i,s,n,r)=>{const d={};return e.x+t>i?d.x=e.x-t:e.x-t<s?d.x=e.x+t:d.x=e.x+E([t*cos(h),t*sin(h)]),e.y+t>n?d.y=e.y-t:e.y-t<r?d.y=e.y+t:d.y=e.y+E([t*cos(h),t*sin(h)]),d},I=(e,t,h,i,s,n)=>{const r=[];let d=0,o=n;for(let a=0;a<s;a+=1)r.push({x:e+h*R.cos(d)*o,y:t+h*R.sin(d)*o}),d+=i/s,o+=n;return r},O=(e,t,h,i,s,n)=>{const r=[];let d=0;for(let o=0;o<s;o+=1)r.push({x:e+h*R.sin(d)*R.cos(d),y:t+h*R.cos(d*n)}),d+=i/s;return r},q=(e,t,h,i,s)=>{const n=[];let r=0;for(let d=0;d<s;d+=1)n.push({x:e+h*R.cos(r),y:t+h*R.sin(r)*R.cos(r)}),r+=i/s;return n},Q=(e,t,h,i,s,n)=>{const r=[];let d=0;for(let o=0;o<s;o+=1)r.push({x:e+h*R.sin(d*n)*R.cos(d*n),y:t+h*R.cos(d)}),d+=i/s;return r};