mirror of
https://github.com/seigler/generative
synced 2025-07-26 22:56:10 +00:00
1 line
No EOL
20 KiB
JavaScript
1 line
No EOL
20 KiB
JavaScript
!function(){"use strict";var e="undefined"==typeof global?self:global;if("function"!=typeof e.require){var r={},o={},a={},n={}.hasOwnProperty,t=/^\.\.?(\/|$)/,i=function(e,r){for(var o,a=[],n=(t.test(r)?e+"/"+r:r).split("/"),i=0,s=n.length;i<s;i++)o=n[i],".."===o?a.pop():"."!==o&&""!==o&&a.push(o);return a.join("/")},s=function(e){return e.split("/").slice(0,-1).join("/")},d=function(r){return function(o){var a=i(s(r),o);return e.require(a,r)}},l=function(e,r){var a=w&&w.createHot(e),n={id:e,exports:{},hot:a};return o[e]=n,r(n.exports,d(e),n),n.exports},h=function(e){return a[e]?h(a[e]):e},c=function(e,r){return h(i(s(e),r))},u=function(e,a){null==a&&(a="/");var t=h(e);if(n.call(o,t))return o[t].exports;if(n.call(r,t))return l(t,r[t]);throw new Error("Cannot find module '"+e+"' from '"+a+"'")};u.alias=function(e,r){a[r]=e};var f=/\.[^.\/]+$/,m=/\/index(\.[^\/]+)?$/,M=function(e){if(f.test(e)){var r=e.replace(f,"");n.call(a,r)&&a[r].replace(f,"")!==r+"/index"||(a[r]=e)}if(m.test(e)){var o=e.replace(m,"");n.call(a,o)||(a[o]=e)}};u.register=u.define=function(e,a){if(e&&"object"==typeof e)for(var t in e)n.call(e,t)&&u.register(t,e[t]);else r[e]=a,delete o[e],M(e)},u.list=function(){var e=[];for(var o in r)n.call(r,o)&&e.push(o);return e};var w=e._hmr&&new e._hmr(c,u,r,o);u._cache=o,u.hmr=w&&w.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(a)e.randomSeed(a);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=n*t/s,p=Math.sqrt(h),v=Math.max(1,Math.round(t/p))+1,g=Math.max(1,Math.round(n/p))+1,S=e.random(0,1e3*d),x=[],k=0;k<v*g;k++)x[k]=k;o(x);for(var y=0;y<v*g;y++){var L=x[y]%g,E=Math.floor(x[y]/g);c.noStroke(),c.background("#000");var U=e.noise(S+E/v*d,S+L/g*d),P=i*U,G=e.color(100*e.random(),100,90*U+10,70*U+10);c.fill(G),c.circle(i/2,i/2,P);for(var _=i/80,W=0;W<l;W++){var B=(l-W)*_/l;u.shader(M),M.setUniform("tex0",0==W?c:f),M.setUniform("texelSize",[B/i,B/i]),M.setUniform("direction",[1,0]),u.rect(0,0,i,i),f.shader(w),w.setUniform("tex0",u),w.setUniform("texelSize",[B/i,B/i]),w.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 H=e.random(2*Math.PI),I=e.random(.1,1.5)*P/2,N=I*e.random(-.7,.3);c.circle((i+(N+P)*Math.cos(H))/2,(i+(N+P)*Math.sin(H))/2,2*I)}do{var q=e.random(2*Math.PI),j=e.random(2*Math.PI);c.stroke(0),c.strokeWeight(1+P*Math.pow(e.random(.7368),3)),c.line(i*(Math.sin(q)+.5),i*(Math.cos(q)+.5),i*(Math.sin(j)+.5),i*(Math.cos(j)+.5))}while(e.random()<.5+.45*U);var R=e.random(0,2*Math.PI),C=e.random(p),D=n/(g-1)*L+C*Math.cos(R),T=t/(v-1)*E+C*Math.sin(R);e.image(c,D-i/2,T-i/2)}m.shader(b),b.setUniform("u_resolution",[n,t]),b.setUniform("u_alpha",.05),m.rect(0,0,n,t),e.blendMode(e.OVERLAY),e.image(m,0,0)}function o(r){var o=0,a=0,n=null;for(o=r.length-1;o>0;o-=1)a=Math.floor(e.random()*(o+1)),n=r[o],r[o]=r[a],r[a]=n}e.disableFriendlyErrors=!0;var a,n,t,i,s,d,l,h,c,u,f,m,M,w,b;e.preload=function(){M=e.loadShader("../shaders/base.vert","../shaders/blur-two-pass.frag"),w=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(){a=window.location.hash.substr(1),r()},a=window.location.hash.substr(1),e.noStroke(),e.colorMode(e.HSB,100),n=e.windowWidth,t=e.windowHeight,h=e.createCanvas(n,t),i=1.75*(n+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(n,t,e.WEBGL),c.noStroke(),u.noStroke(),f.noStroke(),m.noStroke(),r()},e.draw=function(){},e.keyPressed=function(){" "==e.key?(a=null,r()):"s"==e.key&&e.saveCanvas("seigler-p5-1-gradient_burst-"+a+".jpg","jpg")},e.doubleClicked=function(){a=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(a)e.randomSeed(a);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=n*t/s,S=Math.sqrt(c),x=Math.max(1,Math.round(t/S))+1,k=Math.max(1,Math.round(n/S))+1,y=e.random(0,1e3*d),L=[],E=0;E<x*k;E++)L[E]=E;o(L);for(var U=0;U<x*k;U++){var P=L[U]%k,G=Math.floor(L[U]/k);m.noStroke(),m.blendMode(e.BLEND),m.background("#000");var _=e.noise(y+G/x*d,y+P/k*d),W=i*(.2+.7*_),B=e.color(100*(2*e.noise(2*y+G/x*l,2*y+P/k*l)-.5),100,80*_+10,60*_+10);if(m.fill(B),m.circle(i/2,i/2,W),e.random()>.5){m.fill("#000");var H=e.random(2*Math.PI),I=e.random(.1,1.5)*W/2,N=I*e.random(-.7,.3);m.circle((i+(N+W)*Math.cos(H))/2,(i+(N+W)*Math.sin(H))/2,2*I)}for(var q=i/100,j=0;j<h;j++){var R=(h-j)*q/h;M.shader(p),p.setUniform("tex0",0==j?m:w),p.setUniform("texelSize",[R/i,R/i]),p.setUniform("direction",[1,0]),M.rect(0,0,i,i),w.shader(v),v.setUniform("tex0",M),v.setUniform("texelSize",[R/i,R/i]),v.setUniform("direction",[0,1]),w.rect(0,0,i,i)}m.image(w,0,0,i,i);do{var C=e.random(2*Math.PI),D=e.random(-Math.PI,Math.PI);m.blendMode(e.MULTIPLY);var T=e.random(1,4)*W,V=T/600*405,z=W*e.random(.1,.8);m.translate(i/2,i/2),m.rotate(D),m.translate(0,z),m.rotate(C),m.image(e.random()>.3?u:f,0,0,V,T),m.resetMatrix()}while(e.random()<.8);var O=e.random(0,2*Math.PI),A=e.random(S),F=n/(k-1)*P+A*Math.cos(O),Q=t/(x-1)*G+A*Math.sin(O);e.image(m,F-i/2,Q-i/2)}b.shader(g),g.setUniform("u_resolution",[n,t]),g.setUniform("u_alpha",.05),b.rect(0,0,n,t),e.blendMode(e.OVERLAY),e.image(b,0,0)}function o(r){var o=0,a=0,n=null;for(o=r.length-1;o>0;o-=1)a=Math.floor(e.random()*(o+1)),n=r[o],r[o]=r[a],r[a]=n}e.disableFriendlyErrors=!0;var a,n,t,i,s,d,l,h,c,u,f,m,M,w,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(){a=window.location.hash.substr(1),r()},a=window.location.hash.substr(1),e.noStroke(),e.colorMode(e.HSB,100),n=e.windowWidth,t=e.windowHeight,e.createCanvas(n,t),i=2*(n+t)/Math.sqrt(s),m=e.createGraphics(i,i),M=e.createGraphics(i,i,e.WEBGL),w=e.createGraphics(i,i,e.WEBGL),b=e.createGraphics(n,t,e.WEBGL),m.noStroke(),M.noStroke(),w.noStroke(),b.noStroke(),r()},e.draw=function(){},e.keyPressed=function(){" "==e.key?(a=null,r()):"s"==e.key&&e.saveCanvas(c+a+".jpg","jpg")},e.doubleClicked=function(){a=null,r()};var S;e.windowResized=function(){clearTimeout(S),S=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(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),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,M=i/2,w=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-w,M-b,m+w,M+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,S=Math.max(1,Math.round(t/v))+1,x=1000.37,k=[],y=function(r){var o=r%S,a=Math.floor(r/S),n=s.map(function(r,n){var t=r/Math.min(g,S);return e.noise(x*n+a*t,x*n+o*t)});k.push({row:a,col:o,noise:n})},L=0;L<g*S;L++)y(L);o(k);var E=e.random(0,2*Math.PI);k.forEach(function(r,o){var n=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/(S-1)*s-v/2,m=i/(g-1)*n-v/2,M=2*Math.PI*a(c)+E,w=(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-w*Math.cos(M),m-w*Math.sin(M),f+w*Math.cos(M),m+w*Math.sin(M))}})}function o(r){var o=0,a=0,n=null;for(o=r.length-1;o>0;o-=1)a=Math.floor(e.random()*(o+1)),n=r[o],r[o]=r[a],r[a]=n}function a(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,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(){n=window.location.hash.substr(1),r()},n=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?(n=null,r()):"s"==e.key&&e.saveCanvas(filenamePrefix+n+".jpg","jpg")},e.doubleClicked=function(){n=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(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);var u=e.random(0,Math.PI),f=Math.min(n,t)/e.random(10,80),m=Math.max(n,t)*Math.SQRT2,M=Math.ceil(Math.SQRT2*m/f),w=e.random(),b=n/2,p=t/2,v=Math.cos(u)*m/2,g=Math.sin(u)*m/2;l.buffer.strokeCap(e.SQUARE);for(var S=Math.ceil(M/2);S>0;S--)l.buffer.stroke(w,.5,.2+.1*(S%2)),l.buffer.strokeWeight((2*S-1)*f),l.buffer.line(b-v,p-g,b+v,p+g);e.blendMode(e.BLEND);for(var x=Math.min(n,t)/Math.round(e.random(3,10)),k=Math.max(1,Math.round(t/x/Math.sin(Math.PI/3)))+1,y=Math.max(1,Math.round(n/x))+1,L=200*x+Math.SQRT2,E=[],U=function(r){var o=r%y,a=Math.floor(r/y),n=i.map(function(r,n){return e.noise(L*(n+1)+(a-k/2)*r,L*(n+1)+(o-y/2)*r)});E.push({row:a,col:o,noise:n})},P=0;P<k*y;P++)U(P);E.forEach(function(e){var r=e.col,a=e.row,i=e.noise,s=i[0],d=i[1];i[2],i[3];e.x=n/(y-1)*r+(a%2-.5)*x/2+1*s*x*Math.cos(2*Math.PI*o(d)),e.y=t/(k-1)*a+1*s*x*Math.sin(2*Math.PI*o(d))});var G={xl:0-x/2,xr:n+x/2,yt:0-x/2,yb:t+x/2},_=c.voronoi.compute(E,G);l.cells.background(.5),_.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 a=r.halfedges[o%r.halfedges.length],n=a.getStartpoint(),t=n.x,i=n.y,s=a.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 W=x/300,B=0;B<d;B++){var H=(d-B)*W/d;l.blur1.shader(h.blurH),h.blurH.setUniform("tex0",0==B?l.cells:l.blur2),h.blurH.setUniform("texelSize",[H/n,H/t]),h.blurH.setUniform("direction",[1,0]),l.blur1.rect(0,0,n,t),l.blur2.shader(h.blurV),h.blurV.setUniform("tex0",l.blur1),h.blurV.setUniform("texelSize",[H/n,H/t]),h.blurV.setUniform("direction",[0,1]),l.blur2.rect(0,0,n,t)}l.cells.image(l.blur2,0,0,n,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/x),l.displacement.rect(0,0,n,t),e.blendMode(e.BLEND),e.image(l.displacement,Math.floor(-n*s/2),Math.floor(-t*s/2)),l.noise.shader(h.whiteNoise),h.whiteNoise.setUniform("u_resolution",[n,t]),h.whiteNoise.setUniform("u_alpha",.05),l.noise.rect(0,0,n,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=!1;var a,n,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,n=Math.floor(e.windowWidth*(1+s)),t=Math.floor(e.windowHeight*(1+s)),i=[.2,.1,.05,2],d=1,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),l.buffer=e.createGraphics(n,t),l.buffer.colorMode(e.HSL,1),l.cells=e.createGraphics(n,t),l.cells.colorMode(e.HSL,1),l.cells.noStroke(),l.noise=e.createGraphics(n,t,e.WEBGL),l.displacement=e.createGraphics(n,t,e.WEBGL),l.blur1=e.createGraphics(n,t,e.WEBGL),l.blur2=e.createGraphics(n,t,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("4/index.static.hbs",function(e,r,o){}),require.register("5/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);var c=Math.min(n,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 M=function(r,o){void 0===o&&(o=e.random(0,1e9)),e.randomSeed(o);var a={x:e.random(n*s*.4,n*(1-.4*s)),y:e.random(t*s*.4,t*(1-.4*s))};e.random()>.5?a.y=e.random()>.5?t*s*.4:t*(1-.4*s):a.x=e.random()>.5?n*s*.4:n*(1-.4*s);var i=e.random(Math.PI/8,Math.PI),d=Math.atan2(t/2-a.y,n/2-a.x);d+=e.random(-.25,.25)*i,r.beginShape(),r.vertex(a.x,a.y);var l=0;do{var h=a.x,u=a.y,f=a.x+c/2*Math.cos(d),m=a.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)),a={x:f,y:m},l++}while(l<80||a.x>-c/2&&a.x<n+c/2&&a.y>-c/2&&a.y<t+c/2);r.endShape()};l.buffer.blendMode(e.MULTIPLY);for(var w=0;w<m;w++)l.buffer.strokeWeight(e.random(.5,2)*m),l.buffer.stroke(e.random(.2,.45)),M(l.buffer);l.buffer.blendMode(e.BLEND),l.buffer.stroke(f,1,.5),l.buffer.strokeWeight(25),M(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/n,v/t]),h.blurH.setUniform("direction",[1,0]),l.blur1.rect(0,0,n,t),l.blur2.shader(h.blurV),h.blurV.setUniform("tex0",l.blur1),h.blurV.setUniform("texelSize",[v/n,v/t]),h.blurV.setUniform("direction",[0,1]),l.blur2.rect(0,0,n,t)}l.buffer.image(l.blur2,0,0,n,t),l.buffer.strokeWeight(1);for(var g=0;g<30*m;g++)l.buffer.stroke(e.random(.05)),M(l.buffer);l.buffer.stroke(f,1,.9),l.buffer.strokeWeight(5),M(l.buffer,u),e.image(l.buffer,Math.round(-n*s/2),Math.round(-t*s/2)),e.blendMode(e.BLEND);for(var S=Math.max(1,Math.round(t/c/Math.sin(Math.PI/3)))+1,x=Math.max(1,Math.round(n/c))+1,k=200*c+Math.SQRT2,y=[],L=function(r){var o=r%x,a=Math.floor(r/x),n=i.map(function(r,n){return e.noise(k*(n+1)+(a-S/2)*r,k*(n+1)+(o-x/2)*r)});y.push({row:a,col:o,noise:n})},E=0;E<S*x;E++)L(E);y.forEach(function(r){var a=r.col,i=r.row,s=r.noise,d=s[0],l=s[1];s[2],s[3];r.x=n/(x-1)*a+(i%2-.5)*c/2+1*d*c*Math.cos(e.TWO_PI*o(l)),r.y=t/(S-1)*i+1*d*c*Math.sin(e.TWO_PI*o(l))}),l.noise.shader(h.whiteNoise),h.whiteNoise.setUniform("u_resolution",[n,t]),h.whiteNoise.setUniform("u_alpha",.05),l.noise.rect(0,0,n,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=!1;var a,n,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,n=Math.floor(e.windowWidth*(1+s)),t=Math.floor(e.windowHeight*(1+s)),i=[.2,.1,.05,2],d=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),l.buffer=e.createGraphics(n,t),l.buffer.colorMode(e.HSL,1),l.cells=e.createGraphics(n,t),l.cells.colorMode(e.HSL,1),l.cells.noStroke(),l.noise=e.createGraphics(n,t,e.WEBGL),l.blur1=e.createGraphics(n,t,e.WEBGL),l.blur2=e.createGraphics(n,t,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 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,a,n,i,s,d,l,h,c,u,f,m){var M=a.x,w=a.y;void 0===f&&(f=0),void 0===m&&(m=0);var b=M+i*Math.cos(n),p=w+i*Math.sin(n),v=e.lerp(n+e.random(-1,1)*l,-Math.PI/2,.2),g=b+i*Math.cos(n),S=p+i*Math.sin(n);if(r.strokeWeight(d+2),r.beginShape(),r.vertex(M,w),r.quadraticVertex(b,p,g,S),r.endShape(),f<20&&d>1)for(var x=0,k=0===f?1:Math.ceil(.8+e.random(1.2));x<k;x++){var y=v+(k>1?c*e.map(x,0,k-1,-.5,.5):0);t(r,o,{x:g,y:S},y,.9*i,s,e.map(Math.cos(y-n),0,1,0,d*(1-(m+i)/h)),l,h,c,u,f+1,m+i)}else{var L=s*e.random(.7,1.8);o.circle(g,S,L);for(var E=1;E<L;E+=2){var U=Math.pow(e.random(),2)*L*2,P=u*e.random(.6,1.4)+Math.PI/2;o.line(g-L/2+E,S,g-L/2+E+U*Math.cos(P),S+U*Math.sin(P))}}},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=n/4.5;t(d.branches,d.leaves,{x:a/2,y:n},e.random(-.45*Math.PI,-.55*Math.PI),h/4,h/6,e.random(h/6,h/3),Math.PI/4,.8*n,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(a*(1-i)/2,n*(1-i)/2,.8*n),d.noise.shader(l.whiteNoise),l.whiteNoise.setUniform("u_resolution",[a,n]),l.whiteNoise.setUniform("u_alpha",.05),d.noise.rect(0,0,a,n),e.image(d.branches,Math.round(-a*i/2),Math.round(-n*i/2)),e.image(d.leaves,Math.round(-a*i/2),Math.round(-n*i/2)),e.blendMode(e.OVERLAY),e.image(d.noise,0,0)}e.disableFriendlyErrors=!1;var o,a,n,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,a=Math.floor(e.windowWidth*(1+i)),n=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(a,n),d.branches.colorMode(e.HSL,1),d.leaves=e.createGraphics(a,n),d.leaves.colorMode(e.HSL,1),d.noise=e.createGraphics(a,n,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("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"); |