memoscan
← all memos

Memo 0xa4328469…13516d on Ethereum

[1,()=>{console.log("Artist 34. Lolo Armdz -- platform 1"); console.log(" *** PATRIA O MUERTE CARETAS *** ");SEED = R.random_int(0,99999999);let t,e,$,n=0,o=0,r,l,d=[],f={};function _(t,e,$,n,o){t.shadowBlur=e,t.shadowColor=$,t.shadowOffsetX=n,t.shadowOffsetY=o}function a(t){t.shadowBlur=0}function m(t,e,$,n,o){let r=t,d=e,a=random(.01,.09),m=random(-PI,PI),s=f.shadowOffset,x=cos(m)*l.width*a*s,u=sin(m)*l.width*a*s;_(r.drawingContext,l.width*a,n,x,u),r.push(),r.beginShape();for(var c=0;c<2;c++){r.fill(240);for(var h=1;h<d.length-1;h++){var v=d[0==c?h:d.length-1-h],g=0==c?o?v.x1_i:v.x1:o?v.x2_i:v.x2,p=0==c?o?v.y1_i:v.y1:o?v.y2_i:v.y2;r.stroke(f.lineStroke),r.strokeWeight(.003*l.width),r.vertex(g,p)}}r.endShape(CLOSE),r.pop()}function s(t,e,$,n,o,r,l,d){var f=random(-1,1)*PI*.02,_=f,a=R.random_choice([.04,.1,.2,.9]),m=o/128;let s=random(.5,1);random(0,100)>90&&(s*=.1);let x=n,u=$,c=$+PI,h=[],v=t,g=e,p=r,y=[],b=[],w=t,A=e,S=.02*PI;random(0,100)>50&&(S*=2);for(var C=0;C<128;C++){var E=C/127;_+=(f-_)*a,u+=_*p,c-=_*p,random(0,100)>50&&(f=random(-1,1)*PI*S);var k=v+cos(u)*m,D=g+sin(u)*m,M=w+cos(c)*m,P=A+sin(c)*m;y.push(k),y.push(D),b.push(M),b.push(P),v=k,g=D,w=M,A=P,h.push({angle:u,angle_i:c})}let O=[];for(var C=0;C<y.length;C+=2)O.push({x:y[C],y:y[C+1],x_i:b[C],y_i:b[C+1],cx:0,cy:0,x1_i:0,y1_i:0,x2_i:0,y2_i:0,x1:0,x2:0,y1:0,y2:0});for(var C=0;C<O.length-1;C++){var E=C/(O.length-1),T=h[C].angle,U=h[C].angle_i,B=x*lerp(.02*s,s,sin(E*PI));l||(B=x);var I=T-.5*PI,N=T+.5*PI,V=U-.5*PI,z=U+.5*PI;if(void 0!=O[C]){var H=O[C].x+cos(I)*B,L=O[C].y+sin(I)*B,Y=O[C].x+cos(N)*B,j=O[C].y+sin(N)*B;O[C].x1=H,O[C].y1=L,O[C].x2=Y,O[C].y2=j,O[C].x1_i=O[C].x_i+cos(V)*B,O[C].y1_i=O[C].y_i+sin(V)*B,O[C].x2_i=O[C].x_i+cos(z)*B,O[C].y2_i=O[C].y_i+sin(z)*B,O[C].cx=O[C].x,O[C].cy=O[C].y,O[C].angle=T}}return O}setup=function(){$=Math.min(t=(e=window.innerHeight)/1.69,e),n=t/e,o=$/1920,/Android|webOS|MacOs|iPhone|iPad/i.test(navigator.userAgent)?pixelDensity(2):pixelDensity(1),createCanvas(t,e,WEBGL),l=createGraphics(t,e),randomSeed(SEED),noiseSeed(SEED),noLoop(),r=createShader(` precision highp float; uniform mat4 uModelViewMatrix; uniform mat4 uProjectionMatrix; attribute vec3 aPosition; attribute vec2 aTexCoord; varying vec2 vTexCoord; void main() { vTexCoord = aTexCoord; vec4 positionVec4 = vec4(aPosition, 1.0); gl_Position = uProjectionMatrix * uModelViewMatrix * positionVec4; } `,` precision mediump float; varying vec2 vTexCoord; uniform sampler2D textura1; uniform vec2 resolution; uniform float u_black; uniform float u_scale; float hash_1(vec2 n) { return fract(sin(dot(n, vec2(12.9898, 4.1414))) * 43758.5453); } float luma(vec4 color) { return dot(color.rgb, vec3(0.299, 0.587, 0.114)); } float luma(vec3 color) { return dot(color, vec3(0.299, 0.587, 0.114)); } float dither8x8(vec2 position, float brightness) { int x = int(mod(position.x, 8.0)); int y = int(mod(position.y, 8.0)); int index = x + y * 8; float limit = 0.0; if (x < 8) { if (index == 0) limit = 0.015625; if (index == 1) limit = 0.515625; if (index == 2) limit = 0.140625; if (index == 3) limit = 0.640625; if (index == 4) limit = 0.046875; if (index == 5) limit = 0.546875; if (index == 6) limit = 0.171875; if (index == 7) limit = 0.671875; if (index == 8) limit = 0.765625; if (index == 9) limit = 0.265625; if (index == 10) limit = 0.890625; if (index == 11) limit = 0.390625; if (index == 12) limit = 0.796875; if (index == 13) limit = 0.296875; if (index == 14) limit = 0.921875; if (index == 15) limit = 0.421875; if (index == 16) limit = 0.203125; if (index == 17) limit = 0.703125; if (index == 18) limit = 0.078125; if (index == 19) limit = 0.578125; if (index == 20) limit = 0.234375; if (index == 21) limit = 0.734375; if (index == 22) limit = 0.109375; if (index == 23) limit = 0.609375; if (index == 24) limit = 0.953125; if (index == 25) limit = 0.453125; if (index == 26) limit = 0.828125; if (index == 27) limit = 0.328125; if (index == 28) limit = 0.984375; if (index == 29) limit = 0.484375; if (index == 30) limit = 0.859375; if (index == 31) limit = 0.359375; if (index == 32) limit = 0.0625; if (index == 33) limit = 0.5625; if (index == 34) limit = 0.1875; if (index == 35) limit = 0.6875; if (index == 36) limit = 0.03125; if (index == 37) limit = 0.53125; if (index == 38) limit = 0.15625; if (index == 39) limit = 0.65625; if (index == 40) limit = 0.8125; if (index == 41) limit = 0.3125; if (index == 42) limit = 0.9375; if (index == 43) limit = 0.4375; if (index == 44) limit = 0.78125; if (index == 45) limit = 0.28125; if (index == 46) limit = 0.90625; if (index == 47) limit = 0.40625; if (index == 48) limit = 0.25; if (index == 49) limit = 0.75; if (index == 50) limit = 0.125; if (index == 51) limit = 0.625; if (index == 52) limit = 0.21875; if (index == 53) limit = 0.71875; if (index == 54) limit = 0.09375; if (index == 55) limit = 0.59375; if (index == 56) limit = 1.0; if (index == 57) limit = 0.5; if (index == 58) limit = 0.875; if (index == 59) limit = 0.375; if (index == 60) limit = 0.96875; if (index == 61) limit = 0.46875; if (index == 62) limit = 0.84375; if (index == 63) limit = 0.34375; } return brightness < limit ? 0.0 : 1.0; } vec3 dither8x8(vec2 position, vec3 color) { return color * dither8x8(position, luma(color)); } vec4 dither8x8(vec2 position, vec4 color) { return vec4(color.rgb * dither8x8(position, luma(color)), 1.0); } float dither4x4(vec2 position, float brightness) { int x = int(mod(position.x, 4.0)); int y = int(mod(position.y, 4.0)); int index = x + y * 4; float limit = 0.0; if (x < 8) { if (index == 0) limit = 0.0625; if (index == 1) limit = 0.5625; if (index == 2) limit = 0.1875; if (index == 3) limit = 0.6875; if (index == 4) limit = 0.8125; if (index == 5) limit = 0.3125; if (index == 6) limit = 0.9375; if (index == 7) limit = 0.4375; if (index == 8) limit = 0.25; if (index == 9) limit = 0.75; if (index == 10) limit = 0.125; if (index == 11) limit = 0.625; if (index == 12) limit = 1.0; if (index == 13) limit = 0.5; if (index == 14) limit = 0.875; if (index == 15) limit = 0.375; } return brightness < limit ? 0.0 : 1.0; } vec3 dither4x4(vec2 position, vec3 color) { return color * dither4x4(position, luma(color)); } vec4 dither4x4(vec2 position, vec4 color) { return vec4(color.rgb * dither4x4(position, luma(color)), 1.0); } vec2 screenDistort(vec2 uv) { uv -= vec2(.5,.5); uv = uv*1.2*(1./1.2+2.*uv.x*uv.x*uv.y*uv.y); uv += vec2(.5,.5); return uv; } void main() { vec2 uv = (vTexCoord); float noiseAmount = 0.1; float noiseSeed = 0.0; vec4 noise = vec4( mix(-noiseAmount, noiseAmount, fract(noiseSeed + hash_1(uv * 1234.5678))), mix(-noiseAmount, noiseAmount, fract(noiseSeed + hash_1(uv * 876.54321))), mix(-noiseAmount, noiseAmount, fract(noiseSeed + hash_1(uv * 3214.5678))), 0. ); vec2 bkp_uv = uv; const float BARREL = -1.0; const float PINCUSHION = 0.91; float effect = PINCUSHION; float effect_scale = 2.0; uv=uv*2.0-1.0; float d=length(uv); float z = sqrt(1.0 + d * d * effect); float r = atan(d, z) / 3.14159; r *= effect_scale; float phi = atan(uv.y, uv.x); uv = vec2(r*cos(phi)+.5,r*sin(phi)+.5); float distn = distance(vec2(0.5),uv); vec2 uv_noise = uv+noise.rg*distn*(.5*u_scale); vec4 color_n = texture2D(textura1,uv_noise); vec4 color = texture2D(textura1,uv); color.rgb=mix(color.rgb,dither8x8(uv*resolution,color_n.rgb*1.5),smoothstep(0.1,0.7,distn)); vec3 bc = color.rgb; float lu = luma(color.rgb); vec4 outColor = vec4(color+noise*(.5*u_scale)); outColor.rgb=mix(outColor.rgb,vec3(smoothstep(0.3,.9,luma(outColor.rgb))),u_black); gl_FragColor = outColor+noise*.5; }`),f.steps=R.random_int(80,200),f.scaleY=R.random_num(.05,.2)*l.height,f.centered=R.random_num(0,1)>.7,f.lineStroke=R.random_num(50,140),f.black=R.random_num(0,1)>.8,f.bigLeaf=R.random_num(0,1)>.5,f.giantLeaf=!1,f.gridStep=R.random_int(5,20),f.shadowOffset=R.random_num(0,1)>.5;let _=f.steps,a=R.random_dec(0,100),m=R.random_num(.008,.06),s=f.scaleY,x=0,u=0;for(let c=0;c<=_;c++){let h=c/_,v=.5*l.width+sin(a+20*h)*(l.width*m),g=lerp(s,l.height-s,h),p=atan2(g-u,v-x);x=v,f.centered&&(x=.5*l.width),u=g,0==c&&(p=0),d.push({x:v,y:g,z:0,angle:p,dx:0,dy:c/_})}},draw=function(){l.background(0),random(10,20);var t=l.width/f.gridStep;random(2.5,4);let e=2*width,$=2*height;l.blendMode(BLEND),l.push(),l.translate(.5*l.width,.5*l.height),l.translate(-(.5*e),-(.5*$));for(var n=0;n<e;n+=t)for(var x=0;x<$;x+=t)_(l.drawingContext,.02*l.width,color(50),0,0),l.stroke(10),l.fill(0),l.rect(n,x,t,t),a(l.drawingContext);l.pop(),l.push(),d.forEach(t=>{var e=t.x,$=t.y;l.width,l.blendMode(BLEND),l.height,l.width;let n=random(1,10),o=sin(t.dy*PI*n),r=sin(t.dy*PI*n);random(20,80);let d=.1+.1*sin(t.dy*PI),f=l.height*random(.01,.018);random(0,100)>90?f*=4:random(0,100)>50?f*=.9:(f*=.3,d*=1.2),random(0,100)>80&&(d*=4),random(0,100)>90&&(d*=8),random(.1,2);let _=s(e,$,t.angle+.5*PI,f,l.width*d,o,1),x=color(0);x=color(x);let u=lerpColor(x,color(0),1-r);x=lerpColor(x,color(255),r),l.blendMode(BLEND),m(l,_,x,u,!1),m(l,_,x,u,!0);let c=.02*l.width*sin(t.dy*PI);l.stroke(0,100),l.fill(255),l.ellipse(e,$,.5*c,c),l.fill(255),l.noStroke(),a(l.drawingContext)}),l.pop(),background(0,0,255),push(),image(l,-(.5*l.width),-(.5*l.height)),pop(),shader(r),fill(255),r.setUniform("resolution",[width,height]),r.setUniform("u_black",f.black),r.setUniform("u_scale",o),r.setUniform("textura1",l),rect(-(.5*width),-(.5*height),width,height)}; }],[0,()=>{console.log("Artist 47. zancan🌿 -- platform 0");let J=R.R.bind(R),K=r=>r??.5>J(),SA=(e,a,v)=>(e.setAttribute(a,v),e),E=(t,s,n,e,a)=>{e??=n?D.createElementNS(ns,t):D.createElement(t);if(s)for(a in s)a=='t'?e.innerText=s[a]:a=='to'?s[a].appendChild(e):SA(e,a,s[a]);return e},w3=`http://www.w3.org/`,ns=`${w3}2000/svg`, sh=new URLSearchParams(location.search),k='hash',s=e=>sh.get(e),h=s(k)||tokenData[k], dd=(e,n)=>{let s=new XMLSerializer().serializeToString(e),b=new Blob([`<?xml version="1.0" standalone="no"?>`+s],{type:'image/svg+xml'}),u=URL.createObjectURL(b),a=E("a",{href:u,download:n,to:D.body});a.click();a.remove();URL.revokeObjectURL(u)}, iO=o=>typeof o==="object",U=_=>undefined,Q="round", M=Math,PI=M.PI,P2=2*PI,Hy=M.hypot,co=M.cos,si=M.sin,Z=(n,v)=>(n.fill(v??0),n),An=(n,v)=>Z(Array(n),v), I=(n,f)=>{for(let i=0;i<n;i++)f(i)},IJ=(n,m,f)=>I(m,j=>I(n,i=>f(i,j))),Ai=(n,f)=>An(n,0).map((p,i)=>f(i)), N=(x,y,o=iO(x),t)=>(t={x:o?x.x:x,y:o?x.y:y,s:(x,y)=>(t.x=x,t.y=y,t),l:_=>Hy(t.x,t.y),d:p=>Hy(p.x-t.x,p.y-t.y),dt:a=>t.x*a.x+t.y*a.y,a:p=>(t.x+=p.x,t.y+=p.y,t),m:a=>N(t.x-a.x,t.y-a.y),p:(a,b)=>N(t.x+a,t.y+b),u:p=>{let a=p.x-t.x,b=p.y-t.y,l=Hy(a,b);return l?[l,N(a/l,b/l)]:[0]},},t), P=(x,y,z,w=1,o=iO(x),t)=>(t={x:o?x.x:x,y:o?x.y:y,z:o?x.z:z,w,s:(x,y,z)=>(t.x=x,t.y=y,t.z=z,t),l3:_=>Hy(t.x,t.y,t.z),cr3:(a,b,c)=>iO(a)?P(t.y*a.z-t.z*a.y,t.z*a.x-t.x*a.z,t.x*a.y-t.y*a.x):P(t.y*c-t.z*b,t.z*a-t.x*c,t.x*b-t.y*a),dt3:a=>t.x*a.x+t.y*a.y+t.z*a.z,m:a=>P(t.x-a.x,t.y-a.y,t.z-a.z),p:(a,b,c)=>P(t.x+a,t.y+b,t.z+c),nd:u=>(u=t.l3()||1,t.x/=u,t.y/=u,t.z/=u,t)},t), M4=t=>(t={a:An(16),id:_=>(I(16,i=>t.a[i]=i%5?0:1),t),cpy:m=>(t.a=[...m.a],t),cln:_=>M4().cpy(t), r(r,x,y,z){let c=co(r),s=si(r),l=Hy(x,y,z),u=[x/l,y/l,z/l],a=Z(t.a);a[15]=1;I(3,i=>{a[i*4+(i+1)%3]=u[(i+2)%3]*s;a[i*4+(i+2)%3]=-u[(i+1)%3]*s});IJ(3,3,(j,i)=>a[i*4+j]+=(1-c)*u[i]*u[j]+(i==j?c:0));return t}, rot:(r,x,y,z)=>t.cpy(t.mul(M4().r(r,x,y,z))), mul(m){let r=M4(),b=m.a,a=t.a,j=0;for(;j<13;j+=4)I(4,i=>r.a[j+i]=b[j]*a[i]+b[1+j]*a[4+i]+b[2+j]*a[8+i]+b[3+j]*a[12+i]);return r}, mv:(v,r=[],a=t.a)=>(I(4,i=>r[i]=a[i]*v.x+a[i+4]*v.y+a[i+8]*v.z+a[i+12]*v.w),P(...r)), tr(x,y,z){if(iO(x))z=x.z,y=x.y,x=x.x;I(4,i=>t.a[12+i]+=t.a[i]*x+t.a[i+4]*y+t.a[i+8]*z);return t} },t),W=1080,H=W/9*16,u=s('u')||2,nz=(x,y)=>(((1+x/y)*1e6+t0)%10)/10, G=((s,w=W/s|0,h=H/s|0)=>({k:s,w:w,h:h,s:W/w,t:H/h,v:H/h/2,a:An(w*h)}))(8+J()*8|0),l=255, clp=(a,u,v)=>a<u?u:a>v?v:a,srt=(a,b)=>(a<b?[a,b]:[b,a]).map(a=>clp(a,0,G.w-2)), Y=(t=>{t={a:An(G.h),b:-1,c:0,h:G.h,i:_=>{if(t.b>=0)for(let i=t.b;i<=t.c;i++)t.a[i].p=-1;t.b=-1},r:(y,p,q)=>{t.b<0?t.b=t.c=y:y<t.b?t.b=y:y>t.c?t.c=y:0;let[u,v]=srt(p,q),o=t.a[y],i=o.p<0;if(i||u<o.p)o.p=u;if(i||v>o.q)o.q=v}};I(t.h,i=>t.a[i]={y:i,p:-1,q:0});return t})(), cv=E(0,{style:"height:100vh",width:W*u,height:H*u},0,SA(D.body,'style',"margin:0;padding:0").querySelector("canvas")),X=cv.getContext('2d'), F=c=>X.fillStyle=c,C=c=>X.strokeStyle=c,CF=c=>F(c)|C(c),Lw=s=>X.lineWidth=s,BP=_=>X.beginPath(),Fl=_=>X.fill(),Lt=(x,y)=>X.lineTo(x,y),Sk=_=>X.stroke(),xa=(x,a)=>`rgba(${x},${x},${x},${a??1})`,bl=a=>xa(0,a),wh=a=>xa(l,a),gA=a=>X.globalAlpha=a??1, cr3=(r,n)=>Ai(n+1,i=>P(r*co(i*P2/n),0,r*si(i*P2/n))), cr2=(r,n)=>Ai(n+1,i=>N(r*co(i*P2/n),r*si(i*P2/n))), de=(a,e=0,d=1.1,n=M.ceil(e/d),y=-e/2+.5,o=[])=>e<1.5?a:(Ai(n,(i,b)=>{b=a.map(p=>p.p(0,y+i*e/n));o.push(...(i%2?b.reverse():b))}),o), sv,sg=(s,n)=>s?E('g',{name:n,opacity:1,to:s},1):0,su=(x)=>x.toFixed(2),sp=(x,y)=>`${su(x)},${su(y)}`,sl=(a,s,e)=>E("polyline",{points:de(a,e).map(p=>sp(p.x,p.y)).join(' '),to:s},1), Ln=(a,b,c,d)=>sv?E("line",{x1:a,y1:b,x2:c,y2:d,to:sv},1):BP()|Lt(a,b)|Lt(c,d)|Sk(), svc=(x,y,d)=>sl(cr2(d/2,M.max(8,PI*d|0)).map(p=>p.p(x,y)),sv), spi=(x,y,r,q,e)=>{let L=[],t=r,a=0,i,f=e/P2;while(t>q)L.push({x:x+t*co(a),y:y+t*si(a)}),a+=i=1/t,t-=a<P2?0:i*f;sl(L,sv)}, circ=(x,y,d)=>sv?spi(x,y,d/2,.1,1.2):BP()|X.arc(x,y,d/2,0,P2,0)|Fl(), ring=(x,y,d)=>sv?svc(x,y,d):BP()|X.arc(x,y,d/2,0,P2,0)|X.arc(x,y,d/4,0,P2,1)|Fl(), cross=(x,y,d,o=nz(x,y)<.6,k=4*d/G[o?'s':'t']|0,e=.9*d/k,f=(k-1)*e/2)=>{o?x-=f:y-=f;d/=2;Lw(1);Ai(k,i=>o?Ln(x+i*e,y-d,x+i*e,y+d):Ln(x-d,y+i*e,x+d,y+i*e))}, shp,poly=(a,s,e)=>s?sl(a,s,e):BP()|a.map(p=>Lt(p.x,p.y))|Sk(), Dr,iZ,Gp=(x,y,i)=>N((x+.5)*G.s,y*G.t+(i?0:G.v*co(x/3+y/10))), Zi=(x,y)=>G.a[y*G.w+x],Zf=(x,y)=>x>=0&&y>=0&&x<W&&y<H&&!Zi(x/G.s|0,y/G.t|0),Zb=(x,y)=>iZ&&Zi(x,y)?0:(G.a[y*G.w+x]=1,Gp(x,y)), nL=(l,w=[])=>(l?.push(w),w), DR=(y,x,b,p)=>{for(;x<=b;x++)if(p=Zb(x,y))shp(p.x,p.y,Dr(x,y))}, DL=(y,x,b,r=Dr(x,y,1)*.9)=>{let l=[],v,p,s=G.s/2-r/2;Lw(r);for(;x<=b;x++)(p=Zb(x,y))?(v??=nL(l),v.push(p)):v=U();l.map(v=>poly([v[0].p(-s,0),...v,v[v.length-1].p(s,0)],sv,r))}, sT=s('txt')??"GALAXY/VENICE BEACH/NEW YORK/BERLIN/LONDON/MEXICO CITY/TOKYO/BUENOS AIRES/PARIS/VENEZIA/".replaceAll('/','-------'),nT=sT.length, e=1.1,c='i2803003073i8ii8',o='i3703003073i7ii7i3',T={_:{R:.45,e:e,i:1,E:-.05,V:.07,P:1.05},A:['0i5Eii-1797',1.2],B:['00809193840494i5i99i0i-000i',e],C:c,D:'000i7ii7i37000',E:'i0000iii-0484',F:['i0000i-0474',1],G:[`${c}i555`,e],H:'000i-i0ii-04i4',I:'505i-2080-2i8i',J:'i0i88i2i08-80e0',K:'000i-9005-43ii',H:'000i-04i4-i0ii',L:['000iii'],M:['0i0054i0ii',1],N:['0i0Viii0'],O:o,P:['000i-0080i2i48606',e],Q:[`${o}-77ee`,e],R:['000i-0090i1i39404-64ii',e],S:'91801001042585i6i98i1i09',T:'00i0-505i',U:'00082i8ii8i0',V:['005ii0',e],W:'002i568ii0',X:['00ii-0ii0',e],Y:['i05500-555i',e],Z:['00P00iii',e],'/':'0ii0','-':['07i7',.8],'.':['3iRi',.5],}, cT=(b,q)=>{let o=[],L=nL(o),i=0,l=T[b],a=l&&Array.isArray(l)?l:l?[l]:0,s=a?a[0]:0,n=s?.length|0,k=a?a[1]??.9:0,c=(i)=>T._[s[i]]??s[i]/10;while(i<n)s[i]=='-'?(i++,L=nL(o)):L.push(N(c(i++)*G.s*k*q,c(i++)*G.t*q));return o}, DT=(y,x,b)=>{let p,L,m=M.min(.7,Dr(x,y)/G.t),s=sT;Lw(1);for(;x<=b;x++)if((p=Zb(x,y))&&(L=cT(s[(x+((2+y%10)*t0)%nT+y*y|0)%nT],m)))L.map(l=>poly(l.map(q=>q.a(p)),sv))}, rowf=DR, mk=(ps,o=[],i=0,q,L)=>(ps.map(p=>{if(q){let x=0,[l,u]=q.u(p),a=N(q),b=c=>L.push(c),j;for(;x<l;x++,a.a(u)){if((j=Zf(a.x,a.y))!=i){j?o.push(L=[N(a)]):b(a.m(u));i=j}}if(L&&j)b(p)}q=p}),o), tri=(A,B,C)=>{let[a,b,c]=[A,B,C].sort((a,b)=>a.y<b.y?-1:1),i,y,w,v,k,x,s=(q,r)=>{if(y=r.y-q.y)for(w=(r.x-q.x)/y,v=q.x,x=a.x+(q.y-a.y)*k,i=q.y;i<=r.y;i++,v+=w,x+=k)if(i>0&&i<G.h)Y.r(i,v|0,x|0)};if(c.y>a.y)k=(c.x-a.x)/(c.y-a.y),s(a,b),s(b,c)}, squ=(A,B,C,D)=>tri(A,B,C)|tri(A,C,D), cube=(w,h,d)=>{let v=[],i=0,N=(k,l)=>i&k?l/2:-l/2;for(;i<8;i++)v.push(P(N(1,w),N(2,h),N(4,d)));return {t:0,v:v,h:h,d:d,f:[[0,4,6,2],[1,3,7,5],[0,1,5,4],[2,6,7,3],[0,2,3,1],[4,5,7,6]]}}, rf=requestAnimationFrame,tm0,ni=5,nj=10,wi=W/ni,wj=H/nj,O=N(W/2,H*.7),nr=wi/2,fr=.9e3, p2D=(p,z=p.z/30)=>N(p.x-z/2,H-p.y+z), pj=(p)=>(p.z<nr?N(O.x+fr*(p.x-O.x)/(1+nr-p.z),O.y-fr*(p.y-O.y)/(1+nr-p.z)):p2D(p)), gr=_=>'#64966E',bs=[[gr(),wh,bl,0],['#D66086',wh,bl,0],['#F5F6F3',bl,bl,0],[bl(),wh,K()?gr:wh,l]], Os=[],[bg,ln,cR,bn]=bs[J()*bs.length|0], lt,Lts=P(-1,1,-1).nd(),t0=0, dtf=(r=J())=>r<.7?(x,y,l)=>(1.5+lt*G.t*(1+(l?0:nz(x,y))))*.6:(x,y,l)=>(1.5+lt*G.t*(l?.7:1)) ,py=u<3, petal=(sz,a,r,m,k=.5+J()/2,q=m.mul(M4().r(a,0,1,0)))=>cr3(1,20).map(p=>q.mv(p.s(sz*p.x/3,sz/2*k*si((1+p.z)/2*PI/2),(p.z/2+.5)**.6*sz+r))), stem=(sz,n=20,d=sz/n,x=0,y=0,a=0,b=PI*(J()-.5)/n)=>Ai(n,i=>P(x+=d*si(a),y+=d*co(a+=b),0)), ft=(i,q=J())=>(q<.2&&i)?DT:q<.8?DR:DL console.log(`seed:${h}\n\nPress [s] for plottable SVG\n\n- Z🌿`) X.scale(u,u) X.lineCap=Q cv.onclick=_=>py^=1 IJ(ni,nj,(i,j,p,o,k=j/(nj-1))=>{ Os.push(o={...cube(wi*(.1+J())/3,wj*(1+k*J()*nj),wi*J()), tr:p=P(O.x+(i-ni/2+J())*wi/3,(j/2+6)*wj,-(wj+H*(k**1.3))),clr:cR(),k:{rx:(J()-.5)*PI*.7,ry:0*PI*J()},ks:N(0,J()*PI),iz:K(.9),ctr:J()<.4}) let c=P(0,e*o.h+wj*J(),1),m=M4().id().tr(c).rot(PI/6,1,0,0),r=10,rp=30,np=6+8*J()|0 K()?Os.push({t:1,tr:P(p.x,p.y,p.z-o.d/2),Ls:[[P(0,0,0),c],cr3(r,20).map(p=>m.mv(p)),...Ai(np,i=>petal(rp,i*P2/np,r,m))]}) :(K()||k<.2)?I(5,k=>Os.push({t:1,tr:P(p.x+(J()-.5)/3*wi,p.y,p.z+(J()-.5)*o.d),Ls:[stem((J()+1)*c.y/2)]})):0 o.tr.y+=o.h*.4 }) Os.sort((a,b)=>a.tr.z<b.tr.z?1:-1) let B=_=>{F(bg),X.fillRect(0,0,W,H)},cvi,xi,B2=_=>{ let w=G.w/10*G.s*u|0,h=cv.height,x,y,a,b,e if(!xi){let id=new ImageData(w+1+G.s*u|0,h),p=id.data,t=0,q=K(),r=K();IJ(id.width,h,(i,j)=>{p[t]=p[t+1]=p[t+2]=bn;p[3+t]=J()*(200+(50*co((q*j/u+r*60*i/w|0)*P2/6))|0)*(h-j)/h|0;t+=4});xi=(cvi=E('canvas',{width:cv.width,height:h})).getContext('2d');xi.putImageData(id,0,0),id=null} IJ(G.w,G.h,(i,j)=>{if(e=(2*!Zi(i,j)+!Zi(i-1,j))/3)x=i*G.s|0,y=j*G.t|0,a=((i+1)*G.s|0)-x,b=((j+1)*G.t|0)-y,gA(e),X.drawImage(cvi,(x%(w/u|0))*u,y*u,a*u,b*u,x,y+(e<1?(1-e)*J()*G.t:0),a,b)});gA() }, Ut=(tm,s)=>{ let dt=M.min(.2,(tm-(tm0??tm))/1e3),m4,ol=[] const f=[(c)=>{ m4=M4().id().tr(c.tr).rot(c.k.rx,1,0,0).rot(c.k.ry,0,1,0); c.vt=c.v.map(v=>m4.mv(v)) c.vp=c.vt.map(v=>pj(v)) c.vg=c.vp.map(v=>N(v.x/G.s|0,v.y/G.t|0)) c.f.map(f=>{let p=f.map(i=>c.vp[i]),[u,v,w]=p;if((f.ff=((v.x-u.x)*(w.y-u.y)-(v.y-u.y)*(w.x-u.x))<0)&&c.ctr)ol.push(...mk([...p,p[0]]))}) c.f.map(f=>{if(f.ff){ let[u,v,w]=f.map(i=>c.vt[i]),n=v.m(u).cr3(w.m(u)).nd() lt=(.5-n.dt3(Lts)/2)**2 Dr=(f.r??=dtf());rowf=f.rf??=ft(c.iz);shp=f.rs??=((r)=>r<.6?ring:r<.8?cross:circ)(J()) CF(c.clr);Y.i() squ(...f.map(i=>c.vg[i])) if(Y.b>=0)for(let p,i=Y.b;i<=Y.c&&(p=Y.a[i++]);)if(p.p>=0)rowf(p.y,p.p+1,p.q); }}) c.k.ry+=dt*c.ks.y },(c)=>{if(!c.vt){m4=M4().id().tr(c.tr);c.Ls.map(L=>{L.vt=L.map(v=>m4.mv(v));L.vp=L.vt.map(v=>pj(v))})}c.Ls.map(L=>ol.push(...mk(L.vp)))}] tm0=tm if(py||s||!t0){ s?0:B();Z(G.a); sv=sg(s,'fills') Os.map(c=>{iZ=c.iz;f[c.t]?.call(c,c)}) Lw(1);B2();C(ln()) let g=sg(s,'lines') ol.map(L=>poly(L,g)) } if(!s)t0+=dt;rf(Ut) } rf(Ut) D.addEventListener('keypress',e=>{if(e.key=='s'){let m=20,s=E("svg",{xmlns:ns,version:"1.1",width:`236mm`,height:`420mm`,viewBox:[-m,-m,W+2*m,H+2*m].join(' '),stroke:"black",fill:"none","stroke-width":1,opacity:1,'stroke-linecap':Q,"stroke-linejoin":Q},1);py=0;Ut(tm0,s);dd(s,"z.svg")}}) }],