0x71aa…d4ca

All memos sent from and to 0x71aa…d4ca.

C#<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" > <meta name="description" content="Holos | eclipse.art" > <title>Holos</title> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.5.0/p5.min.js"></script> </head> <body> <style>html, body { margin: 0; padding: 0; background-color: #0000; overflow: hidden; } canvas { background-color: #000; display: block; } </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>class T{constructor(e){this.t=new Random(e,4)}r(){return this.t.random_dec()}o(e){return e*this.r()}i(e,t){return e+(t-e)*this.r()}l(e){return Math.floor(this.o(e+1))}h(e,t){return Math.floor(this.i(e,t+1))}p(e){return this.r()<e}u(t){var o=this.r();for(let e=0;e<t.length;++e)if(o<=t[e])return e;return t.length-1}m(e){return e[this.l(e.length-1)]}v(e,t,o,r,i,n,s){return{S:this.h(e,t),s:s?0:this.h(o,r),b:this.h(i,n)}}map(e,t,o,r,i){return(e-t)/(o-t)*(i-r)+r}I(){var t={},e=this.o(Math.PI),o=.8*Math.sin(this.o(Math.PI/2)),e=(t.P=this.m([0,0,.15,.15,.3,.3,.7,.8]),o*=1-t.P,t.W=Math.cos(e)*o,t._=Math.sin(e)*o,t.k=this.p(.05),t.C=this.m([1,2,2,3,3,3,3,4,4,4,5,5]),t.T=this.m([0,0,0,1,1,2,3,4]),t.g=this.u([.01,.05,1]),t.M=this.p(.8),t.L=!t.M||!t.k&&this.p(.3),t.A=t.L&&!t.M,t.D=t.A&&1!=t.Coloring&&this.p(.01),t.O=t.k&&t.M,t.R=t.M&&t.L&&this.p(.1),t.F=t.M&&!t.L&&this.p(.1),t.H=this.m([0,0,1,1,0<t.T?2:1]),t.N=this.m([0,0,0,0,0,0,0,0,0,0,-1,1]),t.B=1==l||l%111==0?6:this.m([0,0,0,0,1,1,2,3,3,3,4,4,5,5,5]),t.G=6==t.B?4:this.m([0,1,2,3,4]),t.Uniform=this.p(.1),t.Clear=this.p(.01),t.Gaps=!t.Clear&&this.p(.05),t.Y=t.Gaps?t.C<3?[1,0]:t.C<5?[0,1]:[0,2]:[0,0],t.Response=t.Clear||t.Gaps?0:this.u([.94,.96,1]),t.X=this.h(20,50),t.q=this.h(this.map(t.C,1,5,50,200),500/t.C),t.Coloring=this.m([0,1,2,3]),t.K=!t.k&&t.Coloring<=1&&this.p(.1),t.Z=t.K?this.i(0,1):0,t.j=this.h(-5,5),[[27,170,45,-170,"Moss"],[300,200,75,160,"Kali"],[60,125,40,45,"Dope"],[161,161,65,180,"Zomp"],[187,217,65,180,"Steel"],[340,184,50,-140,"Amaranth"],[30,316,65,50,"Fandango"],[178,300,50,120,"Hollish"],[300,278,65,90,"Dazed"],[40,268,40,-90,"Orchid"]]),o=(t.U=this.h(1,e.length-1),e[t.U][0]),r=e[t.U][1],i=e[t.U][2]*(t.k?.5:1),n=e[t.U][3],e=(t.J=t.k?"Mono":e[t.U][4],t.V=this.v(o,o,70,90,80,90,t.k),t.$=this.v(r,r,60,80,i-30,10+i,t.k),t.e0=this.v(r,r,100,100,80,90,t.k),36*t.j);let s=t.K?1:r+n,a=t.K?360:r+n+e;a<s&&(o=s,s=a,a=o),t.k&&!t.M?(t.t0=this.v(s,s,0,0,70,90,t.k),t.o0=this.v(a,a,0,0,20,50,t.k)):(t.t0=this.v(s,s,50,80,70,90,t.k),t.o0={...t.t0,S:a}),t.r0=this.v(100,360,0,100,50,100,t.k),t.i0=this.v(100,360,0,70,50,100,t.k),t.n0=this.i(2,3),t.s0=this.i(.1,1),t.a0=t.Uniform?0:this.h(100,300),t.l0=this.i(0,.5),t.h0=this.i(2,3),t.p0=this.m([0,0,1,2,2,3,3]),t.u0=this.m([0,1]);i=t.V.S;t.c0=this.v(i-10,i+10,50,100,50,100,t.k),t.f0=t.k?2:this.u([.1,.4,1]),t.d0=this.i(.1,.5),t.m0=this.h(200,1e3),t.v0=this.map(t.m0,200,1e3,5,3),t.S0=this.h(1e3,5e3),t.I0=this.p(.01)?-1:1,t.P0=this.h(5,10),t.b0=this.h(10,30),t.w0=[];for(let e=0;e<t.w0.length;++e)t.w0.push(this.h(999));return t}}class g{constructor(e,t){this.count=e,this.r=t,this.radius=t*Q.radius}}class W{constructor(e,t){this.angle=e,this.r=t,this.radius=t*Q.radius,this.W0=map(t,X,_,0,1),this._0=this.k0=s(e,t).mult(Q.radius),this.C0=[0,0,0,0,0],this.random=k.r(),this.T0=k.h(0,K.length-1);let o;o=0==V.Coloring?this.W0:1==V.Coloring?abs(map(h0(e+L*HALF_PI),0,TWO_PI,V.K?0:-1,1)):(t=6*(this._0.x/Q.radius+V.Coloring-2),e=6*(this._0.y/Q.radius+V.Coloring-2),map(noise(t,e),.3,.7,0,1)),0!=V.Z&&(o=fract(o+V.Z)),colorMode(HSB),this.c=l0(V.t0,V.o0,o),this.g0=l0(V.t0,V.o0,1-o),colorMode(V.k?HSB:RGB),this.M0=color(red(this.c),green(this.c),blue(this.c),0)}L0(){vertex(this.k0.x,this.k0.y,this.k0.z)}}function M(e,t){return new p5.Vector(sin(t)*cos(e),sin(t)*sin(e),cos(t))}function p(e,t){return M(e,t*$())}function s(o,r){let i=p(o,r);if(0<V.B){let e=new p5.Vector(cos(o),sin(o)),t=1;1==V.B||2==V.B?(2==V.B&&(s=e.x,e.x=e.y,e.y=s),t=1.5*(s=e,a=X,s.x=1.75*abs(s.x),s.y=1.25*abs(s.y),l=sqrt(a*a-1),-1*(s.y-l)>s.x*l?p5.Vector.sub(s,new p5.Vector(0,l)).mag():p5.Vector.sub(s,new p5.Vector(1,0)).mag()-a)):3==V.B?t=1.25*function(e,t){e=function(e){return new p5.Vector(abs(e.x),abs(e.y),abs(e.z))}(e).sub(new p5.Vector(t,t));return function(e,t){return new p5.Vector(max(e.x,t),max(e.y,t),max(e.z,t))}(e,0).mag()+min(max(e.x,e.y),0)}(e,1.3*X):4==V.B?t=1.5*h(e,X,2):5==V.B?t=2*h(e,X,3.55):6==V.B&&(t=1.5*(l=e,a=X,l.x=.78*l.x,l.y=.72*l.y,n=l.y-abs(l.x)*sqrt(1-abs(l.x))+.2,(n=new p5.Vector(l.x,n,l.z)).mag()-a)),e=p(o,X*t),i=e.lerp(i,map(r,X,_,0,1))}var n,s,a,l;return i}function h(e,t,o){e.y=-e.y;var r=new p5.Vector(.809016994375,-.587785252292),i=new p5.Vector(-r.x,r.y),i=(e.x=abs(e.x),e.sub(p5.Vector.mult(r,2*max(r.dot(e),0))),e.sub(p5.Vector.mult(i,2*max(i.dot(e),0))),e.x=abs(e.x),e.y-=t,p5.Vector.mult(new p5.Vector(-r.y,r.x),o).sub(new p5.Vector(0,1))),r=s0(e.dot(i)/i.dot(i),0,t);return p5.Vector.sub(e,p5.Vector.mult(i,r)).mag()*x(e.y*i.x-e.x*i.y)}class a{constructor(){this.width=window.innerWidth,this.height=window.innerHeight,this.diam=min(this.width,this.height)/u,this.radius=this.diam/2,this.scale=parseFloat(options.scale??min(this.diam/800,1))}}const e=[1.1,.65,.57],E=6;let o,O,t=!1,R=0,F=0,H=0,N=R,B=F,G=H,y=void 0,Y=void 0,r=!1,z,r0=void 0,i=0,X,_,i0=e[0],q,u=1,l,L,n0,K=[0,0,0,0,0,0,0,0,0,0],Z,j,U,J,Q,k,V;var GET_HOLOS=()=>({holosId:l,done:t,DIM:Q??{},zoom:H,colorBg:V?.$?.toString("#rrggbb")??"#000",options:options,metadata:window.METADATA??{},autoPilot:Y??!1});function SET_HOLOS(e={}){(r=Boolean(e.mouse)||Boolean(e.mouseProg))&&(y=!0,R=e.mouseProg?e.mouseProg.x*Q.width:e.mouse.x,F=e.mouseProg?e.mouseProg.y*Q.height:e.mouse.y),null!=e.zoom&&(G=s0(e.zoom,0,2)),null!=e.autoPilot&&(Y=e.autoPilot)}function n(){window.parent.postMessage("holos:updated","*")}function setup(){function e(e,t){return t<e.length?e[t]:null}var t;Y=Boolean(options.autoPilot)??!1,u=parseFloat(options.distance??1),l=parseInt((options.tokenId??0).toString().slice(-4)),Q=new a,o=createCanvas(Q.width,Q.height,WEBGL),c(),t=V,t={Id:l,Shot:t.P<.5?"Wide":"Zoom",Globe:e(["Roots","Wire","Wire Deep","Wire Roots","Wire Black"],t.T),Palette:t.J,Family:t.J+(t.O?" Crystal":t.k?" Chrome":t.K?" Spectrum":0==t.j?" Roots":(t.j<0?"-":"+")+abs(t.j)),Reflection:e(["Shiny","Gradient","Wire"],t.H),Pupil:e(["Round","Predator","Prey","Diamond","Pentagon","Star","True Love"],t.B),Lens:e(["No Lens","Flat","Pentagon","Star","Pulse"],t.G),Response:1==t.Response?"Contracted":2==t.Response?"Dilated":void 0,"Iris Size":e(["Mini","Medium","Large"],t.g),"Iris Rings":t.C,"Iris Hues":t.k&&!t.O?1:t.K?7:Math.abs(t.j)+1,Ciliary:t.D?"Haystack":t.R?"Glass":t.A?"Wire":t.L?"Plastic Wire":"Plastic",Coloring:e(["Circular","Concentric","Blot","Chaos"],t.Coloring),Uniform:t.Uniform?"Yes":void 0,Slit:t.F?"Yes":void 0,Clear:t.Clear?"Yes":void 0,Gaps:t.Gaps?"Yes":void 0,Twist:t.N<0?"CW":0<t.N?"CCW":"No Twist",Stars:0<=t.I0?"CW":"CCW"},Object.entries(t).filter(([e,t])=>{null!=t&&setMetadata(e,t)}),onMetadata(),O=document.getElementById("defaultCanvas0").getContext("webgl"),q=color(0),console.log("Holos#"+l,{...options,DIM:Q},window.METADATA,"CLICK+SHIFT: dive, SPACE: lock, A: autopilot")}function draw(){r||void 0===y||0===mouseX&&0===mouseY||(R=mouseX,F=mouseY),Date.now()-r0<3e3?cursor(CROSS):noCursor();var n=r?2:0<touches?.length?touches.length:(keyIsDown(SHIFT)?1:0)+(mouseIsPressed?1:0),s=h0(atan2(V._,V.W)),a=min(new p5.Vector(V._,V.W).mag(),.99999),n=(y&&(Y?(noiseDetail(2,.3),i+=5e-5*deltaTime,R=.5*Q.width+map(noise(z.x,i),.05,.6,-1,1,!0)*Q.radius,F=.5*Q.height+map(noise(z.y,i),.05,.6,-1,1,!0)*Q.radius,G=map(noise(z.z,i),.05,.6,0,2,!0)):r||(G=n),H=lerp(H,G,.01),N=map(R,0,Q.width,-1,1),B=map(F,0,Q.height,-1,1),V.W=lerp(V.W,N,.1),V._=lerp(V._,B,.1)),i0=H<1?lerp(e[0],e[1],sin(HALF_PI*map(H,0,1,0,1))):lerp(e[1],e[2],1-cos(HALF_PI*map(H,1,2,0,1))),map(H,0,2,1,.25,!0)),l=Q.height*i0,h=map(H,1,1.9,1,0,!0),p=map(H,1,2,0,1,!0);camera(map(V.W*n,-1,1,Q.width,0),map(V._*n,-1,1,Q.height,0),l,Q.width/2,Q.height/2,0,0,1,0);for(let e=0;e<K.length;++e)K[e]=sin((TWO_PI+TWO_PI*(e/K.length))*(millis()/15e3));if(colorMode(HSB),q=lerpColor(q,l0(V.t0,V.o0,abs(map(s,0,TWO_PI,V.K?0:-1,1))),.99),noLights(),noStroke(),noFill(),colorMode(RGB),background(V.$),O.disable(O.DEPTH_TEST),translate(Q.width/2,Q.height/2),0!==Q.scale){blendMode(SCREEN),t0(new p5.Vector(0,0,-Q.radius),1.5*Q.radius,36,0,a0(V.V,.3),color(0,0)),t0(new p5.Vector(0,0,.95*Q.radius),.5*Q.radius,36,0,a0(q,.75),color(0,0));n=1.2*map(H,0,2,1,.3,!0)*Q.scale,l=(blendMode(REPLACE),0==V.T?(noStroke(),fill(V.V),sphere(Q.radius,32,32)):(rotateX(HALF_PI),2<=V.T&&(3<=V.T&&O.enable(O.DEPTH_TEST),noStroke(),fill(3==V.T?V.$:color(0)),sphere(.9999*Q.radius)),noFill(),strokeWeight(n),stroke(V.V),sphere(Q.radius),rotateX(-HALF_PI),O.disable(O.DEPTH_TEST)),blendMode(BLEND),noStroke(),fill(0),HALF_PI-$());t0(new p5.Vector(0,0,sin(l)*Q.radius),cos(l)*Q.radius,36,0),noStroke(),beginShape(TRIANGLES);for(let e=0;e<U.length;++e)fill(U[e].c),o0(U[e].k0,map(K[U[e].T0],-1,1,.5,1)*map(U[e].W0,.5,1,1,.5,!0)*V.v0*Q.scale,n0,0);endShape();l=HALF_PI-$()*X;let e=.6+.4*abs(K[0]);var u=e0(q,255*p),c=color(0,0),f=2*Q.radius,p=.5*Q.radius*p;blendMode(ADD),noStroke(),t0(new p5.Vector(0,0,sin(l)*p),cos(l)*f*e,36,0,u,c),blendMode(BLEND),push(),rotate(millis()/5e4*V.I0,new p5.Vector(0,0,1));for(let t=0;t<E;++t){var d,m=t/(E-1),v=0<t?millis()/(4e4*t):0,S=s0(map(H,0,1,.25-t,1,!0),0,1);rotate(v*V.I0,new p5.Vector(0,0,1)),strokeWeight(map(m,0,1,1,3)),stroke(lerpColor(e0(color(255),map(S,0,1,0,200/Q.scale)),e0(V.V,map(S,0,1,0,160/Q.scale)),m)),beginShape(POINTS);for(let e=0;e<J.length;++e)J[e].track==t&&(d=5*K[J[e].T0],vertex(J[e].k0.x,J[e].k0.y,J[e].k0.z-d));endShape()}pop(),blendMode(BLEND);let t,o=1;t=V.A?(noFill(),strokeWeight(map(H,0,1,1.2,.4,!0)*Q.scale),o=16,V.D?TRIANGLES:LINES):(V.Depth&&O.enable(O.DEPTH_TEST),V.L?(strokeWeight(map(H,0,1,.2,.1,!0)),stroke(a0(q,.8))):noStroke(),TRIANGLES);var I=ceil(j.length/o);for(let e=0;!(e<V.Clear)&&o;++e){var P=e*I;if(P>=j.length)break;V.A&&stroke(e0(j[P].c,128)),beginShape(t);for(let e=P;e<P+I&&e<j.length;++e){var b=j[e];if(!(b.random>max(.6,Q.scale))){var w,W,_=1-map(K[b.T0],-1,1,.12,0)*b.W0;for(let e=b.C0.length-1;0<e;--e)0!=floor(b.C0[e])&&(w=j[int(floor(b.C0[e]))],W=j[int(floor(b.C0[V.F?e:e-1]))],V.A?(b.L0(),w.L0(),b.L0()):(fill(b.c),b.L0(),fill(w.M0),w.L0(),fill(W.M0)),vertex(W.k0.x,W.k0.y,W.k0.z*_))}}endShape()}V.Depth&&O.disable(O.DEPTH_TEST),0<V.G&&(p=e0(V.V,255*h),f=e0(p,V.G<3?255*h:0),u=Q.radius,V.G<3&&(e=1),c=2==V.G||3==V.G?5:36,blendMode(ADD),noStroke(),t0(new p5.Vector(0,0,sin(l)*u),cos(l)*u*e,c,radians(-18),p,f)),blendMode(SCREEN);var k=1==V.u0;k?(strokeWeight(2),stroke(V.i0),noFill(),beginShape(POINTS)):(noStroke(),fill(V.i0),beginShape(TRIANGLES));for(let e=0;e<j.length;++e){var C=j[e];C.random>max(.5,Q.scale)||(k||C.random<V.l0)&&(k?C.L0():p0(C.k0,V.h0*Q.scale,s))}endShape(),blendMode(SCREEN),noStroke(),fill(V.r0),beginShape(TRIANGLES);var T=V.n0*Q.scale;for(let e=0;e<j.length;++e){var g,M=j[e];M.random>max(.5,Q.scale)||M.random<V.s0&&M.random>V.l0&&(g=map(K[M.T0],-1,1,0,TWO_PI),0==V.p0?o0(M.k0,T,16,g):1==V.p0?o0(M.k0,T,4,g):2==V.p0?o0(M.k0,T,5,g):p0(M.k0,T,g))}endShape(),blendMode(2==V.H?SCREEN:ADD);h=2==V.H,l=1==V.H,u=map(H,0,1.1,V.k?.8:3,0,!0),c=l?0:u;let r=e0(V.e0,255*u),i=e0(V.e0,255*c);h?(strokeWeight(n),stroke(r),noFill(),r=i=null):(noStroke(),fill(r));var L=max(map(a,.1,1,0,1),0),x=HALF_PI/2;for(let e=0;e<Z.length-1;++e){var A=Z[e].r,D=.8*(Z[e+1].r-A);u0(s-x,s+x,A+D,A+D-D*L,r,i),u0(s-.5*x+PI,s+.5*x+PI,A+.1*D,A+D*(.1+L),r,i)}}t||(onDone(),t=!0)}function mouseMoved(){void 0===y&&(y=!0),r0=Date.now()}function mousePressed(){y=!0,Y=!1,n()}function keyPressed(){var e;16==keyCode&&(y=!0),32==keyCode&&(y=!y),65==keyCode&&(Y=!Y,y=y||!0,n()),83==keyCode&&((e=createGraphics(o.width,o.height)).fill(0,255),e.rect(0,0,e.width,e.height),e.blendMode(BLEND),e.image(o,0,0),saveCanvas(e,"Holos#"+l,"png"))}function windowResized(){Q=new a,resizeCanvas(Q.width,Q.height),c(),n()}function $(){return 3.14159265*[.1,.15,.2][V.g]}function C(e){return color(e.S<0?e.S+360:e.S%360,e.s,e.b)}function c(){k=new T(options.hash),V=k.I(),noiseDetail(4,.5),noiseSeed(k.l(999)),colorMode(HSB,360,100,100),V.V=C(V.V),V.$=C(V.$),V.e0=C(V.e0),V.t0=C(V.t0),V.o0=C(V.o0),V.r0=C(V.r0),V.i0=C(V.i0),V.c0=C(V.c0),background(V.$),X=1==V.Response?.1:2==V.Response?.3:.2,_=1,y=!!Y||void 0,N=V.W,B=V._,R=map(N,-1,1,0,Q.width),F=map(B,-1,1,0,Q.height),B=map(F,0,Q.height,-1,1),H=V.P,G=0;var e=Date.now(),t=(z=new p5.Vector(k.l(e),k.l(e),k.l(e)),Q.scale<=.5&&V.M&&V.L&&(V.L=!1),Z=[],(_-X)/V.C);for(let e=0+V.Y[0];e<=V.C-V.Y[1];++e){var o=int(map(e,0,V.C,V.X,V.q)),r=X+e*t;Z.push(new g(o,r))}let i=1,n=0;for(let e=0;e<Z.length;++e)i=min(i,Z[e].r),n=max(n,Z[e].r);j=[],n0=k.m([5,6,16]),L=k.h(0,3);for(let t=0;t<Z.length;++t){var s=Z[t].r,a=0==V.B?Z[t].r:map(Z[t].r,X+.1,_,0,1);for(let e=0;e<Z[t].count;++e){var l=float(e)/float(Z[t].count)*TWO_PI,h=s+map(k.r(),0,1,-.02,.02)*a;j.push(new W(l,h))}}for(let e=0;e<V.a0;++e){var p=k.o(TWO_PI),u=i+k.o(n-i);j.push(new W(p,u))}(V.A||V.Depth)&&(1==V.Coloring?j.sort(function(e,t){return e.angle-t.angle}):j.sort(function(e,t){return e.W0-t.W0}));for(let o=0;o<j.length;++o){var c=radians(map(j[o].W0,0,1,V.P0,V.b0));for(let t=0;t<j.length;++t)if(j[o].radius<j[t].radius)if(function(e,t){e<0&&(e+=TWO_PI);t<0&&(t+=TWO_PI);t=abs(t-e);return t<PI?t:TWO_PI-t}(j[o].angle,j[t].angle)<=c&&(0==V.N||V.N==x(j[o].angle-j[t].angle))){var f=j[o].k0.dist(j[t].k0)/Q.radius;if(.02<=f&&f<=1&&f<1)for(let e=0;e<j[o].C0.length;++e)if(0==j[o].C0[e]||f<j[o].C0[e]%1){j[o].C0[e]=t+f;break}}}U=[];for(let e=0;e<V.m0*Q.scale;++e){var d=(1-cos(k.o(HALF_PI)))*V.d0,m=_-min(d,.5),v=k.o(TWO_PI),d=1-d/V.d0,m=new W(v,m),v=new W(v,_,d).k0.z;m.k0.z=lerp(v-(m.k0.z-v),m.k0.z,k.r()),m.c=0==V.f0?m.c:1==V.f0?m.g0:lerpColor(color(0),V.c0,d),U.push(m)}J=[];var S=V.S0*Q.scale;for(let e=0;e<S;++e){var I=floor(e/(S/E)),P=map(I,0,E-1,$(),PI),b=k.o(TWO_PI),P=k.i(0,P),w=k.i(.4,.98)*Q.radius,b={k0:M(b,P).mult(w),T0:k.h(0,K.length-1),track:I};J.push(b)}}function x(e){return e<0?-1:1}function s0(e,t,o){return e<t?t:o<e?o:e}function e0(e,t){return color(red(e),green(e),blue(e),t)}function a0(e,t){return color(red(e)*t,green(e)*t,blue(e)*t)}function l0(e,t,o){colorMode(HSB,360,100,100);var r=round(hue(e));let i=round(hue(t));i<r&&(i+=360);r=lerp(r,i,o)%360,e=lerpColor(e,t,o);return color(r,saturation(e),brightness(e),alpha(e))}function h0(e){for(;e<0;)e+=TWO_PI;for(;e>TWO_PI;)e-=TWO_PI;return e}function t0(t,o,r,i,e=null,n=null){var s=TWO_PI/r;beginShape(TRIANGLE_FAN),e&&n&&fill(e),vertex(t.x,t.y,t.z),e&&n&&fill(n);for(let e=0;e<=r;e++)vertex(t.x+cos(i+e*s)*o,t.y+sin(i+e*s)*o,t.z);endShape()}function o0(t,o,r,i){var n=TWO_PI/r;for(let e=0;e<r;e++)vertex(t.x,t.y,t.z),vertex(t.x+cos(i+e*n)*o,t.y+sin(i+e*n)*o,t.z),vertex(t.x+cos(i+(e+1)*n)*o,t.y+sin(i+(e+1)*n)*o,t.z)}function p0(e,t,o){var r=TWO_PI/3;vertex(e.x+cos(o+0*r)*t,e.y+sin(o+0*r)*t,e.z),vertex(e.x+cos(o+r)*t,e.y+sin(o+r)*t,e.z),vertex(e.x+cos(o+2*r)*t,e.y+sin(o+2*r)*t,e.z)}function u0(t,e,o,r,i=null,n=null){var e=e-t,s=int(ceil(e/(TWO_PI/54))),a=e/s;beginShape(TRIANGLE_STRIP);for(let e=0;e<=s;e++){var l=t+a*e,h=p(l,r).mult(Q.radius);i&&fill(i),vertex(h.x,h.y,h.z),h=p(l,o).mult(Q.radius),n&&fill(n),vertex(h.x,h.y,h.z)}endShape()} </script></body> </html>
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>
<head> <meta charset="utf-8"> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script> <script id="genart-tweaks">const tweaks = undefined;</script></head> <body> <style>html,body { margin: 0; position: relative; min-height: 100vh; } canvas { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 100%; max-height: 100%; object-fit: scale-down; } </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>const hash=options.hash,rnd=new Random(hash,4);function rB($,_){return rnd.random_between($,_)}function ri($,_){return rnd.random_int($,_)}const pltS={1:["#030303","#FFFFFF","#1A1C1D","#5D5D5D"],2:["#292107","#201803","#F5CC79","#6F5203","#43380C","#070707","#FFC246","#110601","#664A01","#25241F","#F08E19","#BB4F04"],3:["#0662C4","#021425","#FFC107","#015798","#1B2E41","#0A1621"],4:["#222222","#FFC107","#FF9800","#FF5722","#F44336","#251702"],5:["#aa0200","#FEFCFB","#3F0101","#988B88","#FA1605","#000000","#282727"],6:["#024AB0","#FCD8D9","#01193E","#C36929","#001118"],7:["#414269","#17181A","#D9C514","#C95402","#192334","#28292D","#C7CCE8","#28292D","#052464","#2E3957","#FFC107","#162E60"],8:["#29241D","#29241D","#D56B06","#1C4A68","#9D6438","#FFFAED","#1C1A17","#F4E9CA","#773D06","#055F99","#9D6438","#FFFAED"],9:["#191818","#F25C05","#F21905","#021911","#1B3D3C","#F29422","#F25C05","#F21905","#1B4133","#1B3D3C","#052D35","#FFDF73"],10:["#FF9800","#A5B605","#3D3D3D","#C09411","#E4E2CF","#4E2414","#6F4408","#3D2D2C","#7A1818","#090808","#7E7B0C","#389E00","#E5E4D4"],11:["#065264","#143238","#363636","#BB7538","#35291F","#123E47","#E1E3E4","#5C9EAC","#DFCA72","#85684E","#403125","#163A46"],12:["#191818","#F25C05","#F21905","#021911","#EFF5F5","#F29422","#F25C05","#F21905","#1B4133","#1B3D3C","#052D35","#000000"]};pL1=ri(1,(pLT=pltS[p7=(p7X=rB(0,1))>.975?1:p7X>.875?2:p7X>.775?3:p7X>.7?4:p7X>.6?5:p7X>.5?6:p7X>.45?7:p7X>.35?8:p7X>.225?9:p7X>.125?10:p7X>.05?11:12]).length-1);const[cN,cN1,fS,lg]=[1000,1500,25,10];let[mA1,pS,mTex]=[rB(10,50),ri(1,5),ri(0,4)];if(zM=(zMX=rB(0,1))>.75?75:zMX>.5?100:zMX>.25?150:200,ori=(oriX=rB(0,1))>.6?0:1,c7X=rB(0,1),0==ori)switch(c7=c7X>.9?0:c7X>.8?1:c7X>.6?2:c7X>.45?3:c7X>.3?4:c7X>.2?5:c7X>.1?6:c7X>.05?7:8){case 0:A1=25,j1=2,ja=9;break;case 1:A1=25,j1=2,ja=13;break;case 2:A1=25,j1=1.5,ja=13;break;case 3:A1=25,j1=2,ja=25;break;case 4:A1=25,j1=2,ja=37;break;case 5:A1=25,j1=2,ja=43;break;case 6:A1=25,j1=3,ja=67;break;case 7:A1=25,j1=1,ja=21;break;case 8:A1=3,j1=1,ja=57}else switch(c7=c7X>.85?9:c7X>.65?10:c7X>.3?11:c7X>.15?12:c7X>.075?13:14){case 9:Ab1=25,j1=2,jCa=17;break;case 10:Ab1=25,j1=1.5,jCa=19;break;case 11:Ab1=25,j1=1.75,jCa=36;break;case 12:Ab1=25,j1=2,jCa=61;break;case 13:Ab1=25,j1=1,jCa=55;break;case 14:Ab1=3,j1=1,jCa=75}sat=(satX=rB(0,1))>.75?0:satX>.25?1:2; function setup(){colorMode(RGB,255),pixelDensity(2),createCanvas(cN,cN1),m=createGraphics(cN,cN1,WEBGL),m1=createGraphics(cN,cN1),mShd=m.createShader(vs,vf),randomSeed(seed=1e9*rB(0,1)),noiseSeed(seed),m.randomSeed(seed),m.noiseSeed(seed),m1.randomSeed(seed),m1.noiseSeed(seed),imageMode(CENTER),rectMode(CENTER),m.imageMode(CENTER),m.rectMode(CENTER),M=width,N=height} function draw(){switch(background("#FAF7EF"),Fm(),push(),m.shader(mShd),mShd.setUniform("u_tex",m1),mShd.setUniform("zM",zM),mShd.setUniform("mag",.02),mShd.setUniform("mA1",mA1),mShd.setUniform("u_res",[M,N]),mShd.setUniform("u_seed",seed),m.rect(0,0,M,N),0==sat?drawingContext.filter="saturate(25%)":1==sat?drawingContext.filter="saturate(75%)":drawingContext.filter="saturate(100%)",translate(M/2,N/2),push(),scale(-1,-1),image(m,0,0,1.025*M,1.025*N),pop(),pop(),0==sat?drawingContext.filter="saturate(50%)":1==sat?drawingContext.filter="saturate(100%)":drawingContext.filter="saturate(125%)",1==p7||(drawingContext.shadowBlur=25,drawingContext.shadowColor="rgb(0,0,0)"),fill(150),noStroke(),1==p7?blendMode(DIFFERENCE):blendMode(BLEND),jb=fS,ori){case 0:for(let e=0;e<ja;e+=j1)1==p7?sR(e*(M/(ja+1))+M/jb/A1,-N/2+M/jb,M/(ja+1)-M/jb/A1,N-M/jb):(drawingContext.save(),sR(e*(M/(ja+1))+M/jb/A1,-N/2+M/jb,M/(ja+1)-M/jb/A1,N-M/jb),drawingContext.clip(),image(m,M/2,N/2,1.025*M,1.025*N),drawingContext.restore());break;case 1:for(let t=0;t<jCa;t+=j1)1==p7?sR(-M/2+M/jb,t*(N/(jCa+1))+M/jb/Ab1,M-M/jb,N/(jCa+1)-M/jb/Ab1):(drawingContext.save(),sR(-M/2+M/jb,t*(N/(jCa+1))+M/jb/Ab1,M-M/jb,N/(jCa+1)-M/jb/Ab1),drawingContext.clip(),image(m,M/2,N/2,1.025*M,1.025*N),drawingContext.restore())}1==p7&&(0==sat?drawingContext.filter="saturate(50%)":1==sat?drawingContext.filter="saturate(100%)":drawingContext.filter="saturate(125%)",push(),blendMode(OVERLAY),fill("#0188D8"),rect(M/2,N/2,M,N),pop()),noLoop(),12==p7&&filter(GRAY),onDone()} function cALP($,_=1){var e=color($);return color("rgba("+[red(e),green(e),blue(e),_].join(",")+")")}function Fm(){let $=ri(0,2);elem=0==$?350:1==$?500:1e3,q=[350,500,1e3];for(var _=1;_<q[$];_++){switch(shuffle(pLT,!0),m1.fill(cALP(pLT[pL1],.5)),sin(rB(-1,1),rB(1,-1)),mTex){case 0:m1.rect(rB(0,M),rB(0,N),M/3,rB(0,N/rB(20,10)));break;case 1:m1.rect(rB(0,M),rB(0,N),rB(0,M/rB(1,5)),N/25);break;case 2:m1.rect(rB(0,M),rB(0,N),rB(0,M/rB(10,15)),N/5);break;case 3:m1.rect(rB(0,M),rB(0,N),rB(0,M/rB(50,10)),N/3);break;case 4:m1.rect(rB(0,M),rB(0,N),M/5,rB(0,N/rB(7,5)))}m1.noFill(),m1.strokeWeight(1),m1.stroke(cALP(pLT[pL1],.75)),m1.rect(rB(0,M),rB(0,N),rB(M/rB(50,100)),N/rB(2,200)),m1.stroke(cALP(pLT[pL1],.75)),m1.rect(rB(0,M),rB(0,N),rB(0,2*M)),m1.stroke(cALP(pLT[pL1],.5));for(let e=10;e<50;e+=1)m1.rect(rB(0,M),rB(0,N),rB(0,M/e)/(e*rB(.75,1)))}}function sR($,_,e,r){let[t,c]=[$+e/2,_+r/2];beginShape(),vertex(t,c);for(let o=0,a,l;o<e;o+=pS)[a,l]=[t+o+map(noise(.1*o,.1*c),0,1,-lg,lg),c+map(noise(.1*t,.1*o),0,1,-lg,lg)],vertex(a,l);vertex(t+e,c);for(let s=0,f,n;s<r;s+=pS)[f,n]=[t+e+map(noise(.1*e,(c+s)*.1),0,1,-lg,lg),c+s+map(noise((t+e)*.1,.1*s),0,1,-lg,lg)],vertex(f,n);vertex(t+e,c+r);for(let i=0,k,b;i<e;i+=pS)[k,b]=[t+e-i+map(noise((e-i)*.1,(c+r)*.1),0,1,-lg,lg),c+r+map(noise((t+e)*.1,(r+i)*.1),0,1,-lg,lg)],vertex(k,b);vertex(t,c+r);for(let A=0,L,P;A<r;A+=pS)[L,P]=[t+map(noise(.1*$,(c+r-A)*.1),0,1,-lg,lg),c+r-A+map(noise(.1*A,(c+r)*.1),0,1,-lg,lg)],vertex(L,P);endShape(CLOSE)} const vs="\n attribute vec3 aPosition;\n \n attribute vec2 aTexCoord;\n \n varying vec2 vTC;\n \n uniform float uSeed;\n \n uniform float zM;\n \n void main() {\n \n vTC = aTexCoord;\n \n vec4 positionVec4 = vec4(aPosition, 1.0);\n \n float randomValue = fract(sin(dot(positionVec4.xyz,vec3(10.0,80.0,35.0) * uSeed)) *100.0);\n \n float scaledValue = randomValue * 10.0 + zM;\n \n positionVec4.xy = positionVec4.xy * scaledValue - 10.0;\n \n gl_Position = positionVec4;} \n ";vf="\n precision highp float;\n uniform sampler2D u_tex; \n uniform float mag;\n uniform vec2 u_res; \n \n uniform float u_t; \n \n uniform float mA1; uniform float u_seed; \n \n varying vec2 vTC; \n \n float random (vec2 st) {return fract(cos(dot(st.xy,vec2(10.0,80.0)))*10000.0);} \n \n float noise (vec2 st) { \n \n vec2 i = floor(st); \n \n vec2 f = fract(st); \n \n vec2 u = f*f*(3.0-2.0*f); \n \n return mix( mix( random( i + vec2(0.0,0.0) ), random( i + vec2(1.0,0.0) ), u.x), mix( random( i + vec2(0.0,1.0) ), random( i + vec2(1.0,1.0) ), u.x), u.y);} \n \n float fbm( vec2 n ) { \n \n float total = 0.0, amp = 15.0; \n \n for (int i = 0; i < 8; i++) {total += noise(n) * amp; n += n; amp *= 0.5;} \n \n return total;} \n \n float sLex(vec2 st) { \n \n return fract(sin(dot(st, vec2(10.0, 80.0))) * 40000.0);} \n \n float s_noise(vec2 st) { \n \n vec2 i = floor(st); \n \n vec2 f = fract(st); \n \n vec2 u = f*f*(3.0-2.0*f); \n \n return mix(mix(sLex(i + vec2(0.0,0.0)), sLex(i + vec2(1.0,0.0)), u.x), mix(sLex(i + vec2(0.0,1.0)), sLex(i + vec2(1.0,1.0)), u.x), u.y);} \n \n void main() { \n \n vec2 st = vTC; \n \n st.x += fbm(vec2( st.x * mA1 , st.y * mA1) * 2.0 + u_t * 0.05) * mag; \n \n st.y += fbm(vec2(st.x*mA1,st.y*mA1)*1.0+u_t*0.097)*mag; \n \n vec4 color = texture2D(u_tex,st); \n \n gl_FragColor = color;} \n"; function getC(e){return 1==e?"Eclipse":2==e?"Desert":3==e?"Marine":4==e?"Volcanic":5==e?"Crimson ":6==e?"Sea":7==e?"Urban":8==e?"Coastal":9==e?"Tropical":10==e?"Eclectic ":11==e?"Ocean":12==e?"Grayscale":void 0}function getO(e){return 0==e?"Vertical":1==e?"Horizontal":void 0}function getZ(e){return 25==e?"1":50==e?"2":75==e?"3":100==e?"4":void 0}function getD(e){return 0==e?"5":1==e?"7":2==e?"9":3==e?"13":4==e?"19":5==e?"22":6==e?"23":7==e?"21":8==e?"57":9==e?"9 -":10==e?"13 -":11==e?"21 -":12==e?"31":13==e?"55":14==e?"75":void 0}function getS(e){return 0==e?"1":1==e?"2":2==e?"3":void 0}setMetadata("Color_Zone",getC(p7)),setMetadata("Orientation",getO(ori)),setMetadata("Amplitude",getZ(zM)),setMetadata("Density",getD(c7)),setMetadata("Saturation",getS(sat));</script></body>
<head> <meta charset="utf-8"> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script> <script id="genart-tweaks">const tweaks = {"tweak_range":1,"tweak_range_2":1,"bool":true,"tweak_select":"sin","hex_color":"#ff005b","rgba_color":{"r":248,"g":214,"b":40,"a":1}};</script></head> <body> <style>html,body { margin: 0; position: relative; min-height: 100vh; } canvas { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 100%; max-height: 100%; object-fit: scale-down; filter: drop-shadow(0.3rem 0.3rem 0.3rem rgba(0,0,0,0.43)); }</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> const hash = options.hash; const rnd = new Random(hash, 5); let paleta,fundao;function createWeightedSelector(e){const a=[];for(const F of e)for(let e=0;e<F.weight;e++)a.push(F.value);return function(){return a[Math.floor(rnd_btw(0,1)*a.length)]}}const pickPaleta=createWeightedSelector([{weight:2,value:"Outono"},{weight:2,value:"Fronce"},{weight:2,value:"Mondrian"},{weight:1,value:"BW"},{weight:1,value:"Inverse BW"},{weight:2,value:"Riso"},{weight:2,value:"Antigo"},{weight:2,value:"Blue dreams"},{weight:2,value:"cmyk"},{weight:1,value:"Rubro"},{weight:1,value:"Garden"},{weight:2,value:"Vapor"},{weight:1,value:"Munch"},{weight:2,value:"Electric Night"},{weight:2,value:"Contrasting Emotions"},{weight:2,value:"Nebula Nights"}]);let pickBg,corzinha=pickPaleta();"Outono"==corzinha?paleta={colors:["#053043","#F37247","#FDAF3A"],bg:["#fcd5ce","#fae1dd","#f8edeb","#e8e8e4","#d8e2dc","#ece4db","#ffe5d9","#ffd7ba","#effaf8"],name:"Outono"}:"Fronce"==corzinha?paleta={colors:["#800016","#a0001c","#c00021","#ff002b","#1565c0","#407ba7","#004e89","#002962","#002962","#00043a"],bg:["#F2F2F2","#FFF1E0","#F2E7C4"],name:"Bic"}:"Mondrian"==corzinha?paleta={colors:["#EDC917","#0B0C0C","#FD3E4D","#6886DC"],bg:["#F8F5F5","#FFF1E0"],name:"Mondrian"}:"BW"==corzinha?paleta={colors:["#0B0C0C"],bg:["#F8F5F5","#FFF1E0"],name:"BW"}:"Inverse BW"==corzinha?paleta={bg:["#0B0C0C"],colors:["#F8F5F5","#FFF1E0"],name:"Inverse BW",dark:!0}:"Riso"==corzinha?paleta={colors:["#1851BB","#F7AFE1","#39104A","#FF3F00","#F3D701"],bg:["#E8E7E3","#FFF1E0"],name:"Riso"}:"Antigo"==corzinha?paleta={colors:["#000005","#FFF"],bg:["#F4D075","#F4D09D"],name:"Antigo"}:"Blue dreams"==corzinha?paleta={colors:["#FF5995","#D958FA","#8762F5","#5E5CE6","#00BFFF"],bg:["#F8F5F5","#FFF1E0"],name:"Blue dreams"}:"cmyk"==corzinha?paleta={colors:["cyan","magenta","yellow","black"],bg:["#F4D075","#FFF1E0"],name:"Cmyk"}:"Rubro"==corzinha?paleta={colors:["#0F0F0F","#F22233"],bg:["#F4D075","#FFF1E0"],name:"Rubro"}:"Garden"==corzinha?paleta={colors:["#2E5902","#65A603","#558C03","#338C03","#338C32"],bg:["#ECFFCB","#D6FFD6","#E1FFE9","#F0FFD4"],name:"Garden"}:"Munch"==corzinha?paleta={colors:["#4278A1","#E69352","#EDB830","#E4512F","#272A2A"],bg:["#f7f3f2","#F2F0D0"],name:"Edvard Munch"}:"Vapor"==corzinha?paleta={colors:["#D7E8FC","#b7d3f2","#afafdc","#9370FD","#84afe6","#79beee","#BA72F1","#FFFFFF"],bg:["#142638","#141938","#0B0E1F","#181024"],name:"Vapor",dark:!0}:"Electric Night"==corzinha?paleta={colors:["#011627","#D5D8E2","#05AF9F","#EB0925","#EB8A06","#001219","#4C4C4C","#0CA798","#A81326","#D67D04"],bg:["#f7f3f2","#F2F0D0"],name:"Electric Night",dark:!1}:"Contrasting Emotions"==corzinha?paleta={colors:["#9e0031","#8e0045","#770058","#600047","#44001a","#9e0031","#EAF0E4","#7C2465","#6E285C","#F5A7B0","#5B3D3A","#90C5E5"],bg:["#f7f3f2","#F2F0D0"],name:"Contrasting Emotions",dark:!1}:"Nebula Nights"==corzinha&&(paleta={colors:["#31263e","#eca72c","#523086","#ee5622","#100A16","#D4A146","#463561","#88381C","#31263e","#FCA202"],bg:["#f7f3f2","#F2F0D0"],name:"Nebula Nights",dark:!1}),pickBg=paleta.dark?createWeightedSelector([{weight:2,value:"0B0E1F"},{weight:2,value:"181024"},{weight:2,value:"0B0C0C"},{weight:2,value:"956450"},{weight:2,value:"10151A"},{weight:0,value:"B27734"},{weight:2,value:"E3AF53"}]):createWeightedSelector([{weight:2,value:"FFF1E0"},{weight:2,value:"f7f3f2"},{weight:2,value:"F8F5F5"},{weight:2,value:"F2E7C4"},{weight:2,value:"F4D075"},{weight:2,value:"F4D09D"},{weight:2,value:"F2F2F2"},{weight:2,value:"212121"}]);let fundo=pickBg();"FFF1E0"==fundo?fundao={cor:"#FFF1E0",name:"FFF1E0"}:"f7f3f2"==fundo?fundao={cor:"#f7f3f2",name:"f7f3f2"}:"F8F5F5"==fundo?fundao={cor:"#F8F5F5",name:"F8F5F5"}:"F2E7C4"==fundo?fundao={cor:"#F2E7C4",name:"F2E7C4"}:"F4D075"==fundo?fundao={cor:"#F4D075",name:"F4D075"}:"F4D09D"==fundo?fundao={cor:"#F4D09D",name:"F4D09D"}:"F2F2F2"==fundo?fundao={cor:"#F2F2F2",name:"F2F2F2"}:"181024"==fundo?fundao={cor:"#181024",name:"181024"}:"0B0E1F"==fundo?fundao={cor:"#0B0E1F",name:"0B0E1F"}:"0B0C0C"==fundo?fundao={cor:"#0B0C0C",name:"0B0C0C"}:"B27734"==fundo?fundao={cor:"#B27734",name:"B27734"}:"E3AF53"==fundo?fundao={cor:"#E3AF53",name:"E3AF53"}:"956450"==fundo?fundao={cor:"#956450",name:"956450"}:"10151A"==fundo?fundao={cor:"#10151A",name:"10151A"}:"212121"==fundo&&(fundao={cor:"#212121",name:"212121"}); function rnd_btw(n,r){return rnd.random_between(n,r)}function rnd_int(n,r){return rnd.random_int(n,r)}function rnd_arr(n){return n[rnd_int*n.length]} let seed=rnd_btw(0,1e4),rnd_cor=rnd_int(0,paleta.colors.length-1),rnd_bege=rnd_int(0,paleta.bg.length-1),cor=paleta.colors,tam_cor=cor.length-1,cnv={w:1e3,h:1e3},prob_view=rnd_int(25,85)/100,prob_divide=rnd_int(2,15)/100,padding_h=cnv.h*rnd_btw(.05,.2),padding_w=cnv.w*rnd_btw(.05,.2),easein=rnd_btw(0,1)>.5;function setup(){noiseSeed(rnd_btw(0,9999999)),randomSeed(rnd_btw(0,9999999)),createCanvas(cnv.w,cnv.h),pixelDensity(options.pixelDensity),background(fundao.cor)}function draw(){noLoop(),texturinha(0,0,cnv.w,cnv.h),drawAdaptiveRectangles(padding_w,padding_h,cnv.w-padding_w,cnv.h-padding_h),prob_view=rnd_int(10,35)/100,drawAdaptiveRectangles(padding_w,padding_h/2,cnv.w-padding_w,cnv.h-padding_h/2);let t="none";quantity<=70?t="Few":quantity<=200?t="Many":quantity>200&&(t="Too many"),granulate(8),setMetadata("Palette",paleta.name),setMetadata("Background",fundao.name),setMetadata("Stretched",stretched),setMetadata("Quantity",t),onDone(),console.log(METADATA)}let stretched,size_thing={x:rnd_btw(.01,.5),y:rnd_btw(.01,.5)};size_thing.x>size_thing.y?stretched="Stretched out":size_thing.x<size_thing.y?stretched="Stretched up":size_thing.x==size_thing.y&&(stretched="Equal sizes");let quantity=0;function drawAdaptiveRectangles(t,n,e,i){let d=t,r=n;for(;r<i;){let n=i*rnd_btw(.001,size_thing.y);r+n>i&&(n=i-r),d=t;let a=!1;for(;d<e&&!a;){quantity++;let t=e*rnd_btw(.001,size_thing.x);d+t>e&&(t=e-d,a=!0),rnd_btw(0,1)<prob_view&&(rnd_btw(0,1)<prob_divide?(rnd_rect(d,r,t/2,n/2),rnd_rect(d+t/2,r,t/2,n/2),rnd_rect(d,r+n/2,t/2,n/2),rnd_rect(d+t/2,r+n/2,t/2,n/2)):rnd_rect(d,r,t,n)),d+=t}r+=n}}function rnd_rect(t,n,e,i){rnd_btw(0,1)>.15?(noFill(),stroke(cor[rnd_int(0,tam_cor)]),drawCircles(t,n,e,i)):(noStroke(),fill(cor[rnd_int(0,tam_cor)]),scribbleRectangle(t,n,e,i))} function scribbleRectangle($,e,_,t){offsete=2,steps=25,strokeWeight(1),beginShape(),vertex($,e);for(let n=0;n<_;n+=steps){let u=$+n+map(noise(.1*n,.1*e),0,1,-offsete,offsete),r=e+map(noise(.1*$,.1*n),0,1,-offsete,offsete);vertex(u,r)}vertex($+_,e);for(let i=0;i<t;i+=steps){let o=$+_+map(noise(.1*_,(e+i)*.1),0,1,-offsete,offsete),c=e+i+map(noise(($+_)*.1,.1*i),0,1,-offsete,offsete);vertex(o,c)}vertex($+_,e+t);for(let f=0;f<_;f+=steps){let l=$+_-f+map(noise((_-f)*.1,(e+t)*.1),0,1,-offsete,offsete),a=e+t+map(noise(($+_)*.1,(t+f)*.1),0,1,-offsete,offsete);vertex(l,a)}vertex($,e+t);for(let s=0;s<t;s+=steps){let b=$+map(noise(.1*$,(e+t-s)*.1),0,1,-offsete,offsete),C=e+t-s+map(noise(.1*s,(e+t)*.1),0,1,-offsete,offsete);vertex(b,C)}endShape(CLOSE)}function drawCircles($,e,_,t){push(),translate($,e),qtt=Math.min(_,t)*rnd_btw(30,125);for(let n=0;n<qtt;n++){ease=easein?easeInCubic(rnd_btw(0,1)):easeOutCubic(rnd_btw(0,1));let u;point(rnd_btw(0,_),map(ease,0,1,0,t),2)}pop()}function easeInExpo($){return 0==$?0:pow(2,10*($-1))}function easeInCirc($){return 1-sqrt(1-pow($,2))}function easeInCubic($){return $*$*$}function easeInOutCubic($){return $<.5?4*$*$*$:1-Math.pow(-2*$+2,3)/2}function easeInOutQuad($){return $<.5?2*$*$:1-Math.pow(-2*$+2,2)/2}function easeOutCubic($){return 1-Math.pow(1-$,3)}function texturinha($,e,_,t){push(),translate($,e);let n=createVector();stroke(texturinha_cor=paleta.dark?rnd_btw(240,255):rnd_btw(0,25),40),strokeWeight(.55);for(let u=0;u<_;u+=2)n.x=3.5*u,n.y=3.5*u*rnd_btw(.85,2),strokeWeight(.4),line(n.x,0,n.x,t),strokeWeight(.15),line(0,n.y,_,n.y);pop()} function granulate(i){loadPixels();let e=pixelDensity(),l=width*e*4*(height*e);for(let e=0;e<l;e+=4)grainAmount=rnd_btw(-i,i),pixels[e]=pixels[e]+i,pixels[e+1]=pixels[e+1]+grainAmount,pixels[e+2]=pixels[e+2]+grainAmount,pixels[e+3]=pixels[e+3]+grainAmount;updatePixels()} </script></body>
<head> <meta charset="utf-8"> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script> <script id="genart-tweaks">const tweaks = undefined;</script></head> <body> <style>html,body { margin: 0; position: relative; min-height: 100vh; } canvas { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 100%; max-height: 100%; object-fit: scale-down; } </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>const hash=options.hash,rnd=new Random(hash,4);function rB($,_){return rnd.random_between($,_)}function ri($,_){return rnd.random_int($,_)}const pltS={1:["#030303","#FFFFFF","#1A1C1D","#5D5D5D"],2:["#292107","#201803","#F5CC79","#6F5203","#43380C","#070707","#FFC246","#110601","#664A01","#25241F","#F08E19","#BB4F04"],3:["#0662C4","#021425","#FFC107","#015798","#1B2E41","#0A1621"],4:["#222222","#FFC107","#FF9800","#FF5722","#F44336","#251702"],5:["#aa0200","#FEFCFB","#3F0101","#988B88","#FA1605","#000000","#282727"],6:["#024AB0","#FCD8D9","#01193E","#C36929","#001118"],7:["#414269","#17181A","#D9C514","#C95402","#192334","#28292D","#C7CCE8","#28292D","#052464","#2E3957","#FFC107","#162E60"],8:["#29241D","#29241D","#D56B06","#1C4A68","#9D6438","#FFFAED","#1C1A17","#F4E9CA","#773D06","#055F99","#9D6438","#FFFAED"],9:["#191818","#F25C05","#F21905","#021911","#1B3D3C","#F29422","#F25C05","#F21905","#1B4133","#1B3D3C","#052D35","#FFDF73"],10:["#FF9800","#A5B605","#3D3D3D","#C09411","#E4E2CF","#4E2414","#6F4408","#3D2D2C","#7A1818","#090808","#7E7B0C","#389E00","#E5E4D4"],11:["#065264","#143238","#363636","#BB7538","#35291F","#123E47","#E1E3E4","#5C9EAC","#DFCA72","#85684E","#403125","#163A46"],12:["#191818","#F25C05","#F21905","#021911","#EFF5F5","#F29422","#F25C05","#F21905","#1B4133","#1B3D3C","#052D35","#000000"]};pL1=ri(1,(pLT=pltS[p7=(p7X=rB(0,1))>.975?1:p7X>.875?2:p7X>.775?3:p7X>.7?4:p7X>.6?5:p7X>.5?6:p7X>.45?7:p7X>.35?8:p7X>.225?9:p7X>.125?10:p7X>.05?11:12]).length-1);const[cN,cN1,fS,lg]=[1000,1500,25,10];let[mA1,pS,mTex]=[rB(10,50),ri(1,5),ri(0,4)];if(zM=(zMX=rB(0,1))>.75?75:zMX>.5?100:zMX>.25?150:200,ori=(oriX=rB(0,1))>.6?0:1,c7X=rB(0,1),0==ori)switch(c7=c7X>.9?0:c7X>.8?1:c7X>.6?2:c7X>.45?3:c7X>.3?4:c7X>.2?5:c7X>.1?6:c7X>.05?7:8){case 0:A1=25,j1=2,ja=9;break;case 1:A1=25,j1=2,ja=13;break;case 2:A1=25,j1=1.5,ja=13;break;case 3:A1=25,j1=2,ja=25;break;case 4:A1=25,j1=2,ja=37;break;case 5:A1=25,j1=2,ja=43;break;case 6:A1=25,j1=3,ja=67;break;case 7:A1=25,j1=1,ja=21;break;case 8:A1=3,j1=1,ja=57}else switch(c7=c7X>.85?9:c7X>.65?10:c7X>.3?11:c7X>.15?12:c7X>.075?13:14){case 9:Ab1=25,j1=2,jCa=17;break;case 10:Ab1=25,j1=1.5,jCa=19;break;case 11:Ab1=25,j1=1.75,jCa=36;break;case 12:Ab1=25,j1=2,jCa=61;break;case 13:Ab1=25,j1=1,jCa=55;break;case 14:Ab1=3,j1=1,jCa=75}sat=(satX=rB(0,1))>.75?0:satX>.25?1:2; function setup(){colorMode(RGB,255),pixelDensity(2),createCanvas(cN,cN1),m=createGraphics(cN,cN1,WEBGL),m1=createGraphics(cN,cN1),mShd=m.createShader(vs,vf),randomSeed(seed=1e9*rB(0,1)),noiseSeed(seed),m.randomSeed(seed),m.noiseSeed(seed),m1.randomSeed(seed),m1.noiseSeed(seed),imageMode(CENTER),rectMode(CENTER),m.imageMode(CENTER),m.rectMode(CENTER),M=width,N=height} function draw(){switch(background("#FAF7EF"),Fm(),push(),m.shader(mShd),mShd.setUniform("u_tex",m1),mShd.setUniform("zM",zM),mShd.setUniform("mag",.02),mShd.setUniform("mA1",mA1),mShd.setUniform("u_res",[M,N]),mShd.setUniform("u_seed",seed),m.rect(0,0,M,N),0==sat?drawingContext.filter="saturate(25%)":1==sat?drawingContext.filter="saturate(75%)":drawingContext.filter="saturate(100%)",translate(M/2,N/2),push(),scale(-1,-1),image(m,0,0,1.025*M,1.025*N),pop(),pop(),0==sat?drawingContext.filter="saturate(50%)":1==sat?drawingContext.filter="saturate(100%)":drawingContext.filter="saturate(125%)",1==p7||(drawingContext.shadowBlur=25,drawingContext.shadowColor="rgb(0,0,0)"),fill(150),noStroke(),1==p7?blendMode(DIFFERENCE):blendMode(BLEND),jb=fS,ori){case 0:for(let e=0;e<ja;e+=j1)1==p7?sR(e*(M/(ja+1))+M/jb/A1,-N/2+M/jb,M/(ja+1)-M/jb/A1,N-M/jb):(drawingContext.save(),sR(e*(M/(ja+1))+M/jb/A1,-N/2+M/jb,M/(ja+1)-M/jb/A1,N-M/jb),drawingContext.clip(),image(m,M/2,N/2,1.025*M,1.025*N),drawingContext.restore());break;case 1:for(let t=0;t<jCa;t+=j1)1==p7?sR(-M/2+M/jb,t*(N/(jCa+1))+M/jb/Ab1,M-M/jb,N/(jCa+1)-M/jb/Ab1):(drawingContext.save(),sR(-M/2+M/jb,t*(N/(jCa+1))+M/jb/Ab1,M-M/jb,N/(jCa+1)-M/jb/Ab1),drawingContext.clip(),image(m,M/2,N/2,1.025*M,1.025*N),drawingContext.restore())}1==p7&&(0==sat?drawingContext.filter="saturate(50%)":1==sat?drawingContext.filter="saturate(100%)":drawingContext.filter="saturate(125%)",push(),blendMode(OVERLAY),fill("#0188D8"),rect(M/2,N/2,M,N),pop()),noLoop(),12==p7&&filter(GRAY),onDone()} function cALP($,_=1){var e=color($);return color("rgba("+[red(e),green(e),blue(e),_].join(",")+")")}function Fm(){let $=ri(0,2);elem=0==$?350:1==$?500:1e3,q=[350,500,1e3];for(var _=1;_<q[$];_++){switch(shuffle(pLT,!0),m1.fill(cALP(pLT[pL1],.5)),sin(rB(-1,1),rB(1,-1)),mTex){case 0:m1.rect(rB(0,M),rB(0,N),M/3,rB(0,N/rB(20,10)));break;case 1:m1.rect(rB(0,M),rB(0,N),rB(0,M/rB(1,5)),N/25);break;case 2:m1.rect(rB(0,M),rB(0,N),rB(0,M/rB(10,15)),N/5);break;case 3:m1.rect(rB(0,M),rB(0,N),rB(0,M/rB(50,10)),N/3);break;case 4:m1.rect(rB(0,M),rB(0,N),M/5,rB(0,N/rB(7,5)))}m1.noFill(),m1.strokeWeight(1),m1.stroke(cALP(pLT[pL1],.75)),m1.rect(rB(0,M),rB(0,N),rB(M/rB(50,100)),N/rB(2,200)),m1.stroke(cALP(pLT[pL1],.75)),m1.rect(rB(0,M),rB(0,N),rB(0,2*M)),m1.stroke(cALP(pLT[pL1],.5));for(let e=10;e<50;e+=1)m1.rect(rB(0,M),rB(0,N),rB(0,M/e)/(e*rB(.75,1)))}}function sR($,_,e,r){let[t,c]=[$+e/2,_+r/2];beginShape(),vertex(t,c);for(let o=0,a,l;o<e;o+=pS)[a,l]=[t+o+map(noise(.1*o,.1*c),0,1,-lg,lg),c+map(noise(.1*t,.1*o),0,1,-lg,lg)],vertex(a,l);vertex(t+e,c);for(let s=0,f,n;s<r;s+=pS)[f,n]=[t+e+map(noise(.1*e,(c+s)*.1),0,1,-lg,lg),c+s+map(noise((t+e)*.1,.1*s),0,1,-lg,lg)],vertex(f,n);vertex(t+e,c+r);for(let i=0,k,b;i<e;i+=pS)[k,b]=[t+e-i+map(noise((e-i)*.1,(c+r)*.1),0,1,-lg,lg),c+r+map(noise((t+e)*.1,(r+i)*.1),0,1,-lg,lg)],vertex(k,b);vertex(t,c+r);for(let A=0,L,P;A<r;A+=pS)[L,P]=[t+map(noise(.1*$,(c+r-A)*.1),0,1,-lg,lg),c+r-A+map(noise(.1*A,(c+r)*.1),0,1,-lg,lg)],vertex(L,P);endShape(CLOSE)} const vs="\n attribute vec3 aPosition;\n \n attribute vec2 aTexCoord;\n \n varying vec2 vTC;\n \n uniform float uSeed;\n \n uniform float zM;\n \n void main() {\n \n vTC = aTexCoord;\n \n vec4 positionVec4 = vec4(aPosition, 1.0);\n \n float randomValue = fract(sin(dot(positionVec4.xyz,vec3(10.0,80.0,35.0) * uSeed)) *100.0);\n \n float scaledValue = randomValue * 10.0 + zM;\n \n positionVec4.xy = positionVec4.xy * scaledValue - 10.0;\n \n gl_Position = positionVec4;} \n ";vf="\n precision highp float;\n uniform sampler2D u_tex; \n uniform float mag;\n uniform vec2 u_res; \n \n uniform float u_t; \n \n uniform float mA1; uniform float u_seed; \n \n varying vec2 vTC; \n \n float random (vec2 st) {return fract(cos(dot(st.xy,vec2(10.0,80.0)))*10000.0);} \n \n float noise (vec2 st) { \n \n vec2 i = floor(st); \n \n vec2 f = fract(st); \n \n vec2 u = f*f*(3.0-2.0*f); \n \n return mix( mix( random( i + vec2(0.0,0.0) ), random( i + vec2(1.0,0.0) ), u.x), mix( random( i + vec2(0.0,1.0) ), random( i + vec2(1.0,1.0) ), u.x), u.y);} \n \n float fbm( vec2 n ) { \n \n float total = 0.0, amp = 15.0; \n \n for (int i = 0; i < 8; i++) {total += noise(n) * amp; n += n; amp *= 0.5;} \n \n return total;} \n \n float sLex(vec2 st) { \n \n return fract(sin(dot(st, vec2(10.0, 80.0))) * 40000.0);} \n \n float s_noise(vec2 st) { \n \n vec2 i = floor(st); \n \n vec2 f = fract(st); \n \n vec2 u = f*f*(3.0-2.0*f); \n \n return mix(mix(sLex(i + vec2(0.0,0.0)), sLex(i + vec2(1.0,0.0)), u.x), mix(sLex(i + vec2(0.0,1.0)), sLex(i + vec2(1.0,1.0)), u.x), u.y);} \n \n void main() { \n \n vec2 st = vTC; \n \n st.x += fbm(vec2( st.x * mA1 , st.y * mA1) * 2.0 + u_t * 0.05) * mag; \n \n st.y += fbm(vec2(st.x*mA1,st.y*mA1)*1.0+u_t*0.097)*mag; \n \n vec4 color = texture2D(u_tex,st); \n \n gl_FragColor = color;} \n"; function getC(e){return 1==e?"Eclipse":2==e?"Desert":3==e?"Marine":4==e?"Volcanic":5==e?"Crimson ":6==e?"Sea":7==e?"Urban":8==e?"Coastal":9==e?"Tropical":10==e?"Eclectic ":11==e?"Ocean":12==e?"Grayscale":void 0}function getO(e){return 0==e?"Vertical":1==e?"Horizontal":void 0}function getZ(e){return 25==e?"1":50==e?"2":75==e?"3":100==e?"4":void 0}function getD(e){return 0==e?"5":1==e?"7":2==e?"9":3==e?"13":4==e?"19":5==e?"22":6==e?"23":7==e?"21":8==e?"57":9==e?"9 -":10==e?"13 -":11==e?"21 -":12==e?"31":13==e?"55":14==e?"75":void 0}function getS(e){return 0==e?"1":1==e?"2":2==e?"3":void 0}setMetadata("Color_Zone",getC(p7)),setMetadata("Orientation",getO(ori)),setMetadata("Amplitude",getZ(zM)),setMetadata("Density",getD(c7)),setMetadata("Saturation",getS(sat));</script></body>
<head> <meta charset="UTF-8"> <title>Fibrant</title> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script> <script id="genart-tweaks">const tweaks = {"tweak_range":1,"tweak_range_2":1,"bool":true,"tweak_select":"sin","hex_color":"#ff005b","rgba_color":{"r":248,"g":214,"b":40,"a":1}};</script></head> <body> <style> body { background: #000; width: 100vw; height: 100vh; display: flex; justify-content: center; align-items: center; flex-direction: row; margin: 0 } canvas { margin: auto; display: block; box-shadow: 0 2px 12px -2px rgba(0, 0, 0, .15) }</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>let canvas,DIM,bgc=[{n:"Light",c:[[42,26,89]]},{n:"Dark",c:[[0,0,0]]}],plts=[{n:"Tokyo",c:[[354,90,58],[348,80,59],[184,69,40],[187,37,69],[249,19,7],[199,49,16]]},{n:"Glass rose",c:[[355,91,42],[1,93,65],[192,60,16],[84,38,25],[49,92,86],[35,84,61]]},{n:"Bones",c:[[0,92,44],[0,0,95],[0,0,65],[0,0,6],[0,0,49]]},{n:"Tuna",c:[[27,35,46],[26,48,26],[27,49,85],[355,65,38],[355,100,74],[14,82,75],[16,85,58]]},{n:"Subway",c:[[183,89,70],[194,100,32],[167,55,77],[165,30,49],[86,100,20],[151,100,23],[78,42,52],[213,100,19]]},{n:"Peace",c:[[61,51,50],[57,71,38],[71,46,18],[69,56,10],[351,14,10],[21,29,15],[40,71,32],[41,87,42],[140,17,43],[95,47,78],[66,97,85]]},{n:"Rainbow",c:[[318,99,32],[238,74,38],[143,58,84],[103,54,69],[56,81,64],[352,77,61]]},{n:"Firehead",c:[[0,88,56],[36,87,64],[39,91,66],[354,74,21],[4,97,56],[5,91,54]]},{n:"Seth",c:[[359,72,43],[355,74,46],[19,59,53],[21,91,65],[208,77,65],[52,23,86],[61,100,90],[44,96,10],[55,33,43],[45,100,67]]},{n:"AutoHaus",c:[[357,84,33],[40,100,49],[208,100,19]]},{n:"Robot",c:[[23,84,47],[33,81,52],[42,34,85],[82,14,77],[198,80,16],[192,91,21],[179,43,43]]},{n:"Poco",c:[[195,60,13],[188,54,47],[2,98,50],[38,98,50],[27,96,80],[45,82,85]]},{n:"B&W",c:[[0,0,0],[0,0,100]]},{n:"Dinnertime",c:[[60,95,77],[51,82,59],[218,60,17],[234,91,5],[135,67,99],[120,6,50],[176,31,17],[8,89,35],[2,100,30]]},{n:"IceVulcano",c:[[359,99,48],[359,76,27],[187,53,34],[178,52,32],[110,12,10],[220,60,99],[135,2,43],[37,87,60],[22,72,31]]},{n:"MJ",c:[[5,75,49],[27,82,54],[251,74,5],[204,85,11],[171,78,37],[168,62,51],[12,63,58],[22,87,66],[336,26,28],[303,53,7]]},{n:"Watercolor",c:[[30,100,45],[32,59,67],[174,15,47],[41,39,85],[191,100,27],[171,89,7]]},{n:"Church",c:[[28,100,79],[200,100,50],[96,89,38],[114,74,15],[47,97,54],[180,8,90]]},{n:"Primary",c:[[192,100,35],[0,96,53],[36,99,54],[47,100,50]]},{n:"Rooster",c:[[192,100,35],[0,96,53],[212,89,14],[47,100,50]]},{n:"Spring",c:[[69,98,36],[128,96,18],[356,97,74],[16,100,74]]},{n:"Mars",c:[[71,22,90],[221,36,38],[5,67,50],[51,100,56]]},{n:"Purple Haze",c:[[39,100,50],[47,100,50],[324,63,30],[324,56,52]]},{n:"Bruise",c:[[324,63,30],[0,0,10],[39,100,50],[47,100,50]]},{n:"Coral",c:[[29,100,75],[326,100,75],[0,96,48],[0,100,51]]},{n:"Subzero Ice",c:[[192,100,35],[212,89,14],[0,0,98],[0,0,81]]},{n:"Subzero Rose",c:[[192,100,35],[212,89,14],[0,0,98],[0,96,48]]},{n:"Subzero Red",c:[[192,100,35],[212,89,14],[0,96,53],[0,96,48]]},{n:"Sprout",c:[[20,94,63],[42,93,64],[94,38,59],[162,43,46]]},{n:"Mango",c:[[29,100,75],[36,100,54],[326,100,75],[347,87,57]]},{n:"Fire",c:[[29,100,75],[0,96,48],[30,100,45],[49,100,50]]}];const DS=1600;let WIDTH=window.innerWidth,HEIGHT=window.innerHeight;const ES=1600;DIM=WIDTH>4*HEIGHT/5?4*HEIGHT/5:WIDTH;let rHs,bgCl,bgClP,pSWMi,pSWMa,cSW,lLP,paR,paC,sEP,nSYV,cuF,wLMi,nSXSM,nSYSM,maWi,maHe,dP1,nOL,cPlC,cPlC2,sp,ep,osp,oep,cl,noC,mP1o,mP2o,cBC,mP,wLs,colorshademode,M=DIM/DS,rHss=options.hash,pAL=.6,particleAlphaHigh=.9,lLPMa=.4,lLPMiT=.15,gMWi=0,gMHe=0,grPA=[],aEPA=[],clA=[],wLMa=0,sCMo=1,nLSc=1,lLPMi=-1,lSp=!1,cC=0,iOCx=!1,iOCy=!1,mSlYT=1,exportToFile=!1,nLD=0,nLPf=20,prv=0,pcv=0,cPD=options.pixelDensity,mPD=1;function setup(){let e=getURLParams();null!=e.hash?(rHs=new Random(e.hash,4),rHss=e.hash):rHs=new Random(rHss,4),null!=e.pixeldensity&&(mPD=int(e.pixeldensity)),null!=e.exportToFile&&(exportToFile=boolean(e.exportToFile)),print("currentHash: "+rHss),cPD<mPD&&(cPD=mPD),1==exportToFile&&(pixelDensity(cPD),DIM=ES,WIDTH=ES,HEIGHT=2e3,M=DIM/DS),DW=DS,DH=2e3,canvas=createCanvas(DW*M,DH*M),colorMode(HSL,360,100,100,1),angleMode(DEGREES),seed=round(1e9*rHs.random_dec()),noiseSeed(seed),window.METADATA={},createNewDrawing()}function createNewDrawing(){noC=rHs.random_int(140,160),sEP=w_r([1,2,5,6,8],[10,10,1,6,5]),colorshademode=w_r([0,3,4],[15,2,1]),1==sEP||6==sEP||8==sEP?(prv=w_r([[2,8],[500,2e3]],[1,3]),paR=rHs.random_int(prv[0],prv[1]),paC=rHs.random_int(3,15),iOCx=!0):2==sEP&&(paR=rHs.random_int(3,15),pcv=w_r([[2,8],[500,2e3]],[1,3]),paC=rHs.random_int(pcv[0],pcv[1]),lLPMi=DH/paR/DH,iOCy=!0),5==sEP&&(prv=w_r([[10,15],[500,2e3]],[50,15]),paR=rHs.random_int(prv[0],prv[1]),nLSc=.5,paC=rHs.random_int(13,30),cSz=rHs.random_between(DW/3,DW/2.2),noC*=3,lLPMa=.5),6==sEP&&(paR=rHs.random_int(40,50),noC=floor(noC/2),paC=rHs.random_int(4,15),wLs=w_r([[20,30,0],[50,80,1],[200,250,2],[500,1e3,3],[2e3,5e3,4],[2e4,5e4,5]],[1,1,1,1,1,1]),wLMi=wLs[0],wLMa=wLs[1],nSXSM=w_r([.1,1,3,5],[1,1,1,1]),nSYSM=w_r([3,5],[1,1]),lLPMa=.7,lLPMiT=.2,iOCx=!0),8==sEP&&(gMWi=rHs.random_between(.2,.6),gMHe=rHs.random_between(.2,.6),paR=rHs.random_int(50,100),sCMo=.5,iOCx=!0,mSlYT=.5),-1==lLPMi&&(lLPMi=DW/paC/DW),lLPMi<lLPMiT&&(lLPMi=lLPMiT),lLP=rHs.random_between(lLPMi,lLPMa),pSWMi=.08,pSWMa=.12,bgClP=bgc[rHs.random_int(0,1)],daPsh=rHs.random_int(0,bgClP.c.length-1),bgCl=bgClP.c[daPsh],background(bgCl),1!=sEP&&2!=sEP||(lSp=w_r([!0,!1],[1,5])),mP=plts[rHs.random_int(0,plts.length-1)],nSYV=w_r([[1,10],[1,200]],[0,10]),updateGridMargins(),createGridPointArray(paR,paC),assignColorsTogridPoints(),populateMetadata(),generateBezierClusters()}function assignColorsTogridPoints(){grPA.forEach((function(e,r){e.pCo=color(prcP())}))}function generateBezierClusters(){for(let e=0;e<noC;e++)prepCluster(),generateBeziers()}function draw(){noFill(),cuF=frameCount,1==exportToFile?drawForExport():(0==linesLeftToDraw()&&(noLoop(),onDone()),drawLinesForFrame(nLD,nLPf),nLD+=nLPf)}function linesLeftToDraw(){let e=!0;return clA.forEach((function(r,o){0==r.clusterFinishedDrawing&&(e=!1)})),0==e}function drawLinesForFrame(e,r){clA.forEach((function(o,n){let t;e+r>o.bCA.length-1?(t=o.bCA.length-1,o.clusterFinishedDrawing=!0):t=e+r;for(let r=e;r<t;r++)strokeWeight(o.bCA[r].beSw*M),stroke(o.bCA[r].sCol),bezier(o.bCA[r].obSP.x*M,o.bCA[r].obSP.y*M,o.bCA[r].obMP1.x*M,o.bCA[r].obMP1.y*M,o.bCA[r].obMP2.x*M,o.bCA[r].obMP2.y*M,o.bCA[r].obEP.x*M,o.bCA[r].obEP.y*M)}))}function drawForExport(){let e=0;for(;1==linesLeftToDraw();)e+=1,drawLinesForFrame(nLD,nLPf),nLD+=nLPf;print("Animation finished, exported: "+e+"frames."),saveCanvasToFile(),noLoop(),onDone()}function prepCluster(){let e;cBC=new BezierCurveCluster,cl=0;let r=w_r([200,300,600,5e3],[1,1,12,10]),o=w_r([300,500,800,1e4],[1,1,12,10]);r*=nLSc,o*=nLSc,6==sEP&&(r=w_r([1e3,2e4,3e4],[1,5,5]),o=w_r([2e4,3e4,4e4],[1,5,5])),nOL=rHs.random_int(r,o);let n,t=caMaCLl(),s=caMaRLl();if(wL=rHs.random_int(wLMi,wLMa),1==sEP||5==sEP||6==sEP||8==sEP){let r=rHs.random_int(0,paR-1);aEPA=[],grPA.forEach((function(e,o){e.row==r&&aEPA.push(e)}));let o=rHs.random_int(0,aEPA.length-2);n=o<aEPA.length-1-t?t+o:aEPA.length-1;let s=rHs.random_int(o+1,n);e=aEPA[o],sp=createVector(e.gp.x,e.gp.y);let a=aEPA[s];ep=createVector(a.gp.x,a.gp.y)}if(2==sEP){let r=rHs.random_int(0,paC-1);aEPA=[],grPA.forEach((function(e,o){e.column==r&&aEPA.push(e)}));let o=rHs.random_int(0,aEPA.length-2);o<aEPA.length-1-s?eRMa=s+o:eRMa=aEPA.length-1;let n=rHs.random_int(o+1,eRMa);e=aEPA[o],sp=createVector(e.gp.x,e.gp.y);let t=aEPA[n];ep=createVector(t.gp.x,t.gp.y)}dP1=w_r([1,-1],[1,1]),osp=sp.copy(),oep=ep.copy(),cPlC=e.pCo,0==colorshademode&&(cPlC=geCoD(cPlC,8),cPlC2=e.pCo),3==colorshademode&&(cPlC2=geCoD(cPlC,30)),4==colorshademode&&(cPlC2=geCoH(cPlC,50)),dP1=w_r([-1,1],[1,1]),cC+=1}function generateBeziers(){for(let e=0;e<nOL;e++){let r=new BezierCurve;cl+=1;let o=rHs.random_between(pSWMi,pSWMa);cPlC=color(hue(cPlC),saturation(cPlC),lightness(cPlC),rHs.random_between(pAL,particleAlphaHigh)),cPlC2=color(hue(cPlC2),saturation(cPlC2),lightness(cPlC2),rHs.random_between(pAL,particleAlphaHigh)),spSc=o;let n=rHs.random_int(nSYV[0],nSYV[1]),t=rHs.random_int(1,10);if(2==sEP){let e=n;n=t,t=e}6==sEP&&(t*=nSXSM,n*=nSYSM),3!=colorshademode&&4!=colorshademode||(r.sCol=lerpColor(cPlC,cPlC2,cl*(1/nOL)));let s=ep.x-sp.x,a=ep.y-sp.y;1==lSp&&(1==sEP&&s/DW<.5&&(n*=s/DW*3),2==sEP&&a/DH<.4&&(t*=a/DH*2));let c=createVector(sp.x+s*rHs.random_between(.1,.5),sp.y+a*rHs.random_between(.1,.5)),i=createVector(sp.x+s*rHs.random_between(.6,1),sp.y+a*rHs.random_between(.5,1)),l=createVector(0,0),p=createVector(0,0),P=createVector(0,0),d=createVector(0,0);1==cl&&(mP1o=c,mP2o=i),1!=sEP&&8!=sEP||(r.obSP=createVector(sp.x+noise(sp.x,sp.y)*t*w_r([-1,1],[1,1]),sp.y+noise(sp.x,sp.y)*n*w_r([-1,1],[1,1])),r.obMP1=createVector(c.x,c.y+noise(c.x,c.y)*n*w_r([-1,1],[1,1])),r.obMP2=createVector(i.x,i.y+noise(i.x,i.y)*n*w_r([-1,1],[1,1])),r.obEP=createVector(ep.x+noise(ep.x,ep.y)*t*w_r([-1,1],[1,1]),ep.y+noise(ep.x,ep.y)*n*w_r([-1,1],[1,1]))),2==sEP&&(r.obSP=createVector(sp.x+noise(sp.x,sp.y)*t*w_r([-1,1],[1,1]),sp.y+noise(sp.x,sp.y)*n*w_r([-1,1],[1,1])),r.obMP1=createVector(c.x+noise(c.x,c.y)*t*w_r([-1,1],[1,1]),c.y),r.obMP2=createVector(i.x+noise(i.x,i.y)*t*w_r([-1,1],[1,1]),i.y),r.obEP=createVector(ep.x+noise(ep.x,ep.y)*t*w_r([-1,1],[1,1]),ep.y+noise(ep.x,ep.y)*n*w_r([-1,1],[1,1]))),5==sEP&&(l.x=sp.x+noise(sp.x,sp.y)*t*w_r([-1,1],[1,1]),l.y=sp.y+noise(sp.x,sp.y)*n*w_r([-1,1],[1,1]),P.x=c.x,P.y=c.y+noise(c.x,c.y)*n*w_r([-1,1],[1,1]),d.x=i.x,d.y=i.y+noise(i.x,i.y)*n*w_r([-1,1],[1,1]),p.x=ep.x+noise(ep.x,ep.y)*t*w_r([-1,1],[1,1]),p.y=ep.y+noise(ep.x,ep.y)*n*w_r([-1,1],[1,1]),1==chPIc(l,createVector(DW/2,DH/2),cSz)&&1==chPIc(P,createVector(DW/2,DH/2),cSz)&&1==chPIc(d,createVector(DW/2,DH/2),cSz)&&1==chPIc(p,createVector(DW/2,DH/2),cSz)&&(r.obSP=l,r.obMP1=P,r.obMP2=d,r.obEP=p)),6==sEP&&(r.obSP=createVector(sp.x,sp.y+noise(sp.x,sp.y)*t*w_r([-1,1],[1,1])),r.obMP1=createVector(c.x,c.y+noise(c.x,c.y)*n*w_r([-1,1],[1,1])),r.obMP2=createVector(i.x,i.y+noise(i.x,i.y)*n*w_r([-1,1],[1,1])),r.obEP=createVector(ep.x,ep.y+noise(ep.x,ep.y)*t*w_r([-1,1],[1,1]))),r.beSw=o,r.sCol=cPlC,null!=r.obSP&&cBC.bCA.push(r),1==sEP||8==sEP||5==sEP?(sp.y=osp.y+cl*spSc*sCMo*dP1,ep.y=oep.y+cl*spSc*sCMo*dP1):2==sEP?(sp.x=osp.x+cl*spSc*dP1,ep.x=oep.x+cl*spSc*dP1):6==sEP&&(sp.y=osp.y+cl*pSWMi*dP1,ep.y=oep.y+cl*pSWMi*dP1,1==dP1?(sp.x=osp.x+100*sin(TWO_PI/wL*cl),ep.x=oep.x+100*sin(TWO_PI/wL*cl)):(sp.x=osp.x+100*cos(TWO_PI/wL*cl),ep.x=oep.x+100*cos(TWO_PI/wL*cl))),1!=iOCy&&(sp.y>DH-maHe/2||ep.y>DH-maHe/2||sp.y<maHe*mSlYT||ep.y<maHe*mSlYT)&&(e=nOL),1!=iOCx&&(sp.x>DW-maHe/2||ep.x>DW-maHe/2||sp.x<maHe||ep.x<maHe)&&(e=nOL)}clA.push(cBC)}function chPIc(e,r,o){return e.dist(r)<o}function caMaCLl(){let e=DW*lLP,r=(DW-maWi)/paC;return Math.floor(e/r)}function caMaRLl(){let e=DH*lLP,r=(DH-maHe)/paR;return Math.floor(e/r)}function createGridPointArray(e,r){aSpWi=DW-maWi,aSpHe=DH-maHe;for(let o=0;o<=e;o++)for(let n=0;n<=r;n++){let t=new Gridpoint,s=createVector(aSpWi/r*n+maWi/2,aSpHe/e*o+maHe/2);t.column=n,t.row=o,t.gp=s,grPA.push(t)}}function reloadAfter5seconds(){location.reload()}function saveCanvasToFile(){print("Exporting: "+rHss),saveCanvas("Fibrant_by_jenslabs_"+options.tokenId+"_"+rHss,"png"),print("Export finished")}function updateGridMargins(){maWi=DW*gMWi,maHe=DH*gMHe}function prcP(){return slCo=mP.c[rHs.random_int(0,mP.c.length-1)],slCo}function geCoD(e,r){let o=e,n=0,t=0,s=0,a=rHs.random_int(-r,r),c=rHs.random_int(-r,r),i=rHs.random_int(-r,r);return n=lightness(e)>255-a?255:lightness(e)-a<0?0:lightness(e)+a,t=saturation(e)>255-c?255:saturation(e)-c<0?0:saturation(e)+c,s=hue(e)>359-i?359:hue(e)-i<0?0:hue(e)+i,o=color(round(s),round(t),round(n)),o}function geCoH(e,r){let o=e,n=0,t=rHs.random_int(-r,r);return n=hue(e)>359+t?359:hue(e)+t<0?0:hue(e)+t,o=color(round(n),saturation(o),lightness(o)),o}function keyReleased(){"e"==key&&saveCanvasToFile()}function w_r(e,r){let o;for(o=0;o<r.length;o++)r[o]+=r[o-1]||0;let n=rHs.random_between(0,1)*r[r.length-1];for(o=0;o<r.length&&!(r[o]>n);o++);return e[o]}function populateMetadata(){let e=0,r=0,o="N/A";paC>100&&(e=1),paR>100&&(r=1),null!=wLs&&(o=["20-30","50-80","200-250","500-1000","2000-5000","20000-50000"][wLs[2]]),setMetadata("Palette",mP.n),setMetadata("Background Color",bgClP.n),setMetadata("No of Rows",["Low","High"][r]),setMetadata("No of Columns",["Low","High"][e]),setMetadata("Form",["","Vertical","Horizontal","","","Circle","Snakes","","Square"][sEP]),setMetadata("Flow hertz",o),setMetadata("Constrained spread",lSp),setMetadata("Color depth",["Low","","","Medium","High"][colorshademode]),onMetadata()}class Gridpoint{constructor(){this.row,this.column,this.gp=createVector(0,0),this.pCo}}class BezierCurve{constructor(){this.obSP,this.obMP1,this.obMP2,this.obEP,this.beSw,this.sCol}}class BezierCurveCluster{constructor(){this.clusterNumber,this.bCA=[],this.clusterFinishedDrawing=!1}}</script></body>
<!DOCTYPE html> <head> <meta charset="utf-8"> </head> <body> <style>html, body { margin: 0; padding: 0; background-color:#eee; } canvas { display: block; margin-left: auto; margin-right: auto; } </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>// License: CC BY-NC 4.0 www.josvromans.com W=window;A=W.requestAnimationFrame;S=V=parseInt(options.hash.slice(0,16),16);R=_=>{S^=S<<13;S^=S>>17;S^=S<<5;return((S<0?~S+1:S)%999)/999}; C=({body}=document).createElement('canvas');body.appendChild(C);X=C.getContext('2d');w=1000;h=1500;H=750;M=25;z=h*.1;F=U=v=0;let {sin:N,cos:c,tan:t,PI:P}=Math;wW=W.innerWidth;wH=W.innerHeight;if(wW>=wH*2/3){wW=wH*2/3;}else{wH=wW/2*3} q=(s,v)=>{C[s]=v;C.style[s]=v*Math.min(wW/w,wH/h)+"px"};q('width',w);q('height',h);Y=R(X=C.getContext('2d')); O=l=>l[l.length*R()|0];II='Layers #'+(options.tokenId||'???').slice(-3);l=(p='')=>document.title=p+II; DI=O([0,0,0,1,1,1,1,2,2,2,2,3,3,4,4,4,4,5,5,6,6]);SI=O([0,1,1,2,2,2]);DY=O(DI===3?[2,2,3,4.5]:[1.65,1.8,1.8,1.8,2,2,3,4.5]); s=[(v)=>N(v),(v)=>N(v/5)*t(-v/3)*N(-v)*c(v/5),(v)=>N(v)*t(-v)*N(-v)*c(v)][SI]; Q=[(x,y)=>{if(y>1600){y=0};return N(y/h)*N(y/h*.05)*c(x/90)*N(x/w*(9+R()*.1))*N(y/h*-3)*(y-h*4)/(30+y/h)*(x-Y*h)/8},(x,y)=>N(x/w*3)*N(x/w*3)*(y-w),(x,y)=>N(x/w*4)*N(x/w*4)*(y-w)-z,(x,y)=>N(x/w*4)*t(x/w*P)*(y-w)-z,(x,y)=>t(x/w)*t(x/w)*(y-w)-z,(x,y)=>N(x/w)*N(x/w)*(y-w),(x,y)=>N(x/w*4)*t(x/w*2)*(y-w)-z][DI]; AD=99;I=O([46,140]);if(SI===1){if(R()<.5){I=148;AD=999}}else{if(R()<.1){I=148;AD=999}} E=O([0,0,0,1,2,2,3,3,4,5,5,5,6,7,8,9,9,10,10,10,11,11,11,12,13,14,14]); L=[ ['#cdd0c4','#000000','#aebbb4','#f6fae5','#5e0000','#fda201','#370000','#8f0000','#96857b','#cdbda2','#fd8301','#b70000','#fcc301','#016f8f','#d2a7c3','#0184b1','#fc5a01','#d90101','#ad805b','#aea577'], ['#000000','#001427','#145872','#01334d','#2c3848','#6e4a46','#009cb7','#d4b081','#ab6047','#943f3d','#60232f','#2e2529','#d22424','#ae9b7f','#61827f','#336f7d','#bef6e8','#ebf9e7','#d68666','#71e0e1'], ['#000000','#171a18','#2a2e31','#444949','#990007','#6a5231','#b70000','#050019','#d40000','#f5efe7','#730003','#aca896','#7c7d76','#997546','#61696d','#53341c','#ffc700','#f9ab00','#e8d3bf','#ecc41f'], ['#000000','#191c16','#2e342f','#6f0101','#880201','#a90201','#464c4a','#4f0101','#fcc202','#fb8603','#f74a03','#c50301','#abaa95','#eff8f1','#765f3f','#2a0100','#f9a305','#c9c5b4','#5d686b','#fa6603'], ['#001','#000','#643','#322','#e86','#035','#fc0','#fd9','#200','#422','#a00','#500','#c00','#f35','#ccb','#da0','#07e','#f51','#104','#631'], ['#f3f0e9','#54676a','#dddac9','#c4c2b6','#1e1c27','#224f62','#4b4b56','#94a0a2','#6d6d75','#3d383c','#9ed1cf','#888687','#36b4cb','#60cfd2','#112759','#1a47a5','#583b32','#13347d','#bdd7d3','#79d0cf'], ['#ffffff','#cda4b4','#cc7a86','#cb5314','#d8cbd4','#d2742c','#c3464e','#c6e0ed','#c32f2f','#c83a12','#dabeb2','#ca6064','#68a9ed','#af88a7','#9ec9f3','#b2b5c4','#4d7fc8','#d68945','#0a0a0a','#91b5d9'], ['#c21','#fa0','#026','#121', '#404', '#fff'], ['#230000','#0e0c19','#ffedbb','#fae1a1','#221449','#070000','#eac380','#2f1522','#cd9f7b','#341f6c','#d2b7c0','#b37560','#2874c0','#784160','#bd9361','#421540','#712d42','#f4c0ab'], ['#050505','#0182c4','#dfa818','#013821','#007737','#d4cdc5','#96050c','#00463e','#b00b12','#007f86','#005e60','#019bb7','#0192e1','#00627f','#051f12','#0065a9','#1f9fc4','#0d0a4f'], ['#000000','#2f3336','#faca8a','#71767b','#046169','#e7e9ea','#f4c92c','#9fae2d','#f1784d'], ['#000000','#fb5c02','#fbb603','#2a2221','#faf79d','#e7f8da','#fa8d02','#fbcab3','#f9eb6c'], ['#000001','#01012b','#ca0206','#041b54','#046477','#f73a06','#c8a605','#9a0305','#fada04'], ['#0a0e1a','#bb0000','#d5ba76','#564a1b','#00007f','#a08d50','#900000','#c9952d','#000054'], ['#fed','#022','#eda','#d22','#a01','#412','#245','#567','#fc3']][E]; K=setMetadata;K('Palette',['Delight','Coast','Earth','Warm','Quatro','Ocean','Tender','Glow','Lavender','Oasis','Fresh','Golden','Ferno','Lazuli','Fin'][E]);K('Layout',['ZigZag','Facade','Wave','Asymptote','Steep','Slope','Blow'][DI]);K('Wave',SI!==1&&I==148?'Stripe':['Sin','Tan','Custom'][SI]);K('Vibration',DY>1.9?'No':DY<1.8?'High':'Low');K('F11',R(Z='globalAlpha')<.04?'Yes':'No');onMetadata(); createKeyListeners([{keys:['p'],fn:()=>{U=!U;U||A(T)},description:'(Un)pause the rendering'},{keys:['r'],fn:()=>a(),description:'Regenerate the artwork, but in lower or higher resolution'},{keys:['v'],fn:()=>r(),description:'Regenerate in vertical or default mode'}]);d=DI==0?200:0; PL=[];for(let k=I;k--;){let [x,y]=[R()*w*2-d,R()*h];PL.push([0,1].map(i=>[s(P*i)*H+x,c(P*i)*H+y]))} r=_=>{v=!v;F=!F;a()};a=_=>{S=V;J=F?3:40;B=w/(F?299:999);X.fillStyle='#fff';X[Z]=1;X.fillRect(0,0,w,h);X[Z]=.1;D=(x,y)=>{if(v){[x,y]=[y,x]};y+=Q(x,y);x>M&&x<w-M&&y>M&&y<h-M&&X.fillRect(x,y,B,B)};x=y=i=pi=0; e=J*7**7;T=(a)=>{l(`${~~(i/e*100)}% `);for(an=5000;an--;){if(i%4<1){pi=(pi+1)%I;X.fillStyle=L[pi%L.length]};let r=PL[pi][2*R()|0];x+=(r[0]-x)/O([1.1,2,4]);y+=(r[1]-y)/DY;x+=s(y/14)*(w/AD);y+=t(y/h)*(w/50)*s(x/w*9);D(y,x,i++)};if(!U&&i<e){A(T)}else{l(U?'(paused) ':'');!U&&onDone()}};A(T);F=!F};a()</script></body>
<head> <meta charset="utf-8"> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.0/p5.js"></script> <script id="genart-tweaks">const tweaks = {"tweak_range":1,"tweak_range_2":1,"bool":true,"tweak_select":"sin","hex_color":"#ff005b","rgba_color":{"r":248,"g":214,"b":40,"a":1}};</script></head> <body> <style>html, body { width: 100vw; height: 100vh; margin: 0; padding: 0; display: grid; place-items: center; background: #111; } canvas { display: block; }</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>let x, y, pixel_size, pixels_count, tile, tile_size, colors, color_palette, primary_color; let func; const rnd = new Random(options.hash); function preload() { tile_size = min(windowWidth, windowHeight); tile_size = tile_size - (tile_size % 100); loadJSON( "https://raw.githubusercontent.com/Jam3/nice-color-palettes/master/1000.json", (o) => (colors = Object.values(o)) ); } function setup() { createCanvas(tile_size, tile_size); frameCount = -1; x = y = 0; pixel_size = tile_size * 0.025; pixels_count = tile_size / pixel_size; pickColorPalette(); primary_color = color_palette[0]; tile = createGraphics(tile_size, tile_size); tile.background(primary_color); setMetadata("background", primary_color); const itr = pixels_count * min(1, int(rnd.random_int(1, 8)) / 2); setMetadata("iterations", itr); for (let $x = 0; $x <= itr; $x++) { for (let $y = 0; $y <= itr; $y++) { draw4Pixels($x, $y, tile.rect); } } noLoop(); } function draw() { image(tile, 0, 0, tile_size, tile_size); noFill(); stroke(primary_color); strokeWeight(pixel_size * 2); rect( pixel_size / 2, pixel_size / 2, tile_size - pixel_size, tile_size - pixel_size ); onDone(); } function pickColorPalette() { let full_color_palette = deterministicShuffle(rnd.random_choice(colors)); color_palette = full_color_palette.slice( 0, int(rnd.random_int(2, full_color_palette.length)) ); color_palette = deterministicShuffle([...color_palette, "#000"]); } function draw4Pixels($x, $y, func) { tile.stroke((curr_color = rnd.random_choice(color_palette))); tile.fill((curr_color = rnd.random_choice(color_palette))); tile.strokeWeight(pixel_size * rnd.random_between(0, 1)); func($x * pixel_size, $y * pixel_size, pixel_size); func((pixels_count - $x - 1) * pixel_size, $y * pixel_size, pixel_size); func($x * pixel_size, (pixels_count - $y - 1) * pixel_size, pixel_size); func( (pixels_count - $x - 1) * pixel_size, (pixels_count - $y - 1) * pixel_size, pixel_size ); } function deterministicShuffle(array) { let currentIndex = array.length, randomIndex; while (currentIndex != 0) { randomIndex = rnd.random_int(0, array.length - 1); currentIndex--; [array[currentIndex], array[randomIndex]] = [ array[randomIndex], array[currentIndex], ]; } return array; } function downloadBanner() { const banner = createGraphics(tile_size * 3, tile_size); banner.image(tile, 0, 0, tile_size, tile_size); banner.image(tile, tile_size, 0, tile_size, tile_size); banner.image(tile, tile_size * 2, 0, tile_size, tile_size); banner.noFill(); banner.stroke(primary_color); banner.strokeWeight(pixel_size * 2); banner.rect( pixel_size / 2, pixel_size / 2, tile_size * 3 - pixel_size, tile_size - pixel_size ); saveCanvas(banner, "banner", "png"); } createKeyListeners([ { description: "Download Banner", keys: ["a"], fn: downloadBanner, }, ]);</script></body>