mirror of
https://github.com/seigler/generative
synced 2025-07-26 22:56:10 +00:00
1 line
No EOL
27 KiB
JavaScript
1 line
No EOL
27 KiB
JavaScript
!function(){"use strict";var e="undefined"==typeof global?self:global;if("function"!=typeof e.require){var r={},o={},n={},a={}.hasOwnProperty,t=/^\.\.?(\/|$)/,i=function(e,r){for(var o,n=[],a=(t.test(r)?e+"/"+r:r).split("/"),i=0,s=a.length;i<s;i++)o=a[i],".."===o?n.pop():"."!==o&&""!==o&&n.push(o);return n.join("/")},s=function(e){return e.split("/").slice(0,-1).join("/")},d=function(r){return function(o){var n=i(s(r),o);return e.require(n,r)}},l=function(e,r){var n=M&&M.createHot(e),a={id:e,exports:{},hot:n};return o[e]=a,r(a.exports,d(e),a),a.exports},h=function(e){return n[e]?h(n[e]):e},c=function(e,r){return h(i(s(e),r))},u=function(e,n){null==n&&(n="/");var t=h(e);if(a.call(o,t))return o[t].exports;if(a.call(r,t))return l(t,r[t]);throw new Error("Cannot find module '"+e+"' from '"+n+"'")};u.alias=function(e,r){n[r]=e};var f=/\.[^.\/]+$/,m=/\/index(\.[^\/]+)?$/,w=function(e){if(f.test(e)){var r=e.replace(f,"");a.call(n,r)&&n[r].replace(f,"")!==r+"/index"||(n[r]=e)}if(m.test(e)){var o=e.replace(m,"");a.call(n,o)||(n[o]=e)}};u.register=u.define=function(e,n){if(e&&"object"==typeof e)for(var t in e)a.call(e,t)&&u.register(t,e[t]);else r[e]=n,delete o[e],w(e)},u.list=function(){var e=[];for(var o in r)a.call(r,o)&&e.push(o);return e};var M=e._hmr&&new e._hmr(c,u,r,o);u._cache=o,u.hmr=M&&M.wrap,u.brunch=!0,e.require=u}}(),function(){"undefined"==typeof window?this:window;require.register("1/index.js",function(e,r,o){new p5(function(e){function r(){if(n)e.randomSeed(n);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random()),e.blendMode(e.BLEND),e.background("#000"),e.blendMode(e.ADD);for(var h=a*t/s,p=Math.sqrt(h),v=Math.max(1,Math.round(t/p))+1,g=Math.max(1,Math.round(a/p))+1,x=e.random(0,1e3*d),S=[],k=0;k<v*g;k++)S[k]=k;o(S);for(var E=0;E<v*g;E++){var y=S[E]%g,L=Math.floor(S[E]/g);c.noStroke(),c.background("#000");var I=e.noise(x+L/v*d,x+y/g*d),N=i*I,P=e.color(100*e.random(),100,90*I+10,70*I+10);c.fill(P),c.circle(i/2,i/2,N);for(var U=i/80,_=0;_<l;_++){var G=(l-_)*U/l;u.shader(w),w.setUniform("tex0",0==_?c:f),w.setUniform("texelSize",[G/i,G/i]),w.setUniform("direction",[1,0]),u.rect(0,0,i,i),f.shader(M),M.setUniform("tex0",u),M.setUniform("texelSize",[G/i,G/i]),M.setUniform("direction",[0,1]),f.rect(0,0,i,i)}if(c.image(f,0,0,i,i),e.random()>.5){c.fill("#000");var W=e.random(2*Math.PI),H=e.random(.1,1.5)*N/2,j=H*e.random(-.7,.3);c.circle((i+(j+N)*Math.cos(W))/2,(i+(j+N)*Math.sin(W))/2,2*H)}do{var B=e.random(2*Math.PI),T=e.random(2*Math.PI);c.stroke(0),c.strokeWeight(1+N*Math.pow(e.random(.7368),3)),c.line(i*(Math.sin(B)+.5),i*(Math.cos(B)+.5),i*(Math.sin(T)+.5),i*(Math.cos(T)+.5))}while(e.random()<.5+.45*I);var C=e.random(0,2*Math.PI),R=e.random(p),q=a/(g-1)*y+R*Math.cos(C),D=t/(v-1)*L+R*Math.sin(C);e.image(c,q-i/2,D-i/2)}m.shader(b),b.setUniform("u_resolution",[a,t]),b.setUniform("u_alpha",.05),m.rect(0,0,a,t),e.blendMode(e.OVERLAY),e.image(m,0,0)}function o(r){var o=0,n=0,a=null;for(o=r.length-1;o>0;o-=1)n=Math.floor(e.random()*(o+1)),a=r[o],r[o]=r[n],r[n]=a}e.disableFriendlyErrors=!0;var n,a,t,i,s,d,l,h,c,u,f,m,w,M,b;e.preload=function(){w=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),M=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),b=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag")},e.setup=function(){d=2,l=2,s=70,window.onhashchange=function(){n=window.location.hash.substr(1),r()},n=window.location.hash.substr(1),e.noStroke(),e.colorMode(e.HSB,100),a=e.windowWidth,t=e.windowHeight,h=e.createCanvas(a,t),i=1.75*(a+t)/Math.sqrt(s),c=e.createGraphics(i,i),u=e.createGraphics(i,i,e.WEBGL),f=e.createGraphics(i,i,e.WEBGL),m=e.createGraphics(a,t,e.WEBGL),c.noStroke(),u.noStroke(),f.noStroke(),m.noStroke(),r()},e.draw=function(){},e.keyPressed=function(){" "==e.key?(n=null,r()):"s"==e.key&&e.saveCanvas("seigler-p5-1-gradient_burst-"+n+".jpg","jpg")},e.doubleClicked=function(){n=null,r()};var p;e.windowResized=function(){clearTimeout(p),p=setTimeout(function(){window.location.reload()},100)}})}),require.register("1/index.static.hbs",function(e,r,o){}),require.register("2/index.js",function(e,r,o){new p5(function(e){function r(){if(n)e.randomSeed(n);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random()),e.blendMode(e.BLEND),e.background("#000"),e.blendMode(e.ADD);for(var c=a*t/s,x=Math.sqrt(c),S=Math.max(1,Math.round(t/x))+1,k=Math.max(1,Math.round(a/x))+1,E=e.random(0,1e3*d),y=[],L=0;L<S*k;L++)y[L]=L;o(y);for(var I=0;I<S*k;I++){var N=y[I]%k,P=Math.floor(y[I]/k);m.noStroke(),m.blendMode(e.BLEND),m.background("#000");var U=e.noise(E+P/S*d,E+N/k*d),_=i*(.2+.7*U),G=e.color(100*(2*e.noise(2*E+P/S*l,2*E+N/k*l)-.5),100,80*U+10,60*U+10);if(m.fill(G),m.circle(i/2,i/2,_),e.random()>.5){m.fill("#000");var W=e.random(2*Math.PI),H=e.random(.1,1.5)*_/2,j=H*e.random(-.7,.3);m.circle((i+(j+_)*Math.cos(W))/2,(i+(j+_)*Math.sin(W))/2,2*H)}for(var B=i/100,T=0;T<h;T++){var C=(h-T)*B/h;w.shader(p),p.setUniform("tex0",0==T?m:M),p.setUniform("texelSize",[C/i,C/i]),p.setUniform("direction",[1,0]),w.rect(0,0,i,i),M.shader(v),v.setUniform("tex0",w),v.setUniform("texelSize",[C/i,C/i]),v.setUniform("direction",[0,1]),M.rect(0,0,i,i)}m.image(M,0,0,i,i);do{var R=e.random(2*Math.PI),q=e.random(-Math.PI,Math.PI);m.blendMode(e.MULTIPLY);var D=e.random(1,4)*_,V=D/600*405,A=_*e.random(.1,.8);m.translate(i/2,i/2),m.rotate(q),m.translate(0,A),m.rotate(R),m.image(e.random()>.3?u:f,0,0,V,D),m.resetMatrix()}while(e.random()<.8);var F=e.random(0,2*Math.PI),z=e.random(x),O=a/(k-1)*N+z*Math.cos(F),Y=t/(S-1)*P+z*Math.sin(F);e.image(m,O-i/2,Y-i/2)}b.shader(g),g.setUniform("u_resolution",[a,t]),g.setUniform("u_alpha",.05),b.rect(0,0,a,t),e.blendMode(e.OVERLAY),e.image(b,0,0)}function o(r){var o=0,n=0,a=null;for(o=r.length-1;o>0;o-=1)n=Math.floor(e.random()*(o+1)),a=r[o],r[o]=r[n],r[n]=a}e.disableFriendlyErrors=!0;var n,a,t,i,s,d,l,h,c,u,f,m,w,M,b,p,v,g;e.preload=function(){p=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),v=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),g=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag"),u=e.loadImage("palm-leaf-1.jpg"),f=e.loadImage("palm-leaf-2.jpg")},e.setup=function(){d=2,l=6,h=2,s=80,c="seigler-p5-2-gradient_jungle-",window.onhashchange=function(){n=window.location.hash.substr(1),r()},n=window.location.hash.substr(1),e.noStroke(),e.colorMode(e.HSB,100),a=e.windowWidth,t=e.windowHeight,e.createCanvas(a,t),i=2*(a+t)/Math.sqrt(s),m=e.createGraphics(i,i),w=e.createGraphics(i,i,e.WEBGL),M=e.createGraphics(i,i,e.WEBGL),b=e.createGraphics(a,t,e.WEBGL),m.noStroke(),w.noStroke(),M.noStroke(),b.noStroke(),r()},e.draw=function(){},e.keyPressed=function(){" "==e.key?(n=null,r()):"s"==e.key&&e.saveCanvas(c+n+".jpg","jpg")},e.doubleClicked=function(){n=null,r()};var x;e.windowResized=function(){clearTimeout(x),x=setTimeout(function(){window.location.reload()},100)}})}),require.register("2/index.static.hbs",function(e,r,o){}),require.register("3/index.js",function(e,r,o){new p5(function(e){function r(){if(a)e.randomSeed(a);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random(0,1e9)),e.blendMode(e.BLEND),e.background(291/360,.3,.25);var h=e.random(0,Math.PI),c=Math.min(t,i)/e.random(10,80),u=Math.max(t,i)*Math.SQRT2,f=Math.ceil(Math.SQRT2*u/c),m=t/2,w=i/2,M=Math.cos(h)*u/2,b=Math.sin(h)*u/2;e.strokeCap(e.SQUARE);for(var p=Math.ceil(f/2);p>0;p--)e.stroke(291/360,.3,.2+.1*(p%2)),e.strokeWeight((2*p-1)*c),e.line(m-M,w-b,m+M,w+b);d.shader(l),l.setUniform("u_resolution",[t,i]),l.setUniform("u_alpha",.05),d.rect(0,0,t,i),e.blendMode(e.OVERLAY),e.image(d,0,0),e.blendMode(e.BLEND),e.strokeCap(e.ROUND);for(var v=5,g=Math.max(1,Math.round(i/v))+1,x=Math.max(1,Math.round(t/v))+1,S=1000.37,k=[],E=function(r){var o=r%x,n=Math.floor(r/x),a=s.map(function(r,a){var t=r/Math.min(g,x);return e.noise(S*a+n*t,S*a+o*t)});k.push({row:n,col:o,noise:a})},y=0;y<g*x;y++)E(y);o(k);var L=e.random(0,2*Math.PI);k.forEach(function(r,o){var a=r.row,s=r.col,d=r.noise,l=d[0],h=d[1],c=d[2],u=d[3];if(!(e.random()>1.75*l-.5)){var f=t/(x-1)*s-v/2,m=i/(g-1)*a-v/2,w=2*Math.PI*n(c)+L,M=(8*u*u+1)*v;e.stroke(.075,.5,h-.2*(o/k.length)+.1),e.strokeWeight(v*(1+2*u*u*u)),e.line(f-M*Math.cos(w),m-M*Math.sin(w),f+M*Math.cos(w),m+M*Math.sin(w))}})}function o(r){var o=0,n=0,a=null;for(o=r.length-1;o>0;o-=1)n=Math.floor(e.random()*(o+1)),a=r[o],r[o]=r[n],r[n]=a}function n(e){return 23.8615*Math.pow(e,5)-59.6041*Math.pow(e,4)+47.2472*Math.pow(e,3)-11.3053*Math.pow(e,2)+.806219*e-.00259101}e.disableFriendlyErrors=!0;var a,t,i,s,d,l;e.preload=function(){l=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag")},e.setup=function(){filenamePrefix="seigler-p5-3-peanut_butter_and_jelly-",t=e.windowWidth,i=e.windowHeight,s=[2,2,2,2],window.onhashchange=function(){a=window.location.hash.substr(1),r()},a=window.location.hash.substr(1),e.noStroke(),e.colorMode(e.HSL,1),e.createCanvas(t,i),d=e.createGraphics(t,i,e.WEBGL),d.noStroke(),r()},e.draw=function(){},e.keyPressed=function(){" "==e.key?(a=null,r()):"s"==e.key&&e.saveCanvas(filenamePrefix+a+".jpg","jpg")},e.doubleClicked=function(){a=null,r()};var h;e.windowResized=function(){clearTimeout(h),h=setTimeout(function(){window.location.reload()},100)}})}),require.register("3/index.static.hbs",function(e,r,o){}),require.register("4/index.js",function(e,r,o){new p5(function(e){function r(){if(n)e.randomSeed(n);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random(0,1e9)),e.blendMode(e.BLEND);var u=e.random(0,Math.PI),f=Math.min(a,t)/e.random(10,80),m=Math.max(a,t)*Math.SQRT2,w=Math.ceil(Math.SQRT2*m/f),M=e.random(),b=a/2,p=t/2,v=Math.cos(u)*m/2,g=Math.sin(u)*m/2;l.buffer.strokeCap(e.SQUARE);for(var x=Math.ceil(w/2);x>0;x--)l.buffer.stroke(M,.5,.2+.1*(x%2)),l.buffer.strokeWeight((2*x-1)*f),l.buffer.line(b-v,p-g,b+v,p+g);e.blendMode(e.BLEND);for(var S=Math.min(a,t)/Math.round(e.random(3,10)),k=Math.max(1,Math.round(t/S/Math.sin(Math.PI/3)))+1,E=Math.max(1,Math.round(a/S))+1,y=200*S+Math.SQRT2,L=[],I=function(r){var o=r%E,n=Math.floor(r/E),a=i.map(function(r,a){return e.noise(y*(a+1)+(n-k/2)*r,y*(a+1)+(o-E/2)*r)});L.push({row:n,col:o,noise:a})},N=0;N<k*E;N++)I(N);L.forEach(function(e){var r=e.col,n=e.row,i=e.noise,s=i[0],d=i[1];i[2],i[3];e.x=a/(E-1)*r+(n%2-.5)*S/2+1*s*S*Math.cos(2*Math.PI*o(d)),e.y=t/(k-1)*n+1*s*S*Math.sin(2*Math.PI*o(d))});var P={xl:0-S/2,xr:a+S/2,yt:0-S/2,yb:t+S/2},U=c.voronoi.compute(L,P);l.cells.background(.5),U.cells.forEach(function(r){if(r.halfedges.length>=3){l.cells.fill(r.site.noise[2]),l.cells.beginShape();for(var o=0;o<r.halfedges.length+1;o++){var n=r.halfedges[o%r.halfedges.length],a=n.getStartpoint(),t=a.x,i=a.y,s=n.getEndpoint(),d=s.x,h=s.y;0===o?(l.cells.vertex(e.lerp(e.lerp(t,d,.5),r.site.x,.1),e.lerp(e.lerp(i,h,.5),r.site.y,.1)),first=!1):l.cells.quadraticVertex(e.lerp(t,r.site.x,.1),e.lerp(i,r.site.y,.1),e.lerp(e.lerp(t,d,.5),r.site.x,.1),e.lerp(e.lerp(i,h,.5),r.site.y,.1))}l.cells.endShape()}});for(var _=S/300,G=0;G<d;G++){var W=(d-G)*_/d;l.blur1.shader(h.blurH),h.blurH.setUniform("tex0",0==G?l.cells:l.blur2),h.blurH.setUniform("texelSize",[W/a,W/t]),h.blurH.setUniform("direction",[1,0]),l.blur1.rect(0,0,a,t),l.blur2.shader(h.blurV),h.blurV.setUniform("tex0",l.blur1),h.blurV.setUniform("texelSize",[W/a,W/t]),h.blurV.setUniform("direction",[0,1]),l.blur2.rect(0,0,a,t)}l.cells.image(l.blur2,0,0,a,t),l.displacement.shader(h.displacement),h.displacement.setUniform("u_src",l.buffer),h.displacement.setUniform("u_map",l.cells),h.displacement.setUniform("u_intensity",10/S),l.displacement.rect(0,0,a,t),e.blendMode(e.BLEND),e.image(l.displacement,Math.floor(-a*s/2),Math.floor(-t*s/2)),l.noise.shader(h.whiteNoise),h.whiteNoise.setUniform("u_resolution",[a,t]),h.whiteNoise.setUniform("u_alpha",.05),l.noise.rect(0,0,a,t),e.blendMode(e.OVERLAY),e.image(l.noise,0,0)}function o(e){return 23.8615*Math.pow(e,5)-59.6041*Math.pow(e,4)+47.2472*Math.pow(e,3)-11.3053*Math.pow(e,2)+.806219*e-.00259101}e.disableFriendlyErrors=!0;var n,a,t,i,s,d,l={},h={},c={};e.preload=function(){h.whiteNoise=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag"),h.displacement=e.loadShader("../shaders/base.vert","../shaders/displacement.frag"),h.blurH=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),h.blurV=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),c.voronoi=new Voronoi},e.setup=function(){filenamePrefix="seigler-p5-4-lenses-",s=.1,a=Math.floor(e.windowWidth*(1+s)),t=Math.floor(e.windowHeight*(1+s)),i=[.2,.1,.05,2],d=1,window.onhashchange=function(){n=window.location.hash.substr(1),r()},n=window.location.hash.substr(1),e.colorMode(e.HSL,1),e.createCanvas(e.windowWidth,e.windowHeight),l.buffer=e.createGraphics(a,t),l.buffer.colorMode(e.HSL,1),l.cells=e.createGraphics(a,t),l.cells.colorMode(e.HSL,1),l.cells.noStroke(),l.noise=e.createGraphics(a,t,e.WEBGL),l.displacement=e.createGraphics(a,t,e.WEBGL),l.blur1=e.createGraphics(a,t,e.WEBGL),l.blur2=e.createGraphics(a,t,e.WEBGL),r()},e.draw=function(){},e.keyReleased=function(){" "==e.key?(n=null,r()):"s"==e.key&&e.saveCanvas(filenamePrefix+n+".jpg","jpg")},e.doubleClicked=function(){n=null,r()};var u;e.windowResized=function(){clearTimeout(u),u=setTimeout(function(){window.location.reload()},100)}})}),require.register("4/index.static.hbs",function(e,r,o){}),require.register("5/index.js",function(e,r,o){new p5(function(e){function r(){if(n)e.randomSeed(n);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random(0,1e9)),e.blendMode(e.BLEND);var c=Math.min(a,t)/Math.round(e.random(4,6)),u=e.random(0,1e9),f=e.random(),m=Math.round(c/15);l.buffer.background(e.random(),.1,.25),l.buffer.blendMode(e.BLEND),l.buffer.strokeCap(e.ROUND),l.buffer.noFill();var w=function(r,o){void 0===o&&(o=e.random(0,1e9)),e.randomSeed(o);var n={x:e.random(a*s*.4,a*(1-.4*s)),y:e.random(t*s*.4,t*(1-.4*s))};e.random()>.5?n.y=e.random()>.5?t*s*.4:t*(1-.4*s):n.x=e.random()>.5?a*s*.4:a*(1-.4*s);var i=e.random(Math.PI/8,Math.PI),d=Math.atan2(t/2-n.y,a/2-n.x);d+=e.random(-.25,.25)*i,r.beginShape(),r.vertex(n.x,n.y);var l=0;do{var h=n.x,u=n.y,f=n.x+c/2*Math.cos(d),m=n.y+c/2*Math.sin(d);d+=e.random(-1,1)*i,r.quadraticVertex(h,u,e.lerp(h,f,.5),e.lerp(u,m,.5)),n={x:f,y:m},l++}while(l<80||n.x>-c/2&&n.x<a+c/2&&n.y>-c/2&&n.y<t+c/2);r.endShape()};l.buffer.blendMode(e.MULTIPLY);for(var M=0;M<m;M++)l.buffer.strokeWeight(e.random(.5,2)*m),l.buffer.stroke(e.random(.2,.45)),w(l.buffer);l.buffer.blendMode(e.BLEND),l.buffer.stroke(f,1,.5),l.buffer.strokeWeight(25),w(l.buffer,u);for(var b=m/6,p=0;p<d;p++){var v=(d-p)*b/d;l.blur1.shader(h.blurH),h.blurH.setUniform("tex0",0==p?l.buffer:l.blur2),h.blurH.setUniform("texelSize",[v/a,v/t]),h.blurH.setUniform("direction",[1,0]),l.blur1.rect(0,0,a,t),l.blur2.shader(h.blurV),h.blurV.setUniform("tex0",l.blur1),h.blurV.setUniform("texelSize",[v/a,v/t]),h.blurV.setUniform("direction",[0,1]),l.blur2.rect(0,0,a,t)}l.buffer.image(l.blur2,0,0,a,t),l.buffer.strokeWeight(1);for(var g=0;g<30*m;g++)l.buffer.stroke(e.random(.05)),w(l.buffer);l.buffer.stroke(f,1,.9),l.buffer.strokeWeight(5),w(l.buffer,u),e.image(l.buffer,Math.round(-a*s/2),Math.round(-t*s/2)),e.blendMode(e.BLEND);for(var x=Math.max(1,Math.round(t/c/Math.sin(Math.PI/3)))+1,S=Math.max(1,Math.round(a/c))+1,k=200*c+Math.SQRT2,E=[],y=function(r){var o=r%S,n=Math.floor(r/S),a=i.map(function(r,a){return e.noise(k*(a+1)+(n-x/2)*r,k*(a+1)+(o-S/2)*r)});E.push({row:n,col:o,noise:a})},L=0;L<x*S;L++)y(L);E.forEach(function(r){var n=r.col,i=r.row,s=r.noise,d=s[0],l=s[1];s[2],s[3];r.x=a/(S-1)*n+(i%2-.5)*c/2+1*d*c*Math.cos(e.TWO_PI*o(l)),r.y=t/(x-1)*i+1*d*c*Math.sin(e.TWO_PI*o(l))}),l.noise.shader(h.whiteNoise),h.whiteNoise.setUniform("u_resolution",[a,t]),h.whiteNoise.setUniform("u_alpha",.05),l.noise.rect(0,0,a,t),e.blendMode(e.OVERLAY),e.image(l.noise,0,0)}function o(e){return 23.8615*Math.pow(e,5)-59.6041*Math.pow(e,4)+47.2472*Math.pow(e,3)-11.3053*Math.pow(e,2)+.806219*e-.00259101}e.disableFriendlyErrors=!0;var n,a,t,i,s,d,l={},h={};e.preload=function(){h.whiteNoise=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag"),h.blurH=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),h.blurV=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag")},e.setup=function(){filenamePrefix="seigler-p5-5-glow_path-",s=.1,a=Math.floor(e.windowWidth*(1+s)),t=Math.floor(e.windowHeight*(1+s)),i=[.2,.1,.05,2],d=2,window.onhashchange=function(){n=window.location.hash.substr(1),r()},n=window.location.hash.substr(1),e.colorMode(e.HSL,1),e.createCanvas(e.windowWidth,e.windowHeight),l.buffer=e.createGraphics(a,t),l.buffer.colorMode(e.HSL,1),l.cells=e.createGraphics(a,t),l.cells.colorMode(e.HSL,1),l.cells.noStroke(),l.noise=e.createGraphics(a,t,e.WEBGL),l.blur1=e.createGraphics(a,t,e.WEBGL),l.blur2=e.createGraphics(a,t,e.WEBGL),r()},e.draw=function(){},e.keyReleased=function(){" "==e.key?(n=null,r()):"s"==e.key&&e.saveCanvas(filenamePrefix+n+".jpg","jpg")},e.doubleClicked=function(){n=null,r()};var c;e.windowResized=function(){clearTimeout(c),c=setTimeout(function(){window.location.reload()},100)}})}),require.register("5/index.static.hbs",function(e,r,o){}),require.register("6/index.js",function(e,r,o){new p5(function(e){function r(){if(o)e.randomSeed(o);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random(0,1e9)),e.blendMode(e.BLEND);var t=function(r,o,n,a,i,s,d,l,h,c,u,f,m){var w=n.x,M=n.y;void 0===f&&(f=0),void 0===m&&(m=0);var b=w+i*Math.cos(a),p=M+i*Math.sin(a),v=e.lerp(a+e.random(-1,1)*l,-Math.PI/2,.2),g=b+i*Math.cos(a),x=p+i*Math.sin(a);if(r.strokeWeight(d+2),r.beginShape(),r.vertex(w,M),r.quadraticVertex(b,p,g,x),r.endShape(),f<20&&d>1)for(var S=0,k=0===f?1:Math.ceil(.8+e.random(1.2));S<k;S++){var E=v+(k>1?c*e.map(S,0,k-1,-.5,.5):0);t(r,o,{x:g,y:x},E,.9*i,s,e.map(Math.cos(E-a),0,1,0,d*(1-(m+i)/h)),l,h,c,u,f+1,m+i)}else{var y=s*e.random(.7,1.8);o.circle(g,x,y);for(var L=1;L<y;L+=2){var I=Math.pow(e.random(),2)*y*2,N=u*e.random(.6,1.4)+Math.PI/2;o.line(g-y/2+L,x,g-y/2+L+I*Math.cos(N),x+I*Math.sin(N))}}},s=e.random();d.branches.clear(),d.branches.blendMode(e.BLEND),d.branches.strokeCap(e.ROUND),d.branches.noFill(),d.branches.stroke(0),d.leaves.clear(),d.leaves.fill((s+.5)%1,.3,.9),d.leaves.stroke((s+.5)%1,.3,.9),d.leaves.strokeWeight(2);var h=a/4.5;t(d.branches,d.leaves,{x:n/2,y:a},e.random(-.45*Math.PI,-.55*Math.PI),h/4,h/6,e.random(h/6,h/3),Math.PI/4,.8*a,Math.PI/3,0*Math.PI),e.blendMode(e.BLEND),e.background(s,.1,.25),e.strokeWeight(h/4),e.stroke(s,1,.3),e.noFill(),e.circle(n*(1-i)/2,a*(1-i)/2,.8*a),d.noise.shader(l.whiteNoise),l.whiteNoise.setUniform("u_resolution",[n,a]),l.whiteNoise.setUniform("u_alpha",.05),d.noise.rect(0,0,n,a),e.image(d.branches,Math.round(-n*i/2),Math.round(-a*i/2)),e.image(d.leaves,Math.round(-n*i/2),Math.round(-a*i/2)),e.blendMode(e.OVERLAY),e.image(d.noise,0,0)}e.disableFriendlyErrors=!0;var o,n,a,t,i,s,d={},l={};e.preload=function(){l.whiteNoise=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag")},e.setup=function(){filenamePrefix="seigler-p5-6-grow-",i=.1,n=Math.floor(e.windowWidth*(1+i)),a=Math.floor(e.windowHeight*(1+i)),t=[.2,.1,.05,2],s=2,window.onhashchange=function(){o=window.location.hash.substr(1),r()},o=window.location.hash.substr(1),e.colorMode(e.HSL,1),e.createCanvas(e.windowWidth,e.windowHeight),d.branches=e.createGraphics(n,a),d.branches.colorMode(e.HSL,1),d.leaves=e.createGraphics(n,a),d.leaves.colorMode(e.HSL,1),d.noise=e.createGraphics(n,a,e.WEBGL),r()},e.draw=function(){},e.keyReleased=function(){" "==e.key?(o=null,r()):"s"==e.key&&e.saveCanvas(filenamePrefix+o+".jpg","jpg")},e.doubleClicked=function(){o=null,r()};var h;e.windowResized=function(){clearTimeout(h),h=setTimeout(function(){window.location.reload()},100)}})}),require.register("6/index.static.hbs",function(e,r,o){}),require.register("7/delaunay.js",function(e,r,o){var n;!function(){"use strict";function e(e){var r,o,n,a,t,i,s=Number.POSITIVE_INFINITY,d=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,h=Number.NEGATIVE_INFINITY;for(r=e.length;r--;)e[r][0]<s&&(s=e[r][0]),e[r][0]>l&&(l=e[r][0]),e[r][1]<d&&(d=e[r][1]),e[r][1]>h&&(h=e[r][1]);return o=l-s,n=h-d,a=Math.max(o,n),t=s+.5*o,i=d+.5*n,[[t-20*a,i-a],[t,i+20*a],[t+20*a,i-a]]}function r(e,r,o,n){var a,i,s,d,l,h,c,u,f,m,w=e[r][0],M=e[r][1],b=e[o][0],p=e[o][1],v=e[n][0],g=e[n][1],x=Math.abs(M-p),S=Math.abs(p-g);if(x<t&&S<t)throw new Error("Eek! Coincident points!");return x<t?(d=-((v-b)/(g-p)),h=(b+v)/2,u=(p+g)/2,a=(b+w)/2,i=d*(a-h)+u):S<t?(s=-((b-w)/(p-M)),l=(w+b)/2,c=(M+p)/2,a=(v+b)/2,i=s*(a-l)+c):(s=-((b-w)/(p-M)),d=-((v-b)/(g-p)),l=(w+b)/2,h=(b+v)/2,c=(M+p)/2,u=(p+g)/2,a=(s*l-d*h+u-c)/(s-d),i=x>S?s*(a-l)+c:d*(a-h)+u),f=b-a,m=p-i,{i:r,j:o,k:n,x:a,y:i,r:f*f+m*m}}function a(e){var r,o,n,a,t,i;for(o=e.length;o;)for(a=e[--o],n=e[--o],r=o;r;)if(i=e[--r],t=e[--r],n===t&&a===i||n===i&&a===t){e.splice(o,2),e.splice(r,2);break}}var t=1/1048576;n={triangulate:function(o,n){var i,s,d,l,h,c,u,f,m,w,M,b,p=o.length;if(p<3)return[];if(o=o.slice(0),n)for(i=p;i--;)o[i]=o[i][n];for(d=new Array(p),i=p;i--;)d[i]=i;for(d.sort(function(e,r){var n=o[r][0]-o[e][0];return 0!==n?n:e-r}),l=e(o),o.push(l[0],l[1],l[2]),h=[r(o,p+0,p+1,p+2)],c=[],u=[],i=d.length;i--;u.length=0){for(b=d[i],s=h.length;s--;)f=o[b][0]-h[s].x,f>0&&f*f>h[s].r?(c.push(h[s]),h.splice(s,1)):(m=o[b][1]-h[s].y,f*f+m*m-h[s].r>t||(u.push(h[s].i,h[s].j,h[s].j,h[s].k,h[s].k,h[s].i),h.splice(s,1)));for(a(u),s=u.length;s;)M=u[--s],w=u[--s],h.push(r(o,w,M,b))}for(i=h.length;i--;)c.push(h[i]);for(h.length=0,i=c.length;i--;)c[i].i<p&&c[i].j<p&&c[i].k<p&&h.push(c[i].i,c[i].j,c[i].k);return h},contains:function(e,r){if(r[0]<e[0][0]&&r[0]<e[1][0]&&r[0]<e[2][0]||r[0]>e[0][0]&&r[0]>e[1][0]&&r[0]>e[2][0]||r[1]<e[0][1]&&r[1]<e[1][1]&&r[1]<e[2][1]||r[1]>e[0][1]&&r[1]>e[1][1]&&r[1]>e[2][1])return null;var o=e[1][0]-e[0][0],n=e[2][0]-e[0][0],a=e[1][1]-e[0][1],t=e[2][1]-e[0][1],i=o*t-n*a;if(0===i)return null;var s=(t*(r[0]-e[0][0])-n*(r[1]-e[0][1]))/i,d=(o*(r[1]-e[0][1])-a*(r[0]-e[0][0]))/i;return s<0||d<0||s+d>1?null:[s,d]}},"undefined"!=typeof o&&(o.exports=n)}()}),require.register("7/index.js",function(e,r,o){var n=r("./delaunay.js");new p5(function(e){function r(){if(a)e.randomSeed(a);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random(0,1e9)),h.stars.clear(),h.stars.fill(1),h.stars.noStroke(),o(h.stars),e.blendMode(e.BLEND),e.background(0),h.noise.shader(c.whiteNoise),c.whiteNoise.setUniform("u_resolution",[t,i]),c.whiteNoise.setUniform("u_alpha",.05),h.noise.rect(0,0,t,i),e.image(h.stars,Math.round(-t*d/2),Math.round(-i*d/2)),e.blendMode(e.OVERLAY),e.image(h.noise,0,0)}function o(r){for(var o=new Array(Math.round(t*i/2e3)),a=new Array(Math.round(t*i/200)),s=0;s<o.length;s++)o[s]=[e.random(t),e.random(i)];for(var d=0;d<a.length;d++)a[d]=[e.random(t),e.random(i)];r.noStroke(),r.fill(1),a.forEach(function(o){r.circle(o[0],o[1],e.random(.25,.5))});var l=n.triangulate(o);r.stroke(235/360,.82,.42,.28),r.strokeWeight(2),r.strokeCap(e.SQUARE),r.noFill();for(var h=0;h<l.length;h+=3)e.random()>.85&&r.triangle(o[l[h]][0],o[l[h]][1],o[l[h+1]][0],o[l[h+1]][1],o[l[h+2]][0],o[l[h+2]][1]);r.noStroke(),r.fill(1),o.forEach(function(o){r.circle(o[0],o[1],e.random(.75,2))})}e.disableFriendlyErrors=!0;var a,t,i,s,d,l,h={},c={};e.preload=function(){c.whiteNoise=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag")},e.setup=function(){filenamePrefix="seigler-p5-7-estrellas-",d=.1,t=Math.floor(e.windowWidth*(1+d)),i=Math.floor(e.windowHeight*(1+d)),s=[.2,.1,.05,2],l=2,window.onhashchange=function(){a=window.location.hash.substr(1),r()},a=window.location.hash.substr(1),e.colorMode(e.HSL,1),e.createCanvas(e.windowWidth,e.windowHeight),h.stars=e.createGraphics(t,i),h.stars.colorMode(e.HSL,1),h.noise=e.createGraphics(t,i,e.WEBGL),r()},e.draw=function(){},e.keyReleased=function(){" "==e.key?(a=null,r()):"s"==e.key&&e.saveCanvas(filenamePrefix+a+".jpg","jpg")},e.doubleClicked=function(){a=null,r()};var u;e.windowResized=function(){clearTimeout(u),u=setTimeout(function(){window.location.reload()},100)}})}),require.register("7/index.static.hbs",function(e,r,o){}),require.register("8/index.js",function(e,r,o){new p5(function(e){function r(){if(i)e.randomSeed(i);else{var r=Math.floor(e.random(1e12));window.location.hash=r,e.randomSeed(r)}e.noiseSeed(e.random(0,1e9)),m.simplex=new SimplexNoise(e.random(0,1e9)),u.contours.clear(),o(u.contours),e.blendMode(e.BLEND),e.background(0),u.noise.shader(f.whiteNoise),f.whiteNoise.setUniform("u_resolution",[s,d]),f.whiteNoise.setUniform("u_alpha",.05),u.noise.rect(0,0,s,d),e.image(u.contours,Math.round(-s*h/2),Math.round(-d*h/2)),e.blendMode(e.OVERLAY),e.image(u.noise,0,0)}function o(r){var o=3/(s+d),i=Math.round(Math.sqrt(s*d)/1440*100);u.contours.imageMode(e.CENTER);var l=n(0,0,s,d,15*i);r.noStroke(),l.forEach(function(n){var t=n.x,i=n.y,s=a(t,i,o),d=s.noise,l=s.angle;d<.5?r.tint(218/360,.8,.1+e.random(.05)+2*d*.2):r.tint(119/360,.8,.1+e.random(.05)+2*(d-.5)*.2);var h=200;r.translate(t,i),r.rotate(l+(d<.5?e.HALF_PI:0)),r.image(w.stroke,0,0,h,h/3),r.resetMatrix()});var h=n(0,0,s,d,5*i);r.noTint(),r.strokeCap(e.SQUARE),h.forEach(function(n){for(var s=n.x+e.random(-50,50),d=n.y+e.random(-50,50),l=t(s,d,o),h=0,c=i/2,u=s,f=d;h<c;h++){var m=a(u,f,o),w=m.angle,M=4*Math.cos(w+e.HALF_PI),b=4*Math.sin(w+e.HALF_PI);l>.5?r.stroke(0,.8):r.stroke(1,.5),r.strokeWeight(Math.sin(h/c*Math.PI)),r.line(u,f,u+M,f+b),u+=M,f+=b}})}function n(e,r,o,n,a){for(var t=o-e,i=n-r,s=Math.sqrt(t*i/Math.sin(Math.PI/3)/a),d=Math.max(1,Math.round(i/s/Math.sin(Math.PI/3)))+1,l=Math.max(1,Math.round(t/s))+1,h=[],c=0;c<d*l;c++){var u=c%l,f=Math.floor(c/l);h.push({x:e+t/(l-1)*u+(f%2-.5)*s/2,y:r+i/(d-1)*f})}return h}function a(r,o,n,a){void 0===n&&(n=2/(s+d)),void 0===a&&(a=0);var i=t(r,o,n,a),l=t(r+1,o,n,a)-i,h=t(r,o+1,n,a)-i,c=Math.atan2(h,l),u=e.dist(0,0,l,h);return{noise:i,angle:c,length:u}}function t(e,r,o,n){return void 0===o&&(o=2/(s+d)),void 0===n&&(n=0),.5+.5*(m.simplex.noise2D(n+o*e,n+o*r)+.5*m.simplex.noise2D(n+2*o*e,n+2*o*r)+.25*m.simplex.noise2D(n+4*o*e,n+4*o*r))/1.75}e.disableFriendlyErrors=!0;var i,s,d,l,h,c,u={},f={},m={},w={};e.preload=function(){f.whiteNoise=e.loadShader("../shaders/base.vert","../shaders/white-noise.frag"),w.stroke=e.loadImage("./brush-100x30.png")},e.setup=function(){filenamePrefix="seigler-p5-8-terra-firma-",h=.1,s=Math.floor(e.windowWidth*(1+h)),d=Math.floor(e.windowHeight*(1+h)),l=[.2,.1,.05,2],c=2,window.onhashchange=function(){i=window.location.hash.substr(1),r()},i=window.location.hash.substr(1),e.colorMode(e.HSL,1),e.createCanvas(e.windowWidth,e.windowHeight),u.contours=e.createGraphics(s,d),u.contours.colorMode(e.HSL,1),u.noise=e.createGraphics(s,d,e.WEBGL),r()},e.draw=function(){},e.keyReleased=function(){" "==e.key?(i=null,r()):"s"==e.key&&e.saveCanvas(filenamePrefix+i+".jpg","jpg")},e.doubleClicked=function(){i=null,r()};var M;e.windowResized=function(){clearTimeout(M),M=setTimeout(function(){window.location.reload()},100)}})}),require.register("8/index.static.hbs",function(e,r,o){}),require.register("index.static.hbs",function(e,r,o){}),require.register("initialize.js",function(e,r,o){document.addEventListener("DOMContentLoaded",function(){var e=document.location.pathname.split("/");e.length>1&&r(e[e.length-2]+"/index")})}),require.register("___globals___",function(e,r,o){})}(),require("___globals___"),require("initialize"); |