0x18b75119…b783sent to0x381233d5…7acd·#19,623,340·view on Etherscan
[0,()=>{console.log("Artist 1. Piter Pasma -- platform 0");O={N:1200,...Object.fromEntries(new URL(location).searchParams)};as=9/16;R=R.R;T=a=>R(a)-R(a);P=a=>R(R(a));r=(a,x=1,y=1)=>`mat2(${a*=u,[cos(a)*x,-sin(a)*x,sin(a)*y,cos(a)*y]})`;F=(N,f)=>[...Array(N)].map((_,i)=>f(i));S=(a=1)=>R()<.5?a:-a;W=f=>`W(${F(3,_=>f())})`;g=a=>W(_=>S(a*1.5**R()));p=_=>W(_=>R(u));m=(a=1)=>W(_=>a*S(2+R()));({min,PI,sin,cos}=Math);u=PI*2;N=([x,y,z],m=1e-99+(x*x+y*y+z*z)**.5)=>[x/m,y/m,z/m];A=([x,y,z],[a,b,c],t=1)=>[x+a*t,y+b*t,z+c*t];L=([x,y,z])=>(x*x+y*y+z*z)**.5;X=([x,y,z],[a,b,c])=>[y*c-z*b,z*a-x*c,x*b-y*a];Z=(1.2+T(.1));cp=[R(60)-30,10+R(20),-80*Z];a=T(.1);fw=N(A([0,27,0],cp,-1));rt=N(X(fw,[sin(a),cos(a),0]));up=X(rt,fw);fw=fw.map(v=>v*Z);c=(x,y,t)=>A(cp,N(A(A(fw,rt,as*x),up,y)),t);[px,py,pz]=c(T(.5),T(.5),120+T(96));sl=R()**.5;e=[[T(.5),a=1/6],[T(.5),-a],[-a,T(.5)],[a,T(.5)]];d=132+R(24);f=i=>([x,y,z]=c(...e.splice(R(e.length)|0,1)[0],d),R()<.2?px=x:0,R()<.2?py=y:0,R()<.2?pz=z:0,i==3?p0=[x,y,z]:0,tsl=T(sl),sx=S(),sy=S(),`k(W(p.xy*${r(tsl/u,-sx,-sy)}+V(${[x*sx,y*sy]}),${d-=19+R(),z}-p.z))`);ch=c(R()-.5,R()-.5,50);ch.pop();pw=2+T(1);c0=20+T(9);c1=5+T(2);rp=T()<0;rr=.3+P();K=`~ph precision highp~uf uniform~T return~S smoothstep~N normalize~L length~cl clamp~Z floor~B abs~U min~G max~W vec3~V vec2~X vec4~F float~E 1e-2~MAXD 240~O ${u}~H0 uvec4(9,7,5,3)*23205u~D gl_VertexID\nph int;ph F;`.replace(/~/g,`\n#define `);v=K+`in V u;out X c;uf V r;uf uint I,R;uf sampler2D K;F sqr(F x){T x*x;}W sqr(W x){T x*x;}F pow5(F x){T x*sqr(sqr(x));}F U2(V v){T U(v.x,v.y);}F U3(W v){T U(U(v.x,v.y),v.z);}F G3(W v){T G(G(v.x,v.y),v.z);}F k(F a,F b){T L(G(V(a,b),0))+U(G(a,b),0);}F k(W q){T L(G(q,0))+U(G3(q),0);}W C(F h){h*=O;W c = .5+.3*sin(h+.5*sin(h+5.3)+W(-1,0,1.2));c-=.4*U3(c)+.2*c.gbr;T S(0.,1.,c*1.5)+.02;}W sin3(W x){x=sin(x);T x*x*x;}${F(3,i=>`F w${i}(W p){W q=sin(p.xyz*${g(1)}+${p()}+${m()}*sin3(p.yzx*${g(.618)}+${p()}));p+=q.zxy*${m(.15)};T dot(q,sin(p.zxy*${g(1.618)}+${p()}+${m()}*sin3(p.zyx*${g(1)}+${p()})));}`).join``}F wx(W p){T w0(p)+w1(p*2+77)/2+w2(p*4-97)/4;}uvec4 H;X Q(){H.wxyz*=H*22695477u^H0;T X(H<<(3u+(H>>29u)))/${2**32};}V DT(W p) {V d=V(${F(3,i=>'U('+f(i))},${f(3)})))-3,1);F f=k(L(p+W(${T(150)},${t=150+R(999)},0))-${t-pw*2},${pw*6}-d.x)-${pw*2},n=S(-2,2,w2(p*W(.15,.08,.05)+23))+3;d=d.x<f?d:V(f,2);d.x-=2;F d2=d.x*d.x,h=L(V(sqrt(d2+sqr(${rp?`p.x+`+-px:`p.y+`+-py}))+${-pw}*2,${ry=rp?`p.y`:`p.x`}-Z(${ry}/4)*4-2))+${-rr};d.x=k(d.x+n+1,${c1}-B(L(p.xy-V(${ch}))+${-c0}))-1;f+=n-2;d=d.x<f?d:V(f,2);f=sqrt(d2+U3(sqr(p-W(${[px,py,pz]}))))*.85+${-pw*.85};d=d.x<f?d:V(f,3);T d.x<h?V(k(.2+${rr}-h,d.x+.2)-.2,d.y):V(h,4);}W rc,dc;V e;void gm(W p){W q=p;q.yz*=${r(R())};q.xy*=${r(R())};F ma=DT(p).y,nb=wx(p.yzx*.4+17),nz=wx(q.zxy*.2-22),na=wx(q*.07-99),no=wx(p*.02+93),sk=step(.7,wx(q*W(1,37,1)/3)),sz=sk*S(-1,3,no);W g3=sin(W(nb,nz,na)*7+${p()}),s=W(${[.15+R(.1),.15-R(.05),.1-R(.05)]});nb=S(-3,3,nb);nz=S(-3,3,nz);na=S(-3,3,na);no=S(-3,3,no);F f=S(.4,.7,nz)*S(1,.7,nz),k=g3.x*g3.y*g3.z*nz,a;e=V(.01,.1);rc=W(1);if(ma==1){a=.2*nz+.3*na+.1*nb;e=V(.06-.05*S(.1,.5,a),.5);dc=mix(W(${.5-P(.5)}*no*no),s,a);rc=W(.4);}else if(ma==2){e=V(.08-.03*sin(9*na),.3-.1*na-.1*nz);dc=W(.25,${.1+R(.15)},${.1+P(.1)})-(9*na-5*nz-3*nb)*.005;rc=W(1);}else if(ma==3){a=S(1,2,nb*3);e=V(.98-.07*f+.02*sk,.01+.05*a);rc=W(.25,.3,.36)*(.9-.4*B(a-.5))*(1-.5*f+.1*sk);dc=s*(.9-.4*B(a-.5));}else if(ma==4){e=V(.75-.5*f+.05*sk,.01+.1*nb+.3*f);rc=W(.95,${.2+R(.6)},.1)*${b=.2+R(.7)}*(.2+.2*nb)*(1-.8*f);dc=s.brg*${b}*(.2+.3*nb)*(1-.5*f);k+=${R(.3)}+(na-.5)*.1;}if(ma<3){if(k>.6){e=V(nb,nz*.5);rc=W(.7);}}else{e=mix(V(e.x,mix(e.y,.4-.3*nz,sz)),V(.005,.3),step(.2,k));dc=mix(rc,dc*.5,step(.2,k)*S(.8,.5,k));rc*=1+sz*(.1+.2*nz);rc=mix(rc,W(.1),.5*G(0,1-3*e.x));}}W bg(W g){W pg=W(g.xy/g.z,25);F so=wx(pg*W(${.5+R(1.5)},7,1))*.15,sm=S(-2,2,so);F t=S(-.7,1,g.y+so);t=2*t-t*t;F h0=${h0=R()};W ca = ${.05+R(.1)}+C(h0);W cc=${.1+R(.2)}+C(h0+${T(.2)})*${.2+R()};W k=3*t*(ca+t*(${t=R()<.5?0:1}-2*ca+t*(cc/3+ca-${t})))+.2*t;W s=C(h0+.1),u=C(h0-.4);F s0=G(0,dot(g,W(${N([sux=S(1+R(9)),1+P(9),-5])}))),s1=G(0,dot(g,W(${N([(1+R(9))*(sux<0?1:-1),.5+P(5),-3])})));k=mix(k,(1+s)*(2+s0)*${.2+P(4)},pow5(S(${[R(-.5)-.5,.5+R(.5)]},so)));s=(.5+s)*S(.9*(1-.3*sm),1,pow5(s0))*(1-.8*sm);u=(.5+u)*S(.9*(1-.3*sm),1,pow5(s1))*(1-.8*sm);T k*${.03+R(.12)}+s*8+u*20;}F ix(W p, W g){F t=E*4,d;for(F i=0;i<299;i++){d=DT(p+g*t).x;t+=d*.9;if(d<E){T t+d;}if(t>MAXD)T MAXD;}T -1;}W tx(V p){X v=texture(K,p);T v.rgb/v.a;}void main(){H=H0*packSnorm2x16(u)^R;Q();`;h=min(innerWidth/as,innerHeight);w=as*h|0;h|=0;V=document.querySelector`canvas`;V.parentNode.style.background='#000';V.style.width=w+'px';V.style.height=h+'px';m=(O.M||1)*devicePixelRatio;V.width=w=w*m|0;V.height=h=h*m|0;g=V.getContext`webgl2`;g.getExtension`EXT_color_buffer_float`;Q=[`X d=Q()*1.5;d.z*=O;F t=1,px=1/r.x;V as=r*px;W fc=W(1),rg=W(${rt}),up=W(${up}),go=W(cos(d.z),sin(d.z),0)*sqrt(d.w)*${.4/Z/Z},o=W(${cp})+go.x*rg+go.y*up,g=N(W((d.xy*3-1.5+u*r)*px,2));g.xy+=N(g*${L(A(p0,cp,-1))}/2-go).xy;g=N(mat3(rg,up,2*W(${fw}))*g);for(F l=0;l<5;l++){t=ix(o,g);if(t<0){fc*=0;break;}if(fract(d.w*9)>sqr(sqr(9-t*9/MAXD)))break;o+=g*t;d=Q()*X(1,O,2,1);d.z--;W n=N(${F(4,j=>`W(${t=F(3,i=>(j<3?(i==j)*2-1:1)/999)})*DT(o+W(${t})).x`).join`+`});W rs=W(V(cos(d.y),sin(d.y))*sqrt(1-d.z*d.z),d.z);F rso=dot(n,rs)<0?-1:1;gm(o);bool re=d.x<e.x+(1-e.x)*(pow5(1+dot(n,g)));fc*=re?rc:dc;g=N(re?reflect(g,(n+e.y*rs*rso)):rs+n);o+=.3*n;}c=texelFetch(K,ivec2((.5*u+.5)*r),0i)+X(fc*bg(g),.6);}`,`W e=tx(u*.5+.5);W t=W(Q());F p=F(I)/${O.N-1},n=p<1?32:256;W TW=W(0),WI=W(0);for(F i=0;i<n;i++){V d=fract(i*V(.57,.755)+t.xy)-.5;W f=tx(u*.5+.5+d*8/r),dc=e-f,w=W(1e-9+exp(-dot(d,d)*27-dot(dc,dc)*55));TW+=w;WI+=f*w;}WI/=TW;WI=mix(mix(e,WI,F(I)/${O.N-1}),W(step(u.x,p*2-1)),step(p<1?.99:2,u.y));c=X(pow(clamp((WI*(2.51*WI+.03))/(WI*(2.43*WI+.59)+.14),0,1),W(1/2.2))+t/256,1);}`].map((s,i)=>(C=(y,c)=>(y=g.createShader(y),g.shaderSource(y,c=`#version 300 es\n`+c.replace(/([^a-z_0-9.])([0-9]+)(?=[^.0-9ux])/gi,'$1$2.').replace(/([0-9.]e-[0-9]+|([0-9]+(?=\.i)))\.i?/gi,'$1')),g.compileShader(y),y),g.attachShader(p=g.createProgram(),C(t=35632,v+s)),g.attachShader(p,C(t+1,K+`out V u;void main(){u=V(-1);D<2i?u[D]=3:0;gl_Position=X(u,0,1);}`)),g.linkProgram(p),[p,[...'rIRK'].map(n=>g.getUniformLocation(p,n))]));B=F(2,i=>(g.activeTexture(33984+i),g.bindTexture(t=3553,x=g.createTexture()),g.texImage2D(t,0,34836,w,h,0,6408,5126,null),F(4,i=>g.texParameteri(t,10240+i,i<2?9728:33071)),g.bindFramebuffer(q=36160,b=g.createFramebuffer()),g.framebufferTexture2D(q,q-96,t,x,0),b));g.viewport(0,0,w,h);I=0;x=new Uint8Array(4);f=_=>(Q.map(([p,c],i)=>(g.bindFramebuffer(q,i?null:B[I&1]),g.useProgram(p),[w,I,R(2**32),I&1^1^i].map((v,i)=>g['uniform'+'2f01ui01ui01i'.split(0)[i]](c[i],v,h)),g.drawArrays(4,0,3))),I++,g.readPixels(1,1,1,1,6408,5121,x));(k=_=>I<O.N?setTimeout(k,1,f()):0)()
}],[1,()=>{console.log("Artist 28. Anna Lucia -- platform 1");let art;
let theShader;
let vertShader = `
attribute vec3 aPosition;
attribute vec2 aTexCoord;
varying vec2 vTexCoord;
void main() {
vTexCoord = aTexCoord;
vec4 positionVec4 = vec4(aPosition, 1.0);
positionVec4.xy = positionVec4.xy * 2.0 - 1.0;
gl_Position = positionVec4;
}`;
let fragShader = `
#ifdef GL_ES
precision mediump float;
#endif
varying vec2 vTexCoord;
uniform sampler2D tex0;
uniform float u_s;
uniform vec2 u_res;
#define PI 3.14159265359
float map(float x, float imin, float imax, float omin, float omax) {
return imin + (x-omin)*((imax-imin)/(omax-omin));
}
mat2 rotate2d(float a){
return mat2(cos(a),-sin(a),
sin(a),cos(a));
}
void main() {
vec2 uv = vTexCoord;
uv.y = 1.0 - uv.y;
uv.y *= u_res.y/u_res.x;
uv.x = map(uv.x, 0.15, 0.85, 0.0, 1.0);
uv.y = map(uv.y, 0.15, 0.85, 0.0, 1.0);
float r = 1.0;
float cf = 0.0;
float a = 0.0;
vec4 col = vec4(1.0);
uv -= vec2(0.5, 0.5*u_res.y/u_res.x);
uv = rotate2d(u_s) * uv;
uv += vec2(0.5, 0.5*u_res.y/u_res.x);
for (int i = 0; i < 50; i++) {
uv -= vec2(0.5, 0.5*u_res.y/u_res.x);
a = float(i)*PI*0.001;
uv = rotate2d(a) * uv;
r -= 0.001*float(i);
cf = smoothstep(0.0,0.1,length(uv)-r);
uv += vec2(0.5, 0.5*u_res.y/u_res.x);
col = mix(texture2D(tex0, uv),col,cf);
}
gl_FragColor = vec4(col);
}`;
let pals = [
{
colors: [
"#FF8B22",
"#FFCE43",
"#FF6EA6",
"#FF0D81",
"#D7C7DE",
],
prob: [0.1,0.05,0.25,0.2,0.4],
},
{
colors: [
"#02B7C7",
"#D0B3F4",
"#7E69E8",
"#7E5D8E",
"#F0E8D7",
"#C4CFCF",
],
prob: [1/12,1/6,1/6,3/12,1/6,1/6],
},
{
colors: [
"#00AF57",
"#FF0000",
"#0070F6",
"#fbbb00",
"#FF9D00",
],
prob: [0.2,0.2,0.2,0.2,0.2],
},
{
colors: [
"#FF8B22",
"#FFCE43",
"#FF6EA6",
"#FF0D81",
"#77c39c",
"#00AF57",
"#D7C7DE",
"#EEE8DB",
"#C4CFCF",
],
prob: [0.12, 0.12, 0.12, 0.12, 0.13, 0.1, 0.03, 0.07, 0.07, 0.07],
},
{
colors: [
"#FF8B22",
"#FFCE43",
"#FF0D81",
"#00AF57",
"#FF80D2",
"#FFCFEF",
"#EEE8DB",
],
prob: [1/7,1/7,1/7,1/7,1/7,1/7,1/7],
},
{
colors: [
"#FFCFEF",
"#FF80D2",
"#FFCE43",
"#FF9D00",
"#00AF57",
"#FF0000",
"#0070F6",
"#C4CFCF",
"#E8EBEA",
],
prob: [0.05, 0.05, 0.075, 0.075, 0.15, 0.15, 0.125, 0.1, 0.1],
},
];
let pal, cP = [], bgC, tE, sp, pts = [], ptsS = [];
let cM, matchbgC, sP, start;
setup = function() {
setAttributes('antialias', true);
setAttributes('perPixelLighting', true);
createCanvas(windowWidth,windowHeight,WEBGL);
pixelDensity(displayDensity(2));
frameRate(30);
sp = 240;
theShader = createShader(vertShader,fragShader);
S = Uint32Array.from([0, 1, s = t = 2, 3].map(i => parseInt(tokenData.hash.substr(i * 8 + 5, 8), 16)));
R = (a = 1) => a * (t = S[3], S[3] = S[2], S[2] = S[1], S[1] = s = S[0], t ^= t << 11, S[0] ^= (t ^ t >>> 8) ^ (s >>> 19), S[0] / 2 ** 32);
cP = []
pal = pals[floor(R(pals.length))];
bgC = pal.colors[floor(R(pal.colors.length))];
background(bgC);
art = createGraphics(windowWidth,windowHeight);
art.background(bgC);
art.strokeCap(SQUARE);
cM = R();
matchbgC = R();
if (cM < 0.15) {
matchbgC = 0.1;
}
sP = R();
rP = R();
nHps = 0;
nHps = 1;
columns = 5 + floor(R(10));
rows = 5 + floor(R(10));
nL = floor(R(3)) + 3;
detptsS(1,1,0, R())
cPPicker()
pts = [];
for (let j = 0; j < ptsS.length; j++) {
if (rP < 0.5) {
columns = 4 + floor(R(10));
rows = 4 + floor(R(10));
cPPicker()
}
for (let i = 0; i < nL; i++) {
if (cM >= 0.35) {
cPPicker()
}
let stringThickness = 0.85 - i*0.1;
if (sP > 0.75) {
stringThickness = 1 - i*0.15;
}
let patch = new Patch(ptsS[j].x,ptsS[j].y,ptsS[j].w,ptsS[j].h,columns,rows, stringThickness);
pts.push(patch);
tE = (frameCount/sp)*TWO_PI;
}
}
start = R(TAU);
}
draw = function() {
background(bgC);
tE = (frameCount/sp)*TWO_PI;
for (let i = 0; i < pts.length; i++) {
let patch = pts[i];
patch.display();
}
shader(theShader);
theShader.setUniform('tex0', art);
theShader.setUniform('u_s',start);
theShader.setUniform('u_res', [art.width,art.height]);
rect(0,0,width,height);
}
class Patch {
constructor(x_pos, y_pos, w_, h_, columns, rows, stringThickness) {
this.grid = [];
this.x_pos = x_pos;
this.y_pos = y_pos;
this.w = w_;
this.h = h_;
this.sw = stringThickness;
this.columns = columns;
this.rows = rows;
let c1 = color(cP[0]);
let c2 = color(cP[1]);
if (sP > 0.65) {
c1.setAlpha(70);
c2.setAlpha(70);
}
this.dx = this.w/this.columns;
this.dy = this.h/this.rows;
if (cM > 0.6) {
cPPicker()
}
for (let i = 0; i < this.rows; i++) {
if (cM > 0.85) {
cPPicker()
}
let band = {
x: this.x_pos,
y: this.y_pos + i*this.dy + this.dy/2,
c1 : c1,
c2 : c2,
C : R(TWO_PI),
B : 0.7 + R(0.4),
dir : 1,
};
this.grid.push(band);
}
if (cM > 0.6) {
cPPicker()
}
for (let i = 0; i < this.columns; i++) {
if (cM > 0.85) {
cPPicker()
}
let band = {
x: this.x_pos + i*this.dx + this.dx/2,
y: this.y_pos,
c1 : cP[0],
c2 : cP[1],
C : R(TWO_PI),
B : 0.7 + R(0.4),
dir : 0,
};
this.grid.push(band);
}
shuffleArray(this.grid);
}
display() {
for (let j = 0; j < this.grid.length; j++) {
let g = this.grid[j];
if (g.dir > 0.5) {
art.strokeWeight(this.sw*this.dy);
linearGradient(
this.x_pos + this.w*0.3 + cos(g.B*(tE + g.C))*this.w*0.7,
this.y_pos,
this.x_pos + this.w*0.7 + cos(g.B*(tE + g.C))*this.w*0.7,
this.y_pos,
g.c1,
g.c2
);
art.line(g.x,g.y,g.x + this.w,g.y);
} else {
art.strokeWeight(this.sw*this.dx);
linearGradient(
this.x_pos,
this.y_pos + this.h*0.3 + cos(g.B*(tE + g.C))*this.h*0.7,
this.x_pos,
this.y_pos + this.h*0.7 + cos(g.B*(tE + g.C))*this.h*0.7,
g.c1,
g.c2
);
art.line(g.x,g.y,g.x,g.y + this.h);
art.strokeWeight(this.sw*this.dx*0.5);
}
}
}
}
function detptsS(per, nHps,ran_rectangles) {
ptsS = []
let verticalPatch
for (let j = 0; j < nHps; j++) {
verticalPatch = {
w: (width/nHps)*per,
h: height,
x: (width/nHps)*(j + (1-per)/2),
y: 0,
}
if ((ran_rectangles < 0.7)) {
ptsS.push(verticalPatch);
}
}
shuffleArray(ptsS);
}
function colorPick(t, i) {
let h = R(),
r = 0;
for (let e = 0; e < t.length - 1; e++) {
let s = t[e];
if (h < (r += i[e]))
return s
}
return t[t.length - 1]
}
function cPPicker() {
cP[0] = colorPick(pal.colors,pal.prob);
cP[1] = cP[0]
while (cP[1] == cP[0]) {
cP[1] = colorPick(pal.colors,pal.prob);
}
colorPick(pal.colors,pal.prob);
if (matchbgC < 0.5) {
cP[0] = bgC;
while (cP[1] == cP[0]) {
cP[1] = colorPick(pal.colors,pal.prob);
}
}
}
function linearGradient(sX, sY, eX, eY, colorS, colorE){
let gradient = art.drawingContext.createLinearGradient(
sX, sY, eX, eY
);
gradient.addColorStop(0, colorS);
gradient.addColorStop(1, colorE);
art.drawingContext.fillStyle = gradient;
art.drawingContext.strokeStyle = gradient;
}
windowResized = function() {
resizeCanvas(windowWidth, windowHeight);
}
function shuffleArray(array) {
var m = array.length, t, i;
while (m) {
i = floor(R() * m--);
t = array[m];
array[m] = array[i];
array[i] = t;
}
return array;
}
}],