0xb3b212da…19cbsent to0x99a9b7c1…b069·#15,854,878·view on Etherscan
,we=[],ke=[],ve=[],Le="NEW",Se={};window.setup=()=>{colorMode(HSL);let r=1;const e=new re;var n;tokenData.hash&&(r=1e17*e.random_dec()),randomSeed(r),noiseSeed(r),window.seedValue=r,pixelDensity(2),createCanvas(window.innerHeight*le,window.innerHeight),n=height/1200,M=n,window.CONFIG=Se=Hr(e);o=Se.palette,i=Se.colorMod,X="exclusive"===i?T(I[o]):I[o];var o,i;const a=B(Se.c1).cb;se=a.slices,ye=((r,e)=>{const n=(0,Or[r])(),o=Ar(n);return e?o:n})(Se.b9,Se.b8),ge=(r=>{let e;return"circle"===r?e=[$(me/2,he/2,me,128)]:"diamond"===r&&(e=[U(me/2,he/2,me,me)]),e})(Se.secondaryGeometry),Re(),Se.oneLastSkewTho&&se.splice(se.length-1,0,{a9:random()>.5?.5:-.5,b0:D(7,2),a6:random()>.5?-1:1,b1:0})},window.draw=()=>{"NEW"===Le?(background(255),Ce(),Pe(),"DEBUG"!==Se.fillStrategy&&background(z("c2").a4),Le="RENDERSHADING"):"RENDERSHADING"===Le?"DEBUG"===Se.fillStrategy?((r,e,n,o,i)=>{r.forEach(((r,e)=>{noStroke();const o=n.a4Polygons[e];stroke(...o.a4.l,1),stroke(0,0,20),fill(255,0,random(80,100)),r&&(beginShape(),r.forEach((r=>{vertex(r.x,r.y)})),vertex(r[0].x,r[0].y),endShape())})),o.forEach((r=>{stroke(40),strokeWeight(q(.5)),r.length&&line(r[0].x,r[0].y,r[1].x,r[1].y)})),i()})(ye,0,xe,ce,(()=>Le="POSTPROCESSING")):"individual"===Se.fillStrategy&&(Se.renderSecondaryPolys?Qr(ye,ge,pe,xe,ce,(()=>Le="POSTPROCESSING")):Qr(ye,[],pe,xe,ce,(()=>Le="POSTPROCESSING"))):"POSTPROCESSING"===Le?Zr(ye,ce,xe,fe,(()=>Le="DONE")):"DONE"===Le?(noLoop(),ne=get()):"LOOPING"===Le&&(1===oe&&image(ne,0,0,width,height),ee.forEach((r=>r.tick())))},window.keyPressed=()=>{"DONE"!==Le&&"LOOPING"!==Le||be()};const be=()=>{Le="LOOPING",(()=>{oe=1===oe?2:1,image(ne,0,0,width,height),ee=[];for(let r=0;r<250;r++){const r=random(0,me),e=random(0,he),n=r*(width/me),o=e*(height/he);let i=get(n,o),a=Ir(i[0],i[1],i[2]);a=R(a,2);let t=a,s=createVector(n,o,2),l=0,h=createVector(cos(l),sin(l)),m=random(.15,.5),d=Yr(s,h,m,a,t,!0,2===oe);ee.push(d)}})(),loop()},Ce=()=>{const r=15,e={some:.93,alot:.87,none:1},n=random(2*-PI,2*PI);for(let o=0;o<2500;o++){const o=z("b5",random(-15,10));switch(o.a8&&random()<o.a8.c?o.d6=!0:random()>e[Se.d1Probability]&&(o.d1=!0,o.d1Type=P(["leaf",5,"dots",3,"evenLines",4,"spacedLines",5,"perspectiveLines",5,"perspectiveDots",5])),o.d1||(o.fillType=P([Se.internalShadeMode,50,"leaf",50])),Se.fillDirection){case"down":o.d9=PI/2+random(-.1,.1);break;case"uniform":o.d9=n;break;case"flippy":o.d9=PI/2*(random()>.5?1:-1)+random(-.1,.1);break;default:o.d9=random(2*PI)}xe.a4Polygons.push(o),xe.e0.push({...z("b5",random(-15,r)),type:P(["pop",1,"shade",7,"none",8])}),"random"===Se.backgroundLighting?xe.d8.push(z("c2",random(-7.5,7.5))):xe.d8.push(z("c2",0));const i=P(Cr);xe.b0s.push({color:z("c7",5),style:i.type,spacing:random(i.spacing[0],i.spacing[1]),sz:random(i.sz[0],i.sz[1])})}xe.c0=z("c0",0)},Pe=()=>{let r=ye,e=ge;const n=xe.a4Polygons.map((r=>!0===r.d1));for(let n=1;n<=se.length;n++){let{a9:o,b0:i,a6:a,b1:t}=se[n-1];r=Ie(r,i,o,a,t),random()>.25&&(e=Ie(e,i,o,a,t,.85)),ce.length>0?ce=Xe(ce,i,o,a,t):ce.push(i)}ye=r,ge=e,ge=ge.filter((r=>r.length>1)),"minimal"===Se.shouldPerformReversion&&Te(.15),"negminimal"===Se.shouldPerformReversion?Te(-.15):"single"===Se.shouldPerformReversion?Te():"double"===Se.shouldPerformReversion&&Fe();let o=Se.a7;"distant"!==o&&"adaptive"!==o&&"verydistant"!==o&&"tight"!==o&&"TEST"!==o&&"full"!==o&&"cover"!==o&&"neardistant"!==o&&"veryverydistant"!==o||(De(),Ne(Se.a7)),"center"!==Se.a7&&"onlycenter"!==Se.a7||De();Be()&&(De(),Ne(Se.a7)),ye=Oe(ye),ye=ye.filter((r=>r.length>2)),ce=ze(ce),pe=E(ce,ye,n),Ye(),Ee(),ue=ye,ye=_(ye,me,he,width,height),ge=_(ge,me,he,width,height),ce=_(ce,me,he,width,height),pe=pe.map((r=>_([r[0]],me,he,width,height))),ce=He(ce)},He=r=>r.filter((r=>!(isNaN(r[0].x)||isNaN(r[1].x)||isNaN(r[0].y)||isNaN(r[1].y)))),Ye=()=>{let r=[],e=[],n=[],o=[];ye=ye.sort(((r,e)=>d(e)-d(r))),xe.a4Polygons.forEach(((i,a)=>{if(a>ye.length-1)return!1;i.d6?(n.unshift(i),o.unshift(ye[a])):(r.push(i),e.push(ye[a]))})),ye=e.concat(o),xe.a4Polygons=r.concat(n)},Ee=()=>{const r=height/he;let e;we=ye.map((n=>(e=d(n),{area:e,a5:h(n),perimeter:c(n),scaled:{area:e*r,a5:h(n,r)}}))),ke=pe.map((n=>n.map((n=>(e=d(n),{area:e,a5:h(n),scaled:{area:e*r,a5:h(n,r)}}))))),ve=ge.map((n=>(e=d(n),{area:e,a5:h(n),scaled:{area:e*r,a5:h(n,r)}})))},Xe=(r,e,n,o,i)=>Ge(r,e,n,o,i),Ie=(r,n,o,i,t,s=1)=>{let l=[];return r.forEach((r=>{if(e(n[0].x,n[0].y,n[1].x,n[1].y,r)%2!=0){const e=b(r,n);l=l.concat(C(e))}else l.push(r)})),l=l.map((r=>{const e=a(r);let l=null;return(n[1].x-n[0].x)*(e.y-n[0].y)-(e.x-n[0].x)*(n[1].y-n[0].y)>i?(l=g(r,n,o).vertices,0!==t.distance&&t.a6>.5&&(l=x(l,n,t.distance))):(l=r,0!==t.distance&&t.a6<.5&&(l=x(l,n,t.distance))),((r,e,n)=>{const o=[];for(let i=0;i<r.length;i++)o.push({x:lerp(r[i].x,e[i].x,n),y:lerp(r[i].y,e[i].y,n)});return o})(r,l,s)})),l.length>0?l:r},Ge=(r,e,n,o,a)=>{let t=[];return r.forEach((r=>{if(i(e[0].x,e[0].y,e[1].x,e[1].y,r[0].x,r[0].y,r[1].x,r[1].y)){const n=((r,e)=>{const n=i(r[0].x,r[0].y,r[1].x,r[1].y,e[0].x,e[0].y,e[1].x,e[1].y),o={x:n[0],y:n[1]};return[[r[0],o],[r[1],o]]})(r,e);t=t.concat(n)}else t.push(r)})),t=t.map((r=>{const i=(r=>({x:lerp(r[0].x,r[1].x,.5),y:lerp(r[0].y,r[1].y,.5)}))(r);if((e[1].x-e[0].x)*(i.y-e[0].y)-(i.x-e[0].x)*(e[1].y-e[0].y)>o){let o=g(r,e,n).vertices;return 0!==a.distance&&a.a6>.5&&(o=x(o,e,a.distance)),o}{let n=r;return 0!==a.distance&&a.a6<.5&&(n=x(n,e,a.distance)),n}})),t.push(e),t.length>0?t:r},Oe=r=>r.map((r=>r.filter(((r,e,n)=>e===n.findIndex((e=>e.x===r.x&&e.y===r.y)))))),ze=r=>{const e=r;return e.forEach(((r,n)=>{let o=!1,i=!1,a=0;for(;a<e.length;){const t=e[a];a!==n&&((r[0].x===t[0].x&&r[0].y===t[0].y||r[0].x===t[1].x&&r[0].y===t[1].y)&&(o=!0),(r[1].x===t[0].x&&r[1].y===t[0].y||r[1].x===t[1].x&&r[1].y===t[1].y)&&(i=!0)),a++}o||(r[0].ending=!0),i||(r[1].ending=!0)})),e.forEach((r=>{let e=-1;r.forEach(((n,o)=>{if(n.ending){e=o;const n=r[e],i=0===e?r[r.length-1]:r[0],a=Math.atan2(i.y-n.y,i.x-n.x);0===e&&(n.x-=3*cos(a),n.y-=3*sin(a))}}))})),e},Ae=(r,e,n)=>r.filter((r=>{let o=!1,i=0;for(;i<r.length&&!o;){let a=r[i];a.x>-1&&a.x<e- -1&&a.y>-1&&a.y<n- -1&&(o=!0),i++}return o})),Re=()=>{const r=random()>.5?"w":"h";fe.x="w"===r?random()>.5?0:width:random(width),fe.y="h"===r?random()>.5?0:height:random(height)},Te=(r=1)=>{let e=me/2+random(-me/2,me/2),n=he/2+random(-he/2,he/2),o=random(1.5,4.5)*r;const i=r=>l(r,o,e,n);ye=ye.map(i),ge=ge.map(i),pe=pe.map((r=>r.map(i))),ce=ce.map(i)},Fe=()=>{const r=round(random(2,4));for(let e=0;e<r;e++){const r=random(-.2,1.2)*me,e=random(-.2,1.2)*he,n=random(1,3.5),o=o=>l(o,n,r,e);ye=ye.map(o),ge=ge.map(o),pe=pe.map((r=>r.map(o))),ce=ce.map(o)}},Ne=r=>{let e=1;const n=m(ye),o=random()>.4?random(.9,1.2):random(.7,.9);switch(r){case"distant":e=max(n.width,n.height)/max(me,he)*o+.9;break;case"neardistant":e=max(n.width,n.height)/min(me,he)+random(.02,.06);break;case"adaptive":e=n.width>n.height?n.width/me*o:max(n.width,n.height)/max(me,he)*o+.1;break;case"verydistant":e=max(n.width,n.height)/max(me,he)*o+1.5;break;case"veryverydistant":e=min(n.width,n.height)/min(me,he)*o+.8;break;case"tight":e=max(n.width,n.height)/max(me,he)*o+.2;break;case"full":e=min(n.width,n.height)/min(me,he)-.2;break;case"cover":e=min(n.width,n.height)/max(me,he);break;default:e=1}const i=r=>{var o,i,a,t;return o=r,i=e,a=n.centerX,t=n.centerY,r=o.map((r=>({x:a+(r.x-a)/i,y:t+(r.y-t)/i})))};let a=[{x:n.minX,y:n.minY},{x:n.b6,y:n.minY},{x:n.b6,y:n.b7},{x:n.minX,y:n.b7},{x:n.minX,y:n.minY}];ye=ye.map(i),ge=ge.map(i),pe=pe.map((r=>r.map(i))),ce=ce.map(i),ye=Ae(ye,me,he),a=[a].map(i)},De=()=>{let r=0,e=0;const n=m(ye);r=me/2-n.centerX,e=he/2-n.centerY;const o=n=>n=t(n,r,e);ye=ye.map(o),pe=pe.map((r=>r.map(o))),ce=ce.map(o)},Be=()=>{const r=m(ye);r.width,r.height,ye.reduce(((r,e)=>r+d(e)),0);return!1}})();