0x865f…5033

All memos sent from and to 0x865f…5033.

console.log("Owen McAteer | Motu ;class Random{@Ctructor(){this.useA=!1;let e=fun ction(e){l o=parseInt(e.sub = ing(0,8),16),ti=i+1|0,o=t^t>>>9 0)/4294967296}};a1prngA=new e(tokenData.hash getTriadicColors i,r,s;if(0===o)i=r=s=t;else`:t+o-t*o,c=2*t-a;i=n(c,a,e/ ;wi$M w.PRAMAS={Bregl=createREGL({extens%{vert:`#ifdef GL_ES preci@W bute vec2 posiA( mod((t*34.+1.%K11324865405187,"=403784439,-.577350269189626,.02 1400159-.85373472095314* PC,smoothstep@W#t
"Contours" is a generative artwork of an abstract and unknown place, drawn in the style of a colourful and animated topographical map. The unknown landscape changes and evolves overtime. Endlessly moving and exploring in an arbitrary direction, I aim to evoke a sense of wandering and a poetic beauty that can emerge from the interplay of order and randomness.
var n={};n="#ifdef GL_ES\nprecision highp float;\n# #endif\n\nuniform mat4 uModelViewbute vec3 aPosi@" =Speed,iGridSize,i!{return@P or(i+.5);}`12.9898,78.233)))*43758.5453123;c=smoothstep(A,A-.02,c$const o=new class{`n){this.useA=!1;le'r=r+1|0,i=o^o>>>9 0)/4294967296}};a"J ()}random_dec(1@X 0,n.length-1)] *1.58740105,3)#J.document.body);
"Fragmented Perception" is an animated artwork born from a serendipitous coding error, transforming an unintended mistake into a piece of unexpected beauty. The artwork features an ordered grid of circles, fragmented in a disordered yet rhythmic dance that explores the balance between clarity and chaos. The piece aims to delve into the interplay between structure and disruption, discovering beauty in the fractured, the incomplete, and the unexpected.
eK<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" > <title>Linearity | Motus Art</title> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js"></script> </head> <body> <style>html{height:100%}html,body{min-height:100%;margin:0;padding:0}canvas{margin:auto;padding:0;display:block;position:absolute;inset:0}</style><script>window.METADATA = {}; function onMetadata() { window.top?.postMessage( `genart:metadata:${JSON.stringify(window.METADATA)}`, "*" ); } function onDone(index = 0) { window["RENDERED_INDEX"] = index; window.top?.postMessage(`genart:done:${index}`, "*"); window.onImageRendered && window.onImageRendered(index); } function random_hash() { let chars = "0123456789abcdef"; let result = "0x"; for (let i = 64; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)]; return result; } function setMetadata(prop, value) { window.METADATA[prop] = value; } function getMetadata(prop) { return window.METADATA[prop]; } class Random { seed; decimals; constructor(hash, decimals = 3) { this.seed = parseInt(hash.slice(0, 16), 16); this.decimals = decimals; } random_dec() { this.seed ^= this.seed << 13; this.seed ^= this.seed >> 17; this.seed ^= this.seed << 5; return ( ((this.seed < 0 ? ~this.seed + 1 : this.seed) % 10 ** this.decimals) / 10 ** this.decimals ); } random_between(a, b) { return a + (b - a) * this.random_dec(); } random_int(a, b) { return Math.floor(this.random_between(a, b + 1)); } random_choice(x) { return x[Math.floor(this.random_between(0, x.length * 0.99))]; } } function createKeyListeners(ls) { const l = {}; const add = (ks, f) => (l[ks.join("_")] = f); const c = (n) => l[n] && l[n](); const d = document.body; let ks = []; d.addEventListener("keydown", (e) => { ks.push(e.key); if (ks.length == 2) c(ks.join("_")); }); d.addEventListener("keyup", () => { if (ks.length == 1) c(ks.join("_")); ks = []; }); ls.forEach((l) => add(l.keys, l.fn)); } </script><script id="genart-options">const options = { hash: random_hash() }</script><script>function e(e,i,r,n,a,o,c,l){var h,b,A,f,d,g=o,u=l,R=e,S=i,P=r,M=n,p=a;Math.abs(g)<1e-4?h=P+p:Math.abs(g)>.9999?h=R+p:(b=(S-R)*Math.abs(u),h=P-Math.abs(b),A=Math.abs(p/c),f=new t(P,S,P,R),d=new t(M,S,M,R)),this.getNextLine=function(){if(Math.abs(g)<1e-4){if(h<M){var e=[h,R,h,S];return h+=p,e}}else if(Math.abs(g)>.9999){if(h<S){e=[P,h,M,h];return h+=p,e}}else{var i=h-b/2,r=h+b/2,n=S,a=R;if(h<M+b){for(;i<P&&r<P||i>M&&r>M;)if(i=(h+=A)-b/2,r=h+b/2,h>M+b)return null;var o=new t(i,n,r,a);return o.compare(f)==s.INTERSECTS&&(i=o.getIntersectionX(),n=o.getIntersectionY()),o.compare(d)==s.INTERSECTS&&(r=o.getIntersectionX(),a=o.getIntersectionY()),u>0&&(i=M-(i-P),r=M-(r-P)),h+=A,e=[i,n,r,a]}}return null}}function t(e,t,i,r){var n,a,o,c,l=e,h=t,b=i,A=r,f=Number.MAX_VALUE,d=Number.MAX_VALUE;a=l-b,o=b*h-l*A,c=0==(n=A-h)&&0==a&&0==o,this.compare=function(e){if(this.isUndefined()||e.isUndefined())return s.UNDEFINED;var t=Number.MAX_VALUE,i=Number.MAX_VALUE,r=0,c=0;return Math.abs(a)>1e-5&&(t=-n/a,r=-o/a),Math.abs(e.getB())>1e-5&&(i=-e.getA()/e.getB(),c=-e.getC()/e.getB()),t==Number.MAX_VALUE?i==Number.MAX_VALUE?-o/n!=-e.getC()/e.getA()?s.SEPARATE:h>=Math.min(e.getPy1(),e.getPy2())&&h<=Math.max(e.getPy1(),e.getPy2())?(f=l,d=h,s.INTERSECTS):A>=Math.min(e.getPy1(),e.getPy2())&&A<=Math.max(e.getPy1(),e.getPy2())?(f=b,d=A,s.INTERSECTS):s.SEPARATE:(h-(d=i*(f=l)+c))*(d-A)<-1e-5||(e.getPy1()-d)*(d-e.getPy2())<-1e-5||Math.abs(e.getA())<1e-5&&(e.getPx1()-f)*(f-e.getPx2())<-1e-5?s.SEPARATE:s.INTERSECTS:i==Number.MAX_VALUE?(f=e.getPx1(),d=t*f+r,(e.getPy1()-d)*(d-e.getPy2())<-1e-5||(h-d)*(d-A)<-1e-5||Math.abs(n)<1e-5&&(l-f)*(f-b)<-1e-5?s.SEPARATE:s.INTERSECTS):t==i?r!=c?s.SEPARATE:l>=Math.min(e.getPx1(),e.getPx2())&&l<=Math.max(e.getPy1(),e.getPy2())?(f=l,d=h,s.INTERSECTS):b>=Math.min(e.getPx1(),e.getPx2())&&b<=Math.max(e.getPx1(),e.getPx2())?(f=b,d=A,s.INTERSECTS):s.SEPARATE:(d=t*(f=(c-r)/(t-i))+r,(l-f)*(f-b)<-1e-5||(e.getPx1()-f)*(f-e.getPx2())<-1e-5?s.SEPARATE:s.INTERSECTS)},this.getPx1=function(){return l},this.getPy1=function(){return h},this.getPx2=function(){return b},this.getPy2=function(){return A},this.isUndefined=function(){return c},this.getA=function(){return n},this.getB=function(){return a},this.getC=function(){return o},this.getIntersectionX=function(){return f},this.getIntersectionY=function(){return d},this.getLength=function(e,t,s,i){var r=s-e,n=i-t;return Math.sqrt(r*r+n*n)}}var s={LEFT:1,RIGHT:2,INTERSECTS:3,AHEAD:4,BEHIND:5,SEPARATE:6,UNDEFINED:7},i=function(i){this.sketch=i||window,this.bowing=1,this.roughness=1,this.maxOffset=2,this.numEllipseSteps=9,this.ellipseInc=2*Math.PI/this.numEllipseSteps,this.getOffset=function(e,t){return this.roughness*(this.sketch.random()*(t-e)+e)},this.buildEllipse=function(e,t,s,i,r,n){var a=this.getOffset(-.5,.5)-Math.PI/2;this.sketch.beginShape(),this.sketch.curveVertex(this.getOffset(-r,r)+e+.9*s*Math.cos(a-this.ellipseInc),this.getOffset(-r,r)+t+.9*i*Math.sin(a-this.ellipseInc));for(var o=a;o<2*Math.PI+a-.01;o+=this.ellipseInc)this.sketch.curveVertex(this.getOffset(-r,r)+e+s*Math.cos(o),this.getOffset(-r,r)+t+i*Math.sin(o));this.sketch.curveVertex(this.getOffset(-r,r)+e+s*Math.cos(a+2*Math.PI+.5*n),this.getOffset(-r,r)+t+i*Math.sin(a+2*Math.PI+.5*n)),this.sketch.curveVertex(this.getOffset(-r,r)+e+.98*s*Math.cos(a+n),this.getOffset(-r,r)+t+.98*i*Math.sin(a+n)),this.sketch.curveVertex(this.getOffset(-r,r)+e+.9*s*Math.cos(a+.5*n),this.getOffset(-r,r)+t+.9*i*Math.sin(a+.5*n)),this.sketch.endShape()},this.getIntersectingLines=function(e,i,r){for(var n=[],a=new t(e[0],e[1],e[2],e[3]),o=0;o<i.length;o++){var c=new t(i[o],r[o],i[(o+1)%i.length],r[(o+1)%i.length]);a.compare(c)==s.INTERSECTS&&n.push([a.getIntersectionX(),a.getIntersectionY()])}return n},this.scribbleLine=function(e,t,s,i){var r=(e-s)*(e-s)+(t-i)*(t-i),n=this.maxOffset;this.maxOffset*this.maxOffset*100>r&&(n=Math.sqrt(r)/10);var a=n/2,o=.2+.2*this.sketch.random(),c=this.bowing*this.maxOffset*(i-t)/200,l=this.bowing*this.maxOffset*(e-s)/200;c=this.getOffset(-c,c),l=this.getOffset(-l,l),this.sketch.noFill(),this.sketch.beginShape(),this.sketch.vertex(e+this.getOffset(-n,n),t+this.getOffset(-n,n)),this.sketch.curveVertex(e+this.getOffset(-n,n),t+this.getOffset(-n,n)),this.sketch.curveVertex(c+e+(s-e)*o+this.getOffset(-n,n),l+t+(i-t)*o+this.getOffset(-n,n)),this.sketch.curveVertex(c+e+2*(s-e)*o+this.getOffset(-n,n),l+t+2*(i-t)*o+this.getOffset(-n,n)),this.sketch.curveVertex(s+this.getOffset(-n,n),i+this.getOffset(-n,n)),this.sketch.vertex(s+this.getOffset(-n,n),i+this.getOffset(-n,n)),this.sketch.endShape(),this.sketch.beginShape(),this.sketch.vertex(e+this.getOffset(-a,a),t+this.getOffset(-a,a)),this.sketch.curveVertex(e+this.getOffset(-a,a),t+this.getOffset(-a,a)),this.sketch.curveVertex(c+e+(s-e)*o+this.getOffset(-a,a),l+t+(i-t)*o+this.getOffset(-a,a)),this.sketch.curveVertex(c+e+2*(s-e)*o+this.getOffset(-a,a),l+t+2*(i-t)*o+this.getOffset(-a,a)),this.sketch.curveVertex(s+this.getOffset(-a,a),i+this.getOffset(-a,a)),this.sketch.vertex(s+this.getOffset(-a,a),i+this.getOffset(-a,a)),this.sketch.endShape()},this.scribbleCurve=function(e,t,s,i,r,n,a,o){this.sketch.bezier(e+this.getOffset(-2,2),t+this.getOffset(-2,2),r+this.getOffset(-4,4),n+this.getOffset(-3,3),a+this.getOffset(-3,3),o+this.getOffset(-3,3),s+this.getOffset(-1,1),i+this.getOffset(-1,1)),this.sketch.bezier(e+this.getOffset(-2,2),t+this.getOffset(-2,2),r+this.getOffset(-3,3),n+this.getOffset(-3,3),a+this.getOffset(-3,3),o+this.getOffset(-4,4),s+this.getOffset(-2,2),i+this.getOffset(-2,2))},this.scribbleRect=function(e,t,s,i){var r=s/2,n=i/2,a=Math.min(e-r,e+r),o=Math.max(e-r,e+r),c=Math.min(t-n,t+n),l=Math.max(t-n,t+n);this.scribbleLine(a,c,o,c),this.scribbleLine(o,c,o,l),this.scribbleLine(o,l,a,l),this.scribbleLine(a,l,a,c)},this.scribbleRoundedRect=function(e,t,s,i,r){var n=s/2,a=i/2;if(0==r||r>n||r>a)this.scribbleRect(e,t,s,i);else{var o=Math.min(e-n,e+n),c=Math.max(e-n,e+n),l=Math.min(t-a,t+a),h=Math.max(t-a,t+a);this.scribbleLine(o+r,l,c-r,l,1.5),this.scribbleLine(c,l+r,c,h-r,1.5),this.scribbleLine(c-r,h,o+r,h,1.5),this.scribbleLine(o,h-r,o,l+r,1.5),this.scribbleCurve(o+r,l,o,l+r,o+.1*r,l+.1*r,o+.1*r,l+.1*r),this.scribbleCurve(c-r,l,c,l+r,c-.1*r,l+.1*r,c-.1*r,l+.1*r),this.scribbleCurve(o+r,h,o,h-r,o+.1*r,h-.1*r,o+.1*r,h-.1*r),this.scribbleCurve(c-r,h,c,h-r,c-.1*r,h-.1*r,c-.1*r,h-.1*r)}},this.scribbleEllipse=function(e,t,s,i){var r=Math.abs(s/2),n=Math.abs(i/2);r+=this.getOffset(.05*-r,.05*r),n+=this.getOffset(.05*-n,.05*n),this.buildEllipse(e,t,r,n,1,this.ellipseInc*this.getOffset(.1,this.getOffset(.4,1))),this.buildEllipse(e,t,r,n,1.5,0)},this.scribbleFilling=function(t,s,i,r){if(null!=t&&null!=s&&0!=t.length&&0!=s.length){for(var n=this.sketch.radians(r%180),a=Math.cos(n),o=Math.sin(n),c=Math.tan(n),l=t[0],h=t[0],b=s[0],A=s[0],f=1;f<t.length;f++)l=Math.min(l,t[f]),h=Math.max(h,t[f]),b=Math.min(b,s[f]),A=Math.max(A,s[f]);for(var d=new e(b-1,A+1,l-1,h+1,i,o,a,c),g=null;null!=(g=d.getNextLine());){var u=this.getIntersectingLines(g,t,s);for(f=0;f<u.length;f+=2)if(f<u.length-1){var R=u[f],S=u[f+1];this.scribbleLine(R[0],R[1],S[0],S[1],2)}}}}};var r={easeInCubic:e=>(e/=1)*e*e,easeInExpo:e=>0==e?0:Math.pow(2,10*(e/1-1)),easeInOutCubic:(e,t,s)=>(e/=s/2)<1?s/2*e*e*e+t:s/2*((e-=2)*e*e+2)+t};var n=Ellipses=e=>{const t=PARAMS.cells[e.cell],s=round(25*t.nestedAmount)+1;strokeWeight(10*r.easeInExpo(1-t.nestedAmount)+.5);for(let t=1;t<=s;t++){const i=floor(random(4));push(),translate(e.positionXoffset+(e.columns[e.i].width*e.areaWidth-PARAMS.gap)/2,e.positionYoffset+(e.columns[e.i].rows[e.j]*e.areaHeight-PARAMS.gap)/2),rotate(i*HALF_PI);let r=e.columns[e.i].width*e.areaWidth-PARAMS.gap,n=e.columns[e.i].rows[e.j]*e.areaHeight-PARAMS.gap;i%2==1&&([r,n]=[n,r]),r*=t/s,n*=t/s,e.scribble.scribbleEllipse(0,0,r,n),pop()}},a=Hatchings=(e,t)=>{const s=PARAMS.cells[e.cell];let i=(e.columns[e.i].width*e.areaWidth-PARAMS.gap)/2,n=(e.columns[e.i].rows[e.j]*e.areaHeight-PARAMS.gap)/2;push(),translate(e.positionXoffset+i,e.positionYoffset+n);const a=s.orientation;rotate(HALF_PI*a),a%2==1&&([i,n]=[n,i]);const o=s.hatchingDensity;let c=max(map(o,0,1,1,min(i,n)/3),1),l=10*o+.01;switch(l=constrain(l,.01,c/2),e.scribble.bowing=.5*r.easeInCubic(o)+1,e.scribble.roughness=r.easeInCubic(o)+.25,strokeWeight(l),t){case"Normal":default:e.scribble.scribbleFilling([-i,i,i,-i],[-n,-n,n,n],c,PARAMS.shapeHatchingAngle);break;case"Arrow":e.scribble.scribbleFilling([i,-i,i,-i],[-n,-n,n,n],c,0);break;case"Crossed":e.scribble.scribbleFilling([-i,i,i,-i],[-n,n,-n,n],c,0);break;case"Triangle":e.scribble.scribbleFilling([-i,i,i],[-n,-n,n],c,PARAMS.shapeHatchingAngle);break;case"Diamond":e.scribble.scribbleFilling([0,i,0,-i],[-n,0,n,0],c,s.dec<.25?PARAMS.shapeHatchingAngle:0);break;case"Lighting":e.scribble.scribbleFilling([0,i,-i,0],[-n,0,0,n],c,0)}pop()},o=Rectangles=(e,t)=>{const s=PARAMS.cells[e.cell];let i=round(15*s.nestedAmount)+1,n="scribbleRect",a=8*r.easeInCubic(1-s.nestedAmount)+.5;t&&(n="scribbleRoundedRect",i=max(1,round(i/2)),e.scribble.bowing=1,e.scribble.roughness=1,a/=2),t&&!PARAMS.shapeSingleToggle&&(PARAMS.shapeRoundedRadius=abs(PARAMS.shapeRoundedRadius)),strokeWeight(a),push();let o=e.columns[e.i].width*e.areaWidth-PARAMS.gap,c=e.columns[e.i].rows[e.j]*e.areaHeight-PARAMS.gap;translate(e.positionXoffset+o/2,e.positionYoffset+c/2);for(let t=1;t<=i;t++){const s=o*t/i,r=c*t/i,a=max(1.2*-PARAMS.border,min(s/2,r/2)*PARAMS.shapeRoundedRadius);e.scribble[n](0,0,s,r,a)}pop()},c=Special=e=>{const t=PARAMS.cells[e.cell];let s,i,n;strokeWeight(10*r.easeInExpo(1-t.nestedAmount)+.5),push();let a=e.columns[e.i].width*e.areaWidth-PARAMS.gap,o=e.columns[e.i].rows[e.j]*e.areaHeight-PARAMS.gap;switch(translate(e.positionXoffset+a/2,e.positionYoffset+o/2),floor(5*t.dec)){case 0:PARAMS.hasAnimatedCell="Palmtree";const r=20*t.hatchingDensity+8;for(let t=0;t<=TWO_PI;t+=PI/r)strokeCap(ROUND),e.scribble.scribbleCurve(cos(t+3*PARAMS.tickCounter)*(a/2),sin(t+PARAMS.tickCounter)*(o/2),0,o/2,0,0,0,o/2);break;case 1:PARAMS.hasAnimatedCell="OverlappingSquares";const l=8;for(let t=1;t<l;t++){const s=t/l;e.scribble.scribbleRect(0,0,s*a,s*o)}push(),rotate(QUARTER_PI);const h=sqrt(min(a,o)*min(a,o)+min(a,o)*min(a,o))/2;for(let t=1;t<l;t++){rotate(.3*PARAMS.tickCounter);const s=t/l;e.scribble.scribbleRect(0,0,s*h,s*h)}pop();break;case 2:PARAMS.hasAnimatedCell="BalleticGrid",n=7,s=a/n,i=o/n;for(let t=0;t<n;t++)for(let r=0;r<n;r++){const c=1.4*abs(sin(t/(r+1)+2*PARAMS.tickCounter));let l=-a/2+s*t+s/2;const h=-o/2+i*r+i/2;r%2==0&&(l+=s/2),r%2==0&&t===n-1||e.scribble.scribbleRect(l,h,s*c,i*c)}break;case 3:PARAMS.hasAnimatedCell="DiamondGrid",n=7,s=a/n,i=o/n;const b=min(s,i);for(let t=0;t<n;t++)for(let r=0;r<n;r++){const n=1.5*abs(sin(t*t+2*PARAMS.tickCounter));let c=-a/2+s*t+s/2;const l=-o/2+i*r+i/2;push(),translate(c,l),rotate(QUARTER_PI),e.scribble.scribbleRect(0,0,b*n,b*n),pop()}break;case 4:PARAMS.hasAnimatedCell="Cubes";const A=sqrt(a*a+a*a)/4,f=[{x:-A,y:-A,z:-A},{x:A,y:-A,z:-A},{x:A,y:A,z:-A},{x:-A,y:A,z:-A},{x:-A,y:-A,z:A},{x:A,y:-A,z:A},{x:A,y:A,z:A},{x:-A,y:A,z:A}];var c=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[1,5],[2,6],[3,7]];cubeRotateZ=.5*PARAMS.tickCounter*TWO_PI;for(let e of f){let t=e.x*cos(cubeRotateZ)-e.y*sin(cubeRotateZ),s=e.x*sin(cubeRotateZ)+e.y*cos(cubeRotateZ);e.x=t,e.y=s}cubeRotateX=.2*PARAMS.tickCounter*TWO_PI;for(let e of f){let t=e.y*cos(cubeRotateX)-e.z*sin(cubeRotateX),s=e.y*sin(cubeRotateX)+e.z*cos(cubeRotateX);e.y=t,e.z=s}cubeRotateY=.1*PARAMS.tickCounter*TWO_PI;for(let e of f){let t=e.z*sin(cubeRotateY)+e.x*cos(cubeRotateY),s=e.z*cos(cubeRotateY)-e.x*sin(cubeRotateY);e.x=t,e.z=s}e.scribble.bowing=1.75,e.scribble.roughness=2.5;for(let t=0;t<2;t++){push(),scale(map(t,0,1,.75,1)),t%2==0&&scale(-1,1);for(let t of c)e.scribble.scribbleLine(f[t[0]].x,f[t[0]].y,f[t[1]].x,f[t[1]].y);pop()}}pop()},l=Triangles=e=>{const t=PARAMS.cells[e.cell],s=round(15*t.nestedAmount)+1;strokeWeight(10*r.easeInExpo(1-t.nestedAmount)+.5);for(let i=1;i<=s;i++){push();let r=(e.columns[e.i].width*e.areaWidth-PARAMS.gap)/2,n=(e.columns[e.i].rows[e.j]*e.areaHeight-PARAMS.gap)/2,a=e.columns[e.i].width*e.areaWidth-PARAMS.gap,o=e.columns[e.i].rows[e.j]*e.areaHeight-PARAMS.gap;translate(e.positionXoffset+r,e.positionYoffset+n),rotate(t.orientation*HALF_PI),t.orientation%2==1&&([r,n,a,o]=[n,r,o,a]);const c=i/s,l=r*c,h=n*c;translate(0,-.2*o*c+.2*o),e.scribble.scribbleLine(0,-h,l,h),e.scribble.scribbleLine(l,h,-l,h),e.scribble.scribbleLine(-l,h,0,-h),pop()}};const h=["Ellipses","Rectangles","Rectangles.Rounded","Triangles","Hatch.Normal","Hatch.Arrow","Hatch.Crossed","Hatch.Triangle","Hatch.Diamond","Hatch.Lighting","Curves"],b=e=>{switch(e.scribble.bowing=1,e.scribble.roughness=1,e.scribble.maxOffset=2,strokeCap(PARAMS.cells[e.cell].strokeCap),noFill(),PARAMS.cells[e.cell].type){case"Hatch":default:const t=PARAMS.shape.substr(6);return a(e,t);case"Rectangles":return o(e);case"Rectangles.Rounded":return o(e,!0);case"Triangles":return l(e);case"Ellipses":return n(e);case"Curves":return(e=>{const t=PARAMS.cells[e.cell];let s=round(25*t.nestedAmount)+1;strokeWeight(10*r.easeInExpo(1-t.nestedAmount)+.5),e.positionXoffset,e.positionYoffset;let i=e.columns[e.i].width*e.areaWidth-PARAMS.gap,n=e.columns[e.i].rows[e.j]*e.areaHeight-PARAMS.gap;switch(push(),translate(e.positionXoffset+(e.columns[e.i].width*e.areaWidth-PARAMS.gap)/2,e.positionYoffset+(e.columns[e.i].rows[e.j]*e.areaHeight-PARAMS.gap)/2),PARAMS.shapeCurvePattern){case"denseGrid":case"3dcurves":case"valley":case"smoke":case"scribbled":case"infinity":rotate(t.orientation*HALF_PI),t.orientation%2==1&&([i,n]=[n,i]);break;case"reeds":t.orientation%2==1&&scale(-1,1)}switch(PARAMS.shapeCurvePattern){case"denseGrid":case"scribbled":s=round(s/2)}e.scribble.bowing=1.5,e.scribble.roughness=2,e.scribble.maxOffset=1;for(let r=0;r<=s;r++){const a=r/s;switch(PARAMS.shapeCurvePattern){case"denseGrid":e.scribble.bowing=1.1,e.scribble.roughness=1.5,e.scribble.maxOffset=1.5,e.scribble.scribbleLine(-.5*i,-.5*n,-.5*i+i*a,-.5*n+n),e.scribble.scribbleLine(-.5*i+i,-.5*n+n,-.5*i,-.5*n+n*a);break;case"3dcurves":e.scribble.bowing=1.5,e.scribble.roughness=2,e.scribble.maxOffset=1,e.scribble.scribbleLine(-.5*i+i*a,-.5*n,-.5*i+i,-.5*n+n*a),e.scribble.scribbleLine(-.5*i,-.5*n+n*a,-.5*i+i*a,n+-.5*n);break;case"valley":e.scribble.scribbleCurve(-.5*i+i*a,-.5*n,-.5*i+i*a,-.5*n+n,-.5*i+i,-.5*n,-.5*i+i,-.5*n+n),e.scribble.scribbleCurve(-.5*i+i*a,-.5*n,-.5*i+i*a,-.5*n+n,-.5*i,-.5*n+n,-.5*i,-.5*n);break;case"reeds":e.scribble.scribbleCurve(-.5*i,-.5*n,-.5*i+i,-.5*n+n,-.5*i+i*a,-.5*n+n*a,-.5*i+i,-.5*n);break;case"bikeSpokes":e.scribble.roughness=6;const o=2*max(5,round(s)),c=t.dec<.5?.25:.75;for(let t=0;t<TWO_PI;t+=TWO_PI/o)e.scribble.scribbleCurve(0,0,cos(t)*i*.5,sin(t)*n*.5,cos(t+1)*i*.25,sin(t+1)*n*.25,cos(t+1)*i*c,sin(t+1)*n*c);break;case"spider":e.scribble.scribbleCurve(0,0,i*(r%2-.5),-1*n+.25*n*a+.5*n,0,.5*n,0,-.5*n),e.scribble.scribbleCurve(0,0,i*(r%2-.5),n+-.25*n*a+-.5*n,0,.5*n,0,-.5*n);break;case"plant":const l=t.dec<.5?TWO_PI:PI;e.scribble.scribbleCurve(0,.5*n,cos(a*l)*i/2,sin(a*l)*-n/2,0,.5*n,0,-.5*n);break;case"smoke":e.scribble.scribbleCurve(.5*i,.5*n,-.5*i,-.5*n+n*a,0,.5*n,0,-.5*n);break;case"scribbled":e.scribble.scribbleCurve(0,0,cos(a*TWO_PI)*i/2,sin(a*TWO_PI)*-n/2,sin(a*TWO_PI)*i/2,cos(a*TWO_PI)*-n/2,sin(a*TWO_PI)*i/2,cos(a*TWO_PI)*-n/2);break;case"infinity":e.scribble.scribbleCurve(0,0,0,0,cos(a*TWO_PI)*i,sin(a*TWO_PI)*n,sin(a*TWO_PI)*i,cos(a*TWO_PI)*n)}}pop()})(e);case"Special":return c(e)}};function A(e,t){const s=new Array(e);for(let i=0;i<e;i++)s[i]=noise(i+t,(PARAMS.toggle_animate?PARAMS.tickCounter+=PARAMS.speed:PARAMS.tickCounter)/4),s[i]=max(s[i],.3);const i=s.reduce(((e,t)=>e+t));for(let t=0;t<e;t++)s[t]=s[t]*(1/i);return s}const f=()=>{let e=window.innerWidth,t=e*sqrt(2);return t>window.innerHeight&&(t=window.innerHeight,e=t/sqrt(2)),PARAMS.canvasScale=t/PARAMS.h,{w:round(e),h:round(t)}},d=()=>R.random_choice(["#f9f0de","#ebebe9","#eee","#f6eee3","#fffafa","#faf4e9","#ececec","#f8f0e6","#f2ecda"]),g=()=>R.random_choice(["#392b24","#927154","#2a70ae","#fab511","#385d32","#d83715","#5b3524","#a09684","#3f3e3a","#786e66","#8c4a50","#201c1d","#16474a","#133536","#0d1e5a","#592f56","#65136c","#284555","#412147","#2c52a0","#81556b","#6f624d","#c48337","#294fa1","#fb780d","#344764","#385866","#2b2c57","#1b3e4d","#683041","#ef929e","#844c16","#85172b","#45272f","#275353","#102920","#d14671","#b18e37","#163ba9","#0d254b","#ef9439","#964528","#615125","#f52d7d","#e93323","#90ac93","#1c3f4e","#6f5d2f","#515849","#6b4367","#294535","#353630","#3a83d1"]),u=[[233,59,243],[237,30,120],[66,212,202],[244,199,116]],S=e=>(R.random_dec()<.2?(PARAMS.theme="Dark",PARAMS.colBg=R.random_choice(["#18191d","#1c1c1c","#2c2c2c","#222","#111","#000","#222831","#212121"]),PARAMS.colStroke=R.random_choice(["#a0b08f","#3a83d1","#ff5faf","#afd700","#00afaf","#FFB2FF","#EA80FC","#B64FC8","#67e5e1","#fef14d","#c1ef4b","#afd2e2","#eec7ca","#d55164","#9857bd","#D09CFA","#30AADD","#43919B","#00FFC6","#6EDCD9","#F9D371","#93FFD8","#FF5403","#FBFF00","#7DEDFF"])):(PARAMS.theme="Light",PARAMS.colBg=d(),PARAMS.colStroke=g()),function(e){e.noStroke();for(let t=0;t<55e3;t++){const t=random(e.width),s=random(e.height),i=random(3,7);e.fill(...P.brownLight,.005),e.ellipse(t,s,i),e.fill(...P.brownDark,.005),e.ellipse(t,s+.1*i,i,.8*i)}}(e),function(e){e.stroke(...P.brownMid,.03);for(let t=0;t<75e3;t++){let t=0;t=random(-.25,.25);const s=random(e.width),i=random(e.height),r=random(3,15)/2;e.line(cos(t)*-r+s,sin(t)*-r+i,cos(t)*r+s,sin(t)*r+i)}}(e),PARAMS.canvas="Paper",e),P={brownLight:[208,187,163],brownMid:[146,113,84],brownDark:[57,43,36]};const M=[[170,210,240,.01],[113,201,152,.01],[237,.4],[252,154,154,.01]],p=[[208,187,163],[146,113,84],[57,43,36]],m=()=>{const e=createGraphics(round(PARAMS.w),round(PARAMS.h));e.pixelDensity(pixelDensity()),e.colorMode(RGB,255,255,255,1);const t=R.random_dec();return t<.01?(e=>{e.pixelDensity(1),e.background(0),e.loadPixels();for(let t=0;t<e.height;t++)for(let s=0;s<e.width;s++){const i=4*(t*e.width+s);let r=40*(noise(.005*s,.005*t)+.2*noise(.025*s,.025*t));e.pixels[i]=r,e.pixels[i+1]=r,e.pixels[i+2]=r}e.updatePixels(),PARAMS.canvas="Blackboard",PARAMS.theme="Dark",PARAMS.colBg=[0],PARAMS.colStroke=d()})(e):t<.02?(e=>{PARAMS.colBg=d(),e.background(PARAMS.colBg),e.stroke(...R.random_choice(M)),e.strokeWeight(1),e.translate(R.random_between(-10,0),R.random_between(-10,0));const t=round(R.random_between(10,40)),s=round(5*t);for(let i=0;i<=e.width;i+=t)for(let r=0;r<=e.height;r+=t)e.strokeWeight(1),r%s!=0&&i%s!=0||e.strokeWeight(2),e.line(i,0,i,e.height+20),e.line(0,r,e.width+20,r);PARAMS.canvas="Graphing",PARAMS.theme="Light",PARAMS.colStroke=g()})(e):t<.03?(e=>{PARAMS.colBg=d(),e.background(PARAMS.colBg),e.noStroke();for(let t=0;t<15e4;t++){const t=random(e.width),s=random(e.height),i=random(TWO_PI),r=random(3,20);e.stroke(...random(p),.035),e.line(cos(i)*-r+t,sin(i)*-r+s,cos(i)*r+t,sin(i)*r+s)}PARAMS.canvas="Fiber canvas",PARAMS.theme="Light",PARAMS.colStroke=g()})(e):t<.0325?(e=>{PARAMS.theme="Dark",PARAMS.canvas="Vaporwave",PARAMS.colStroke=R.random_choice(u),PARAMS.colBg="#110d3d";const t=u.filter((e=>e!==PARAMS.colStroke)),s=R.random_choice(t);e.background(PARAMS.colBg);const i=e.canvas.getContext("2d"),n=i.createLinearGradient(0,0,0,e.height);n.addColorStop(0,"rgba(17, 13, 60, 0.5)"),n.addColorStop(.4,"rgba(41, 16, 91, 0.5)"),n.addColorStop(.5,`rgba(${s.join(",")}, 0.5)`),n.addColorStop(.53,"rgba(101, 42, 142, 0.5)"),n.addColorStop(1,"rgba(17, 13, 60, 0.5)"),i.fillStyle=n,e.rect(0,0,e.width,e.height),e.stroke(...s,.4),e.strokeWeight(2);const a=R.random_between(20,50);for(let t=0;t<a;t++){e.line(map(t,0,a,0,e.width),.5*e.height,map(t,0,a,-3*e.width,4*e.width),e.height);const s=r.easeInCubic(t/a)*e.height*.5+.5*e.height;e.line(0,s,e.width,s)}})(e):S(e),e},k=()=>{const e=createGraphics(round(PARAMS.w),round(PARAMS.h));return e.pixelDensity(pixelDensity()),e.colorMode(RGB,255,255,255,1),function(e){const t=e.pixelDensity();e.loadPixels();for(let s=0;s<e.width*t*e.height*t*4;s+=4)e.pixels[s]=e.pixels[s+1]=e.pixels[s+2]=random(200),e.pixels[s+3]=30;e.updatePixels()}(e),function(e){e.noStroke(),e.fill(...P.brownDark,.05);for(let t=0;t<500;t++){const t=random(e.width),s=random(e.height),i=random(1,5);e.push(),e.translate(t,s),e.rotate(random(PI)),e.ellipse(0,0,i,i*random(.5,1)),e.pop()}}(e),e};function w(e){return e<15?"Packed":e<20?"Cozy":e<40?"Orderly":e>=45?"Spacious":void 0}var x=()=>{const e={canvas:PARAMS.canvas,theme:PARAMS.theme,gridSizeX:PARAMS.gridSizeX,gridSizeY:PARAMS.gridSizeY,gridSizeFlip:PARAMS.gridSizeFlip,gap:w(PARAMS.gap),shape:PARAMS.shape,hasAnimatedCell:PARAMS.hasAnimatedCell,hasDifferentShape:PARAMS.hasDifferentShape};Object.keys(e).forEach((t=>{setMetadata(t,e[t])})),onMetadata()};R=new Random(options.hash,4),R.random_distribute=()=>Math.pow(1.57923837*(R.random_dec()-.5),3)+.5,R.random_bell=(e,t)=>e+(t-e)*R.random_distribute(),window.PARAMS={w:1080,h:1080*Math.sqrt(2),border:Math.round(R.random_bell(5,100)),gridSizeX:Math.round(R.random_bell(1,5)),gridSizeY:Math.round(R.random_bell(1,9)),cells:[],gridSizeFlip:R.random_dec()<.5,gap:R.random_bell(10,50),shape:R.random_choice(h),shapeRoundedRadius:R.random_between(-1,1),shapeHatchingAngle:R.random_between(0,360),shapeCurvePattern:R.random_choice(["denseGrid","3dcurves","valley","reeds","bikeSpokes","spider","plant","smoke","scribbled","infinity"]),hasAnimatedCell:"False",hasDifferentShape:!1,tickCounter:0,speed:5e-4,toggle_overlay:!0,toggle_animate:!0,DEBUG:!1,randomSeed:4294967296*R.random_dec()>>>0,noiseSeed:4294967296*R.random_dec()>>>0};const O=new i;let v,C;windowResized=()=>{const e=f();resizeCanvas(e.w,e.h)},setup=()=>{const e=f();createCanvas(e.w,e.h),(()=>{for(let e=0;e<PARAMS.gridSizeX*PARAMS.gridSizeY;e++){PARAMS.cells[e]={type:PARAMS.shape,orientation:R.random_int(0,4),nestedAmount:R.random_distribute(),strokeWeight:R.random_between(1,8),hatchingDensity:R.random_distribute(),strokeCap:R.random_choice(["round","butt"]),dec:R.random_dec()};const t=R.random_dec();t<.005?PARAMS.cells[e].type="Special":t<.1&&(PARAMS.cells[e].type=R.random_choice(h),PARAMS.hasDifferentShape=!0)}})(),v=m(),C=k()},draw=()=>{scale(PARAMS.canvasScale),randomSeed(PARAMS.randomSeed),noiseSeed(PARAMS.noiseSeed),PARAMS.toggle_overlay?(background(PARAMS.colBg),image(v,0,0,PARAMS.w,PARAMS.h)):clear(),translate(PARAMS.border,PARAMS.border);const e=PARAMS.w-2*PARAMS.border,t=PARAMS.h-2*PARAMS.border;let s=PARAMS.gridSizeX,i=PARAMS.gridSizeY;PARAMS.gridSizeFlip&&([s,i]=[i,s]);const r=A(s,0).map(((e,t)=>({i:t,width:e,rows:A(i,t*t)})));let n=PARAMS.gap/2;for(let s=0;s<r.length;s++){s>0&&(n+=r[s-1].width*e);let i=PARAMS.gap/2;for(let a=0;a<r[s].rows.length;a++){a>0&&(i+=r[s].rows[a-1]*t);const o={i:s,j:a,cell:a*r.length+s,positionXoffset:n,positionYoffset:i,columns:r,areaWidth:e,areaHeight:t,scribble:O};PARAMS.DEBUG&&(stroke(233,51,35,map(sin(.1*frameCount),-1,1,75,255)),strokeWeight(1),noFill(),rect(n,i,r[s].width*e-PARAMS.gap,r[s].rows[a]*t-PARAMS.gap)),stroke(PARAMS.colStroke),b(o)}}resetMatrix(),PARAMS.toggle_overlay&&image(C,0,0,PARAMS.w,PARAMS.h),1===frameCount&&(x(),onDone())},keyReleased=()=>{switch(keyCode){case 84:PARAMS.toggle_overlay=!PARAMS.toggle_overlay;break;case 65:PARAMS.toggle_animate=!PARAMS.toggle_animate;break;case 83:save(`Linearity-MotusArt-${options.tokenId}.png`);break;case 68:PARAMS.DEBUG=!PARAMS.DEBUG;break;case 70:fullscreen(!fullscreen());break;case UP_ARROW:PARAMS.speed+=1e-4;break;case DOWN_ARROW:PARAMS.speed-=1e-4;break;case LEFT_ARROW:PARAMS.speed=.001}};</script></body> </html>
e>110&&R.dec()<.2))return;this.fillType="scribble"}else"bezier"===this.shape.model.type?this.fillType="solid":R.dec()<.15&&this.shape.size>config.shape.minPatternSize?this.fillType="pattern":this.fillType="solid";switch(this.fillType){case"solid":this.fill={type:"solid",colour:n()};break;case"pattern":this.fill={type:"pattern",colour:n(),pattern:R.choice(Object.keys(je))},this.fill.patternImage=Ke(this.fill.pattern,this.shape);break;case"scribble":this.fill={type:"scribble",colour:n()}}}calcChain=()=>{"bezier"===this.shape.model.type&&(R.dec()>.5||(this.edgeType="chain",this.chainType=R.choice(["rect","square","ellipse","line","triangle"]),this.chainStroke=this.stroke[0].colour,this.chainFill=R.dec()<.5&&this.fill.colour,this.fill=null,this.stroke=[]))};render=()=>{this.drawFill(),this.drawStroke(),this.drawChain()};drawFill(){var e;if(this.fill)switch(noStroke(),this.fill.type){case"solid":fill(this.fill.colour),this.drawFillShape();break;case"pattern":fill(0),e=this.fill.patternImage,drawingContext.fillStyle=e,this.drawFillShape(),fill(0);break;case"scribble":stroke(this.fill.colour),(e=>{const t=new $e,s=e.model.points,i=round(4*e.randomSeed+4);strokeWeight(e.model.curveWeight*e.size/(4*i));for(let o=0;o<s.length-2;o+=2){const n=(o+2)%s.length,r=atan2(s[n+1]-s[o+1],s[n]-s[o])-HALF_PI;for(let c=0;c<i;c++){const a=map(c,0,i-1,-.3*e.model.curveWeight,.3*e.model.curveWeight);t.scribbleLine(e.scalePosition(cos(r)*a+s[o]).x,e.scalePosition(sin(r)*a+s[o+1]).y,e.scalePosition(cos(r)*a+s[n]).x,e.scalePosition(sin(r)*a+s[n+1]).y)}}})(this.shape)}}drawFillShape(){"curved"===this.edgeType?et(this.shape):tt(this.shape)}drawStroke(){this.stroke&&this.stroke.forEach((e=>{noFill(),strokeCap(ROUND),strokeJoin(ROUND),He(e.dashed.split("-").map((e=>e))),strokeWeight(e.weight*this.shape.size),stroke(e.colour),this.drawShape(),He([])}))}drawChain(){"chain"===this.edgeType&&this.drawShape()}drawShape(){switch(this.edgeType){case"curved":et(this.shape);break;case"straight":tt(this.shape);break;case"scribble":(e=>{const t=new $e,s=e.model.points,i="poly"===e.model.type?0:2;for(let o=0;o<s.length-i;o+=2){const i=(o+2)%s.length;t.scribbleLine(e.scalePosition(s[o]).x,e.scalePosition(s[o+1]).y,e.scalePosition(s[i]).x,e.scalePosition(s[i+1]).y)}})(this.shape);break;case"bezier":(e=>{const t=e.model.points;bezier(e.scalePosition(t[0]).x,e.scalePosition(t[1]).y,e.scalePosition(t[2]).x,e.scalePosition(t[3]).y,e.scalePosition(t[4]).x,e.scalePosition(t[5]).y,e.scalePosition(t[6]).x,e.scalePosition(t[7]).y)})(this.shape);break;case"chain":(e=>{const t=new $e;t.roughness=.5;let s=e.model.chainPoints;["line","rect"].includes(e.draw.chainType)&&(s*=2);const i=e.model.curveWeight*e.size,o=e.model.curveWeight/2;stroke(e.draw.chainStroke),e.draw.chainFill?fill(e.draw.chainFill):noFill(),strokeWeight(.05*i);for(let n=0;n<s;n++){let r=n/(s-1);const{x:a,y:h,tx:l,ty:p}=c(e.model.points,r);let u=atan2(p,l);switch(u-=HALF_PI,e.draw.chainType){case"rect":case"square":push(),translate(e.scalePosition(a).x,e.scalePosition(h).y),rotate(u),e.draw.chainFill&&rect(0,0,i,"rect"===e.draw.chainType?.2*i:i),t.scribbleRect(0,0,i,"rect"===e.draw.chainType?.2*i:i),pop();break;case"line":t.scribbleLine(e.scalePosition(cos(u)*-o+a).x,e.scalePosition(sin(u)*-o+h).y,e.scalePosition(cos(u)*o+a).x,e.scalePosition(sin(u)*o+h).y);break;case"ellipse":t.scribbleEllipse(e.scalePosition(a).x,e.scalePosition(h).y,i);break;case"triangle":const s=TWO_PI/3,n=u+-HALF_PI;for(let i=0;i<TWO_PI;i+=s)t.scribbleLine(e.scalePosition(cos(n+i)*o+a).x,e.scalePosition(sin(n+i)*o+h).y,e.scalePosition(cos(n+i+s)*o+a).x,e.scalePosition(sin(n+i+s)*o+h).y)}}})(this.shape)}}}p5.prototype.curvePoint=function(e,t,s,i,o){p5._validateParameters("curvePoint",arguments);const n=this._renderer._curveTightness,r=o*o*o,c=o*o,a=(n-1)/2*r+(1-n)*c+(n-1)/2*o,h=(n+3)/2*r+(-5-n)/2*c+1,l=(-3-n)/2*r+(n+2)*c+(1-n)/2*o,p=(1-n)/2*r+(n-1)/2*c;return e*a+t*h+s*l+i*p},p5.prototype.curveTangent=function(e,t,s,i,o){p5._validateParameters("curveTangent",arguments);const n=this._renderer._curveTightness,r=o*o*3,c=2*o,a=(n-1)/2*r+(1-n)*c+(n-1)/2,h=(n+3)/2*r+(-5-n)/2*c,l=(-3-n)/2*r+(n+2)*c+(1-n)/2,p=(1-n)/2*r+(n-1)/2*c;return e*a+t*h+s*l+i*p};class it{constructor(){this.id=class{static i=0;static getNew(){return this.i++,this.i}}.getNew();const e=config.border+.5*config.minimumSize;this.x=R.num(e,config.w-e),this.y=R.num(e,config.h-e),this.growthSpeed=R.num(...config.shape.growth),this.size=0,this.status="growing",this.debug=!1,this.draw=null,this.randomSeed=R.dec();const t=Ve();this.model={type:t.type,points:t.p,curveThightness:t.ct?t.ct:.99,curveWeight:t.cw?t.cw:.1,collisionDetail:t.cd?t.cd:1,chainPoints:t.chain?t.chain:7},R.dec()<.66&&(this.model.curveThightness=.99),this.collisionPoly=y(this.model),this.boundaries=(e=>{const t={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};for(let s=0;s<e.length;s+=2)t.minX=e[s+0]<t.minX?e[s+0]:t.minX,t.maxX=e[s+0]>t.maxX?e[s+0]:t.maxX,t.minY=e[s+1]<t.minY?e[s+1]:t.minY,t.maxY=e[s+1]>t.maxY?e[s+1]:t.maxY;return t})(this.collisionPoly)}postPlacement(e){this.inside=((e,t)=>{let s=!1;return t.forEach((t=>{t!==e&&v(e.x,e.y,t)&&(s=t)})),s})(this,e),this.inside&&(this.size/=1.4),this.targetSize=this.size,this.inside&&"bezier"===this.inside.model.type&&(this.kill=!0),this.draw=new st(this)}scalePosition(e){return{x:e*this.size+this.x,y:e*this.size+this.y}}grow(){this.size+=this.growthSpeed}changeStatus(e){if("static"===e)this.status="static",Me(this)}collisionCheck(e){(e=>{(e.scalePosition(e.boundaries.minX).x<=config.border||e.scalePosition(e.boundaries.maxX).x>=config.w-config.border||e.scalePosition(e.boundaries.minY).y<=config.border||e.scalePosition(e.boundaries.maxY).y>=config.h-config.border)&&e.changeStatus("static")})(this),((e,t)=>{t.forEach((t=>{t!==e&&(e.id<t.id&&"growing"===t.status||((e,t)=>e.scalePosition(e.boundaries.minX).x<=t.scalePosition(t.boundaries.maxX).x&&t.scalePosition(t.boundaries.minX).x<=e.scalePosition(e.boundaries.maxX).x&&e.scalePosition(e.boundaries.minY).y<=t.scalePosition(t.boundaries.maxY).y&&t.scalePosition(t.boundaries.minY).y<=e.scalePosition(e.boundaries.maxY).y)(e,t)&&Xe(e,t)&&Ue(e,t))}))})(this,e)}update(e){if("growing"===this.status)this.grow(),this.collisionCheck(e)}render=()=>{this.draw.render(),this.debug&&(this.DEBUG_drawAnchorPoints(),this.DEBUG_drawCollisionOutline())};DEBUG_drawAnchorPoints=()=>{fill(187,125,53,.9),noStroke();for(let e=0;e<this.model.points.length;e+=2)ellipse(this.scalePosition(this.model.points[e]).x,this.scalePosition(this.model.points[e+1]).y,this.size*(.025+.002*sin(frameCount/20+999*this.model.points[0])))};DEBUG_drawCollisionOutline=()=>{stroke(187,125,53,.9),strokeWeight(map(sin(frameCount/25+99*this.collisionPoly[0]),-1,1,1,2)),noFill(),beginShape();for(let e=0;e<this.collisionPoly.length;e+=2)vertex(this.scalePosition(this.collisionPoly[e]).x,this.scalePosition(this.collisionPoly[e+1]).y);endShape(CLOSE)}}var ot=()=>{const e=createGraphics(round(config.w),round(config.h));e.pixelDensity(pixelDensity()),background(s[config.colourPallet]);for(let e=0;e<=R.int(5,9);e++){noStroke();const e=color(n());e.setAlpha(.12);const t=new it;t.draw=new st(t),t.draw.stroke=[],t.draw.fill={type:"solid",colour:e},"curve"!==t.model.type&&"bezier"!==t.model.type||(t.draw.edgeType="bezier"===t.model.type?"bezier":"straight",t.draw.stroke=[{colour:e,weight:t.model.curveWeight,dashed:""}],t.draw.fill=null),t.size=R.num(.25*config.h,config.h),t.x=R.num(0,config.w),t.y=R.num(0,config.h),t.render()}blendMode(OVERLAY);const t=createGraphics(round(config.w),round(config.h));t.pixelDensity(pixelDensity());const i=t.pixelDensity();t.loadPixels();for(let e=0;e<t.width*i*t.height*i*4;e+=4)t.pixels[e]=t.pixels[e+1]=t.pixels[e+2]=random(200),t.pixels[e+3]=40;t.updatePixels(),t.stroke(0,40),t.strokeWeight(.5);for(let e=0;e<5e4;e++){const e=random(PI),s=random(t.width),i=random(t.height),o=random(3);t.line(cos(e)*o+s,sin(e)*o+i,cos(e)*-o+s,sin(e)*-o+i)}return image(t,0,0,round(config.w),round(config.h)),blendMode(BLEND),e.copy(config.canvas,0,0,round(width),round(height),0,0,round(config.w),round(config.h)),e};var nt=()=>{const e=createGraphics(round(config.w),round(config.h));e.pixelDensity(1),e.loadPixels(),e.background(0);for(let t=0;t<e.width*e.height*4;t+=4){const s=t/4%e.width/e.width-.5,i=t/4/e.width/e.height-.5,o=w(.5,.2,abs(s)),n=w(.5,.2,abs(i)),r=1-pow(o*n,.25);e.pixels[t+3]=100*r}return e.updatePixels(),e};var rt=class{constructor(){this.backgroundGfx=ot(),this.vignetteGfx=nt(),this.keyboardSetup(),this.failedPlacements=0,this.maxPlacementTried=350,this.shapes=[];const e=R.int(...config.shape.starters);for(let t=0;t<e;t++)this.addNewShape();this.scalingPhase=0}tick(){image(this.backgroundGfx,0,0,round(config.w),round(config.h)),1===frameCount||(2===frameCount?(this.placement(),this.resetSize()):this.renderShapes()),this.drawVignette()}placement(){const e=R.int(...config.shape.spawnRate);let t=0;for(;this.failedPlacements<this.maxPlacementTried;){for(let e=this.shapes.length-1;e>=0;e--)this.shapes[e].update(this.shapes),this.shapes[e].kill&&(this.shapes.splice(e,1),this.failedPlacements++);t%e==0&&this.addNewShape(),t++}for(let e=this.shapes.length-1;e>=0;e--)Me(this.shapes[e]),this.shapes[e].postPlacement(this.shapes),this.shapes[e].kill&&this.shapes.splice(e,1)}addNewShape(){this.shapes.push(new it(this.shapes)),this.shapes[this.shapes.length-1].update(this.shapes),this.shapes[this.shapes.length-1].kill&&this.shapes.pop()}resetSize(){for(let e=0;e<this.shapes.length;e++)this.shapes[e].size=0,this.shapes[e].scalingProgress=0;this.scalingPhase=0}renderShapes(){this.growShapes();for(let e=0;e<this.shapes.length;e++)this.shapes[e].render()}growShapes(){for(let t=0;t<min(this.shapes.length,this.scalingPhase);t++)if(this.shapes[t].targetSize>this.shapes[t].size){this.shapes[t].scalingProgress+=.025;const s=min(this.shapes[t].scalingProgress,1);this.shapes[t].size=(0==(e=s)?0:1==e?1:(e/=.5)<1?.5*pow(2,10*(e-1)):.5*(2-pow(2,-10*--e)))*this.shapes[t].targetSize,this.shapes[t].size=min(this.shapes[t].size,this.shapes[t].targetSize)}var e;round(map(this.scalingPhase,0,this.shapes.length,30,5));frameCount%30==0&&this.scalingPhase++}drawVignette(){image(this.vignetteGfx,0,0,round(config.w),round(config.h))}keyboardSetup(){window.keyReleased=()=>{switch(keyCode){case 68:for(let e=0;e<this.shapes.length;e++)this.shapes[e].debug=!this.shapes[e].debug;break;case 83:save(`ilumz-${tokenData.tokenId}.png`);break;case 82:this.resetSize()}}}};let at;window.R=new t,window.config={},config.w=1280,config.h=720,config.shape={growth:[.1,6],starters:[1,10],spawnRate:[10,180],minPatternSize:120},config.border=-150,config.borderRange=[-50,-200],config.minimumSizeRange=[180,250],config.minimumSize=R.int(...config.minimumSizeRange),config.border=R.int(...config.borderRange),config.colourPallet=R.int(0,s.length-1),setup=()=>{config.canvas=createCanvas(round(window.innerWidth),round(window.innerWidth*(config.h/config.w))),randomSeed(R.num(0,99999)),noiseSeed(R.num(0,99999)),colorMode(RGB,255,255,255,1),ellipseMode(CENTER),rectMode(CENTER),scale(window.innerWidth/config.w),at=new rt},draw=()=>{scale(window.innerWidth/config.w),at.tick()},windowResized=()=>{resizeCanvas(round(window.innerWidth),round(window.innerWidth*(config.h/config.w)))};
[To learn more about the partnership between Motus and Wolffia, we invite you to watch the ilumz video](https://owenmcateer.com/ilumz/) Collaborators working in two opposing mediums create a unique expression of art that neither could create alone. Merging IRL artistic techniques with algorithmic generative coding. Holding focus on creations that are varied, organic and feature human characteristics of spontaneous art work. In the era of the machine, harmony and humanity shine through ilumz. This is rooted in the artists’ contrasting disciplines, techniques and styles which meld to create a cohesive choreography of abstract, organic, generative art. The creative spark was a chance meeting of opposites. An abstract multi media artist (Wolffia) with an intuitive, freeform, joyful flair and a keen eye for bold shapes, vibrant colours and varied textures. And a creative coder (Motus) who uses algorithms and mathematics to explore the hidden beauty within numbers. Their ilumz brainchild is an algorithm with a human touch and the intelligence to not just replicate painted works but to redraw, reconfigure and recreate. Composition is at the core, so ilumz dynamically builds interaction and divergence into a symphony of shape. This fine balance creates a uniquely natural feel that isn’t overpowered by the algorithm for a distinct aesthetic – call it calm wonderment. Ilumz is a journey from contrast to cohesion that blurs the boundary between physical art and digital craft. It fuses geometry with incidental imperfections of hand-drawn elements. And it’s full circle as Wolffia and Motus continue to catalyse (and challenge) each other’s thinking. You can see the humanity and the sense of partnership in every ilumz mint. *“Chance, mistakes, serendipity... from abstract to algorithm we wanted our hybrid physical-digital project to sing of human touch.”* *Wolffia Inc.* *“Working out the rules for how shapes interact, collide and overlap to create unpredictable complexity opens so many opportunities to explore.”* *Motus*
e>110&&R.dec()<.2))return;this.fillType="scribble"}else"bezier"===this.shape.model.type?this.fillType="solid":R.dec()<.15&&this.shape.size>config.shape.minPatternSize?this.fillType="pattern":this.fillType="solid";switch(this.fillType){case"solid":this.fill={type:"solid",colour:n()};break;case"pattern":this.fill={type:"pattern",colour:n(),pattern:R.choice(Object.keys(je))},this.fill.patternImage=Ke(this.fill.pattern,this.shape);break;case"scribble":this.fill={type:"scribble",colour:n()}}}calcChain=()=>{"bezier"===this.shape.model.type&&(R.dec()>.5||(this.edgeType="chain",this.chainType=R.choice(["rect","square","ellipse","line","triangle"]),this.chainStroke=this.stroke[0].colour,this.chainFill=R.dec()<.5&&this.fill.colour,this.fill=null,this.stroke=[]))};render=()=>{this.drawFill(),this.drawStroke(),this.drawChain()};drawFill(){var e;if(this.fill)switch(noStroke(),this.fill.type){case"solid":fill(this.fill.colour),this.drawFillShape();break;case"pattern":fill(0),e=this.fill.patternImage,drawingContext.fillStyle=e,this.drawFillShape(),fill(0);break;case"scribble":stroke(this.fill.colour),(e=>{const t=new $e,s=e.model.points,i=round(4*e.randomSeed+4);strokeWeight(e.model.curveWeight*e.size/(4*i));for(let o=0;o<s.length-2;o+=2){const n=(o+2)%s.length,r=atan2(s[n+1]-s[o+1],s[n]-s[o])-HALF_PI;for(let c=0;c<i;c++){const a=map(c,0,i-1,-.3*e.model.curveWeight,.3*e.model.curveWeight);t.scribbleLine(e.scalePosition(cos(r)*a+s[o]).x,e.scalePosition(sin(r)*a+s[o+1]).y,e.scalePosition(cos(r)*a+s[n]).x,e.scalePosition(sin(r)*a+s[n+1]).y)}}})(this.shape)}}drawFillShape(){"curved"===this.edgeType?et(this.shape):tt(this.shape)}drawStroke(){this.stroke&&this.stroke.forEach((e=>{noFill(),strokeCap(ROUND),strokeJoin(ROUND),He(e.dashed.split("-").map((e=>e))),strokeWeight(e.weight*this.shape.size),stroke(e.colour),this.drawShape(),He([])}))}drawChain(){"chain"===this.edgeType&&this.drawShape()}drawShape(){switch(this.edgeType){case"curved":et(this.shape);break;case"straight":tt(this.shape);break;case"scribble":(e=>{const t=new $e,s=e.model.points,i="poly"===e.model.type?0:2;for(let o=0;o<s.length-i;o+=2){const i=(o+2)%s.length;t.scribbleLine(e.scalePosition(s[o]).x,e.scalePosition(s[o+1]).y,e.scalePosition(s[i]).x,e.scalePosition(s[i+1]).y)}})(this.shape);break;case"bezier":(e=>{const t=e.model.points;bezier(e.scalePosition(t[0]).x,e.scalePosition(t[1]).y,e.scalePosition(t[2]).x,e.scalePosition(t[3]).y,e.scalePosition(t[4]).x,e.scalePosition(t[5]).y,e.scalePosition(t[6]).x,e.scalePosition(t[7]).y)})(this.shape);break;case"chain":(e=>{const t=new $e;t.roughness=.5;let s=e.model.chainPoints;["line","rect"].includes(e.draw.chainType)&&(s*=2);const i=e.model.curveWeight*e.size,o=e.model.curveWeight/2;stroke(e.draw.chainStroke),e.draw.chainFill?fill(e.draw.chainFill):noFill(),strokeWeight(.05*i);for(let n=0;n<s;n++){let r=n/(s-1);const{x:a,y:h,tx:l,ty:p}=c(e.model.points,r);let u=atan2(p,l);switch(u-=HALF_PI,e.draw.chainType){case"rect":case"square":push(),translate(e.scalePosition(a).x,e.scalePosition(h).y),rotate(u),e.draw.chainFill&&rect(0,0,i,"rect"===e.draw.chainType?.2*i:i),t.scribbleRect(0,0,i,"rect"===e.draw.chainType?.2*i:i),pop();break;case"line":t.scribbleLine(e.scalePosition(cos(u)*-o+a).x,e.scalePosition(sin(u)*-o+h).y,e.scalePosition(cos(u)*o+a).x,e.scalePosition(sin(u)*o+h).y);break;case"ellipse":t.scribbleEllipse(e.scalePosition(a).x,e.scalePosition(h).y,i);break;case"triangle":const s=TWO_PI/3,n=u+-HALF_PI;for(let i=0;i<TWO_PI;i+=s)t.scribbleLine(e.scalePosition(cos(n+i)*o+a).x,e.scalePosition(sin(n+i)*o+h).y,e.scalePosition(cos(n+i+s)*o+a).x,e.scalePosition(sin(n+i+s)*o+h).y)}}})(this.shape)}}}p5.prototype.curvePoint=function(e,t,s,i,o){p5._validateParameters("curvePoint",arguments);const n=this._renderer._curveTightness,r=o*o*o,c=o*o,a=(n-1)/2*r+(1-n)*c+(n-1)/2*o,h=(n+3)/2*r+(-5-n)/2*c+1,l=(-3-n)/2*r+(n+2)*c+(1-n)/2*o,p=(1-n)/2*r+(n-1)/2*c;return e*a+t*h+s*l+i*p},p5.prototype.curveTangent=function(e,t,s,i,o){p5._validateParameters("curveTangent",arguments);const n=this._renderer._curveTightness,r=o*o*3,c=2*o,a=(n-1)/2*r+(1-n)*c+(n-1)/2,h=(n+3)/2*r+(-5-n)/2*c,l=(-3-n)/2*r+(n+2)*c+(1-n)/2,p=(1-n)/2*r+(n-1)/2*c;return e*a+t*h+s*l+i*p};class it{constructor(){this.id=class{static i=0;static getNew(){return this.i++,this.i}}.getNew();const e=config.border+.5*config.minimumSize;this.x=R.num(e,config.w-e),this.y=R.num(e,config.h-e),this.growthSpeed=R.num(...config.shape.growth),this.size=0,this.status="growing",this.debug=!1,this.draw=null,this.randomSeed=R.dec();const t=Ve();this.model={type:t.type,points:t.p,curveThightness:t.ct?t.ct:.99,curveWeight:t.cw?t.cw:.1,collisionDetail:t.cd?t.cd:1,chainPoints:t.chain?t.chain:7},R.dec()<.66&&(this.model.curveThightness=.99),this.collisionPoly=y(this.model),this.boundaries=(e=>{const t={minX:1/0,maxX:-1/0,minY:1/0,maxY:-1/0};for(let s=0;s<e.length;s+=2)t.minX=e[s+0]<t.minX?e[s+0]:t.minX,t.maxX=e[s+0]>t.maxX?e[s+0]:t.maxX,t.minY=e[s+1]<t.minY?e[s+1]:t.minY,t.maxY=e[s+1]>t.maxY?e[s+1]:t.maxY;return t})(this.collisionPoly)}postPlacement(e){this.inside=((e,t)=>{let s=!1;return t.forEach((t=>{t!==e&&v(e.x,e.y,t)&&(s=t)})),s})(this,e),this.inside&&(this.size/=1.4),this.targetSize=this.size,this.inside&&"bezier"===this.inside.model.type&&(this.kill=!0),this.draw=new st(this)}scalePosition(e){return{x:e*this.size+this.x,y:e*this.size+this.y}}grow(){this.size+=this.growthSpeed}changeStatus(e){if("static"===e)this.status="static",Me(this)}collisionCheck(e){(e=>{(e.scalePosition(e.boundaries.minX).x<=config.border||e.scalePosition(e.boundaries.maxX).x>=config.w-config.border||e.scalePosition(e.boundaries.minY).y<=config.border||e.scalePosition(e.boundaries.maxY).y>=config.h-config.border)&&e.changeStatus("static")})(this),((e,t)=>{t.forEach((t=>{t!==e&&(e.id<t.id&&"growing"===t.status||((e,t)=>e.scalePosition(e.boundaries.minX).x<=t.scalePosition(t.boundaries.maxX).x&&t.scalePosition(t.boundaries.minX).x<=e.scalePosition(e.boundaries.maxX).x&&e.scalePosition(e.boundaries.minY).y<=t.scalePosition(t.boundaries.maxY).y&&t.scalePosition(t.boundaries.minY).y<=e.scalePosition(e.boundaries.maxY).y)(e,t)&&Xe(e,t)&&Ue(e,t))}))})(this,e)}update(e){if("growing"===this.status)this.grow(),this.collisionCheck(e)}render=()=>{this.draw.render(),this.debug&&(this.DEBUG_drawAnchorPoints(),this.DEBUG_drawCollisionOutline())};DEBUG_drawAnchorPoints=()=>{fill(187,125,53,.9),noStroke();for(let e=0;e<this.model.points.length;e+=2)ellipse(this.scalePosition(this.model.points[e]).x,this.scalePosition(this.model.points[e+1]).y,this.size*(.025+.002*sin(frameCount/20+999*this.model.points[0])))};DEBUG_drawCollisionOutline=()=>{stroke(187,125,53,.9),strokeWeight(map(sin(frameCount/25+99*this.collisionPoly[0]),-1,1,1,2)),noFill(),beginShape();for(let e=0;e<this.collisionPoly.length;e+=2)vertex(this.scalePosition(this.collisionPoly[e]).x,this.scalePosition(this.collisionPoly[e+1]).y);endShape(CLOSE)}}var ot=()=>{const e=createGraphics(round(config.w),round(config.h));e.pixelDensity(pixelDensity()),background(s[config.colourPallet]);for(let e=0;e<=R.int(5,9);e++){noStroke();const e=color(n());e.setAlpha(.12);const t=new it;t.draw=new st(t),t.draw.stroke=[],t.draw.fill={type:"solid",colour:e},"curve"!==t.model.type&&"bezier"!==t.model.type||(t.draw.edgeType="bezier"===t.model.type?"bezier":"straight",t.draw.stroke=[{colour:e,weight:t.model.curveWeight,dashed:""}],t.draw.fill=null),t.size=R.num(.25*config.h,config.h),t.x=R.num(0,config.w),t.y=R.num(0,config.h),t.render()}blendMode(OVERLAY);const t=createGraphics(round(config.w),round(config.h));t.pixelDensity(pixelDensity());const i=t.pixelDensity();t.loadPixels();for(let e=0;e<t.width*i*t.height*i*4;e+=4)t.pixels[e]=t.pixels[e+1]=t.pixels[e+2]=random(200),t.pixels[e+3]=40;t.updatePixels(),t.stroke(0,40),t.strokeWeight(.5);for(let e=0;e<5e4;e++){const e=random(PI),s=random(t.width),i=random(t.height),o=random(3);t.line(cos(e)*o+s,sin(e)*o+i,cos(e)*-o+s,sin(e)*-o+i)}return image(t,0,0,round(config.w),round(config.h)),blendMode(BLEND),e.copy(config.canvas,0,0,round(width),round(height),0,0,round(config.w),round(config.h)),e};var nt=()=>{const e=createGraphics(round(config.w),round(config.h));e.pixelDensity(1),e.loadPixels(),e.background(0);for(let t=0;t<e.width*e.height*4;t+=4){const s=t/4%e.width/e.width-.5,i=t/4/e.width/e.height-.5,o=w(.5,.2,abs(s)),n=w(.5,.2,abs(i)),r=1-pow(o*n,.25);e.pixels[t+3]=100*r}return e.updatePixels(),e};var rt=class{constructor(){this.backgroundGfx=ot(),this.vignetteGfx=nt(),this.keyboardSetup(),this.failedPlacements=0,this.maxPlacementTried=350,this.shapes=[];const e=R.int(...config.shape.starters);for(let t=0;t<e;t++)this.addNewShape();this.scalingPhase=0}tick(){image(this.backgroundGfx,0,0,round(config.w),round(config.h)),1===frameCount||(2===frameCount?(this.placement(),this.resetSize()):this.renderShapes()),this.drawVignette()}placement(){const e=R.int(...config.shape.spawnRate);let t=0;for(;this.failedPlacements<this.maxPlacementTried;){for(let e=this.shapes.length-1;e>=0;e--)this.shapes[e].update(this.shapes),this.shapes[e].kill&&(this.shapes.splice(e,1),this.failedPlacements++);t%e==0&&this.addNewShape(),t++}for(let e=this.shapes.length-1;e>=0;e--)Me(this.shapes[e]),this.shapes[e].postPlacement(this.shapes),this.shapes[e].kill&&this.shapes.splice(e,1)}addNewShape(){this.shapes.push(new it(this.shapes)),this.shapes[this.shapes.length-1].update(this.shapes),this.shapes[this.shapes.length-1].kill&&this.shapes.pop()}resetSize(){for(let e=0;e<this.shapes.length;e++)this.shapes[e].size=0,this.shapes[e].scalingProgress=0;this.scalingPhase=0}renderShapes(){this.growShapes();for(let e=0;e<this.shapes.length;e++)this.shapes[e].render()}growShapes(){for(let t=0;t<min(this.shapes.length,this.scalingPhase);t++)if(this.shapes[t].targetSize>this.shapes[t].size){this.shapes[t].scalingProgress+=.025;const s=min(this.shapes[t].scalingProgress,1);this.shapes[t].size=(0==(e=s)?0:1==e?1:(e/=.5)<1?.5*pow(2,10*(e-1)):.5*(2-pow(2,-10*--e)))*this.shapes[t].targetSize,this.shapes[t].size=min(this.shapes[t].size,this.shapes[t].targetSize)}var e;round(map(this.scalingPhase,0,this.shapes.length,30,5));frameCount%30==0&&this.scalingPhase++}drawVignette(){image(this.vignetteGfx,0,0,round(config.w),round(config.h))}keyboardSetup(){window.keyReleased=()=>{switch(keyCode){case 68:for(let e=0;e<this.shapes.length;e++)this.shapes[e].debug=!this.shapes[e].debug;break;case 83:save(`ilumz-${window.tokenData.hash}-${window.tokenData.tokenId}.png`);break;case 82:this.resetSize()}}}};const ct=new URLSearchParams(window.location.search);if(ct.get("token")){const e=ct.get("token").split("/");window.tokenData={hash:e[0],tokenId:e[1]}}else window.tokenData=function(e){let t={},s="0x";for(var i=0;i<64;i++)s+=Math.floor(16*Math.random()).toString(16);return t.hash=s,t.tokenId=(1e6*e+Math.floor(1e3*Math.random())).toString(),t}(0),window.location.hash=`#token=${window.tokenData.hash}/${window.tokenData.tokenId}`;let at;window.R=new t,window.config={},config.w=1280,config.h=720,config.shape={growth:[.1,6],starters:[1,10],spawnRate:[10,180],minPatternSize:120},config.border=-150,config.borderRange=[-50,-200],config.minimumSizeRange=[180,250],config.minimumSize=R.int(...config.minimumSizeRange),config.border=R.int(...config.borderRange),config.colourPallet=R.int(0,s.length-1),setup=()=>{config.canvas=createCanvas(round(window.innerWidth),round(window.innerWidth*(config.h/config.w))),randomSeed(R.num(0,99999)),noiseSeed(R.num(0,99999)),colorMode(RGB,255,255,255,1),ellipseMode(CENTER),rectMode(CENTER),scale(window.innerWidth/config.w),at=new rt},draw=()=>{scale(window.innerWidth/config.w),at.tick()},windowResized=()=>{resizeCanvas(round(window.innerWidth),round(window.innerWidth*(config.h/config.w)))};
,"w":0.15,"cd":6,"p":[-0.1217,0.0117,-0.0717,-0.4217,-0.0367,0.0033,0.2867,-0.3867,0.0383,0.0467,0.3833,0.3317,-0.035,0.0767,0.095,0.4267,-0.1083,0.0333,-0.4467,0.4083,-0.1967,0.045,-0.4433,-0.3833,-0.1667,-0.0633]}');var le;le=JSON.parse('{"type":"curve","ct":0.25,"cw":0.06,"w":0.15,"cd":7,"p":[-0.3633,-0.41,-0.235,-0.1717,-0.2183,-0.4167,-0.1483,-0.175,0.0633,-0.4167,-0.0683,-0.145,0.4167,-0.1917,-0.075,-0.055,0.3917,0.12,-0.0617,0.0617,0.3567,0.42,-0.17,0.0767]}');var pe;pe=JSON.parse('{"type":"curve","ct":0.25,"cw":0.19,"w":0.15,"cd":6,"p":[-0.3233,0.2117,0.21,-0.2933,-0.2783,-0.345,0.2783,0.255,-0.3233,0.2117]}');var ue;ue=JSON.parse('{"type":"curve","ct":-2.61,"cw":0.19,"w":0.15,"cd":7,"p":[-0.3233,0.2117,0.21,-0.2933,-0.2783,-0.345,0.2783,0.255,-0.3233,0.2117]}');var de;de=JSON.parse('{"type":"curve","ct":-1,"cw":0.1,"w":0.15,"cd":4,"p":[0.015,0.05,-0.37,-0.4667,-0.315,0.1483,0.3967,0.1867,0.455,-0.4583,0.015,0.05]}');var ge;ge=JSON.parse('{"type":"curve","ct":-1.35,"cw":0.15,"w":0.11,"cd":4,"p":[0,-0.45,0.385,-0.4733,0.5967,-0.13,0.3967,0.0967,0.1233,0.295,0.0117,-0.1383,-0.35,-0.0917,-0.3183,-0.4317,0,-0.45]}');var fe;fe=JSON.parse('{"type":"curve","ct":-1,"cw":0.23,"w":0.15,"cd":4,"p":[-0.303,0.44,-0.328,-0.337,0.322,0.208]}');var ye;ye=JSON.parse('{"type":"curve","ct":0.3,"cw":0.05,"w":0.11,"cd":4,"p":[-0.5133,0.6117,-0.6567,0.3133,-0.4067,0.5333,-0.5467,0.205,-0.2867,0.4517,-0.4383,0.1217,-0.19,0.3883,-0.325,0.0533,-0.0917,0.3217,-0.2133,-0.0317,0.0133,0.2567,-0.1,-0.1033,0.12,0.195,0.0033,-0.1767,0.2467,0.1183,0.1283,-0.2317,0.3617,0.0267]}');var ve;ve=JSON.parse('{"type":"curve","ct":0,"cw":0.12,"w":0.11,"cd":4,"p":[-0.4517,0.635,-0.6417,-0.0317,-0.1233,0.3433,-0.2933,0.465,-0.3617,-0.1617,0.27,0.2517,0.0783,0.3667,-0.0267,-0.405,0.595,0.045,0.4267,0.1933,0.435,-0.53]}');var we;we=JSON.parse('{"type":"curve","ct":-2.09,"cw":0.12,"w":0.11,"cd":4,"p":[-0.2233,0.265,0.225,-0.3433,-0.1867,-0.4067,0.3867,0.1917]}');var me;me=JSON.parse('{"type":"curve","ct":-1.48,"cw":0.18,"w":0,"cd":4,"p":[0.06,0.245,-0.3183,0.2683,-0.51,0.1317,-0.1583,-0.085,-0.3867,-0.3733,-0.0533,-0.58,0.2917,-0.405,0.4433,-0.1517,0.0517,-0.0617,0.3283,0.2317,0.06,0.245]}');var be;be=JSON.parse('{"type":"curve","ct":-1.48,"cw":0.07,"w":0,"cd":8,"p":[0.475,0.59,-0.5967,0.6217,0.585,0.3883,-0.6583,0.285,0.5983,0.13,-0.65,0.005,0.5967,-0.0983,-0.6467,-0.2217,0.645,-0.3033,-0.5967,-0.4167,0.595,-0.6117]}');var xe;xe=JSON.parse('{"type":"curve","ct":-1.48,"cw":0.07,"w":0,"cd":7,"p":[-0.0867,0.67,-0.613,0.035,0.1667,0.4717,-0.35,-0.473,0.4983,0.11,0.0867,-0.688,0.6533,-0.235]}');var Pe;Pe=JSON.parse('{"type":"curve","ct":-1,"cw":0.1,"w":0.15,"cd":7,"p":[-0.38,-0.155,0.4383,0.205,-0.3633,0.185,0.345,-0.2583]}');var Se;Se=JSON.parse('{"type":"curve","ct":-1.27,"cw":0.06,"w":0.05,"cd":6,"p":[-0.6333,0.0533,-0.4417,-0.59,-0.1183,0.3317,-0.4467,0.365,0.0467,-0.36,0.1367,0.485,0.59,0.47,0.0083,-0.18]}');var Oe;Oe=JSON.parse('{"type":"curve","ct":-1.27,"cw":0.06,"w":0.05,"cd":8,"p":[0.3067,-0.6083,-0.6317,-0.3633,0.4517,-0.175,-0.2317,0.615]}');var ke;ke=JSON.parse('{"type":"curve","ct":-1.27,"cw":0.06,"w":0.05,"cd":6,"p":[-0.5617,0.125,-0.3933,-0.475,-0.1217,0.165,-0.3417,0.1767,0.0067,-0.4617,0.2167,0.1533,0.58,0.0233]}');var Ne;Ne=JSON.parse('{"type":"curve","ct":-1.27,"cw":0.12,"w":0.05,"cd":6,"p":[0.1033,0.1658,0.0467,0.6733,-0.1917,0.1117,-0.5083,0.6317,-0.5233,-0.0475,-0.6333,-0.5392,-0.1017,-0.4183,0.4067,-0.4275,0.1533,-0.0008,0.6,0.3825,0.1983,0.3658]}');var Je;Je=JSON.parse('{"type":"curve","ct":-1.27,"cw":0.08,"w":0.05,"cd":6,"p":[-0.215,-0.2,-0.0033,-0.5817,0.2683,-0.4983,0.0117,-0.09,0.395,-0.0133,0.5267,0.34,-0.0317,0.2383,-0.1467,0.61,-0.6117,0.5267,-0.32,0.1433,-0.6667,-0.2633,-0.4267,-0.39,-0.28,-0.1083]}');var Re;Re=JSON.parse('{"type":"curve","ct":-1,"cw":0.07,"w":0.12,"cd":3,"p":[-0.6167,0.365,-0.113,-0.393,-0.663,-0.287,0.013,0.305,0.1617,-0.467,0.683,0.0783,0.2917,0.1817,0.49,-0.6117]}');var ze;ze=JSON.parse('{"type":"curve","ct":-1,"cw":0.07,"w":0.12,"cd":3,"p":[-0.69,-0.667,0.46,-0.43,-0.25,0.45,-0.5283,-0.5017,0.6467,0.1217]}');var Te;Te=JSON.parse('{"type":"curve","ct":-1,"cw":0.07,"w":0.12,"cd":3,"p":[-0.6083,0.11,0.5033,-0.506,-0.653,-0.39,0.625,0.3133,-0.4817,0.37,0.5767,-0.2617]}');var We;We=JSON.parse('{"type":"curve","ct":-1,"cw":0.16,"w":0.12,"cd":3,"p":[-0.6283,0.6317,-0.485,-0.6167,-0.0067,0.6317,0.6333,-0.665]}');var De;De=JSON.parse('{"type":"curve","ct":-1,"cw":0.02,"w":0.12,"cd":3,"p":[-0.698,-0.7017,-0.255,-0.6817,0.54,-0.587,-0.003,-0.113,-0.0983,-0.527,0.545,-0.237,-0.3917,0.653,-0.335,0.0583,0.6717,0.667]}');var Ie;Ie=JSON.parse('{"type":"poly","l":"polygon","w":0.21,"ct":0.4,"p":[0.5,0,0,0.5,-0.5,0,0,-0.5]}');var Ce;Ce=JSON.parse('{"type":"poly","l":"polygon","w":0.33,"ct":0.8,"p":[0.5,0,-0.25,0.433,-0.25,-0.43]}');var Le;Le=JSON.parse('{"type":"bezier","cw":0.17,"w":0.26,"cd":8,"chain":7,"p":[0.3967,-0.4317,-0.6617,-0.4533,0.505,0.12,-0.38,0.4]}');var Ee;Ee=JSON.parse('{"type":"bezier","cw":0.05,"w":0.15,"cd":9,"chain":15,"p":[-0.005,-0.48,-0.068,-0.152,0.0583,0.1583,-0.007,0.492]}');var _e;_e=JSON.parse('{"type":"bezier","cw":0.03,"w":0.15,"cd":7,"chain":20,"p":[-0.11,-0.6117,-0.25,0.25,0.25,0.25,0.6383,-0.6717]}');var Fe;Fe=JSON.parse('{"type":"bezier","cw":0.1,"w":0.15,"cd":7,"chain":10,"p":[-0.6367,-0.6567,-0.3417,0.6242,-0.11,0.6892,0.6017,-0.6483]}');var Ge;Ge=JSON.parse('{"type":"bezier","cw":0.11,"w":0.07,"cd":7,"chain":9,"p":[-0.25,-0.575,-0.6617,0.2583,0.69,-0.37,0.5,0.4533]}');var Ae;Ae=JSON.parse('{"type":"bezier","cw":0.2,"w":0.05,"cd":7,"chain":7,"p":[-0.5433,-0.525,-0.7217,0.3933,0.47,0.4925,0.3917,-0.4667]}');var Ye;Ye=JSON.parse('{"type":"bezier","cw":0.1,"w":0.15,"cd":7,"chain":13,"p":[-0.5,-0.5,-0.25,-0.25,0.25,0.25,0.5,0.5]}');var Ve=()=>{const t=R.choice([e(x),e(P),e(S),e(O),e(k),e(N),e(J),e(z),e(T),e(W),e(D),e(I),e(C),e(L),e(E),e(_),e(F),e(G),e(A),e(Y),e(V),e(X),e(M),e(U),e(q),e(B),e(H),e($),e(j),e(K),e(Q),e(Z),e(ee),e(te),e(se),e(ie),e(oe),e(ne),e(re),e(ce),e(ae),e(he),e(le),e(pe),e(ue),e(de),e(ge),e(fe),e(ye),e(ve),e(we),e(me),e(be),e(xe),e(Pe),e(Se),e(Oe),e(ke),e(Ne),e(Je),e(Re),e(ze),e(Te),e(We),e(De),e(Ie),e(Ce),e(Le),e(Ee),e(_e),e(Fe),e(Ge),e(Ae),e(Ye)]);let s=JSON.parse(JSON.stringify(t));return(e=>{if(0!==e.w){e.w*=.1;for(let t=0;t<e.p.length;t+=2){const s=noise(1.3*e.p[t],1.3*e.p[t+1])*TWO_PI;e.p[t]+=cos(s)*e.w,e.p[t+1]+=sin(s)*e.w}}})(s),(e=>{const t=R.num(0,TWO_PI);for(let n=0;n<e.p.length;n+=2){const r=(s=e.p[n],i=e.p[n+1],o=t,{x:s*cos(o)-i*sin(o),y:s*sin(o)+i*cos(o)});e.p[n]=r.x,e.p[n+1]=r.y}var s,i,o})(s),s};const Xe=(e,t)=>function(e,t){let s=0;for(let i=0;i<e.collisionPoly.length;i+=2){s=i+2,s==e.collisionPoly.length&&(s=0);if(qe(t,e.scalePosition(e.collisionPoly[i]).x,e.scalePosition(e.collisionPoly[i+1]).y,e.scalePosition(e.collisionPoly[s]).x,e.scalePosition(e.collisionPoly[s+1]).y))return!0}return!1}(e,t),Me=e=>{e.size<config.minimumSize&&(e.kill=!0)},Ue=(e,t)=>{if(e.size>config.minimumSize&&t.size>config.minimumSize)return e.changeStatus("static"),void t.changeStatus("static");e.size>t.size?t.kill=!0:e.kill=!0};function qe(e,t,s,i,o){let n=0;for(let r=0;r<e.collisionPoly.length;r+=2){n=r+2,n==e.collisionPoly.length&&(n=0);if(Be(t,s,i,o,e.scalePosition(e.collisionPoly[r]).x,e.scalePosition(e.collisionPoly[r+1]).y,e.scalePosition(e.collisionPoly[n]).x,e.scalePosition(e.collisionPoly[n+1]).y))return!0}return!1}function Be(e,t,s,i,o,n,r,c){const a=((r-o)*(t-n)-(c-n)*(e-o))/((c-n)*(s-e)-(r-o)*(i-t)),h=((s-e)*(t-n)-(i-t)*(e-o))/((c-n)*(s-e)-(r-o)*(i-t));return a>=0&&a<=1&&h>=0&&h<=1}const He=e=>{drawingContext.setLineDash(e)};var $e=function(e){this.s=e||window,this.bowing=1,this.roughness=1,this.maxOffset=2,this.numEllipseSteps=9,this.ellipseInc=2*PI/this.numEllipseSteps,this.randomSeq=0,this.random=e=>(this.randomSeq++,abs(sin(e*this.randomSeq))),this.getOffset=function(e,t){return this.roughness*(this.random(t*e)*(t-e)+e)},this.buildEllipse=function(e,t,s,i,o,n){var r=this.getOffset(-.5,.5)-PI/2;this.s.beginShape(),this.s.curveVertex(this.getOffset(-o,o)+e+.9*s*cos(r-this.ellipseInc),this.getOffset(-o,o)+t+.9*i*sin(r-this.ellipseInc));for(var c=r;c<2*PI+r-.01;c+=this.ellipseInc)this.s.curveVertex(this.getOffset(-o,o)+e+s*cos(c),this.getOffset(-o,o)+t+i*sin(c));this.s.curveVertex(this.getOffset(-o,o)+e+s*cos(r+2*PI+.5*n),this.getOffset(-o,o)+t+i*sin(r+2*PI+.5*n)),this.s.curveVertex(this.getOffset(-o,o)+e+.98*s*cos(r+n),this.getOffset(-o,o)+t+.98*i*sin(r+n)),this.s.curveVertex(this.getOffset(-o,o)+e+.9*s*cos(r+.5*n),this.getOffset(-o,o)+t+.9*i*sin(r+.5*n)),this.s.endShape()},this.scribbleLine=function(e,t,s,i){var o=(e-s)*(e-s)+(t-i)*(t-i),n=this.maxOffset;this.maxOffset*this.maxOffset*100>o&&(n=sqrt(o)/10);var r=n/2,c=.2+.2*this.random(e+t*s*i),a=this.bowing*this.maxOffset*(i-t)/200,h=this.bowing*this.maxOffset*(e-s)/200;a=this.getOffset(-a,a),h=this.getOffset(-h,h),this.s.noFill(),this.s.strokeCap(ROUND),this.s.beginShape(),this.s.vertex(e+this.getOffset(-n,n),t+this.getOffset(-n,n)),this.s.curveVertex(e+this.getOffset(-n,n),t+this.getOffset(-n,n)),this.s.curveVertex(a+e+(s-e)*c+this.getOffset(-n,n),h+t+(i-t)*c+this.getOffset(-n,n)),this.s.curveVertex(a+e+2*(s-e)*c+this.getOffset(-n,n),h+t+2*(i-t)*c+this.getOffset(-n,n)),this.s.curveVertex(s+this.getOffset(-n,n),i+this.getOffset(-n,n)),this.s.vertex(s+this.getOffset(-n,n),i+this.getOffset(-n,n)),this.s.endShape(),this.s.beginShape(),this.s.vertex(e+this.getOffset(-r,r),t+this.getOffset(-r,r)),this.s.curveVertex(e+this.getOffset(-r,r),t+this.getOffset(-r,r)),this.s.curveVertex(a+e+(s-e)*c+this.getOffset(-r,r),h+t+(i-t)*c+this.getOffset(-r,r)),this.s.curveVertex(a+e+2*(s-e)*c+this.getOffset(-r,r),h+t+2*(i-t)*c+this.getOffset(-r,r)),this.s.curveVertex(s+this.getOffset(-r,r),i+this.getOffset(-r,r)),this.s.vertex(s+this.getOffset(-r,r),i+this.getOffset(-r,r)),this.s.endShape()},this.scribbleRect=function(e,t,s,i){var o=s/2,n=i/2,r=min(e-o,e+o),c=max(e-o,e+o),a=min(t-n,t+n),h=max(t-n,t+n);this.scribbleLine(r,a,c,a),this.scribbleLine(c,a,c,h),this.scribbleLine(c,h,r,h),this.scribbleLine(r,h,r,a)},this.scribbleEllipse=function(e,t,s,i){i=i||s;var o=abs(s/2),n=abs(i/2);o+=this.getOffset(.05*-o,.05*o),n+=this.getOffset(.05*-n,.05*n),this.buildEllipse(e,t,o,n,1,this.ellipseInc*this.getOffset(.1,this.getOffset(.4,1))),this.buildEllipse(e,t,o,n,1.5,0)}};const je={pokadots:e=>{const t=createGraphics(round(config.w),round(config.h));t.pixelDensity(1);const s=new $e(t);s.roughness=.75,s.maxOffset=.5;const{w:i,h:o,s:r}=Qe(e,t),c=30*r+5,a=Ze(t);t.noStroke(),t.fill(n(a));for(let e=0;e<i;e+=c)for(let t=0;t<o;t+=c)s.scribbleEllipse(e,t,.5*c*R.num(.9,1.1));return t},dotMatrix:e=>{const t=round(map(e.size,config.shape.minPatternSize,config.h,5,13)),s=createGraphics(t,t);return s.pixelDensity(1),s.background(n()),s.noStroke(),s.fill(n()),s.ellipse(s.width/2,s.height/2,t/4),s},grid:e=>{const t=createGraphics(round(config.w),round(config.h));t.pixelDensity(1),Ze(t);const s=new $e(t);s.roughness=.5,s.maxOffset=.5;const{w:i,h:o,s:n}=Qe(e,t);t.stroke(0,5),t.strokeWeight(.5*n+.5),t.strokeCap(PROJECT);const r=25*n+4;for(let e=0;e<i;e+=r)for(let i=0;i<o;i+=r)s.scribbleLine(e,0,e,t.height),s.scribbleLine(0,i,t.width,i);return t},lines:e=>{const t=createGraphics(round(config.w),round(config.h));t.pixelDensity(1),Ze(t);const s=new $e(t),{w:i,h:o,s:n}=Qe(e,t);t.stroke(0,175),t.strokeWeight(6*n+1);const r=(20*n+5)*R.dec();for(let e=0;e<i;e+=r)s.scribbleLine(e,0,e,o);return t},squares:e=>{const t=createGraphics(round(config.w),round(config.h));t.pixelDensity(1);const{w:s,h:i,s:o}=Qe(e,t),r=Ze(t);t.fill(n(r)),t.noStroke(),t.rectMode(CENTER);const c=40*o+5;for(let e=0;e<s;e+=c)for(let s=0;s<i;s+=c)t.push(),t.translate(e,s),t.rotate(R.num(-.15,.15)),t.square(0,0,.5*c),t.pop();return t},scatteredLines:e=>{const t=createGraphics(round(config.w),round(config.h));t.pixelDensity(1),Ze(t);let{w:s,h:i,s:o}=Qe(e,t);const r=round(100*o+50),c=new $e(t);t.stroke(n()),t.strokeCap(PROJECT),t.strokeWeight(3*o+2);for(let e=0;e<r;e++)t.push(),t.translate(R.num(0,s),R.num(0,i)),t.rotate(R.num(0,PI)),c.scribbleLine(-max(s,i),0,max(s,i),0),t.pop();return t},"10print":e=>{const t=createGraphics(round(config.w),round(config.h));t.pixelDensity(1),t.background(n()),t.stroke(n());let{w:s,h:i,s:o}=Qe(e,t);t.strokeWeight(6*o+2),t.noFill(),t.strokeCap(ROUND);const r=30*o+15;o=r;const c=R.dec()<.5;for(let e=0;e<s;e+=r)for(let s=0;s<i;s+=r)R.dec()<.5?c?t.line(e,s,e+o,s+o):(t.arc(e+o,s,o,o,HALF_PI,PI),t.arc(e,s+o,o,o,PI+HALF_PI,TWO_PI)):c?t.line(e+o,s,e,s+o):(t.arc(e,s,o,o,0,HALF_PI),t.arc(e+o,s+o,o,o,PI,PI+HALF_PI));return t},zigzag:e=>{const t=map(e.size,config.shape.minPatternSize,config.h,15,40),s=createGraphics(round(t),round(t/2));s.pixelDensity(1);const i=Ze(s),o=new $e(s);return s.stroke(n(i)),s.strokeCap(ROUND),s.strokeWeight(3),o.scribbleLine(0,s.height-2,.5*s.width,2),o.scribbleLine(.5*s.width,2,s.width,s.height-2),s}},Ke=(e,t)=>{return(s=je[e](t)).canvas?s=s.canvas:s.elt&&(s=s.elt),drawingContext.createPattern(s,i||"repeat");var s,i},Qe=(e,t)=>{const s=map(e.size,config.shape.minPatternSize,config.h,0,1);t.translate(e.scalePosition(e.boundaries.minX).x-50,e.scalePosition(e.boundaries.minY).y-50);return{b:50,w:e.scalePosition(e.boundaries.maxX).x-e.scalePosition(e.boundaries.minX).x+100,h:e.scalePosition(e.boundaries.maxY).y-e.scalePosition(e.boundaries.minY).y+100,s:s}},Ze=e=>(bgCol=null,R.dec()<.5&&(bgCol=n(),e.background(bgCol)),bgCol),et=e=>{const t=e.model.subDivided;curveTightness(e.model.curveThightness),beginShape();for(let s=0;s<t.length;s+=2)(0===s||s===t.length-2&&"curve"===e.model.type)&&vertex(e.scalePosition(t[s]).x,e.scalePosition(t[s+1]).y),curveVertex(e.scalePosition(t[s]).x,e.scalePosition(t[s+1]).y);endShape("poly"===e.model.type?CLOSE:void 0)},tt=e=>{const t=e.model.subDivided;beginShape();for(let s=0;s<t.length;s+=2)vertex(e.scalePosition(t[s]).x,e.scalePosition(t[s+1]).y);endShape("poly"===e.model.type?CLOSE:void 0)};class st{constructor(e){this.shape=e,this.shape.model.subDivided=this.shape.model.points,this.shape.model.curveThightness>=.99?(this.edgeType=R.choice(["straight","scribble"]),this.numOfSubDivisions=R.int(0,2)):(this.edgeType="curved",this.numOfSubDivisions=0);for(let e=0;e<this.numOfSubDivisions;e++)this.shape.model.subDivided=m(this.shape.model.subDivided,this.shape.model.type);this.calcStroke(),this.calcFill(),this.calcChain(),this.applyRules()}applyRules(){"bezier"===this.shape.model.type&&"chain"!==this.edgeType&&(this.edgeType="bezier",this.stroke.length>1&&(this.stroke=this.stroke.slice(0,1)),this.fill=null),"scribble"===this.fillType&&(this.stroke=[]),"poly"===this.shape.model.type&&this.stroke.length&&R.dec()<.3&&(this.fill=null),"pattern"!==this.fillType||this.stroke.length||(this.stroke=[{colour:this.fill.colour,weight:.2*this.shape.model.curveWeight,dashed:""}])}calcStroke(){"curve"===this.shape.model.type||"bezier"===this.shape.model.type?(this.stroke=[{colour:n(),weight:this.shape.model.curveWeight,dashed:""}],R.dec()<.5&&(this.stroke.push({colour:r(this.stroke[0].colour),weight:this.shape.model.curveWeight*R.num(.2,.9),dashed:""}),R.dec()<.3&&(this.stroke[1].dashed=`${R.int(3,10)}-${R.int(20,60)}`))):(this.stroke=[],R.dec()<.15&&(this.stroke=[{colour:n(),weight:.25*this.shape.model.curveWeight,dashed:""}]))}calcFill(){if("curve"===this.shape.model.type){if(!(this.shape.siz
function e(e){return e&&e.__esModule?e.default:e}var t=class{constructor(){this.useA=!1;let e=function(e){let t=parseInt(e.substr(0,8),16),s=parseInt(e.substr(8,8),16),i=parseInt(e.substr(16,8),16),o=parseInt(e.substr(24,8),16);return function(){t|=0,s|=0,i|=0,o|=0;let e=(t+s|0)+o|0;return o=o+1|0,t=s^s>>>9,s=i+(i<<3)|0,i=i<<21|i>>>11,i=i+e|0,(e>>>0)/4294967296}};this.prngA=new e(tokenData.hash.substr(2,32)),this.prngB=new e(tokenData.hash.substr(34,32));for(let e=0;e<1e6;e+=2)this.prngA(),this.prngB()}dec(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}num(e,t){return e+(t-e)*this.dec()}int(e,t){return Math.floor(this.num(e,t+1))}choice(e){return e[this.int(0,e.length-1)]}distribute(){return pow(1.58740105*(this.dec()-.5),3)+.5}};const s=["#ebebe9","#d5c3b9","#212c2e"],i=[["#81556b","#6f624d","#c48337","#294fa1","#fb780d","#344764","#385866","#d478ed","#2b2c57","#1b3e4d","#683041","#c48337","#ef929e","#844c16","#85172b"],["#45272f","#275353","#102920","#d14671","#b18e37","#163ba9","#fb780d","#0d254b","#ef9439","#964528","#615125","#f52d7d","#e93323","#90ac93"],["#1c3f4e","#6f5d2f","#515849","#6b4367","#102920","#294535","#353630","#d478ed","#ef9439","#3a83d1","#294fa1","#b18e37","#d14671"]],o=["#1cf9fe","#830dfb","#40cd36","#fe20bb"],n=(e=null)=>{let t=R.choice(i[config.colourPallet]);return t!==e?t:n(e)},r=(e=null)=>{let t=n(e);if(R.dec()<.05&&o.length>0){const e=R.int(0,o.length-1);t=o[e],o.splice(e,1)}return t},c=(e,t)=>({x:bezierPoint(e[0],e[2],e[4],e[6],t),y:bezierPoint(e[1],e[3],e[5],e[7],t),tx:bezierTangent(e[0],e[2],e[4],e[6],t),ty:bezierTangent(e[1],e[3],e[5],e[7],t)});function h(e,t,s){return minLength="y"===s?1:0,maxLength="x"===s?e.length-2:e.length-1,e[constrain(t,minLength,maxLength)]}var l=e=>{if(e.points.length<4)return;const t=1.5,s=e.points.length-1;curveTightness(e.curveThightness);const i=[],o=[];for(let n=0;n<s-2;n+=2){const r=n-2;for(let s=0;s<=e.collisionDetail;s++){let n=s/e.collisionDetail,c=curvePoint(h(e.points,r,"x"),h(e.points,r+2,"x"),h(e.points,r+4,"x"),h(e.points,r+6,"x"),n),a=curvePoint(h(e.points,r+1,"y"),h(e.points,r+3,"y"),h(e.points,r+5,"y"),h(e.points,r+7,"y"),n),l=curveTangent(h(e.points,r,"x"),h(e.points,r+2,"x"),h(e.points,r+4,"x"),h(e.points,r+6,"x"),n),p=curveTangent(h(e.points,r+1,"y"),h(e.points,r+3,"y"),h(e.points,r+5,"y"),h(e.points,r+7,"y"),n),u=atan2(p,l);u-=PI/2,i.push(cos(u)*e.curveWeight*-.5*t+c),i.push(sin(u)*e.curveWeight*-.5*t+a),o.push(cos(u)*e.curveWeight*.5*t+c),o.push(sin(u)*e.curveWeight*.5*t+a)}if(0===n){const s=atan2(o[3]-o[1],o[2]-o[0]),i={x:h(e.points,n,"x"),y:h(e.points,n+1,"y")};o.unshift(sin(s)*e.curveWeight*-.5*t+i.y),o.unshift(cos(s)*e.curveWeight*-.5*t+i.x)}if(n===s-3){const s=o.length,i=atan2(o[s-1]-o[s-3],o[s-2]-o[s-4]),n={x:h(e.points,r+4,"x"),y:h(e.points,r+5,"y")};o.push(cos(i)*e.curveWeight*.5*t+n.x),o.push(sin(i)*e.curveWeight*.5*t+n.y)}}const n=[];for(let e=0;e<i.length;e+=2)n.push(i[e]),n.push(i[e+1]);for(let e=o.length;e>=0;e-=2)n.push(o[e]),n.push(o[e+1]);return n};const p=(e,t)=>{var s=(t.v2.y-t.v1.y)*(e.v2.x-e.v1.x)-(t.v2.x-t.v1.x)*(e.v2.y-e.v1.y);if(0==s)return null;const i=((t.v2.x-t.v1.x)*(e.v1.y-t.v1.y)-(t.v2.y-t.v1.y)*(e.v1.x-t.v1.x))/s,o=((e.v2.x-e.v1.x)*(e.v1.y-t.v1.y)-(e.v2.y-e.v1.y)*(e.v1.x-t.v1.x))/s;return i<0||o<0||i>1||o>1?null:{x:e.v1.x+i*(e.v2.x-e.v1.x),y:e.v1.y+i*(e.v2.y-e.v1.y)}},u=(e,t,s,i)=>{let o=atan2(s.y-e.y,s.x-e.x),n=atan2(i.y-e.y,i.x-e.x);o<0&&(o+=TWO_PI),n<0&&(n+=TWO_PI);const r=o>n?o-n:o+TWO_PI-n,c=(TWO_PI-r)/3,a=[];a.push(s.x),a.push(s.y);for(var h=1;h<3;++h){var l=o+c*h,p={x:e.x+cos(l)*t,y:e.y+sin(l)*t};a.push(p.x),a.push(p.y)}return a.push(i.x),a.push(i.y),a},d=e=>{const t={v:e},s=[];for(let i=0;i<e.length;i+=2){const o=(i+2)%t.v.length,n={v1:{x:e[i],y:e[i+1]},v2:{x:e[o],y:e[o+1]}};n.normal=g(n),s.push(n)}return t.edges=s,t},g=e=>{var t=e.v2.x-e.v1.x,s=e.v2.y-e.v1.y,i=sqrt(t*t+s*s);return{x:s/i,y:-t/i}};var f=(e,t)=>{polygon=d(e);const s=[];for(let e=0;e<polygon.edges.length;e++){const i=polygon.edges[e],o=i.normal.x*t,n=i.normal.y*t;s.push({v1:{x:i.v1.x+o,y:i.v1.y+n},v2:{x:i.v2.x+o,y:i.v2.y+n}})}const i=[];for(let e=0;e<s.length;e++){const o=s[e],n=s[(e+s.length-1)%s.length],r=p(n,o);r?(i.push(r.x),i.push(r.y)):i.push(...u(polygon.edges[e].v1,t,n.v2,o.v1))}return i};const y=e=>"poly"===e.type?f(e.points,.04):"curve"===e.type?l(e):"bezier"===e.type?(e=>{const t=1.5,s=e.points,i=[],o=[];for(let s=0;s<=e.collisionDetail;s++){let n=s/e.collisionDetail;const{x:r,y:a,tx:h,ty:l}=c(e.points,n);let p=atan2(l,h);p-=PI/2,i.push(cos(p)*e.curveWeight*-.5*t+r),i.push(sin(p)*e.curveWeight*-.5*t+a),o.push(cos(p)*e.curveWeight*.5*t+r),o.push(sin(p)*e.curveWeight*.5*t+a)}a=atan2(o[3]-o[1],o[2]-o[0]);const n=s[0],r=s[1];o.unshift(sin(a)*e.curveWeight*-.5*t+r),o.unshift(cos(a)*e.curveWeight*-.5*t+n);const h=o.length;a=atan2(o[h-1]-o[h-3],o[h-2]-o[h-4]);const l=s[6],p=s[7];o.push(cos(a)*e.curveWeight*.5*t+l),o.push(sin(a)*e.curveWeight*.5*t+p);const u=[];for(let e=0;e<i.length;e+=2)u.push(i[e]),u.push(i[e+1]);for(let e=o.length;e>=0;e-=2)u.push(o[e]),u.push(o[e+1]);return u})(e):void 0,v=(e,t,s)=>{const i=s.model.points;let o=!1;for(let n=0;n<i.length;n+=2){const r=(n+2)%i.length,c=s.scalePosition(i[n]).x,a=s.scalePosition(i[n+1]).y,h=s.scalePosition(i[r]).x,l=s.scalePosition(i[r+1]).y;a>t!=l>t&&e<(h-c)*(t-a)/(l-a)+c&&(o=!o)}return o};const w=(e,t,s)=>{var i=Math.max(0,Math.min(1,(s-e)/(t-e)));return i*i*(3-2*i)},m=(e,t)=>{const s=[],i="poly"===t?0:2;for(let t=0;t<=e.length-i&&!isNaN(e[t]);t+=2){const o=(t+2)%e.length-i,n=b(e[t],e[t+1],e[o],e[o+1],R.distribute());s.push(e[t]),s.push(e[t+1]),s.push(n[0]+R.num(-.0025,.0025)),s.push(n[1]+R.num(-.0025,.0025))}return s},b=(e,t,s,i,o)=>[(1-o)*e+o*s,(1-o)*t+o*i];var x;x=JSON.parse('{"type":"poly","l":"polygon","w":0.08,"ct":0.4,"p":[-0.4367,0.4333,-0.445,-0.4567,-0.3317,-0.4567,-0.3417,0.31,-0.2633,0.3033,-0.2617,-0.4633,-0.1083,-0.4667,-0.145,0.335,0.0083,0.3283,0.0267,-0.4683,0.195,-0.465,0.16,0.3617,0.3017,0.3017,0.3017,-0.4733,0.4333,-0.4617,0.4383,0.455]}');var P;P=JSON.parse('{"type":"poly","l":"polygon","w":0.11,"ct":0.9,"p":[-0.42,0.4233,-0.4467,-0.455,0.1067,-0.465,-0.2017,0.2717,0.35,-0.005,0.445,0.455]}');var S;S=JSON.parse('{"type":"poly","l":"curve","w":0.1,"ct":0.4,"p":[-0.415,-0.4467,0.395,-0.44,0.4233,0.3667,0.0717,0.4117,-0.0217,-0.1017,-0.3883,0.21]}');var O;O=JSON.parse('{"type":"poly","l":"curve","w":0.1,"ct":0.4,"p":[-0.4033,-0.43,0.38,-0.43,0.4017,0.2767,0.2383,-0.2233,0.1533,0.295,-0.0067,-0.2533,-0.2333,0.2783]}');var k;k=JSON.parse('{"type":"poly","l":"curve","w":0.08,"ct":0.4,"p":[-0.2783,-0.1617,0.4233,0.39,-0.4667,0.3733,-0.4567,-0.4617,0.4083,-0.4517]}');var N;N=JSON.parse('{"type":"poly","l":"curve","w":0.08,"ct":0.4,"p":[0.4183,-0.4433,0.42,0.4483,0.25,0.45,0.345,-0.1867,0.1533,-0.205,0.1733,0.4283,0.0117,0.4583,0.0217,-0.1983,-0.0983,-0.2033,-0.1117,0.435,-0.2517,0.42,-0.225,-0.1983,-0.32,-0.2,-0.3267,0.4117,-0.43,0.4083,-0.4233,-0.4033]}');var J;J=JSON.parse('{"type":"poly","l":"curve","w":0.1,"ct":0.4,"p":[0.2767,0.1458,-0.115,0.2058,-0.44,-0.0525,-0.2633,-0.4292,0.4,-0.4475]}');var z;z=JSON.parse('{"type":"poly","l":"curve","w":0.1,"ct":0.7,"p":[-0.4183,0.0967,-0.2983,-0.3417,-0.0183,0.0983,0.2817,-0.34,0.3833,0.1383]}');var T;T=JSON.parse('{"type":"poly","l":"polygon","w":0.1,"ct":0.4,"p":[-0.46,0.2017,-0.4267,-0.305,-0.02,-0.45,0.385,-0.195,0.3533,0.275,-0.0683,-0.1533]}');var W;W=JSON.parse('{"type":"poly","l":"curve","w":0.1,"ct":0.8,"p":[-0.43,0.405,-0.4333,-0.44,-0.2917,-0.445,-0.2017,-0.0017,-0.11,0.2567,-0.1517,-0.4133,0.08,-0.4267,0.225,0.12,0.3183,0.315,0.2783,-0.4133,0.4217,-0.4083,0.4233,0.4433]}');var D;D=JSON.parse('{"type":"poly","l":"polygon","w":0.09,"ct":0.8,"p":[-0.15,-0.4367,0.0867,-0.4433,0.1167,0.4183,-0.0767,0.4067]}');var I;I=JSON.parse('{"type":"poly","l":"curve","w":0.09,"ct":0.4,"p":[0.3517,-0.44,0.3783,0.0433,-0.4183,0.0767,-0.4367,-0.4433]}');var C;C=JSON.parse('{"type":"poly","l":"curve","w":0.09,"ct":0.8,"p":[-0.245,0,-0.415,-0.4067,-0.2717,-0.4467,-0.1467,-0.0283,-0.1083,-0.4333,0.025,-0.44,-0.05,-0.02,0.2067,-0.4083,0.3117,-0.3117,0.0567,0.0667,0.3833,0.0633,0.3567,0.2383,0.0183,0.185,0.2383,0.4317,0.0817,0.5167,-0.1217,0.26,-0.155,0.5717,-0.32,0.5367,-0.2767,0.2583,-0.7,0.2783,-0.7,0.1683,-0.3333,0.0967,-0.6683,-0.215,-0.6,-0.305]}');var L;L=JSON.parse('{"type":"poly","l":"curve","w":0.1,"ct":0.4,"p":[0.3733,0.395,0.0933,0.4267,0.0667,-0.0767,-0.215,0.2733,-0.4333,0.11,-0.1033,-0.2183,-0.4067,-0.1983,-0.3817,-0.425,0.3317,-0.435]}');var E;E=JSON.parse('{"type":"poly","l":"curve","w":0.1,"ct":0.4,"p":[0.44,0.4767,-0.195,0.3917,0.225,-0.3633,-0.45,0.3217,-0.4683,-0.45,0.32,-0.4417]}');var _;_=JSON.parse('{"type":"poly","l":"curve","w":0.1,"ct":0.4,"p":[-0.0067,-0.34,0.1217,0.0083,0.195,-0.4683,0.37,-0.4317,0.315,0.495,0.005,0.0967,-0.255,0.5233,-0.4233,-0.4383,-0.2417,-0.4717,-0.15,0.0183]}');var F;F=JSON.parse('{"type":"poly","l":"polygon","w":0.1,"ct":0.7,"p":[0.1217,-0.6783,0.5733,-0.5333,0.17,-0.2417,0.36,-0.0183,0.085,0.0183,0.2517,0.4617,-0.4283,0.215,-0.1133,-0.025,-0.2967,-0.355,-0.0083,-0.305]}');var G;G=JSON.parse('{"type":"poly","l":"curve","w":0.1,"ct":0.6,"p":[-0.5,-0.6367,-0.3667,-0.605,-0.445,-0.0217,-0.1717,0.2433,0.03,0.0167,-0.0667,-0.13,0.1833,-0.4833,0.2867,-0.42,0.1083,-0.15,0.23,0.0133,-0.13,0.4167,-0.6183,0.02]}');var A;A=JSON.parse('{"type":"poly","l":"polygon","w":0.1,"ct":0.7,"p":[-0.0533,-0.49,-0.0517,-0.3583,-0.4417,-0.0233,-0.0267,0.3017,0.355,-0.1333,0.065,-0.3633,0.0583,-0.4917,0.535,-0.12,-0.0183,0.4933,-0.6067,0.0033]}');var Y;Y=JSON.parse('{"type":"poly","l":"curve","w":0.1,"ct":0.4,"p":[0.3383,-0.37,0.6367,-0.3867,0.6717,0.1217,0.4417,0.3533,0.0317,0.4683,-0.4033,0.4167,-0.6633,-0.0617,-0.5383,-0.28,-0.3383,-0.4017,-0.1417,-0.25,0.0233,0.305]}');var V;V=JSON.parse('{"type":"poly","l":"polygon","w":0.1,"ct":0.4,"p":[-0.6533,-0.59,-0.4133,-0.62,-0.3667,-0.085,-0.2417,-0.1017,-0.235,-0.62,0.055,-0.6283,-0.0167,-0.0917,0.1283,-0.0783,0.305,-0.6217,0.5267,-0.59,0.33,0.56,0.1183,0.56,0.1117,0.0567,-0.0517,0.0317,-0.03,0.555,-0.2867,0.5367,-0.2417,0.0367,-0.3783,0.0467,-0.395,0.54,-0.6433,0.5233]}');var X;X=JSON.parse('{"type":"poly","l":"curve","w":0.1,"ct":0.4,"p":[-0.0483,0.6067,-0.65,0.165,-0.6283,-0.4567,-0.3267,0.155,-0.31,-0.43,0.0217,-0.57,0.05,0.0917,0.3867,-0.5517,0.57,-0.4567,0.2683,0.31,0.68,0.1717,0.5983,0.5333]}');var M;M=JSON.parse('{"type":"poly","l":"polygon","w":0.1,"ct":0.4,"p":[-0.2983,-0.375,-0.2017,-0.4717,-0.0583,-0.2483,-0.0733,-0.4017,0.06,-0.4083,0.06,-0.25,0.125,-0.39,0.2583,-0.375,0.1533,-0.19,0.33,-0.24,0.3333,-0.0467,0.155,-0.0567,0.45,0.1883,0.285,0.28,0.0783,0.12,0.1367,0.25,-0.0583,0.2467,-0.0183,0.05,-0.175,0.2133,-0.2617,0.1433,-0.06,-0.0633,-0.55,0.1917,-0.63,0.0683,-0.1983,-0.0817,-0.5967,-0.13,-0.5533,-0.3183,-0.125,-0.135]}');var U;U=JSON.parse('{"type":"poly","l":"polygon","w":0.1,"ct":0.6,"p":[0.655,-0.295,-0.405,0.0583,-0.385,-0.4683]}');var q;q=JSON.parse('{"type":"poly","l":"polygon","w":0.1,"ct":0.6,"p":[-0.205,-0.5733,0.4133,-0.595,0.4833,0.1067,-0.2867,0.1133,0.34,-0.075]}');var B;B=JSON.parse('{"type":"poly","l":"curve","w":0.1,"ct":0.4,"p":[-0.4683,0.155,-0.5683,-0.645,-0.28,-0.68,-0.095,-0.5792,-0.045,-0.3925,-0.085,-0.21,-0.125,-0.095,-0.2533,0.125,-0.14,0.0367,-0.0167,-0.0833,0.095,-0.175,0.2583,-0.26,0.4317,-0.2617,0.5633,-0.1317,0.4633,0.4433]}');var H;H=JSON.parse('{"type":"poly","l":"polygon","w":0.1,"ct":0.4,"p":[-0.4433,0.17,-0.4733,-0.485,0.5317,-0.5283,0.585,0.175,0.3817,0.1633,0.3533,-0.3017,0.2383,-0.2933,0.2817,0.08,0.1183,0.0783,0.0717,-0.3233,-0.29,-0.3,-0.2533,0.19]}');var $;$=JSON.parse('{"type":"poly","l":"polygon","w":0.07,"ct":0.4,"p":[0.5933,0.7033,-0.595,0.665,-0.62,0.4733,0.2717,0.4217,-0.61,0.3083,-0.6467,0.1467,0.2967,0.1567,-0.6617,-0.0783,-0.6633,-0.27,0.2683,-0.25,-0.625,-0.4967,-0.63,-0.68,0.6617,-0.6767,0.6583,-0.5033,-0.185,-0.5517,0.6617,-0.3017,0.665,-0.065,-0.225,-0.15,0.66,0.0333,0.665,0.2583,-0.1967,0.255,0.65,0.37,0.67,0.5117,-0.075,0.5617,0.6,0.595]}');var j;j=JSON.parse('{"type":"poly","l":"polygon","w":0.1,"ct":0.4,"p":[-0.025,0.6067,-0.72,-0.15,-0.6367,-0.205,-0.045,0.5,-0.71,-0.5267,-0.6,-0.615,-0.0067,0.425,-0.3633,-0.6233,-0.2133,-0.6417,0.05,0.3733,-0.0083,-0.6633,0.1267,-0.655,0.12,0.38,0.3,-0.6333,0.4167,-0.58,0.2,0.4167,0.5317,-0.46,0.6683,-0.3583,0.3183,0.3883,0.6583,-0.0717,0.695,0.08,0.1667,0.6]}');var K;K=JSON.parse('{"type":"poly","l":"polygon","w":0.1,"ct":0.4,"p":[0.6733,-0.34,0.2517,0.145,0.2383,-0.4333,-0.5667,-0.54,-0.3817,-0.7117]}');var Q;Q=JSON.parse('{"type":"poly","l":"curve","w":0.03,"ct":-0.57,"p":[-0.3317,-0.3333,-0.27,-0.2917,-0.22,-0.4433,-0.1317,-0.2867,-0.015,-0.4383,0.0267,-0.325,0.155,-0.4217,0.185,-0.2667,0.3317,-0.3183,0.3067,-0.1417,0.475,-0.1433,0.385,-0.0283,0.5083,0.0483,0.375,0.0817,0.4183,0.24,0.2433,0.1933,0.2283,0.35,0.1083,0.22,0.045,0.3567,-0.0883,0.2767,-0.1783,0.3667,-0.2283,0.2533,-0.3917,0.2767,-0.3767,0.1633,-0.485,0.0817,-0.3767,0.01,-0.4483,-0.11,-0.2733,-0.1267,-0.3317,0.08,-0.15,0.07,-0.14,0.1967,0,0.1133,0.1667,0.1483,0.1717,0.0383,0.31,0.0233,0.225,-0.1617,0.0733,-0.1483,0.0983,-0.255,-0.0583,-0.1767,-0.2,-0.2867,-0.2033,-0.1533,-0.355,-0.2367]}');var Z;Z=JSON.parse('{"type":"poly","l":"curve","w":0.05,"ct":-0.57,"p":[-0.595,-0.1833,-0.5683,-0.3217,-0.5067,-0.175,-0.4133,-0.3017,-0.3717,-0.1533,-0.28,-0.26,-0.2367,-0.135,-0.1017,-0.2417,-0.0533,-0.075,0.0817,-0.2017,0.15,-0.06,0.3183,-0.185,0.36,-0.0217,0.32,0.2533,0.23,0.1,0.1233,0.2417,0.0783,0.075,-0.0317,0.2117,-0.1333,0.0567,-0.2367,0.1883,-0.285,0.03,-0.3983,0.1683,-0.43,0.005,-0.5933,0.095]}');var ee;ee=JSON.parse('{"type":"poly","l":"curve","w":0.05,"ct":-0.57,"p":[-0.35,-0.2233,-0.0767,-0.0583,-0.11,-0.2933,0.0717,-0.3433,0.2283,-0.0683,0.19,-0.315,0.3383,-0.3283,0.3817,-0.08,0.465,-0.3433,0.6667,-0.2883,0.3833,0.0633,-0.325,0.0383]}');var te;te=JSON.parse('{"type":"poly","l":"curve","w":0.05,"ct":-0.57,"p":[-0.09,0.01,-0.6883,-0.3567,0.015,-0.715,-0.075,-0.0633,0.33,-0.555,0.6217,-0.215]}');var se;se=JSON.parse('{"type":"poly","l":"polygon","w":0.08,"ct":-0.57,"p":[-0.66,-0.6433,-0.5567,-0.675,-0.095,0.32,0.4117,-0.6517,0.535,-0.6033,-0.105,0.5917]}');var ie;ie=JSON.parse('{"type":"curve","ct":-1,"cw":0.1,"w":0.15,"cd":8,"p":[-0.46,-0.39,0.365,-0.35,-0.43,-0.155,0.3383,0.0083,-0.3267,0.355]}');var oe;oe=JSON.parse('{"type":"curve","ct":0.25,"cw":0.1,"w":0.15,"cd":5,"p":[-0.385,-0.38,0.2633,-0.37,0.2317,0.0167,-0.3867,0.035,-0.3533,0.38,0.35,0.34]}');var ne;ne=JSON.parse('{"type":"curve","ct":0.25,"cw":0.1,"w":0.15,"cd":5,"p":[-0.0783,0.44,-0.32,-0.3933,0.2967,-0.3633,0.0783,0.2]}');var re;re=JSON.parse('{"type":"curve","ct":0.25,"cw":0.1,"w":0.15,"cd":4,"p":[-0.03,-0.3083,-0.3267,-0.2067,-0.3783,0.045,-0.2383,0.2217,0,0.26,0.255,0.2083,0.3367,0.0817,0.3383,-0.075,0.2917,-0.1967,0.1633,-0.325,-0.03,-0.3083]}');var ce;ce=JSON.parse('{"type":"curve","ct":0.25,"cw":0.1,"w":0.15,"cd":5,"p":[-0.3917,0.0983,-0.3933,-0.365,-0.24,-0.41,-0.2133,-0.0933,-0.1433,0.0917,-0.0733,-0.065,-0.0467,-0.39,0.08,-0.4117,0.1133,-0.2917,0.115,-0.1117,0.135,0.04,0.255,0.1167,0.46,0.0933]}');var ae;ae=JSON.parse('{"type":"curve","ct":0.25,"cw":0.04,"w":0.15,"cd":6,"p":[-0.4083,0.175,-0.4067,-0.4067,-0.2283,0.1467,-0.1133,-0.3483,0.0717,0.1567,0.185,-0.3383,0.3117,0.1517,0.42,-0.365]}');var he;he=JSON.parse('{"type":"curve","ct":0.25,"cw":0.1
class Random{constructor(){this.useA=!1;let t=function(t){let r=parseInt(t.substr(0,8),16),n=parseInt(t.substr(8,8),16),s=parseInt(t.substr(16,8),16),e=parseInt(t.substr(24,8),16);return function(){r|=0,n|=0,s|=0,e|=0;let t=(r+n|0)+e|0;return e=e+1|0,r=n^n>>>9,n=s+(s<<3)|0,s=s<<21|s>>>11,s=s+t|0,(t>>>0)/4294967296}};this.prngA=new t(tokenData.hash.substr(2,32)),this.prngB=new t(tokenData.hash.substr(34,32));for(let t=0;t<1e6;t+=2)this.prngA(),this.prngB()}random_dec(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}random_num(t,r){return t+(r-t)*this.random_dec()}random_int(t,r){return Math.floor(this.random_num(t,r+1))}random_choice(t){return t[this.random_int(0,t.length-1)]}} const Easing={Linear:t=>t,InQuad:t=>(t/=1)*t,OutQuad:t=>-1*(t/=1)*(t-2),InOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),InCubic:t=>(t/=1)*t*t,OutCubic:t=>(t=t/1-1)*t*t+1,InOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),InQuart:t=>(t/=1)*t*t*t,OutQuart:t=>-1*((t=t/1-1)*t*t*t-1),InOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),InQuint:t=>(t/=1)*t*t*t*t,OutQuint:t=>(t=t/1-1)*t*t*t*t+1,InOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),InSine:t=>-1*Math.cos(t/1*(Math.PI/2))+1,OutSine:t=>Math.sin(t/1*(Math.PI/2)),InOutSine:t=>-.5*(Math.cos(Math.PI*t/1)-1),OutExpo:t=>1==t?2:1*(1-Math.pow(2,-10*t/1)),InOutExpo:t=>0==t?0:1==t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t)),InCirc:t=>-1*(Math.sqrt(1-(t/=1)*t)-1),OutCirc:t=>Math.sqrt(1-(t=t/1-1)*t),InOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),InBack:t=>{let u=1.70158;return(t/=1)*t*((u+1)*t-u)},OutBack:t=>{let u=1.70158;return(t=t/1-1)*t*((u+1)*t+u)+1},InOutBack:t=>{let u=1.70158;return(t/=.5)<1?t*t*((1+(u*=1.525))*t-u)*.5:.5*((t-=2)*t*((1+(u*=1.525))*t+u)+2)},InBounce:t=>1-Easing.OutBounce(1-t),OutBounce:t=>(t/=1)<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,InOutBounce:t=>t<.5?.5*Easing.InBounce(2*t):.5*Easing.OutBounce(2*t-1)+.5}; const Algorithms=[(r,n,a,s)=>{const i=map(s.a,0,1,-.125,.125),t=map(s.b,0,1,-.125,.125),o=map(s.c,0,1,.11,.45);return cos((r+a*i)*o)*cos((n+a*t)*o)*.1+.5*a},(r,n,a,s)=>{const i=map(s.a,0,1,5,grid.x/2),t=map(s.b,0,1,1,20),o=map(s.c,0,1,-2*a,2*a),d=map(s.d,0,1,-2*a,2*a);return abs(sin(r/i+o)+1*cos(n/i+d)+1*t)},(r,n,a,s)=>{const i=map(s.b,0,1,1,5),t=map(s.c,0,1,1,5),o=sin(r/i/grid.x+a),d=sin(n/t/grid.y+a);switch(floor(3*s.a)){case 0:return o;case 1:return d;default:return o*d}},(r,n,a,s)=>{const i=map(s.a,0,1,15,40),t=map(s.b,0,1,15,40);return cos(r/i+a)+sin(n/t+a)+a},(r,n,a,s)=>{const i=s.a<.5?r:n,t=s.b<.5?grid.x:grid.y,o=map(s.c,0,1,1,6);return sin(i/t/o+a)},(r,n,a,s)=>{const i=map(s.a,0,1,.06,.3),t=map(s.b,0,1,.1,.5);return sin(a-sqrt((r*r+n*n)*t)*i)},(r,n,a,s)=>{const i=map(s.a,0,1,.05,.1);return a%grid.x-Math.hypot(r-grid.x/2,n-grid.y/2)*i},(r,n,a)=>(r+1)/(n+1)/(r+1)-a,(r,n,a)=>(r-grid.x/2)*(n-grid.y/2)-sin(a),(r,n,a,s)=>{const i=map(sin(a),-1,1,.5,1),t=map(s.b,0,1,1,4),o=s.c<.5?-1:1;return sin(2*atan((n-grid.y/2)/(r-grid.x/2))+t*o*a)*i},(r,n,a)=>sin(n%2+a)*sin(r%2+a)/sin(n%1+a)*sin(r%1+a),(r,n,a)=>sin(a),(r,n,a)=>a,(r,n,a)=>r%2==0&&n%2==0?a:0,(r,n,a,s)=>{let i=n,t=grid.y;s.a<.5&&(i=r,t=grid.x);const o=s.b<.5?t-i:i;return Math.log(o+1)+a},(r,n,a)=>abs(r/2)+a,(r,n,a,s)=>{const i=s.a<.5?r-n:r+n,t=s.b<.5?-a:a;return i/(s.c<.5?grid.x:grid.y)+t},(r,n,a,s)=>{const i=3*(round(3*s.a)+1),t=map(s.b,0,1,-200,200),o=map(s.c,0,1,-200,200);return cos((r+a/t)*i)*sin((n+a/o)*i)*sin(a)*.5+a},(r,n,a,s)=>{const i=map(s.a,0,1,2,5),t=s.b<.5?a:-a;return n/grid.y/i+t},(r,n,a,s)=>{const i=.13*map(s.a,0,1,.05,.3),t=map(s.b,0,1,1.2,3);return floor(r+n)*i/t*HALF_PI+a},(r,n,a,s)=>{const i=map(s.a,0,1,1,3),t=map(s.b,0,1,1,3);return cos(a+r/grid.x/i)+sin(a+n/grid.y/t)},(r,n,a,s)=>(s.a<.5?grid.y/(n+1):grid.x/(r+1))/map(s.b,0,1,1,5)+(s.c<.5?a:-a),(r,n,a,s)=>{const i=s.a<.5?a:-a,t=s.b<.5?r+n:r-n;return cos(i+t/(grid.x+random(10)))},(r,n,a,s)=>{const i=round(10*map(s.a,0,1,1.5,3))/10;return(s.b>.5?n:r)/i%grid.y+a},(r,n,a,s)=>{const i=map(s.a,0,1,.2,.4),t=map(s.b,0,1,.2,.4);return sin(a-sqrt(2*(r-grid.x/i)+(n-grid.y/t)**2))},(r,n,a,s)=>{const i=map(s.a,0,1,50,120);return.1*abs(sin(r*i))+a},(r,n,a,s)=>{const i=round(map(s.a,0,1,5,8)+a/100),t=round(map(s.b,0,1,5,7)+a/100),o=round(1.3*map(s.c,0,1,70,99)),d=s.d<.5?grid.y:grid.y+1;return(r-grid.x/2)**i+(n-d/2)**t-o*sin(a/50)},(r,n,a,s)=>{const i=round(grid.x/map(s.a,0,1,3,6)),t=round(grid.y/map(s.b,0,1,3,5));return(r%i&&n%t/HALF_PI)+a},(r,n,a,s)=>{const i=map(s.a,0,1,1,2.5);return round(r-grid.x/2)*round(n-grid.y/2)-sin(a)*i},(r,n,a,s)=>{const i=floor(map(s.a,0,1,4,grid.x-4)),t=floor(map(s.b,0,1,2,grid.y-2)),o=grid.x/2-i/2,d=grid.y/2-t/2;return(r>=o&n>=d&r<o+i&n<d+t)*PI+a},(r,n,a,s)=>{const i=map(s.a,0,1,-a,a),t=map(s.b,0,1,-a,a),o=map(s.c,0,1,-a,a),d=map(s.d,0,1,5,15);return map(constrain(10*noise(r/d+i,n/d+t,o),3.5,6),3.5,6,0,1)}]; const R=new Random;let timer=0;const blockAspectRatio=Math.sqrt(2);function invertEasing(r){return(r+.5)%1}const params={seed:0,speed:0,algorithm:0,gridCount:0,easing:0,rotationX:0,rotationY:0,rotationZ:0,modifierA:0,modifierB:0,modifierC:0,modifierD:0,chaos:!1,invert:!1},grid={border:{x:75,y:0},size:{},block:{border:{},size:{}}},defaultWidth=1280,defaultHeight=720;function calculateCanvasSize(){const r=1280/720,a=window.innerWidth,i=window.innerHeight;return i<a/r?{w:i*r,h:i}:{w:a,h:a/r}}function setup(){const r=calculateCanvasSize();createCanvas(r.w,r.h,WEBGL);perspective(PI/3,width/height,.1,1e3),frameRate(60),pixelDensity(2),params.seed=R.random_num(0,1e4),params.speed=R.random_num(.003,.007),params.algorithm=floor(Easing.InQuad(R.random_dec())*Algorithms.length);let a=Easing.InOutQuad(R.random_dec());a=invertEasing(a),a=round(55*a+9),params.gridCount=a,R.random_num(0,100)<1&&(params.gridCount=R.random_int(3,6)),params.easing=R.random_int(0,Object.keys(Easing).length-1),params.rotationX=TWO_PI,params.rotationY=R.random_choice([0,PI,TWO_PI]),params.rotationZ=0,R.random_int(0,50)<1&&(params.rotationZ=R.random_choice([0,PI,TWO_PI])),params.modifierA=R.random_dec(),params.modifierB=R.random_dec(),params.modifierC=R.random_dec(),params.modifierD=R.random_dec(),calculateGrid()}function draw(){randomSeed(params.seed),background(29),stroke(39),fill(249),params.invert&&(stroke(249),fill(29)),translate(-.5*width+grid.block.border.x,-.5*height+grid.block.border.y);for(let r=0;r<grid.x;r++)for(let a=0;a<grid.y;a++)params.chaos&&magic(r,a),params.gridCount>40?strokeWeight(1.5):params.gridCount<10?strokeWeight(10.5):strokeWeight(3.5),push(),translate(r*grid.size.x,a*grid.size.y),rotateX(HALF_PI),magic(r,a),box(grid.block.size.x,.2*grid.block.size.x,grid.block.size.y),pop();timer+=params.speed}function magic(r,a){const i={a:params.modifierA,b:params.modifierB,c:params.modifierC,d:params.modifierD};let e=Algorithms[params.algorithm](r,a,timer,i);e=abs(e),e%=1;const o=pickEasing(e);rotateX(o*params.rotationX),rotateY(o*params.rotationY),rotateZ(o*params.rotationZ)}function pickEasing(r){return Easing[Object.keys(Easing)[params.easing]](r)}function calculateGrid(){grid.border.x=width*(grid.border.x/1280),grid.x=params.gridCount,grid.border.y=grid.border.x/blockAspectRatio,grid.size.x=(width-grid.border.x)/(grid.x+1),grid.size.y=grid.size.x*blockAspectRatio,grid.y=max(floor((height-grid.border.y)/grid.size.y),1),grid.block.border.x=grid.size.x+grid.border.x/2,grid.block.border.y=.5*grid.size.y+.5*(height-grid.size.y*grid.y),grid.block.size.x=.7*grid.size.x,grid.block.size.y=.7*grid.size.y}function keyReleased(r){switch(r.keyCode){case 83:save(`Balletic-Motus_Art-${tokenData.hash}`);break;case 80:0!=params.speed?(params.speedOriginal=params.speed,params.speed=0):params.speed=params.speedOriginal;break;case 67:params.chaos=!params.chaos;break;case 73:params.invert=!params.invert}}
Balletic is a generative art animation created by digital artist Owen McAteer, aka. Motus Art. In this piece, a grid of rotating blocks move together in a mathematically choreographed dance to reveal hidden patterns, shapes and flowing figures. Exploring soft fluid motion in a hard fixed grid of blocks to a two-tone minimalist design, the piece comes to life in dance, conducted by the combination of several algorithms, easing curves and timing modifiers all working together.