0xdcf4de0c…9ddcsent to0xa86cd4ec…55c4·#17,961,982·view on Etherscan
class Ornament{constructor(e,t,s){this.Te=e,this.palette=s,this.Be=t}show(){this.Te(this.Be,this.palette)}}class RG{constructor(e){this.position=createVector(e.x,e.y),this.width=e.width,this.height=e.height,this.stroke=e.stroke,this.fill=e.fill,e.direction&&[RG.Ee,RG.ze,RG._e,RG.He].includes(e.direction)?this.direction=e.direction:this.direction=RG.Ee,this.Ae=e.Ae,this.Oe=e.Oe,this.Ne=e.Ne,this.De=e.De,this.Qe=e.Qe,this.je=e.je,this.Xe=e.Xe,this.Ye=e.Ye,this.seed=R.O(0,100)}K(){}Je(e,t,s){push(),translate(e,t),rotate(s*radians(180));e=s*R.N(25,55),strokeWeight(2),stroke(this.stroke),t=R.A();t<.5?fill(this.fill):t<.6?fill(this.stroke):noFill(),ellipse(0,0,e*this.Xe,e*this.Ye),strokeWeight(2.4),line(-(e*this.Xe)/2,0,e*this.Xe,0),pop()}fe(){noiseSeed(this.seed);let i,e,r,t,o=(this.direction==RG.Ee?(i=e=>e<this.width,e=e=>e<this.height,r=e=>e+this.De,t=e=>e+this.De):this.direction==RG.ze?(i=e=>e>-this.width,e=e=>e<this.height,r=e=>e-this.De,t=e=>e+this.De):this.direction==RG._e?(i=e=>e<this.width,e=e=>e>-this.height,r=e=>e+this.De,t=e=>e-this.De):this.direction==RG.He&&(i=e=>e>-this.width,e=e=>e>-this.height,r=e=>e-this.De,t=e=>e-this.De),push(),translate(this.position.x,this.position.y),this.Oe);for(let s=0;e(s);s=t(s)){o+=this.Ne;let t=this.Ae;for(let e=0;i(e);e=r(e))t+=this.Ne,this.Je(e,s,noise(t,o))}pop()}static Ee=1;static ze=2;static _e=3;static He=4}class Supershape{constructor(e,t,s){this.position=createVector(e,t),this.Ue={a:{name:"a",value:1,step:.1,random:()=>this.randomizer.O(0,100)},b:{name:"b",value:1,step:.1,random:()=>this.randomizer.O(0,100)},p1:{name:"p1",value:1,step:.1,random:()=>this.randomizer.O(0,100)},p2:{name:"p2",value:1,step:.1,random:()=>this.randomizer.O(0,100)},p3:{name:"p3",value:1,step:.1,random:()=>this.randomizer.O(0,100)},m:{name:"m",value:0,step:.1,random:()=>this.randomizer.O(0,100)},phiMin:{name:"Φ min",value:0,step:.5,unit:"π",random:()=>0},phiMax:{name:"Φ max",value:4,step:.5,unit:"π",random:()=>2*this.randomizer.N(1,4)},r:{name:"r",value:200,step:1,unit:"px",random:()=>200}},this.qe=.01,this.Ke(0)}Ze(e){return this.$e().f(e,this)}get(e){return this.Ue[e].value}Ke(e){this.et=e}$e(){return Supershape.tt[this.et]}fe(){push(),translate(this.position.x,this.position.y),beginShape();for(let e=this.get("phiMin")*PI;e<this.get("phiMax")*PI;e+=this.qe){var t=this.st(e),s=this.Ze(e)*t*cos(e),t=this.Ze(e)*t*sin(e);vertex(s,t)}endShape(CLOSE),pop()}st(e){var t=1/this.get("a")*cos(e*this.get("m")/4),t=abs(t),e=(t=pow(t,this.get("p2")),1/this.get("b")*sin(e*this.get("m")/4)),e=abs(e),t=(e=pow(e,this.get("p3")),pow(t+e,1/this.get("p1")));return 0===t?0:1/t}re(){this.points=[];for(let e=this.get("phiMin")*PI;e<this.get("phiMax")*PI;e+=this.qe){var t=this.st(e),s=this.Ze(e)*t*cos(e),t=this.Ze(e)*t*sin(e);this.points.push(createVector(s,t))}}it(t){for(let e=0;e<Object.keys(t).length;e++){var s=Object.keys(t)[e];t[s]&&(this.Ue[s].value=t[s])}}static tt=[{},{},{},{description:"|cos(m/2*PHI)*r|",f:(e,t)=>abs(cos(t.get("m")*e/2)*t.get("r")),rt:(e,t)=>{var s=t.findMax();let i=0;i=abs(s.x)>=abs(s.y)?abs(e/(t.st(s.phi)*cos(s.phi))):abs(e/(t.st(s.phi)*sin(s.phi))),t.Ue.r.value=i}},{}]}class Tepal{constructor(e,t,s,i,r){this.position=e,this.size=t,this.rotation=s,this.Be=i,this.ot=r,this.K()}K(){this.ht=this.Be.lt(this.position,this.size,this.ot),this.shape=[],this.nt()}show(){translate(this.position.x,this.position.y),rotate(radians(this.rotation)),translate(-this.position.x,-this.position.y),this.fe()}fe(){push(),fill(this.Be.$),stroke(this.Be.borderColor),strokeWeight(this.Be.ct),beginShape();for(let e=0;e<this.shape.length;e++)curveVertex(this.shape[e].x,this.shape[e].y);endShape(),pop()}nt(){var t=new Supershape(this.position.x,this.position.y);t.Ue.m.value=this.ht.m,t.Ue.a.value=this.ht.a,t.Ue.b.value=this.ht.b,t.Ue.p1.value=this.ht.Rt,t.Ue.p2.value=this.ht.ft,t.Ue.p3.value=this.ht.ut,t.Ke(this.ht.dt),t.Ue.phiMax.value=this.ht.phiMax,t.Ue.r.value=this.ht.size/2,t.qe=this.ht.qe,t.re();for(let e=0;e<t.points.length;e++){var s=this.ht.vt;this.shape.push(createVector(t.points[e].x+s,t.points[e].y+s))}}}let T,R,P,G;const FLOWER_REST=1e4;let currentHash,playing=!0,generated=!1,time=0,force=!1;window.addEventListener("resize",function(e){force=!0},!0);let skyFromColor,skyToColor,fundo,rG1,rG2,rG3,esp1,esp2,esp3,flower1,flower2,flower3,leaves=[],leavesSecondLayer=[],leavesLast=[],leavesBack=[],rocks1=[],rocks2=[],rocks3=[],rocks4=[];function setup(){createAdaptiveCanvas(1600,900),currentHash=tokenData.hash,noCursor()}