_='f(i g)g[i[0]+i[6]]=g;with(g@P=cP(+1"tribute ZPgl_Positi=P;"pEcisi highp UT# RZSZO# a=zxy;# b=a/R-.5;Y=;Uc=J; 4;++d@Ue=OX<?J3:(T-OX|9+J3;Uf;Ug*9.f,-f+,-f-,f,-f,--;} 99;d++@b=#(Yx-y*y,Yy*2.+.7+J01if(Kb,b)>4.@c+=(d|;bEak;}}l=4(^26.,120.,$*c+fGcK^K#(17L3a)|^,7,97.)$,lojugjvA(i=u=0L,5120,bfcB(eV(0))QbDInt8ArGy.of(-QQQ-Q-135044)abc=new AudioCtext,d=c.cEeOscill(zcnecKc.de~iz~arK(f=e=>{1T"e2R"nerWidth,nerHeight&S`a&O`bmousewn=g=>1<b[i=++i%4]?(a=b=Mh.Gnm(u=1):b=e;zfEquency.value=261*u*!this.dump;dr(6,u=0,4Eque~AnimiFGme(f)})()};unifmvecflo;c+=/abs(di~ance(b,#(f(gfj,");}"ce(AaSj,A f(t d=0;d<R.x/R.y;void ma(@*s(T/9)g))-e)*J07=[2LLL],),1.sS(A=cS(FN99.gl_FGgCo=mod(SX,)*.8-.4inatonb.[i]; (34962,or#2$|255.&g.4@){EreGraJ.0Kt(L,2Q1,U X[d]Yx*Z4 ^3(`"...j(Pzd.|)/~stdo';for(Y in $='~|zj`^ZYXUQLKJGE@&$# ')with(_.split($[Y]))_=join(pop());eval(_)
// Zolmeister
// https://zolmeister.com
// magic numbers are WebGL constants
// init borrowed from http://js1k.com/2017-magic/demo/2851
for(i in g)g[i[0]+i[6]]=g[i];
with(g) {
P = cP()
// Shaders compressed via https://github.com/stackgl/glsl-min-stream
sS(A = cS(FN+1), `
attribute vec4 P;
void main() {
gl_Position = P;
}`)
ce(A)
aS(P, A)
// note: RegPack broke on the shader string, fell back to JSCrush
// http://www.iteral.com/jscrush/ https://siorki.github.io/regPack.html
sS(A = cS(FN), `
precision highp float;
uniform float T; // time
uniform vec2 R; // resolution
uniform vec4 S; // ring coords
uniform vec4 O; // ring spawn time
// // calculates 1/distance between a circle and a point
// // 1/x means value drops off more quickly the further you get
// float circle(vec2 px, float radius, vec2 center) {
// return 1. / abs(distance(px, center) - radius) * .01;
// }
void main() {
vec2 P = gl_FragCoord.xy;
vec2 px = P / R - .5; // normalize (-0.5,0.5)
px.x *= R.x/R.y; // adjust for aspect ratio
float res = .0; // brightness of the pixel (0.0-1.0)
// rings
for (int i = 0; i < 4; ++i) {
float r = O[i] < 1. ? .03 : (T - O[i])/999. + .03;
float centerX = mod(S[i], 1.) * .8 - .4;
float centerY = mod(S[i] * 9., 1.)*.8 - .4;
// 0 bounces
// note circle() has been inlined here for better compression
res += 1. / abs(distance(px, vec2(centerX, centerY)) - r)* .007;
// 1 bounce
res += 1. / abs(distance(px, vec2(-centerX + R.x/R.y, centerY)) - r)* .007;
res += 1. / abs(distance(px, vec2(-centerX - R.x/R.y, centerY)) - r)* .007;
res += 1. / abs(distance(px, vec2(centerX, 1. - centerY)) - r)* .007;
res += 1. / abs(distance(px, vec2(centerX, -1. - centerY)) - r)* .007;
}
// Julia Fractal c = (0, .7)
for (int i = 0; i < 99; i++) {
px = vec2(
px.x * px.x - px.y * px.y,
px.x * px.y * 2. + .7 + .001 * sin(T/999.)
);
if (dot(px, px) > 4.) {
res += float(i) / 99.;
break;
}
}
gl_FragColor = vec4(
vec3(26.,99.*sin(T/999.),99.)/255. * res +
// Iestyn's RGB dither (Valve)
fract(
vec3(dot(vec2(171., 231.), P)) / vec3(99., 71., 97.)
) / 255.
,1.);
}`)
ce(A)
aS(P, A)
lo(P)
ug(P)
vA(i = playSound = 0, 2, 5120,
bf(34962, cB(eV(0))),
1,
bD(34962, Int8Array.of(-1,1,1,-1,-1), 35044)
)
ringCoords = [2,2,2,2]
ringTime = [2,2,2,2]
audio = new AudioContext()
oss = audio.createOscillator()
// ES6 features manually added after closure-compiler pass
spawn = function () {
ringCoords[i] = ringTime[i] = Math.random()
playSound = 1
}
oss.connect(v.destination)
oss.start()
;(s=t=> {
uniform1f(gf(P, 'T'), t)
uniform2f(gf(P, 'R'), innerWidth, innerHeight)
// 'g.' otherwise error
g.uniform4f(gf(P, 'S'), ...ringCoords)
g.uniform4f(gf(P, 'O'), ...ringTime)
onmousedown = f =>
ringTime[i=++i%4] > 1 ? spawn() : ringTime[i] = t
// 'this.dump' detects Firefox because of artifacting
oss.frequency.value = 261 * playSound * !this.dump
dr(6,playSound=0,4);
requestAnimationFrame(s)
})()
}