Ephemeral Tides is an exploration of the mesmerizing dance between chaos and control where unpredictability meets order. Each iteration of Ephemeral Tides brings forth a unique and fleeting moment, inviting viewers to embrace the beauty of impermanence and the subtle harmony that arises from the convergence of seemingly opposing forces. Experience the ebb and flow of Ephemeral Tides.
Press the "S" key to save the image, or "P" to export a high-resolution print.
Hyper Drive is based on the mathematics of recursion. Scale symmetry is used to create patterns that repeat at ever-smaller intervals, creating the illusion of infinite depth and complexity.
The rule for the recursive loop is incredibly simple. A box is drawn, then a snapshot of the full canvas is resized to cover the boundary. As this process is repeated, small variations in position create endless fractals.
This project is an experimental cross-chain collection, with a fully-generative A-side published via Art Blocks on Ethereum and an AI-based image composition B-side published via fxhash on Tezos. The artwork symbolizes the great divides we must cross, the connections we make along the way, and the disconnections we feel. We move through the world as the world moves through us.
(()=>{var e={537:e=>{function t(e,t,o){for(var r=[],i=[],n=[],a=[],s=0;s<t*o;s++)r.push(e[4*s]),i.push(e[4*s+1]),n.push(e[4*s+2]),a.push(e[4*s+3]);return[r,i,n,a]}function o(e,t,o,i,n,a){r(e,t,o,i,(a[0]-1)/2),r(t,e,o,i,(a[1]-1)/2),r(e,t,o,i,(a[2]-1)/2)}function r(e,t,o,r,i){for(var n=0;n<e.length;n++)t[n]=e[n];!function(e,t,o,r,i){for(var n=1/(i+i+1),a=0;a<r;a++){for(var s=a*o,l=s,p=s+i,h=e[s],d=e[s+o-1],c=(i+1)*h,m=0;m<i;m++)c+=e[s+m];for(m=0;m<=i;m++)c+=e[p++]-h,t[s++]=c*n;for(m=i+1;m<o-i;m++)c+=e[p++]-e[l++],t[s++]=c*n;for(m=o-i;m<o;m++)c+=d-e[l++],t[s++]=c*n}}(t,e,o,r,i),function(e,t,o,r,i){for(var n=1/(i+i+1),a=0;a<o;a++){for(var s=a,l=s,p=s+i*o,h=e[s],d=e[s+o*(r-1)],c=(i+1)*h,m=0;m<i;m++)c+=e[s+m*o];for(m=0;m<=i;m++)c+=e[p]-h,t[s]=c*n,p+=o,s+=o;for(m=i+1;m<r-i;m++)c+=e[p]-e[l],t[s]=c*n,l+=o,p+=o,s+=o;for(m=r-i;m<r;m++)c+=d-e[l],t[s]=c*n,l+=o,s+=o}}(e,t,o,r,i)}e.exports={blurImage:function(e,r,i,n){var a=t(e,r,i),s=t(e,r,i),l=function(e,t){var o=Math.sqrt(12*e*e/3+1),r=Math.floor(o);r%2==0&&r--;for(var i=r+2,n=(12*e*e-3*r*r-12*r-9)/(-4*r-4),a=Math.round(n),s=[],l=0;l<3;l++)s.push(l<a?r:i);return s}(n);return o(a[0],s[0],r,i,0,l),o(a[1],s[1],r,i,0,l),o(a[2],s[2],r,i,0,l),function(e,t,o,r,i,n,a){for(var s=0;s<t*o;s++)e[4*s]=r[s],e[4*s+1]=i[s],e[4*s+2]=n[s],e[4*s+3]=a[s]}(e,r,i,s[0],s[1],s[2],s[3]),e}}}},t={};function o(r){var i=t[r];if(void 0!==i)return i.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,o),n.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=JSON.parse('{"SWATCHES":{"paper":"#fff0e0","black":"#000","white":"#fff","teal":"#60cab6","yellow":"#fabf0f","red":"#bf2640","blue":"#1a3966","blue2":"#11358e","blue3":"#4c6ebf","blue4":"#6290ff","green":"#60aa10"},"PALETTE":{"Crayon":["teal","yellow","blue","red","paper"],"Blue":["blue","blue2","blue3","blue4","paper"],"Red":["red","paper"],"Sketch":["paper"],"Yellow":["yellow"],"Green":["green","paper"],"Vibes":[],"RGB":[]},"COMPLEXITY":{"Minimal":15,"Low":30,"Normal":45,"High":60,"Ultra":75},"HORIZON":{"Horizontal":false,"Vertical":true,"Mixed":null},"SYMMETRY":{"Wild":[0.333,3],"Normal":[0.5,2],"Square":[1,1]},"SYMMETRY_SCALE":{"Wild":[0,1],"Normal":[0.5,1],"Square":[0.33,0.67]},"FRAME":0.02}');var t=o(537),r=o.n(t);const i=e=>e[Math.floor(random()*e.length)],n=e=>{randomSeed(e),noiseSeed(e)};class a{constructor(){this.useA=!1;let e=function(e){let t=parseInt(e.substr(0,8),16),o=parseInt(e.substr(8,8),16),r=parseInt(e.substr(16,8),16),i=parseInt(e.substr(24,8),16);return function(){t|=0,o|=0,r|=0,i|=0;let e=(t+o|0)+i|0;return i=i+1|0,t=o^o>>>9,o=r+(r<<3)|0,r=r<<21|r>>>11,r=r+e|0,(e>>>0)/4294967296}};this.prngA=new e(tokenData.hash.substr(2,32)),this.prngB=new e(tokenData.hash.substr(34,32));for(let e=0;e<1e6;e+=2)this.prngA(),this.prngB()}random_dec(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}random_num(e,t){return e+(t-e)*this.random_dec()}random_int(e,t){return Math.floor(this.random_num(e,t+1))}random_bool(e){return this.random_dec()<e}random_choice(e){return e[this.random_int(0,e.length-1)]}}class s{version="0.3.0";ignoreWarnings=!1;ignoreErrors=!1;#e;#t;#o;constructor(){this.#e=Math.random,this.#t={frameCount:0},this.#o={frameCount:0,tX_anchor:0,tX:0,tY:0}}setup(e){this.#r("setup",arguments),void 0===e?this.#e=random:"object"==typeof e&&("function"==typeof e.random&&(this.#e=e.random),"boolean"==typeof e.ignoreErrors&&(this.ignoreErrors=e.ignoreErrors),"boolean"==typeof e.ignoreWarnings&&(this.ignoreWarnings=e.ignoreWarnings))}granulateSimple(e,t){let o=round(e);t.loadPixels();let r=t.pixelDensity(),i=t.width*r*4*(t.height*r);for(let e=0;e<i;e+=4){let r=this.#e(-o,o);t.pixels[e]=t.pixels[e]+r,t.pixels[e+1]=t.pixels[e+1]+r,t.pixels[e+2]=t.pixels[e+2]+r}t.updatePixels()}granulateChannels(e,t){let o=round(e);t.loadPixels();let r=t.pixelDensity(),i=t.width*r*4*(t.height*r);for(let e=0;e<i;e+=4)t.pixels[e]=t.pixels[e]+this.#e(-o,o),t.pixels[e+1]=t.pixels[e+1]+this.#e(-o,o),t.pixels[e+2]=t.pixels[e+2]+this.#e(-o,o);t.updatePixels()}granulateFuzzify(e,t,o){this.#r("granulateFuzzy",arguments),loadPixels();let r=round(e),i=t?round(t):2,n=o||!1,a=pixelDensity(),s=4*width*a,l=4*i+s,p=s*(height*a);for(let e=0;e<p;e+=4)pixels[e+l]&&(pixels[e]=round((pixels[e]+pixels[e+l])/2),pixels[e+1]=round((pixels[e+1]+pixels[e+l+1])/2),pixels[e+2]=round((pixels[e+2]+pixels[e+l+2])/2),n&&(pixels[e+3]=round((pixels[e+3]+pixels[e+l+3])/2))),pixels[e]=pixels[e]+this.#e(-r,r),pixels[e+1]=pixels[e+1]+this.#e(-r,r),pixels[e+2]=pixels[e+2]+this.#e(-r,r),n&&(pixels[e+3]=pixels[e+3]+this.#e(-r,r));updatePixels()}textureAnimate(e,t){this.#r("textureAnimate",arguments);let o=t&&t.atFrame?round(t.atFrame):2;if(this.#t.frameCount+=1,this.#t.frameCount>=o){let o=t&&t.amount?round(t.amount):min(width,height),r=floor(this.#e()*o),i=floor(this.#e()*o),n=`${r}px ${i}px`;e instanceof HTMLElement?e.style.backgroundPosition=n:e instanceof SVGElement?(e.style.top=-i+"px",e.style.left=-r+"px"):e instanceof p5.Element&&e.style("background-position",n),this.#t.frameCount=0}}textureOverlay(e,t){this.#r("textureOverlay",arguments);let o=t.context instanceof p5.Graphics,r=t.context?t.context.width:width,i=t.context?t.context.height:height,n=t.mode||MULTIPLY,a=t.reflect||!1,s=t.animate||!1,l=t.animate&&t.animate.atFrame?round(t.animate.atFrame):2,p=t.animate&&t.animate.amount?round(t.animate.amount):min(r,i),h="number"==typeof t.width?t.width:e.width,d="number"==typeof t.height?t.height:e.height;s&&(this.#o.frameCount+=1,this.#o.frameCount>=l&&(this.#o.tX_anchor=-floor(this.#e()*p),this.#o.tY=-floor(this.#e()*p),this.#o.frameCount=0));let c=this.#o.tX_anchor,m=this.#o.tY,f=!0,u=!0;for(blendMode(n);m<i;){for(;c<r;){if(a?(o?t.context.push():push(),f?u?o?t.context.image(e,c,m,h,d):image(e,c,m,h,d):o?(t.context.scale(-1,1),t.context.image(e,-c,m,-h,d)):(scale(-1,1),image(e,-c,m,-h,d)):u?o?(t.context.scale(1,-1),t.context.image(e,c,-m,h,-d)):(scale(1,-1),image(e,c,-m,h,-d)):o?(t.context.scale(-1,-1),t.context.image(e,-c,-m,-h,-d)):(scale(-1,-1),image(e,-c,-m,-h,-d)),o?t.context.pop():pop()):o?t.context.image(e,c,m,h,d):image(e,c,m,h,d),(c+=h)>=r){u=!0,c=this.#o.tX_anchor,m+=d;break}u=!u}f=!f}blendMode(BLEND),o&&t.context.reset()}#r(e,t){if(!this.ignoreErrors)switch(e){case"setup":if(void 0!==t[0]&&"object"!=typeof t[0])throw Error(`[p5.grain] The optional config parameter passed to p5grain.${e}() must be of type object.`);if("object"==typeof t[0]){if(void 0!==t[0].random&&"function"!=typeof t[0].random)throw Error(`[p5.grain] The optional config.random property passed to p5grain.${e}() must be of type function.`);if(void 0!==t[0].ignoreErrors&&"boolean"!=typeof t[0].ignoreErrors)throw Error(`[p5.grain] The optional config.ignoreErrors property passed to p5grain.${e}() must be of type boolean.`);if(void 0!==t[0].ignoreWarnings&&"boolean"!=typeof t[0].ignoreWarnings)throw Error(`[p5.grain] The optional config.ignoreWarnings property passed to p5grain.${e}() must be of type boolean.`)}break;case"granulateSimple":case"granulateChannels":if("number"!=typeof t[0])throw Error(`[p5.grain] The amount parameter passed to ${e}() must be of type number.`);if(void 0!==t[1]&&"boolean"!=typeof t[1])throw Error(`[p5.grain] The alpha parameter passed to ${e}() must be of type boolean.`);break;case"granulateFuzzify":if("number"!=typeof t[0])throw Error(`[p5.grain] The amount parameter passed to ${e}() must be of type number.`);if(void 0!==t[1]&&"number"!=typeof t[1])throw Error(`[p5.grain] The fuzziness parameter passed to ${e}() must be of type number.`);if(void 0!==t[2]&&"boolean"!=typeof t[2])throw Error(`[p5.grain] The alpha parameter passed to ${e}() must be of type boolean.`);break;case"textureAnimate":if(!(t[0]instanceof HTMLElement||t[0]instanceof SVGElement||t[0]instanceof p5.Element))throw Error(`[p5.grain] The textureElement parameter passed to ${e}() must be an instance of HTMLElement, SVGElement or p5.Element.`);if(void 0!==t[1]&&"object"!=typeof t[1])throw Error(`[p5.grain] The optional config parameter passed to ${e}() must be of type object.`);if("object"==typeof t[1]){if(void 0!==t[1].atFrame&&"number"!=typeof t[1].atFrame)throw Error(`[p5.grain] The optional config.atFrame property passed to ${e}() must be of type number.`);if(void 0!==t[1].amount&&"number"!=typeof t[1].amount)throw Error(`[p5.grain] The optional config.amount parameter passed to ${e}() must be of type number.`)}break;case"textureOverlay":if(!(t[0]instanceof p5.Image))throw Error(`[p5.grain] The texture parameter passed to ${e}() must be an instance of p5.Image.`);if(void 0!==t[1]&&"object"!=typeof t[1])throw Error(`[p5.grain] The optional config parameter passed to ${e}() must be of type object.`);if("object"==typeof t[1]){if(void 0!==t[1].width&&"number"!=typeof t[1].width)throw Error(`[p5.grain] The optional config.width property passed to ${e}() must be of type number.`);if(void 0!==t[1].height&&"number"!=typeof t[1].height)throw Error(`[p5.grain] The optional config.height property passed to ${e}() must be of type number.`);if(void 0!==t[1].mode&&"string"!=typeof t[1].mode)throw Error(`[p5.grain] The optional config.mode property passed to ${e}() must be of type string.`);if(void 0!==t[1].context&&!(t[1].context instanceof p5.Graphics))throw Error(`[p5.grain] The optional config.context parameter passed to ${e}() must be an instance of p5.Graphics.`);if(void 0!==t[1].reflect&&"boolean"!=typeof t[1].reflect)throw Error(`[p5.grain] The optional config.reflect property passed to ${e}() must be of type boolean.`)}}}}const l=(e,t,o,r,i=0,n)=>{const[a,s,l]=e,[p,h]=o;for(let e=0;e<t;e++){const e=random(p,h)*l,t=i/180*PI,o=(l-e)*random(),d=random()*r-.5*r,c=random()*r-.5*r;n.line(a+cos(t)*o+d,s-sin(t)*o+c,a+cos(t)*(o+e)+d,s-sin(t)*(o+e)+c)}},p=(e,t,o,r,i)=>{const[n,a,s,p]=e;let h=r/2;l([n-h,a+0,s+2*h],t,o,r,0,i),l([n+0,a-h,p+2*h],t,o,r,-90,i),l([n-h,a+p-0,s+2*h],t,o,r,0,i),l([n+s-0,a-h,p+2*h],t,o,r,-90,i)},h=(e,t,o,r,i)=>{const[n,a,s,p]=e,h=p/t,d=s/t;for(let e=0;e<t;e++)l([n,a+h*e,s],10,o,r,0,i);for(let e=0;e<t;e++)l([n+d*e,a,p],3,o,r,-90,i)},d=(e,t,o)=>{e.noStroke(),e.fill(o);const r=Math.min(e.width,e.height)*t;e.rect(0,0,e.width,r),e.rect(0,e.height-r,e.width,r),e.rect(0,0,r,e.height),e.rect(e.width-r,0,r,e.height)},c=(e,t,o,r,i,n,a,s)=>{if(s.noFill(),s.strokeWeight(2),s.strokeCap(SQUARE),s.colorMode(RGB),a)for(let a=t;a<=t+r;a++){let l=map(a,t,t+r,0,1),p=s.lerpColor(i,n,l);s.stroke(p),s.line(e,a,e+o,a)}else for(let a=e;a<=e+o;a++){let l=map(a,e,e+o,0,1),p=s.lerpColor(i,n,l);s.stroke(p),s.line(a,t,a,t+r)}s.colorMode(HSB,360,100,100)},m=(e,t,o,r=10,i=1,n=1.01,a=0,s)=>{const l=[e,t,o],p=[[l[0],l[1]],[l[1],l[2]],[l[2],l[0]]],[h,d,c]=p,m=dist(...h.flat()),f=dist(...d.flat()),u=dist(...c.flat());switch(a){case 0:{let e=atan2(c[0][1]-h[1][1],c[0][0]-h[1][0]),t=atan2(c[0][1]-h[0][1],c[0][0]-h[0][0]);for(let o=0;o<r;o++){const a=pow(o/r,i),l=[[h[1][0]+cos(e)*f*a,h[1][1]+sin(e)*f*a],[h[0][0]+cos(t)*u*a,h[0][1]+sin(t)*u*a],[h[0][0]+cos(t)*min(u,u*a*n),h[0][1]+sin(t)*min(u,u*a*n)],[h[1][0]+cos(e)*min(f,f*a*n),h[1][1]+sin(e)*min(f,f*a*n)]];s.beginShape(),l.forEach((e=>s.vertex(...e))),s.endShape(CLOSE)}break}case 1:{const e=atan2(c[1][1]-d[1][1],c[1][0]-d[1][0]),t=atan2(c[1][1]-d[0][1],c[1][0]-d[0][0]);for(let o=0;o<r;o++){const a=pow(o/r,i),l=[[d[1][0]+cos(e)*u*a,d[1][1]+sin(e)*u*a],[d[0][0]+cos(t)*m*a,d[0][1]+sin(t)*m*a],[d[0][0]+cos(t)*min(m,m*a*n),d[0][1]+sin(t)*min(m,m*a*n)],[d[1][0]+cos(e)*min(u,u*a*n),d[1][1]+sin(e)*min(u,u*a*n)]];s.beginShape(),l.forEach((e=>s.vertex(...e))),s.endShape(CLOSE)}break}case 2:{const e=atan2(h[1][1]-c[1][1],h[1][0]-c[1][0]),t=atan2(h[1][1]-c[0][1],h[1][0]-c[0][0]);for(let o=0;o<r;o++){const a=pow(o/r,i),l=[[c[1][0]+cos(e)*m*a,c[1][1]+sin(e)*m*a],[c[0][0]+cos(t)*f*a,c[0][1]+sin(t)*f*a],[c[0][0]+cos(t)*min(f,f*a*n),c[0][1]+sin(t)*min(f,f*a*n)],[c[1][0]+cos(e)*min(m,m*a*n),c[1][1]+sin(e)*min(m,m*a*n)]];s.beginShape(),l.forEach((e=>s.vertex(...e))),s.endShape(CLOSE)}break}}},f=(e,t,o,r,i=2,n=10,a=!0,s=!1,l)=>{l.noStroke(),l.fill(0);for(let p=0;p<n;p++)if(s){const s=e+o*Math.pow(p/n,i),h=a?p/n:1-p/n,d=Math.pow(h,2)*(o/n)*1.5+1;l.rect(s,t,d,r)}else{const s=t+r*Math.pow(p/n,i),h=a?p/n:1-p/n,d=Math.pow(h,2)*(r/n)*1.5+1;l.rect(e,s,o,d)}},u=(t=[])=>{const o=window.$features.Palette;return["Vibes","RGB"].includes(o)?window.$settings.hasCol?color(window.$settings.hasColAll?360*random():0,100,100):color(0):color(e.SWATCHES[i(e.PALETTE[o].filter((e=>!t.includes(e))))])},{SWATCHES:w,FRAME:g,COMPLEXITY:b,SYMMETRY:x,SYMMETRY_SCALE:y}=e;let E,S=!1,v=~~(1e9*(new a).random_dec());const M=.75;window.setup=()=>{window.renderComplete=!1,n(v),E=new s,E.setup({random}),window.$features=function(){let e=new a,t={Palette:e.random_bool(.35)?"Vibes":e.random_bool(.3)?"RGB":e.random_bool(.45)?"Crayon":e.random_choice(["Blue","Red","Sketch","Yellow","Green"]),Complexity:e.random_bool(.1)?"Low":e.random_bool(.25)?"High":"Normal",Speed:e.random_bool(.25)?"Normal":"Warp",Symmetry:e.random_bool(.15)?"Square":e.random_bool(.15)?"Wild":"Normal",View:e.random_bool(.25)?"Windows":e.random_choice(["Horizon","Mixed"]),Photogenic:"None",Frame:"Framed",Side:"A"};return["Vibes","RGB"].includes(t.Palette)&&e.random_bool(.1)&&(t.View="None"),["Vibes","RGB"].includes(t.Palette)&&e.random_bool(.33)&&(t.Frame="None"),"Sketch"===t.Palette&&(t.View=e.random_choice(["Windows","Horizon","Mixed"])),["Vibes","RGB"].includes(t.Palette)&&(t.Complexity="Normal"),["Sketch"].includes(t.Palette)&&e.random_bool(.1)&&(t.Complexity="Ultra"),["RGB"].includes(t.Palette)&&(t.Speed="Warp"),t}(),window.$settings={hasCol:random()<.5,hasColAll:random()<.25,horizon:random()<.5?"Mixed":random()<.25?"Horizontal":"Vertical",gravity:random()<.1?i(["Stretch","Split"]):"Normal",rgbShine:random()<.5,blocky:random()<.25||"Sketch"===window.$features.Palette,opacity:["Vibes"].includes(window.$features.Palette)&&random()<.1?.5:1};const[e,t]=((e,t,o)=>((e,t,o,r)=>{const i=Math.min(o/e,r/1);return[e*i,1*i]})(e,0,t,o))(M,windowWidth,windowHeight),o=createCanvas(Math.floor(e),Math.floor(t));pixelDensity(2),o.style("width",""),o.style("height",""),o.style("max-width","100%"),o.style("max-height","100%"),colorMode(HSB,360,100,100),noLoop()};const $=(e,t)=>{clear(),noStroke(),fill(0),rect(0,0,width,height);const o=.005*Math.min(width,height),r=.8*width,i=(width-r)/2,n=e*r;fill("#fff"),rect(i,height/2-o/2,n,o),textSize(3.5*o),text(t,width/2-r/2,height/2-2*o)},P=async(t,o)=>{n(v);const a=window.$features.Palette,s=createGraphics(t,o);s.colorMode(HSB,360,100,100),s.pixelDensity(2),(e=>{const t=window.$features.Palette;let o,r,a;if(["Vibes","RGB"].includes(t)){const e=i(["Blue","Red"]);"Blue"===e&&(a=random(200,250)),"Red"===e&&(a=random(-10,20)),o=color(a%360,100,100),r=color((a+30)%360,100,100)}else o=color(hue(w.paper),saturation(w.paper),brightness(w.paper),window.$settings.opacity),r=color(hue(w.paper),saturation(w.paper),.85*brightness(w.paper),window.$settings.opacity**2);c(0,0,e.width,e.height,o,r,!0,e),"None"===window.$features.View||"Warp"===window.$features.Speed&&((e,t,o,r,i,n,a)=>{const s=[0+o/2,0+r/2];i.noStroke(),n&&(i.fill(n),i.rect(0,0,o,r));const l=[[[0,0],[0+o,0],[s[0],s[1]]],[[0+o,0],[0+o,0+r],[s[0],s[1]]],[[0,0+r],[0+o,0+r],[s[0],s[1]]],[[0,0],[0,0+r],[s[0],s[1]]]];for(const e of l)i.noFill(),i.fill(a),m(e[0],e[1],e[2],random(5,20),random(.5,2),random(1.015,1.15),Math.floor(3*random()),i)})(0,0,e.width,e.height,e,"Vibes"===t?null:w.paper,w.black);const s=50*e.width*.001;["RGB","Vibes"].includes(window.$features.Palette)?E.granulateChannels(s/2,e):E.granulateChannels(s/3,e),n(v),console.info({Features:window.$features,Settings:window.$settings})})(s),await(async(t,o=!0)=>{const r=window.$features.Palette;let i=b[window.$features.Complexity];for(let n=0;n<i;n++){"None"===window.$features.View&&d(t,g,w[["Vibes","RGB"].includes(r)?"black":"paper"]),o&&$(n/i,(S?"SAVING":"LOADING")+" HYPER DRIVE...");const a=Math.pow(1-n/i,1);let s=t.width*random(...y[window.$features.Symmetry])*a;s=constrain(s,0,t.width);let l=s*random(...x[window.$features.Symmetry]);l=constrain(l,0,t.height),"Square"===window.$features.Symmetry&&(l=s*(1/M));const m=.75,b=random(-m,m),E=random(-m,m);let v=(t.width-s)/2+Math.min(t.width,t.height)*b,P=(t.height-l)/2+Math.min(t.width,t.height)*E;"Stretch"===window.$settings.gravity?P=.5*(t.height-l)+.5*P:"Split"===window.$settings.gravity&&random()<.25&&(P=t.height/2);let C=color(n%2==0?u():color(0));if(window.$settings.blocky&&(C=color(n%2==0?color(0):u())),C=color(hue(C),saturation(C),brightness(C),window.$settings.opacity),t.fill(C),t.noStroke(),["Vibes","RGB"].includes(r)){const e=360*random();c(v,P,s,l,color(e,100,100,window.$settings.opacity),color((e+50)%360,100,80,window.$settings.opacity**2),!0,t)}else t.rect(v,P,s,l);let k=random(8,24),R="Horizon"===window.$features.View||"Mixed"===window.$features.View&&random()<.5;if("None"===window.$features.View);else if(R){if(["Vibes","RGB"].includes(r)){const e=360*random();c(v,P,s,l,color(e,100,100,window.$settings.opacity),color((e+50)%360,100,80,window.$settings.opacity**2),!0,t)}else{let e=u();e=color(hue(e),saturation(e),brightness(e),window.$settings.opacity),t.noStroke(),t.fill(e),t.rect(v,P,s,l)}f(v,P,s,l,random(.5,3),k,random()<.5,"Mixed"===window.$settings.horizon?random()<.5:e.HORIZON[window.$settings.horizon],t)}else{let e=n%2!=0?color(0):u();["RGB","Vibes"].includes(window.$features.Palette)||0!==e.levels[0]||0!==C.levels[0]||0!==e.levels[1]||0!==C.levels[1]||0!==e.levels[2]||0!==C.levels[2]||(e=w.paper),t.stroke(e),t.strokeWeight(.0075*Math.min(s,l)),h([v,P,s,l],random(10,15),[.8,1],2,t)}t.stroke(n%2!=0||["Sketch","Green","Blue","Red","Yellow"].includes(window.$features.Palette)?0:u(["paper"])),t.strokeWeight(("Ultra"===window.$features.Complexity?.005:.02125)*Math.min(s,l)),"Framed"===window.$features.Frame&&p([v,P,s,l],random(3,5),[random(.5,.8),random(1,2)],0,t);let T=createImage(2*t.width,2*t.height);T.copy(t,0,0,t.width,t.height,0,0,2*t.width,2*t.height),t.image(T,v,P,s,l,0,0)}})(s);const l=(()=>{switch(window.$features.Palette){case"Vibes":return 115;case"RGB":return 85;default:return 0}})();return["Vibes","RGB"].includes(window.$features.Palette)&&((e,t,o,i)=>{const n=e.get(0,0,e.width,e.height),a=createGraphics(Math.ceil(e.width),Math.ceil(e.height));a.pixelDensity(1),a.image(n,0,0,a.width,a.height),((e,t,o=2.25)=>{e.loadPixels();for(let r=0;r<e.height;r++)for(let i=0;i<e.width;i++){const n=r*e.width*4+4*i;e.pixels[n]=constrain(o*(e.pixels[n]-128)+128,0,255),e.pixels[n+1]=constrain(o*(e.pixels[n+1]-128)+128,0,255),e.pixels[n+2]=constrain(o*(e.pixels[n+2]-128)+128,0,255),e.pixels[n+3]=t}})(a,i),a.pixels=r().blurImage(a.pixels,a.width,a.height,o),a.updatePixels(),e.blendMode(t),e.image(a,0,0,e.width,e.height),a.remove()})(s,"RGB"===a&&window.$settings.rgbShine?SCREEN:BLEND,("RGB"===a?.015:.0225)*s.width,l),(({vW:e,vH:t,vS:o,vP:r,vinScale:i,buf:n})=>{n.loadPixels();const a=2*n.height,s=2*n.width;for(let l=0;l<a;l++){const p=1-l/a;for(let h=0;h<s;h++){const d=l*s*4+4*h,c=dist(h/s*e,l/a*t,.5,.5)*i;let m=Math.pow(p,.25)*.25+.75-Math.pow(c,r)*o;n.pixels[d]=constrain(n.pixels[d]+m,0,255),n.pixels[d+1]=constrain(n.pixels[d+1]+m,0,255),n.pixels[d+2]=constrain(n.pixels[d+2]+m,0,255),n.pixels[d+3]=255}}n.updatePixels(),n.blendMode(BLEND)})({vW:random(.67,1),vH:random(.67,1),vS:random(5,10),vP:random(1.4,1.9),vinScale:random(2,2.75),buf:s}),E.granulateChannels(8*s.width*.001,s),(e=>{let t=Number.MAX_VALUE,o=Number.MIN_VALUE;for(let r=0;r<2*e.height;r++)for(let i=0;i<2*e.width;i++){const n=r*e.width*2*4+4*i;t=Math.min(t,e.pixels[n],e.pixels[n+1],e.pixels[n+2]),o=Math.max(o,e.pixels[n],e.pixels[n+1],e.pixels[n+2])}for(let r=0;r<2*e.height;r++)for(let i=0;i<2*e.width;i++){const n=r*e.width*2*4+4*i,a=255/(o-t);e.pixels[n]=(e.pixels[n]-t)*a,e.pixels[n+1]=(e.pixels[n+1]-t)*a,e.pixels[n+2]=(e.pixels[n+2]-t)*a}e.updatePixels()})(s),d(s,g,w[["Vibes","RGB"].includes(a)?"black":"paper"]),s};window.draw=async()=>{const e=await P(Math.floor(width),Math.floor(height));image(e,0,0),e.remove(),window.renderComplete=!0};const C=async e=>{S=!0,window.renderComplete=!1,console.info("Saving..."),$(0,"SAVING HYPER DRIVE...");const t=await P(Math.floor(e),Math.floor(e*(1/M)));save(t,"hyper_drive_a.png"),console.info("Done."),S=!1,image(t,0,0,width,height),t.remove()};window.keyTyped=()=>{switch(key){case"p":return C(4096);case"s":return C(2048)}}})()})();
(()=>{var e={537:e=>{function t(e,t,o){for(var r=[],i=[],n=[],a=[],s=0;s<t*o;s++)r.push(e[4*s]),i.push(e[4*s+1]),n.push(e[4*s+2]),a.push(e[4*s+3]);return[r,i,n,a]}function o(e,t,o,i,n,a){r(e,t,o,i,(a[0]-1)/2),r(t,e,o,i,(a[1]-1)/2),r(e,t,o,i,(a[2]-1)/2)}function r(e,t,o,r,i){for(var n=0;n<e.length;n++)t[n]=e[n];!function(e,t,o,r,i){for(var n=1/(i+i+1),a=0;a<r;a++){for(var s=a*o,l=s,p=s+i,h=e[s],d=e[s+o-1],c=(i+1)*h,m=0;m<i;m++)c+=e[s+m];for(m=0;m<=i;m++)c+=e[p++]-h,t[s++]=c*n;for(m=i+1;m<o-i;m++)c+=e[p++]-e[l++],t[s++]=c*n;for(m=o-i;m<o;m++)c+=d-e[l++],t[s++]=c*n}}(t,e,o,r,i),function(e,t,o,r,i){for(var n=1/(i+i+1),a=0;a<o;a++){for(var s=a,l=s,p=s+i*o,h=e[s],d=e[s+o*(r-1)],c=(i+1)*h,m=0;m<i;m++)c+=e[s+m*o];for(m=0;m<=i;m++)c+=e[p]-h,t[s]=c*n,p+=o,s+=o;for(m=i+1;m<r-i;m++)c+=e[p]-e[l],t[s]=c*n,l+=o,p+=o,s+=o;for(m=r-i;m<r;m++)c+=d-e[l],t[s]=c*n,l+=o,s+=o}}(e,t,o,r,i)}e.exports={blurImage:function(e,r,i,n){var a=t(e,r,i),s=t(e,r,i),l=function(e,t){var o=Math.sqrt(12*e*e/3+1),r=Math.floor(o);r%2==0&&r--;for(var i=r+2,n=(12*e*e-3*r*r-12*r-9)/(-4*r-4),a=Math.round(n),s=[],l=0;l<3;l++)s.push(l<a?r:i);return s}(n);return o(a[0],s[0],r,i,0,l),o(a[1],s[1],r,i,0,l),o(a[2],s[2],r,i,0,l),function(e,t,o,r,i,n,a){for(var s=0;s<t*o;s++)e[4*s]=r[s],e[4*s+1]=i[s],e[4*s+2]=n[s],e[4*s+3]=a[s]}(e,r,i,s[0],s[1],s[2],s[3]),e}}}},t={};function o(r){var i=t[r];if(void 0!==i)return i.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,o),n.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=JSON.parse('{"SWATCHES":{"paper":"#fff0e0","black":"#000","white":"#fff","teal":"#60cab6","yellow":"#fabf0f","red":"#bf2640","blue":"#1a3966","blue2":"#11358e","blue3":"#4c6ebf","blue4":"#6290ff","green":"#60aa10"},"PALETTE":{"Crayon":["teal","yellow","blue","red","paper"],"Blue":["blue","blue2","blue3","blue4","paper"],"Red":["red","paper"],"Sketch":["paper"],"Yellow":["yellow"],"Green":["green","paper"],"Vibes":[],"RGB":[]},"COMPLEXITY":{"Minimal":15,"Low":30,"Normal":45,"High":60,"Ultra":75},"HORIZON":{"Horizontal":false,"Vertical":true,"Mixed":null},"SYMMETRY":{"Wild":[0.333,3],"Normal":[0.5,2],"Square":[1,1]},"SYMMETRY_SCALE":{"Wild":[0,1],"Normal":[0.5,1],"Square":[0.33,0.67]},"FRAME":0.02}');var t=o(537),r=o.n(t);const i=e=>e[Math.floor(random()*e.length)],n=e=>{randomSeed(e),noiseSeed(e)};class a{constructor(){this.useA=!1;let e=function(e){let t=parseInt(e.substr(0,8),16),o=parseInt(e.substr(8,8),16),r=parseInt(e.substr(16,8),16),i=parseInt(e.substr(24,8),16);return function(){t|=0,o|=0,r|=0,i|=0;let e=(t+o|0)+i|0;return i=i+1|0,t=o^o>>>9,o=r+(r<<3)|0,r=r<<21|r>>>11,r=r+e|0,(e>>>0)/4294967296}};this.prngA=new e(tokenData.hash.substr(2,32)),this.prngB=new e(tokenData.hash.substr(34,32));for(let e=0;e<1e6;e+=2)this.prngA(),this.prngB()}random_dec(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}random_num(e,t){return e+(t-e)*this.random_dec()}random_int(e,t){return Math.floor(this.random_num(e,t+1))}random_bool(e){return this.random_dec()<e}random_choice(e){return e[this.random_int(0,e.length-1)]}}class s{version="0.3.0";ignoreWarnings=!1;ignoreErrors=!1;#e;#t;#o;constructor(){this.#e=Math.random,this.#t={frameCount:0},this.#o={frameCount:0,tX_anchor:0,tX:0,tY:0}}setup(e){this.#r("setup",arguments),void 0===e?this.#e=random:"object"==typeof e&&("function"==typeof e.random&&(this.#e=e.random),"boolean"==typeof e.ignoreErrors&&(this.ignoreErrors=e.ignoreErrors),"boolean"==typeof e.ignoreWarnings&&(this.ignoreWarnings=e.ignoreWarnings))}granulateSimple(e,t){let o=round(e);t.loadPixels();let r=t.pixelDensity(),i=t.width*r*4*(t.height*r);for(let e=0;e<i;e+=4){let r=this.#e(-o,o);t.pixels[e]=t.pixels[e]+r,t.pixels[e+1]=t.pixels[e+1]+r,t.pixels[e+2]=t.pixels[e+2]+r}t.updatePixels()}granulateChannels(e,t){let o=round(e);t.loadPixels();let r=t.pixelDensity(),i=t.width*r*4*(t.height*r);for(let e=0;e<i;e+=4)t.pixels[e]=t.pixels[e]+this.#e(-o,o),t.pixels[e+1]=t.pixels[e+1]+this.#e(-o,o),t.pixels[e+2]=t.pixels[e+2]+this.#e(-o,o);t.updatePixels()}granulateFuzzify(e,t,o){this.#r("granulateFuzzy",arguments),loadPixels();let r=round(e),i=t?round(t):2,n=o||!1,a=pixelDensity(),s=4*width*a,l=4*i+s,p=s*(height*a);for(let e=0;e<p;e+=4)pixels[e+l]&&(pixels[e]=round((pixels[e]+pixels[e+l])/2),pixels[e+1]=round((pixels[e+1]+pixels[e+l+1])/2),pixels[e+2]=round((pixels[e+2]+pixels[e+l+2])/2),n&&(pixels[e+3]=round((pixels[e+3]+pixels[e+l+3])/2))),pixels[e]=pixels[e]+this.#e(-r,r),pixels[e+1]=pixels[e+1]+this.#e(-r,r),pixels[e+2]=pixels[e+2]+this.#e(-r,r),n&&(pixels[e+3]=pixels[e+3]+this.#e(-r,r));updatePixels()}textureAnimate(e,t){this.#r("textureAnimate",arguments);let o=t&&t.atFrame?round(t.atFrame):2;if(this.#t.frameCount+=1,this.#t.frameCount>=o){let o=t&&t.amount?round(t.amount):min(width,height),r=floor(this.#e()*o),i=floor(this.#e()*o),n=`${r}px ${i}px`;e instanceof HTMLElement?e.style.backgroundPosition=n:e instanceof SVGElement?(e.style.top=-i+"px",e.style.left=-r+"px"):e instanceof p5.Element&&e.style("background-position",n),this.#t.frameCount=0}}textureOverlay(e,t){this.#r("textureOverlay",arguments);let o=t.context instanceof p5.Graphics,r=t.context?t.context.width:width,i=t.context?t.context.height:height,n=t.mode||MULTIPLY,a=t.reflect||!1,s=t.animate||!1,l=t.animate&&t.animate.atFrame?round(t.animate.atFrame):2,p=t.animate&&t.animate.amount?round(t.animate.amount):min(r,i),h="number"==typeof t.width?t.width:e.width,d="number"==typeof t.height?t.height:e.height;s&&(this.#o.frameCount+=1,this.#o.frameCount>=l&&(this.#o.tX_anchor=-floor(this.#e()*p),this.#o.tY=-floor(this.#e()*p),this.#o.frameCount=0));let c=this.#o.tX_anchor,m=this.#o.tY,f=!0,u=!0;for(blendMode(n);m<i;){for(;c<r;){if(a?(o?t.context.push():push(),f?u?o?t.context.image(e,c,m,h,d):image(e,c,m,h,d):o?(t.context.scale(-1,1),t.context.image(e,-c,m,-h,d)):(scale(-1,1),image(e,-c,m,-h,d)):u?o?(t.context.scale(1,-1),t.context.image(e,c,-m,h,-d)):(scale(1,-1),image(e,c,-m,h,-d)):o?(t.context.scale(-1,-1),t.context.image(e,-c,-m,-h,-d)):(scale(-1,-1),image(e,-c,-m,-h,-d)),o?t.context.pop():pop()):o?t.context.image(e,c,m,h,d):image(e,c,m,h,d),(c+=h)>=r){u=!0,c=this.#o.tX_anchor,m+=d;break}u=!u}f=!f}blendMode(BLEND),o&&t.context.reset()}#r(e,t){if(!this.ignoreErrors)switch(e){case"setup":if(void 0!==t[0]&&"object"!=typeof t[0])throw Error(`[p5.grain] The optional config parameter passed to p5grain.${e}() must be of type object.`);if("object"==typeof t[0]){if(void 0!==t[0].random&&"function"!=typeof t[0].random)throw Error(`[p5.grain] The optional config.random property passed to p5grain.${e}() must be of type function.`);if(void 0!==t[0].ignoreErrors&&"boolean"!=typeof t[0].ignoreErrors)throw Error(`[p5.grain] The optional config.ignoreErrors property passed to p5grain.${e}() must be of type boolean.`);if(void 0!==t[0].ignoreWarnings&&"boolean"!=typeof t[0].ignoreWarnings)throw Error(`[p5.grain] The optional config.ignoreWarnings property passed to p5grain.${e}() must be of type boolean.`)}break;case"granulateSimple":case"granulateChannels":if("number"!=typeof t[0])throw Error(`[p5.grain] The amount parameter passed to ${e}() must be of type number.`);if(void 0!==t[1]&&"boolean"!=typeof t[1])throw Error(`[p5.grain] The alpha parameter passed to ${e}() must be of type boolean.`);break;case"granulateFuzzify":if("number"!=typeof t[0])throw Error(`[p5.grain] The amount parameter passed to ${e}() must be of type number.`);if(void 0!==t[1]&&"number"!=typeof t[1])throw Error(`[p5.grain] The fuzziness parameter passed to ${e}() must be of type number.`);if(void 0!==t[2]&&"boolean"!=typeof t[2])throw Error(`[p5.grain] The alpha parameter passed to ${e}() must be of type boolean.`);break;case"textureAnimate":if(!(t[0]instanceof HTMLElement||t[0]instanceof SVGElement||t[0]instanceof p5.Element))throw Error(`[p5.grain] The textureElement parameter passed to ${e}() must be an instance of HTMLElement, SVGElement or p5.Element.`);if(void 0!==t[1]&&"object"!=typeof t[1])throw Error(`[p5.grain] The optional config parameter passed to ${e}() must be of type object.`);if("object"==typeof t[1]){if(void 0!==t[1].atFrame&&"number"!=typeof t[1].atFrame)throw Error(`[p5.grain] The optional config.atFrame property passed to ${e}() must be of type number.`);if(void 0!==t[1].amount&&"number"!=typeof t[1].amount)throw Error(`[p5.grain] The optional config.amount parameter passed to ${e}() must be of type number.`)}break;case"textureOverlay":if(!(t[0]instanceof p5.Image))throw Error(`[p5.grain] The texture parameter passed to ${e}() must be an instance of p5.Image.`);if(void 0!==t[1]&&"object"!=typeof t[1])throw Error(`[p5.grain] The optional config parameter passed to ${e}() must be of type object.`);if("object"==typeof t[1]){if(void 0!==t[1].width&&"number"!=typeof t[1].width)throw Error(`[p5.grain] The optional config.width property passed to ${e}() must be of type number.`);if(void 0!==t[1].height&&"number"!=typeof t[1].height)throw Error(`[p5.grain] The optional config.height property passed to ${e}() must be of type number.`);if(void 0!==t[1].mode&&"string"!=typeof t[1].mode)throw Error(`[p5.grain] The optional config.mode property passed to ${e}() must be of type string.`);if(void 0!==t[1].context&&!(t[1].context instanceof p5.Graphics))throw Error(`[p5.grain] The optional config.context parameter passed to ${e}() must be an instance of p5.Graphics.`);if(void 0!==t[1].reflect&&"boolean"!=typeof t[1].reflect)throw Error(`[p5.grain] The optional config.reflect property passed to ${e}() must be of type boolean.`)}}}}const l=(e,t,o,r,i=0,n)=>{const[a,s,l]=e,[p,h]=o;for(let e=0;e<t;e++){const e=random(p,h)*l,t=i/180*PI,o=(l-e)*random(),d=random()*r-.5*r,c=random()*r-.5*r;n.line(a+cos(t)*o+d,s-sin(t)*o+c,a+cos(t)*(o+e)+d,s-sin(t)*(o+e)+c)}},p=(e,t,o,r,i)=>{const[n,a,s,p]=e;let h=r/2;l([n-h,a+0,s+2*h],t,o,r,0,i),l([n+0,a-h,p+2*h],t,o,r,-90,i),l([n-h,a+p-0,s+2*h],t,o,r,0,i),l([n+s-0,a-h,p+2*h],t,o,r,-90,i)},h=(e,t,o,r,i)=>{const[n,a,s,p]=e,h=p/t,d=s/t;for(let e=0;e<t;e++)l([n,a+h*e,s],10,o,r,0,i);for(let e=0;e<t;e++)l([n+d*e,a,p],3,o,r,-90,i)},d=(e,t,o)=>{e.noStroke(),e.fill(o);const r=Math.min(e.width,e.height)*t;e.rect(0,0,e.width,r),e.rect(0,e.height-r,e.width,r),e.rect(0,0,r,e.height),e.rect(e.width-r,0,r,e.height)},c=(e,t,o,r,i,n,a,s)=>{if(s.noFill(),s.strokeWeight(2),s.strokeCap(SQUARE),s.colorMode(RGB),a)for(let a=t;a<=t+r;a++){let l=map(a,t,t+r,0,1),p=s.lerpColor(i,n,l);s.stroke(p),s.line(e,a,e+o,a)}else for(let a=e;a<=e+o;a++){let l=map(a,e,e+o,0,1),p=s.lerpColor(i,n,l);s.stroke(p),s.line(a,t,a,t+r)}s.colorMode(HSB,360,100,100)},m=(e,t,o,r=10,i=1,n=1.01,a=0,s)=>{const l=[e,t,o],p=[[l[0],l[1]],[l[1],l[2]],[l[2],l[0]]],[h,d,c]=p,m=dist(...h.flat()),f=dist(...d.flat()),u=dist(...c.flat());switch(a){case 0:{let e=atan2(c[0][1]-h[1][1],c[0][0]-h[1][0]),t=atan2(c[0][1]-h[0][1],c[0][0]-h[0][0]);for(let o=0;o<r;o++){const a=pow(o/r,i),l=[[h[1][0]+cos(e)*f*a,h[1][1]+sin(e)*f*a],[h[0][0]+cos(t)*u*a,h[0][1]+sin(t)*u*a],[h[0][0]+cos(t)*min(u,u*a*n),h[0][1]+sin(t)*min(u,u*a*n)],[h[1][0]+cos(e)*min(f,f*a*n),h[1][1]+sin(e)*min(f,f*a*n)]];s.beginShape(),l.forEach((e=>s.vertex(...e))),s.endShape(CLOSE)}break}case 1:{const e=atan2(c[1][1]-d[1][1],c[1][0]-d[1][0]),t=atan2(c[1][1]-d[0][1],c[1][0]-d[0][0]);for(let o=0;o<r;o++){const a=pow(o/r,i),l=[[d[1][0]+cos(e)*u*a,d[1][1]+sin(e)*u*a],[d[0][0]+cos(t)*m*a,d[0][1]+sin(t)*m*a],[d[0][0]+cos(t)*min(m,m*a*n),d[0][1]+sin(t)*min(m,m*a*n)],[d[1][0]+cos(e)*min(u,u*a*n),d[1][1]+sin(e)*min(u,u*a*n)]];s.beginShape(),l.forEach((e=>s.vertex(...e))),s.endShape(CLOSE)}break}case 2:{const e=atan2(h[1][1]-c[1][1],h[1][0]-c[1][0]),t=atan2(h[1][1]-c[0][1],h[1][0]-c[0][0]);for(let o=0;o<r;o++){const a=pow(o/r,i),l=[[c[1][0]+cos(e)*m*a,c[1][1]+sin(e)*m*a],[c[0][0]+cos(t)*f*a,c[0][1]+sin(t)*f*a],[c[0][0]+cos(t)*min(f,f*a*n),c[0][1]+sin(t)*min(f,f*a*n)],[c[1][0]+cos(e)*min(m,m*a*n),c[1][1]+sin(e)*min(m,m*a*n)]];s.beginShape(),l.forEach((e=>s.vertex(...e))),s.endShape(CLOSE)}break}}},f=(e,t,o,r,i=2,n=10,a=!0,s=!1,l)=>{l.noStroke(),l.fill(0);for(let p=0;p<n;p++)if(s){const s=e+o*Math.pow(p/n,i),h=a?p/n:1-p/n,d=Math.pow(h,2)*(o/n)*1.5+1;l.rect(s,t,d,r)}else{const s=t+r*Math.pow(p/n,i),h=a?p/n:1-p/n,d=Math.pow(h,2)*(r/n)*1.5+1;l.rect(e,s,o,d)}},u=(t=[])=>{const o=window.$features.Palette;return["Vibes","RGB"].includes(o)?window.$settings.hasCol?color(window.$settings.hasColAll?360*random():0,100,100):color(0):color(e.SWATCHES[i(e.PALETTE[o].filter((e=>!t.includes(e))))])},{SWATCHES:w,FRAME:g,COMPLEXITY:b,SYMMETRY:x,SYMMETRY_SCALE:y}=e;let E,S=!1,v=~~(1e9*(new a).random_dec());const M=.75;window.setup=()=>{window.renderComplete=!1,n(v),E=new s,E.setup({random}),window.$features=function(){let e=new a,t={Palette:e.random_bool(.35)?"Vibes":e.random_bool(.3)?"RGB":e.random_bool(.45)?"Crayon":e.random_choice(["Blue","Red","Sketch","Yellow","Green"]),Complexity:e.random_bool(.1)?"Low":e.random_bool(.25)?"High":"Normal",Speed:e.random_bool(.25)?"Normal":"Warp",Symmetry:e.random_bool(.15)?"Square":e.random_bool(.15)?"Wild":"Normal",View:e.random_bool(.25)?"Windows":e.random_choice(["Horizon","Mixed"]),Photogenic:"None",Frame:"Framed",Side:"A"};return["Vibes","RGB"].includes(t.Palette)&&e.random_bool(.1)&&(t.View="None"),["Vibes","RGB"].includes(t.Palette)&&e.random_bool(.33)&&(t.Frame="None"),"Sketch"===t.Palette&&(t.View=e.random_choice(["Windows","Horizon","Mixed"])),["Vibes","RGB"].includes(t.Palette)&&(t.Complexity="Normal"),["Sketch"].includes(t.Palette)&&e.random_bool(.1)&&(t.Complexity="Ultra"),["RGB"].includes(t.Palette)&&(t.Speed="Warp"),t}(),window.$settings={hasCol:random()<.5,hasColAll:random()<.25,horizon:random()<.5?"Mixed":random()<.25?"Horizontal":"Vertical",gravity:random()<.1?i(["Stretch","Split"]):"Normal",rgbShine:random()<.5,blocky:random()<.25||"Sketch"===window.$features.Palette,opacity:["Vibes"].includes(window.$features.Palette)&&random()<.1?.5:1};const[e,t]=((e,t,o)=>((e,t,o,r)=>{const i=Math.min(o/e,r/1);return[e*i,1*i]})(e,0,t,o))(M,windowWidth,windowHeight),o=createCanvas(Math.floor(e),Math.floor(t));pixelDensity(2),o.style("width",""),o.style("height",""),o.style("max-width","100%"),o.style("max-height","100%"),colorMode(HSB,360,100,100),noLoop()};const $=(e,t)=>{clear(),noStroke(),fill(0),rect(0,0,width,height);const o=.005*Math.min(width,height),r=.8*width,i=(width-r)/2,n=e*r;fill("#fff"),rect(i,height/2-o/2,n,o),textSize(3.5*o),text(t,width/2-r/2,height/2-2*o)},P=async(t,o)=>{n(v);const a=window.$features.Palette,s=createGraphics(t,o);s.colorMode(HSB,360,100,100),s.pixelDensity(2),(e=>{const t=window.$features.Palette;let o,r,a;if(["Vibes","RGB"].includes(t)){const e=i(["Blue","Red"]);"Blue"===e&&(a=random(200,250)),"Red"===e&&(a=random(-10,20)),o=color(a%360,100,100),r=color((a+30)%360,100,100)}else o=color(hue(w.paper),saturation(w.paper),brightness(w.paper),window.$settings.opacity),r=color(hue(w.paper),saturation(w.paper),.85*brightness(w.paper),window.$settings.opacity**2);c(0,0,e.width,e.height,o,r,!0,e),"None"===window.$features.View||"Warp"===window.$features.Speed&&((e,t,o,r,i,n,a)=>{const s=[0+o/2,0+r/2];i.noStroke(),n&&(i.fill(n),i.rect(0,0,o,r));const l=[[[0,0],[0+o,0],[s[0],s[1]]],[[0+o,0],[0+o,0+r],[s[0],s[1]]],[[0,0+r],[0+o,0+r],[s[0],s[1]]],[[0,0],[0,0+r],[s[0],s[1]]]];for(const e of l)i.noFill(),i.fill(a),m(e[0],e[1],e[2],random(5,20),random(.5,2),random(1.015,1.15),Math.floor(3*random()),i)})(0,0,e.width,e.height,e,"Vibes"===t?null:w.paper,w.black);const s=50*e.width*.001;["RGB","Vibes"].includes(window.$features.Palette)?E.granulateChannels(s/2,e):E.granulateChannels(s/3,e),n(v),console.info({Features:window.$features,Settings:window.$settings})})(s),await(async(t,o=!0)=>{const r=window.$features.Palette;let i=b[window.$features.Complexity];for(let n=0;n<i;n++){"None"===window.$features.View&&d(t,g,w[["Vibes","RGB"].includes(r)?"black":"paper"]),o&&$(n/i,(S?"SAVING":"LOADING")+" HYPER DRIVE...");const a=Math.pow(1-n/i,1);let s=t.width*random(...y[window.$features.Symmetry])*a;s=constrain(s,0,t.width);let l=s*random(...x[window.$features.Symmetry]);l=constrain(l,0,t.height),"Square"===window.$features.Symmetry&&(l=s*(1/M));const m=.75,b=random(-m,m),E=random(-m,m);let v=(t.width-s)/2+Math.min(t.width,t.height)*b,P=(t.height-l)/2+Math.min(t.width,t.height)*E;if("Stretch"===window.$settings.gravity?P=.5*(t.height-l)+.5*P:"Split"===window.$settings.gravity&&random()<.25&&(P=t.height/2),s<1||l<1)continue;let C=color(n%2==0?u():color(0));if(window.$settings.blocky&&(C=color(n%2==0?color(0):u())),C=color(hue(C),saturation(C),brightness(C),window.$settings.opacity),t.fill(C),t.noStroke(),["Vibes","RGB"].includes(r)){const e=360*random();c(v,P,s,l,color(e,100,100,window.$settings.opacity),color((e+50)%360,100,80,window.$settings.opacity**2),!0,t)}else t.rect(v,P,s,l);let k=random(8,24),R="Horizon"===window.$features.View||"Mixed"===window.$features.View&&random()<.5;if("None"===window.$features.View);else if(R){if(["Vibes","RGB"].includes(r)){const e=360*random();c(v,P,s,l,color(e,100,100,window.$settings.opacity),color((e+50)%360,100,80,window.$settings.opacity**2),!0,t)}else{let e=u();e=color(hue(e),saturation(e),brightness(e),window.$settings.opacity),t.noStroke(),t.fill(e),t.rect(v,P,s,l)}f(v,P,s,l,random(.5,3),k,random()<.5,"Mixed"===window.$settings.horizon?random()<.5:e.HORIZON[window.$settings.horizon],t)}else{let e=n%2!=0?color(0):u();["RGB","Vibes"].includes(window.$features.Palette)||0!==e.levels[0]||0!==C.levels[0]||0!==e.levels[1]||0!==C.levels[1]||0!==e.levels[2]||0!==C.levels[2]||(e=w.paper),t.stroke(e),t.strokeWeight(.0075*Math.min(s,l)),h([v,P,s,l],random(10,15),[.8,1],2,t)}t.stroke(n%2!=0||["Sketch","Green","Blue","Red","Yellow"].includes(window.$features.Palette)?0:u(["paper"])),t.strokeWeight(("Ultra"===window.$features.Complexity?.005:.02125)*Math.min(s,l)),"Framed"===window.$features.Frame&&p([v,P,s,l],random(3,5),[random(.5,.8),random(1,2)],0,t);let T=createImage(2*t.width,2*t.height);T.copy(t,0,0,t.width,t.height,0,0,2*t.width,2*t.height),t.image(T,v,P,s,l,0,0)}})(s);const l=(()=>{switch(window.$features.Palette){case"Vibes":return 115;case"RGB":return 85;default:return 0}})();return["Vibes","RGB"].includes(window.$features.Palette)&&((e,t,o,i)=>{const n=e.get(0,0,e.width,e.height),a=createGraphics(Math.ceil(e.width),Math.ceil(e.height));a.pixelDensity(1),a.image(n,0,0,a.width,a.height),((e,t,o=2.25)=>{e.loadPixels();for(let r=0;r<e.height;r++)for(let i=0;i<e.width;i++){const n=r*e.width*4+4*i;e.pixels[n]=constrain(o*(e.pixels[n]-128)+128,0,255),e.pixels[n+1]=constrain(o*(e.pixels[n+1]-128)+128,0,255),e.pixels[n+2]=constrain(o*(e.pixels[n+2]-128)+128,0,255),e.pixels[n+3]=t}})(a,i),a.pixels=r().blurImage(a.pixels,a.width,a.height,o),a.updatePixels(),e.blendMode(t),e.image(a,0,0,e.width,e.height),a.remove()})(s,"RGB"===a&&window.$settings.rgbShine?SCREEN:BLEND,("RGB"===a?.015:.0225)*s.width,l),(({vW:e,vH:t,vS:o,vP:r,vinScale:i,buf:n})=>{n.loadPixels();const a=2*n.height,s=2*n.width;for(let l=0;l<a;l++){const p=1-l/a;for(let h=0;h<s;h++){const d=l*s*4+4*h,c=dist(h/s*e,l/a*t,.5,.5)*i;let m=Math.pow(p,.25)*.25+.75-Math.pow(c,r)*o;n.pixels[d]=constrain(n.pixels[d]+m,0,255),n.pixels[d+1]=constrain(n.pixels[d+1]+m,0,255),n.pixels[d+2]=constrain(n.pixels[d+2]+m,0,255),n.pixels[d+3]=255}}n.updatePixels(),n.blendMode(BLEND)})({vW:random(.67,1),vH:random(.67,1),vS:random(5,10),vP:random(1.4,1.9),vinScale:random(2,2.75),buf:s}),E.granulateChannels(8*s.width*.001,s),(e=>{let t=Number.MAX_VALUE,o=Number.MIN_VALUE;for(let r=0;r<2*e.height;r++)for(let i=0;i<2*e.width;i++){const n=r*e.width*2*4+4*i;t=Math.min(t,e.pixels[n],e.pixels[n+1],e.pixels[n+2]),o=Math.max(o,e.pixels[n],e.pixels[n+1],e.pixels[n+2])}for(let r=0;r<2*e.height;r++)for(let i=0;i<2*e.width;i++){const n=r*e.width*2*4+4*i,a=255/(o-t);e.pixels[n]=(e.pixels[n]-t)*a,e.pixels[n+1]=(e.pixels[n+1]-t)*a,e.pixels[n+2]=(e.pixels[n+2]-t)*a}e.updatePixels()})(s),d(s,g,w[["Vibes","RGB"].includes(a)?"black":"paper"]),s};window.draw=async()=>{const e=await P(Math.floor(width),Math.floor(height));image(e,0,0),e.remove(),window.renderComplete=!0};const C=async e=>{S=!0,window.renderComplete=!1,console.info("Saving..."),$(0,"SAVING HYPER DRIVE...");const t=await P(Math.floor(e),Math.floor(e*(1/M)));save(t,"hyper_drive_a.png"),console.info("Done."),S=!1,image(t,0,0,width,height),t.remove()};window.keyTyped=()=>{switch(key){case"p":return C(4096);case"s":return C(2048)}}})()})();
(()=>{var e={537:e=>{function t(e,t,o){for(var r=[],i=[],n=[],a=[],s=0;s<t*o;s++)r.push(e[4*s]),i.push(e[4*s+1]),n.push(e[4*s+2]),a.push(e[4*s+3]);return[r,i,n,a]}function o(e,t,o,i,n,a){r(e,t,o,i,(a[0]-1)/2),r(t,e,o,i,(a[1]-1)/2),r(e,t,o,i,(a[2]-1)/2)}function r(e,t,o,r,i){for(var n=0;n<e.length;n++)t[n]=e[n];!function(e,t,o,r,i){for(var n=1/(i+i+1),a=0;a<r;a++){for(var s=a*o,l=s,p=s+i,h=e[s],d=e[s+o-1],c=(i+1)*h,m=0;m<i;m++)c+=e[s+m];for(m=0;m<=i;m++)c+=e[p++]-h,t[s++]=c*n;for(m=i+1;m<o-i;m++)c+=e[p++]-e[l++],t[s++]=c*n;for(m=o-i;m<o;m++)c+=d-e[l++],t[s++]=c*n}}(t,e,o,r,i),function(e,t,o,r,i){for(var n=1/(i+i+1),a=0;a<o;a++){for(var s=a,l=s,p=s+i*o,h=e[s],d=e[s+o*(r-1)],c=(i+1)*h,m=0;m<i;m++)c+=e[s+m*o];for(m=0;m<=i;m++)c+=e[p]-h,t[s]=c*n,p+=o,s+=o;for(m=i+1;m<r-i;m++)c+=e[p]-e[l],t[s]=c*n,l+=o,p+=o,s+=o;for(m=r-i;m<r;m++)c+=d-e[l],t[s]=c*n,l+=o,s+=o}}(e,t,o,r,i)}e.exports={blurImage:function(e,r,i,n){var a=t(e,r,i),s=t(e,r,i),l=function(e,t){var o=Math.sqrt(12*e*e/3+1),r=Math.floor(o);r%2==0&&r--;for(var i=r+2,n=(12*e*e-3*r*r-12*r-9)/(-4*r-4),a=Math.round(n),s=[],l=0;l<3;l++)s.push(l<a?r:i);return s}(n);return o(a[0],s[0],r,i,0,l),o(a[1],s[1],r,i,0,l),o(a[2],s[2],r,i,0,l),function(e,t,o,r,i,n,a){for(var s=0;s<t*o;s++)e[4*s]=r[s],e[4*s+1]=i[s],e[4*s+2]=n[s],e[4*s+3]=a[s]}(e,r,i,s[0],s[1],s[2],s[3]),e}}}},t={};function o(r){var i=t[r];if(void 0!==i)return i.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,o),n.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=JSON.parse('{"SWATCHES":{"paper":"#fff0e0","black":"#000","white":"#fff","teal":"#60cab6","yellow":"#fabf0f","red":"#bf2640","blue":"#1a3966","blue2":"#11358e","blue3":"#4c6ebf","blue4":"#6290ff","green":"#60aa10"},"PALETTE":{"Crayon":["teal","yellow","blue","red","paper"],"Blue":["blue","blue2","blue3","blue4","paper"],"Red":["red","paper"],"Sketch":["paper"],"Yellow":["yellow"],"Green":["green","paper"],"Vibes":[],"RGB":[]},"COMPLEXITY":{"Minimal":15,"Low":30,"Normal":45,"High":60,"Ultra":75},"HORIZON":{"Horizontal":false,"Vertical":true,"Mixed":null},"SYMMETRY":{"Wild":[0.333,3],"Normal":[0.5,2],"Square":[1,1]},"SYMMETRY_SCALE":{"Wild":[0,1],"Normal":[0.5,1],"Square":[0.33,0.67]},"FRAME":0.02}');var t=o(537),r=o.n(t);const i=e=>e[Math.floor(random()*e.length)],n=e=>{randomSeed(e),noiseSeed(e)};class a{constructor(){this.useA=!1;let e=function(e){let t=parseInt(e.substr(0,8),16),o=parseInt(e.substr(8,8),16),r=parseInt(e.substr(16,8),16),i=parseInt(e.substr(24,8),16);return function(){t|=0,o|=0,r|=0,i|=0;let e=(t+o|0)+i|0;return i=i+1|0,t=o^o>>>9,o=r+(r<<3)|0,r=r<<21|r>>>11,r=r+e|0,(e>>>0)/4294967296}};this.prngA=new e(tokenData.hash.substr(2,32)),this.prngB=new e(tokenData.hash.substr(34,32));for(let e=0;e<1e6;e+=2)this.prngA(),this.prngB()}random_dec(){return this.useA=!this.useA,this.useA?this.prngA():this.prngB()}random_num(e,t){return e+(t-e)*this.random_dec()}random_int(e,t){return Math.floor(this.random_num(e,t+1))}random_bool(e){return this.random_dec()<e}random_choice(e){return e[this.random_int(0,e.length-1)]}}class s{version="0.3.0";ignoreWarnings=!1;ignoreErrors=!1;#e;#t;#o;constructor(){this.#e=Math.random,this.#t={frameCount:0},this.#o={frameCount:0,tX_anchor:0,tX:0,tY:0}}setup(e){this.#r("setup",arguments),void 0===e?this.#e=random:"object"==typeof e&&("function"==typeof e.random&&(this.#e=e.random),"boolean"==typeof e.ignoreErrors&&(this.ignoreErrors=e.ignoreErrors),"boolean"==typeof e.ignoreWarnings&&(this.ignoreWarnings=e.ignoreWarnings))}granulateSimple(e,t){let o=round(e);t.loadPixels();let r=t.pixelDensity(),i=t.width*r*4*(t.height*r);for(let e=0;e<i;e+=4){let r=this.#e(-o,o);t.pixels[e]=t.pixels[e]+r,t.pixels[e+1]=t.pixels[e+1]+r,t.pixels[e+2]=t.pixels[e+2]+r}t.updatePixels()}granulateChannels(e,t){let o=round(e);t.loadPixels();let r=t.pixelDensity(),i=t.width*r*4*(t.height*r);for(let e=0;e<i;e+=4)t.pixels[e]=t.pixels[e]+this.#e(-o,o),t.pixels[e+1]=t.pixels[e+1]+this.#e(-o,o),t.pixels[e+2]=t.pixels[e+2]+this.#e(-o,o);t.updatePixels()}granulateFuzzify(e,t,o){this.#r("granulateFuzzy",arguments),loadPixels();let r=round(e),i=t?round(t):2,n=o||!1,a=pixelDensity(),s=4*width*a,l=4*i+s,p=s*(height*a);for(let e=0;e<p;e+=4)pixels[e+l]&&(pixels[e]=round((pixels[e]+pixels[e+l])/2),pixels[e+1]=round((pixels[e+1]+pixels[e+l+1])/2),pixels[e+2]=round((pixels[e+2]+pixels[e+l+2])/2),n&&(pixels[e+3]=round((pixels[e+3]+pixels[e+l+3])/2))),pixels[e]=pixels[e]+this.#e(-r,r),pixels[e+1]=pixels[e+1]+this.#e(-r,r),pixels[e+2]=pixels[e+2]+this.#e(-r,r),n&&(pixels[e+3]=pixels[e+3]+this.#e(-r,r));updatePixels()}textureAnimate(e,t){this.#r("textureAnimate",arguments);let o=t&&t.atFrame?round(t.atFrame):2;if(this.#t.frameCount+=1,this.#t.frameCount>=o){let o=t&&t.amount?round(t.amount):min(width,height),r=floor(this.#e()*o),i=floor(this.#e()*o),n=`${r}px ${i}px`;e instanceof HTMLElement?e.style.backgroundPosition=n:e instanceof SVGElement?(e.style.top=-i+"px",e.style.left=-r+"px"):e instanceof p5.Element&&e.style("background-position",n),this.#t.frameCount=0}}textureOverlay(e,t){this.#r("textureOverlay",arguments);let o=t.context instanceof p5.Graphics,r=t.context?t.context.width:width,i=t.context?t.context.height:height,n=t.mode||MULTIPLY,a=t.reflect||!1,s=t.animate||!1,l=t.animate&&t.animate.atFrame?round(t.animate.atFrame):2,p=t.animate&&t.animate.amount?round(t.animate.amount):min(r,i),h="number"==typeof t.width?t.width:e.width,d="number"==typeof t.height?t.height:e.height;s&&(this.#o.frameCount+=1,this.#o.frameCount>=l&&(this.#o.tX_anchor=-floor(this.#e()*p),this.#o.tY=-floor(this.#e()*p),this.#o.frameCount=0));let c=this.#o.tX_anchor,m=this.#o.tY,f=!0,u=!0;for(blendMode(n);m<i;){for(;c<r;){if(a?(o?t.context.push():push(),f?u?o?t.context.image(e,c,m,h,d):image(e,c,m,h,d):o?(t.context.scale(-1,1),t.context.image(e,-c,m,-h,d)):(scale(-1,1),image(e,-c,m,-h,d)):u?o?(t.context.scale(1,-1),t.context.image(e,c,-m,h,-d)):(scale(1,-1),image(e,c,-m,h,-d)):o?(t.context.scale(-1,-1),t.context.image(e,-c,-m,-h,-d)):(scale(-1,-1),image(e,-c,-m,-h,-d)),o?t.context.pop():pop()):o?t.context.image(e,c,m,h,d):image(e,c,m,h,d),(c+=h)>=r){u=!0,c=this.#o.tX_anchor,m+=d;break}u=!u}f=!f}blendMode(BLEND),o&&t.context.reset()}#r(e,t){if(!this.ignoreErrors)switch(e){case"setup":if(void 0!==t[0]&&"object"!=typeof t[0])throw Error(`[p5.grain] The optional config parameter passed to p5grain.${e}() must be of type object.`);if("object"==typeof t[0]){if(void 0!==t[0].random&&"function"!=typeof t[0].random)throw Error(`[p5.grain] The optional config.random property passed to p5grain.${e}() must be of type function.`);if(void 0!==t[0].ignoreErrors&&"boolean"!=typeof t[0].ignoreErrors)throw Error(`[p5.grain] The optional config.ignoreErrors property passed to p5grain.${e}() must be of type boolean.`);if(void 0!==t[0].ignoreWarnings&&"boolean"!=typeof t[0].ignoreWarnings)throw Error(`[p5.grain] The optional config.ignoreWarnings property passed to p5grain.${e}() must be of type boolean.`)}break;case"granulateSimple":case"granulateChannels":if("number"!=typeof t[0])throw Error(`[p5.grain] The amount parameter passed to ${e}() must be of type number.`);if(void 0!==t[1]&&"boolean"!=typeof t[1])throw Error(`[p5.grain] The alpha parameter passed to ${e}() must be of type boolean.`);break;case"granulateFuzzify":if("number"!=typeof t[0])throw Error(`[p5.grain] The amount parameter passed to ${e}() must be of type number.`);if(void 0!==t[1]&&"number"!=typeof t[1])throw Error(`[p5.grain] The fuzziness parameter passed to ${e}() must be of type number.`);if(void 0!==t[2]&&"boolean"!=typeof t[2])throw Error(`[p5.grain] The alpha parameter passed to ${e}() must be of type boolean.`);break;case"textureAnimate":if(!(t[0]instanceof HTMLElement||t[0]instanceof SVGElement||t[0]instanceof p5.Element))throw Error(`[p5.grain] The textureElement parameter passed to ${e}() must be an instance of HTMLElement, SVGElement or p5.Element.`);if(void 0!==t[1]&&"object"!=typeof t[1])throw Error(`[p5.grain] The optional config parameter passed to ${e}() must be of type object.`);if("object"==typeof t[1]){if(void 0!==t[1].atFrame&&"number"!=typeof t[1].atFrame)throw Error(`[p5.grain] The optional config.atFrame property passed to ${e}() must be of type number.`);if(void 0!==t[1].amount&&"number"!=typeof t[1].amount)throw Error(`[p5.grain] The optional config.amount parameter passed to ${e}() must be of type number.`)}break;case"textureOverlay":if(!(t[0]instanceof p5.Image))throw Error(`[p5.grain] The texture parameter passed to ${e}() must be an instance of p5.Image.`);if(void 0!==t[1]&&"object"!=typeof t[1])throw Error(`[p5.grain] The optional config parameter passed to ${e}() must be of type object.`);if("object"==typeof t[1]){if(void 0!==t[1].width&&"number"!=typeof t[1].width)throw Error(`[p5.grain] The optional config.width property passed to ${e}() must be of type number.`);if(void 0!==t[1].height&&"number"!=typeof t[1].height)throw Error(`[p5.grain] The optional config.height property passed to ${e}() must be of type number.`);if(void 0!==t[1].mode&&"string"!=typeof t[1].mode)throw Error(`[p5.grain] The optional config.mode property passed to ${e}() must be of type string.`);if(void 0!==t[1].context&&!(t[1].context instanceof p5.Graphics))throw Error(`[p5.grain] The optional config.context parameter passed to ${e}() must be an instance of p5.Graphics.`);if(void 0!==t[1].reflect&&"boolean"!=typeof t[1].reflect)throw Error(`[p5.grain] The optional config.reflect property passed to ${e}() must be of type boolean.`)}}}}const l=(e,t,o,r,i=0,n)=>{const[a,s,l]=e,[p,h]=o;for(let e=0;e<t;e++){const e=random(p,h)*l,t=i/180*PI,o=(l-e)*random(),d=random()*r-.5*r,c=random()*r-.5*r;n.line(a+cos(t)*o+d,s-sin(t)*o+c,a+cos(t)*(o+e)+d,s-sin(t)*(o+e)+c)}},p=(e,t,o,r,i)=>{const[n,a,s,p]=e;let h=r/2;l([n-h,a+0,s+2*h],t,o,r,0,i),l([n+0,a-h,p+2*h],t,o,r,-90,i),l([n-h,a+p-0,s+2*h],t,o,r,0,i),l([n+s-0,a-h,p+2*h],t,o,r,-90,i)},h=(e,t,o,r,i)=>{const[n,a,s,p]=e,h=p/t,d=s/t;for(let e=0;e<t;e++)l([n,a+h*e,s],10,o,r,0,i);for(let e=0;e<t;e++)l([n+d*e,a,p],3,o,r,-90,i)},d=(e,t,o)=>{e.noStroke(),e.fill(o);const r=Math.min(e.width,e.height)*t;e.rect(0,0,e.width,r),e.rect(0,e.height-r,e.width,r),e.rect(0,0,r,e.height),e.rect(e.width-r,0,r,e.height)},c=(e,t,o,r,i,n,a,s)=>{if(s.noFill(),s.strokeWeight(2),s.strokeCap(SQUARE),s.colorMode(RGB),a)for(let a=t;a<=t+r;a++){let l=map(a,t,t+r,0,1),p=s.lerpColor(i,n,l);s.stroke(p),s.line(e,a,e+o,a)}else for(let a=e;a<=e+o;a++){let l=map(a,e,e+o,0,1),p=s.lerpColor(i,n,l);s.stroke(p),s.line(a,t,a,t+r)}s.colorMode(HSB,360,100,100)},m=(e,t,o,r=10,i=1,n=1.01,a=0,s)=>{const l=[e,t,o],p=[[l[0],l[1]],[l[1],l[2]],[l[2],l[0]]],[h,d,c]=p,m=dist(...h.flat()),f=dist(...d.flat()),u=dist(...c.flat());switch(a){case 0:{let e=atan2(c[0][1]-h[1][1],c[0][0]-h[1][0]),t=atan2(c[0][1]-h[0][1],c[0][0]-h[0][0]);for(let o=0;o<r;o++){const a=pow(o/r,i),l=[[h[1][0]+cos(e)*f*a,h[1][1]+sin(e)*f*a],[h[0][0]+cos(t)*u*a,h[0][1]+sin(t)*u*a],[h[0][0]+cos(t)*min(u,u*a*n),h[0][1]+sin(t)*min(u,u*a*n)],[h[1][0]+cos(e)*min(f,f*a*n),h[1][1]+sin(e)*min(f,f*a*n)]];s.beginShape(),l.forEach((e=>s.vertex(...e))),s.endShape(CLOSE)}break}case 1:{const e=atan2(c[1][1]-d[1][1],c[1][0]-d[1][0]),t=atan2(c[1][1]-d[0][1],c[1][0]-d[0][0]);for(let o=0;o<r;o++){const a=pow(o/r,i),l=[[d[1][0]+cos(e)*u*a,d[1][1]+sin(e)*u*a],[d[0][0]+cos(t)*m*a,d[0][1]+sin(t)*m*a],[d[0][0]+cos(t)*min(m,m*a*n),d[0][1]+sin(t)*min(m,m*a*n)],[d[1][0]+cos(e)*min(u,u*a*n),d[1][1]+sin(e)*min(u,u*a*n)]];s.beginShape(),l.forEach((e=>s.vertex(...e))),s.endShape(CLOSE)}break}case 2:{const e=atan2(h[1][1]-c[1][1],h[1][0]-c[1][0]),t=atan2(h[1][1]-c[0][1],h[1][0]-c[0][0]);for(let o=0;o<r;o++){const a=pow(o/r,i),l=[[c[1][0]+cos(e)*m*a,c[1][1]+sin(e)*m*a],[c[0][0]+cos(t)*f*a,c[0][1]+sin(t)*f*a],[c[0][0]+cos(t)*min(f,f*a*n),c[0][1]+sin(t)*min(f,f*a*n)],[c[1][0]+cos(e)*min(m,m*a*n),c[1][1]+sin(e)*min(m,m*a*n)]];s.beginShape(),l.forEach((e=>s.vertex(...e))),s.endShape(CLOSE)}break}}},f=(e,t,o,r,i=2,n=10,a=!0,s=!1,l)=>{l.noStroke(),l.fill(0);for(let p=0;p<n;p++)if(s){const s=e+o*Math.pow(p/n,i),h=a?p/n:1-p/n,d=Math.pow(h,2)*(o/n)*1.5+1;l.rect(s,t,d,r)}else{const s=t+r*Math.pow(p/n,i),h=a?p/n:1-p/n,d=Math.pow(h,2)*(r/n)*1.5+1;l.rect(e,s,o,d)}},u=(t=[])=>{const o=window.$features.Palette;return["Vibes","RGB"].includes(o)?window.$settings.hasCol?color(window.$settings.hasColAll?360*random():0,100,100):color(0):color(e.SWATCHES[i(e.PALETTE[o].filter((e=>!t.includes(e))))])},{SWATCHES:w,FRAME:g,COMPLEXITY:b,SYMMETRY:x,SYMMETRY_SCALE:y}=e;let S,E=!1,v=~~(1e9*(new a).random_dec());const $=.75;window.setup=()=>{window.renderComplete=!1,n(v),S=new s,S.setup({random}),window.$features=function(){let e=new a,t={Palette:e.random_bool(.35)?"Vibes":e.random_bool(.3)?"RGB":e.random_bool(.45)?"Crayon":e.random_choice(["Blue","Red","Sketch","Yellow","Green"]),Complexity:e.random_bool(.1)?"Low":e.random_bool(.25)?"High":"Normal",Speed:e.random_bool(.25)?"Normal":"Warp",Symmetry:e.random_bool(.15)?"Square":e.random_bool(.15)?"Wild":"Normal",View:e.random_bool(.25)?"Windows":e.random_choice(["Horizon","Mixed"]),Photogenic:"None",Frame:"Framed",Side:"A"};return["Vibes","RGB"].includes(t.Palette)&&e.random_bool(.1)&&(t.View="None"),["Vibes","RGB"].includes(t.Palette)&&e.random_bool(.33)&&(t.Frame="None"),"Sketch"===t.Palette&&(t.View=e.random_choice(["Windows","Horizon","Mixed"])),["Vibes","RGB"].includes(t.Palette)&&(t.Complexity="Normal"),["Sketch"].includes(t.Palette)&&e.random_bool(.1)&&(t.Complexity="Ultra"),["RGB"].includes(t.Palette)&&(t.Speed="Warp"),t}(),window.$settings={hasCol:random()<.5,hasColAll:random()<.25,horizon:random()<.5?"Mixed":random()<.25?"Horizontal":"Vertical",gravity:random()<.1?i(["Stretch","Split"]):"Normal",rgbShine:random()<.5,blocky:random()<.25||"Sketch"===window.$features.Palette,filterSize:i([0,.03,.06,.09]),opacity:["Vibes"].includes(window.$features.Palette)&&random()<.1?.5:1};const[e,t]=((e,t,o)=>((e,t,o,r)=>{const i=Math.min(o/e,r/1);return[e*i,1*i]})(e,0,t,o))($,windowWidth,windowHeight),o=createCanvas(Math.floor(e),Math.floor(t));pixelDensity(2),o.style("width",""),o.style("height",""),o.style("max-width","100%"),o.style("max-height","100%"),colorMode(HSB,360,100,100),noLoop()};const M=(e,t)=>{clear(),noStroke(),fill(0),rect(0,0,width,height);const o=.005*Math.min(width,height),r=.8*width,i=(width-r)/2,n=e*r;fill("#fff"),rect(i,height/2-o/2,n,o),textSize(3.5*o),text(t,width/2-r/2,height/2-2*o)},P=async(t,o)=>{n(v);const a=window.$features.Palette,s=createGraphics(t,o);s.colorMode(HSB,360,100,100),s.pixelDensity(2),(e=>{const t=window.$features.Palette;let o,r,a;if(["Vibes","RGB"].includes(t)){const e=i(["Blue","Red"]);"Blue"===e&&(a=random(200,250)),"Red"===e&&(a=random(-10,20)),o=color(a%360,100,100),r=color((a+30)%360,100,100)}else o=color(hue(w.paper),saturation(w.paper),brightness(w.paper),window.$settings.opacity),r=color(hue(w.paper),saturation(w.paper),.85*brightness(w.paper),window.$settings.opacity**2);c(0,0,e.width,e.height,o,r,!0,e),"None"===window.$features.View||"Warp"===window.$features.Speed&&((e,t,o,r,i,n,a)=>{const s=[0+o/2,0+r/2];i.noStroke(),n&&(i.fill(n),i.rect(0,0,o,r));const l=[[[0,0],[0+o,0],[s[0],s[1]]],[[0+o,0],[0+o,0+r],[s[0],s[1]]],[[0,0+r],[0+o,0+r],[s[0],s[1]]],[[0,0],[0,0+r],[s[0],s[1]]]];for(const e of l)i.noFill(),i.fill(a),m(e[0],e[1],e[2],random(5,20),random(.5,2),random(1.015,1.15),Math.floor(3*random()),i)})(0,0,e.width,e.height,e,"Vibes"===t?null:w.paper,w.black);const s=50*e.width*.001;["RGB","Vibes"].includes(window.$features.Palette)?S.granulateChannels(s/2,e):S.granulateChannels(s/3,e),n(v),console.info({Features:window.$features,Settings:window.$settings})})(s),await(async(t,o=!0)=>{const r=window.$features.Palette;let i=b[window.$features.Complexity];for(let n=0;n<i;n++){"None"===window.$features.View&&d(t,g,w[["Vibes","RGB"].includes(r)?"black":"paper"]),o&&M(n/i,(E?"SAVING":"LOADING")+" HYPER DRIVE...");const a=Math.pow(1-n/i,1);let s=t.width*random(...y[window.$features.Symmetry])*a;s=constrain(s,0,t.width);let l=s*random(...x[window.$features.Symmetry]);l=constrain(l,0,t.height),"Square"===window.$features.Symmetry&&(l=s*(1/$));const m=.75,b=random(-m,m),S=random(-m,m);let v=(t.width-s)/2+Math.min(t.width,t.height)*b,P=(t.height-l)/2+Math.min(t.width,t.height)*S;if("Stretch"===window.$settings.gravity?P=.5*(t.height-l)+.5*P:"Split"===window.$settings.gravity&&random()<.25&&(P=t.height/2),s<1||l<1)continue;if(s<t.width*window.$settings.filterSize||l<t.height*window.$settings.filterSize)continue;let C=color(n%2==0?u():color(0));if(window.$settings.blocky&&(C=color(n%2==0?color(0):u())),C=color(hue(C),saturation(C),brightness(C),window.$settings.opacity),t.fill(C),t.noStroke(),["Vibes","RGB"].includes(r)){const e=360*random();c(v,P,s,l,color(e,100,100,window.$settings.opacity),color((e+50)%360,100,80,window.$settings.opacity**2),!0,t)}else t.rect(v,P,s,l);let k=random(8,24),R="Horizon"===window.$features.View||"Mixed"===window.$features.View&&random()<.5;if("None"===window.$features.View);else if(R){if(["Vibes","RGB"].includes(r)){const e=360*random();c(v,P,s,l,color(e,100,100,window.$settings.opacity),color((e+50)%360,100,80,window.$settings.opacity**2),!0,t)}else{let e=u();e=color(hue(e),saturation(e),brightness(e),window.$settings.opacity),t.noStroke(),t.fill(e),t.rect(v,P,s,l)}f(v,P,s,l,random(.5,3),k,random()<.5,"Mixed"===window.$settings.horizon?random()<.5:e.HORIZON[window.$settings.horizon],t)}else{let e=n%2!=0?color(0):u();["RGB","Vibes"].includes(window.$features.Palette)||0!==e.levels[0]||0!==C.levels[0]||0!==e.levels[1]||0!==C.levels[1]||0!==e.levels[2]||0!==C.levels[2]||(e=w.paper),t.stroke(e),t.strokeWeight(.0075*Math.min(s,l)),h([v,P,s,l],random(10,15),[.8,1],2,t)}t.stroke(n%2!=0||["Sketch","Green","Blue","Red","Yellow"].includes(window.$features.Palette)?0:u(["paper"])),t.strokeWeight(("Ultra"===window.$features.Complexity?.005:.02125)*Math.min(s,l)),"Framed"===window.$features.Frame&&p([v,P,s,l],random(3,5),[random(.5,.8),random(1,2)],0,t);let T=createImage(2*t.width,2*t.height);T.copy(t,0,0,t.width,t.height,0,0,2*t.width,2*t.height),t.image(T,v,P,s,l,0,0)}})(s);const l=(()=>{switch(window.$features.Palette){case"Vibes":return 115;case"RGB":return 85;default:return 0}})();return["Vibes","RGB"].includes(window.$features.Palette)&&((e,t,o,i)=>{const n=e.get(0,0,e.width,e.height),a=createGraphics(Math.ceil(e.width),Math.ceil(e.height));a.pixelDensity(1),a.image(n,0,0,a.width,a.height),((e,t,o=2.25)=>{e.loadPixels();for(let r=0;r<e.height;r++)for(let i=0;i<e.width;i++){const n=r*e.width*4+4*i;e.pixels[n]=constrain(o*(e.pixels[n]-128)+128,0,255),e.pixels[n+1]=constrain(o*(e.pixels[n+1]-128)+128,0,255),e.pixels[n+2]=constrain(o*(e.pixels[n+2]-128)+128,0,255),e.pixels[n+3]=t}})(a,i),a.pixels=r().blurImage(a.pixels,a.width,a.height,o),a.updatePixels(),e.blendMode(t),e.image(a,0,0,e.width,e.height),a.remove()})(s,"RGB"===a&&window.$settings.rgbShine?SCREEN:BLEND,("RGB"===a?.015:.0225)*s.width,l),(({vW:e,vH:t,vS:o,vP:r,vinScale:i,buf:n})=>{n.loadPixels();const a=2*n.height,s=2*n.width;for(let l=0;l<a;l++){const p=1-l/a;for(let h=0;h<s;h++){const d=l*s*4+4*h,c=dist(h/s*e,l/a*t,.5,.5)*i;let m=Math.pow(p,.25)*.25+.75-Math.pow(c,r)*o;n.pixels[d]=constrain(n.pixels[d]+m,0,255),n.pixels[d+1]=constrain(n.pixels[d+1]+m,0,255),n.pixels[d+2]=constrain(n.pixels[d+2]+m,0,255),n.pixels[d+3]=255}}n.updatePixels(),n.blendMode(BLEND)})({vW:random(.67,1),vH:random(.67,1),vS:random(5,10),vP:random(1.4,1.9),vinScale:random(2,2.75),buf:s}),S.granulateChannels(8*s.width*.001,s),(e=>{let t=Number.MAX_VALUE,o=Number.MIN_VALUE;for(let r=0;r<2*e.height;r++)for(let i=0;i<2*e.width;i++){const n=r*e.width*2*4+4*i;t=Math.min(t,e.pixels[n],e.pixels[n+1],e.pixels[n+2]),o=Math.max(o,e.pixels[n],e.pixels[n+1],e.pixels[n+2])}for(let r=0;r<2*e.height;r++)for(let i=0;i<2*e.width;i++){const n=r*e.width*2*4+4*i,a=255/(o-t);e.pixels[n]=(e.pixels[n]-t)*a,e.pixels[n+1]=(e.pixels[n+1]-t)*a,e.pixels[n+2]=(e.pixels[n+2]-t)*a}e.updatePixels()})(s),d(s,g,w[["Vibes","RGB"].includes(a)?"black":"paper"]),s};window.draw=async()=>{const e=await P(Math.floor(width),Math.floor(height));image(e,0,0),e.remove(),window.renderComplete=!0};const C=async e=>{E=!0,window.renderComplete=!1,console.info("Saving..."),M(0,"SAVING HYPER DRIVE...");const t=await P(Math.floor(e),Math.floor(e*(1/$)));save(t,"hyper_drive_a.png"),console.info("Done."),E=!1,image(t,0,0,width,height),t.remove()};window.keyTyped=()=>{switch(key){case"p":return C(4096);case"s":return C(2048)}}})()})();
Hyper Drive is based on the mathematics of recursion. Scale symmetry is used to create patterns that repeat at ever-smaller intervals, creating the illusion of infinite depth and complexity.
The rule for the recursive loop is incredibly simple. A box is drawn, then a snapshot of the full canvas is resized to cover the boundary. As this process is repeated, small variations in position create endless fractals.
This project is an experimental cross-chain collection, with a fully-generative A-side published via Art Blocks on Ethereum and an AI-based image composition B-side published via Fxhash on Tezos. The artwork symbolizes the great divides we must cross, the connections we make along the way, and the disconnections we feel. We move through the world as the world moves through us.