let powerupX,powerupY,selectedRectType,selectedDiskType,placeholderScreenX,placeholderScreenY,powerupX1,powerupY1,powerupX2,powerupY2,increment=!0,placeholderCanvasSize=1e3,placeholderScreenWidth=600,placeholderScreenHeight=400,placeholderScreenBackgroundLayer1=[255,255,255],placeholderScreenBackgroundLayer2=[200,200,200],placeholderScreenBackgroundLayer3=[150,150,150],placeholderAlphaValue=100,placeholderBackgroundColor=[0,0,0],rectPercentage=.3,smallRectPercentage=.7,diskPercentage=.99,ssdPercentage=.99,powerupProfiles=[{type:"virus",baseSize:140,maxOffset:80,probability:.1},{type:"virus",baseSize:60,maxOffset:40,probability:.2},{type:"additionalCPU",baseSize:140,maxOffset:30,probability:.2},{type:"additionalCPU",baseSize:200,maxOffset:30,probability:.2},{type:"overclock",baseSize:50,maxOffset:50,probability:.3}],selectedPowerupProfile=powerupProfiles[0];function updateDynamo(e){dynamo=parseInt(e),document.getElementById("dynamoValue").innerText=dynamo}let selectedDataTextProfile,quanticCenterX,quanticCenterY,selectedLightProfile,selectedRectAltProfile,selectedTextProfile,selectedQuanticProfile,speedFactor,baseSpeed,diskX,diskY,rectX,rectY,screenX,screenY,useQuantic,selectedDisquanticProfile,selectedProfile,selectedAnimationSize,selectedBackgroundProfile,selectedColorProfile,offsetX,offsetY,selectedScreenProfile,selectedCorniceProfile,selectedRectProfile,capacitors=[],capacitorProfiles=[{count:32,radius:60,horizontalSpacing:1,verticalSpacing:1,numCircles:3,animationSpeed:.02,rows:4,cols:3,probability:.18},{count:32,radius:130,horizontalSpacing:1,verticalSpacing:1,numCircles:3,animationSpeed:.02,rows:5,cols:2,probability:.18},{count:32,radius:200,horizontalSpacing:1,verticalSpacing:1,numCircles:4,animationSpeed:.02,rows:3,cols:2,probability:.2},{count:32,radius:40,horizontalSpacing:3,verticalSpacing:1,numCircles:3,animationSpeed:.02,rows:4,cols:5,probability:.17},{count:32,radius:350,horizontalSpacing:1,verticalSpacing:1,numCircles:6,animationSpeed:.02,rows:1,cols:1,probability:.03},{count:32,radius:250,horizontalSpacing:1,verticalSpacing:1,numCircles:5,animationSpeed:.02,rows:2,cols:2,probability:.07},{count:32,radius:40,horizontalSpacing:3,verticalSpacing:1,numCircles:2,animationSpeed:.02,rows:6,cols:3,probability:.17}],dataTextProfiles=[{probability:1,textColor:[255,255,255],corner:"top-left"}],dataTextVisible=!1,nextDataTextToggleTime=0,dataTextValues={average_fee:0,average_fee_rate:0,bits:486604799,chainwork:"00000000000100010001",confirmations:0,difficulty:0,hash:"0x19d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",feerate_percentiles:[0,0,0,0,0],height:0,max_fee:0,max_fee_rate:0,max_tx_size:0,median_fee:0,median_time:1231006505,merkle_root:"000000000000000000",min_fee:0,min_fee_rate:0,next_block:null,nonce:0,previous_block:null,subsidy:5e9,target:"00000000ffff000000000000",timestamp:0,total_fee:0,total_size:0,total_weight:0,transaction_count:0,version:0},showDataText=!1,dataTextUpdateInterval=500,lastDataTextUpdateTime=0,quanticRects=[],alphaValue=200,lastGradientUpdateTime=0,gradientUpdateInterval=100,minLightDistance=50,diskRadius=45,diskRotationSpeed=.05,diskAngle=30,diskCircles=0,rectSize=30,rectMaxSize=150,spRam=.3,screenWidth=200,screenHeight=100,quanticProfiles=[{maxDimension:200,baseSpeed:.1,type:"quantic",probability:.2},{maxDimension:250,baseSpeed:.1,type:"quantic",probability:.2},{maxDimension:300,baseSpeed:.1,type:"quantic",probability:.3},{maxDimension:350,baseSpeed:.1,type:"quantic",probability:.25},{maxDimension:420,baseSpeed:.1,type:"quantic",probability:.05}],disquanticProfiles=[{maxDimension:270,baseSpeed:.1,type:"disquantic",probability:.2},{maxDimension:420,baseSpeed:.1,type:"disquantic",probability:.4},{maxDimension:350,baseSpeed:.1,type:"disquantic",probability:.4}],profiles=[{rows:2,cols:2,probability:.15},{rows:3,cols:3,probability:.22},{rows:4,cols:4,probability:.21},{rows:8,cols:8,probability:.14},{rows:10,cols:10,probability:.06},{type:"none",probability:.21}],animationSizes=[{size:150,probability:.24},{size:200,probability:.33},{size:300,probability:.33},{size:350,probability:.1}],diskProfiles=[{radius:150,rotationSpeed:.99,angle:45,probability:.12,circles:60,type:"original"},{radius:200,rotationSpeed:.99,angle:30,probability:.13,circles:70,type:"original"},{radius:200,rotationSpeed:.99,angle:30,probability:.12,circles:45,type:"original"},{radius:150,rotationSpeed:.99,angle:30,probability:.13,circles:45,type:"original"},{radius:40,angle:45,probability:.11,type:"new",numCircles:1.6,circleRotationSpeed:.3,totalSize:500,circleThickness:4.9,circleSpacing:40},{radius:40,angle:45,probability:.11,type:"new",numCircles:3.6,circleRotationSpeed:.4,totalSize:500,circleThickness:2.9,circleSpacing:40},{radius:40,angle:45,probability:.13,type:"new",numCircles:3.2,circleRotationSpeed:.1,totalSize:500,circleThickness:4.9,circleSpacing:30},{radius:40,angle:45,probability:.15,type:"new",numCircles:2.2,circleRotationSpeed:.14,totalSize:500,circleThickness:4.9,circleSpacing:20}],canvasSize=1024,lastBackgroundUpdateTime=0,backgroundUpdateInterval=100,backgroundProfiles=[{type:"gradient",probability:.3},{type:"diagonal",probability:.6},{type:"dynamic",probability:.3}],colorProfiles=[{background1:[80,80,80],background2:[30,30,30],background3:[220,220,220],squareColor1:[195,195,195],squareColor2:[170,175,160],squareColor3:[210,200,205],rectColor1:[145,145,145],rectColor2:[150,150,150],rectColor3:[100,100,100],diskColor1:[170,170,170],diskColor2:[170,170,170],diskColor3:[170,170,170],screenBackground:[200,200,200],screenText:[90,90,90],smallRectColor1:[50,50,50],smallRectColor2:[230,230,230],smallRectColor3:[130,130,130],corniceIntColor1:[30,30,30],corniceIntColor2:[45,45,45],corniceIntColor3:[20,20,20],lightColor1:[60,60,60],lightColor2:[110,110,110],lightColor3:[80,80,80],gradientStart:[160,160,160],gradientEnd:[255,255,255],textColor:[180,180,180],powerupColor1:[155,150,150],powerupColor2:[150,155,150],powerupColor3:[150,150,155],virus1:[250,50,70],virus2:[250,50,70],virus3:[250,50,70],strokeVirus:[235,50,0],additionalCPU1:[150,185,230,100],additionalCPU2:[145,195,240,100],additionalCPU3:[150,1215,250,100],strokeaddCPU:[30,130,40],strokeAdditionalCPU:[10,150,40],probability:.18},{background1:[93,75,10],background2:[73,55,5],background3:[233,195,90],squareColor1:[230,195,40],squareColor2:[245,152,12],squareColor3:[210,100,35],rectColor1:[237,190,80],rectColor2:[220,160,80],rectColor3:[200,150,60],diskColor1:[40,120,0],diskColor2:[40,120,0],diskColor3:[0,155,0],screenBackground:[237,195,90],screenText:[33,41,74],smallRectColor1:[0,255,0],smallRectColor2:[0,200,0],smallRectColor3:[0,150,0],corniceIntColor1:[41,59,89],corniceIntColor2:[33,41,74],corniceIntColor3:[5,12,14],lightColor1:[20,95,60],lightColor2:[20,120,20],lightColor3:[50,130,40],gradientStart:[255,185,0],gradientEnd:[255,185,0],textColor:[245,150,20],virus1:[155,15,20],virus2:[150,15,15],virus3:[150,15,15],strokeVirus:[255,18,0],additionalCPU1:[255,180,200],additionalCPU2:[240,170,180],additionalCPU3:[200,200,190],strokeaddCPU:[30,130,40],strokeAdditionalCPU:[10,150,40],probability:.13},{background1:[20,30,20],background2:[20,20,20],background3:[98,140,40],squareColor1:[193,216,110],squareColor2:[98,140,40],squareColor3:[98,140,40],rectColor1:[120,170,80],rectColor2:[193,216,110],rectColor3:[98,140,40],diskColor1:[98,140,40],diskColor2:[98,140,40],diskColor3:[193,216,110],screenBackground:[25,25,25],screenText:[98,140,40],smallRectColor1:[98,140,40],smallRectColor2:[193,216,110],smallRectColor3:[98,140,40],corniceIntColor1:[20,20,20],corniceIntColor2:[39,25,24],corniceIntColor3:[30,30,30],lightColor1:[170,161,166],lightColor2:[98,140,40],lightColor3:[193,216,110],gradientStart:[98,140,40],gradientEnd:[98,140,40],textColor:[193,216,110],virus1:[255,150,50],virus2:[250,155,50],virus3:[250,150,55],strokeVirus:[225,90,0],additionalCPU1:[120,100,170],additionalCPU2:[100,150,180],additionalCPU3:[150,120,160],strokeaddCPU:[30,130,40],strokeAdditionalCPU:[70,150,240],probability:.18},{background1:[60,40,0],background2:[70,50,0],background3:[120,110,0],squareColor1:[200,130,10],squareColor2:[215,195,40],squareColor3:[215,115,20],rectColor1:[160,90,0],rectColor2:[170,120,0],rectColor3:[180,110,0],diskColor1:[225,185,0],diskColor2:[155,115,0],diskColor3:[225,185,10],screenBackground:[25,25,25],screenText:[255,215,0],smallRectColor1:[190,80,0],smallRectColor2:[220,140,0],smallRectColor3:[205,125,0],corniceIntColor1:[40,40,40],corniceIntColor2:[50,50,50],corniceIntColor3:[60,60,60],lightColor1:[255,215,0],lightColor2:[230,185,30],lightColor3:[220,165,60],gradientStart:[255,215,0],gradientEnd:[255,175,10],textColor:[255,215,0],virus1:[255,50,50],virus2:[250,55,50],virus3:[250,50,55],strokeVirus:[235,0,0],additionalCPU1:[110,190,220],additionalCPU2:[60,180,220],additionalCPU3:[70,170,230],strokeaddCPU:[30,130,40],strokeAdditionalCPU:[10,150,240],probability:.13},{background1:[5,6,21],background2:[15,16,41],background3:[155,76,160],squareColor1:[159,74,181],squareColor2:[190,71,162],squareColor3:[246,71,162],rectColor1:[140,220,162],rectColor2:[159,244,181],rectColor3:[58,124,104],diskColor1:[123,36,81],diskColor2:[123,36,81],diskColor3:[123,36,81],screenBackground:[40,25,51],screenText:[79,122,90],smallRectColor1:[40,25,51],smallRectColor2:[246,71,162],smallRectColor3:[58,24,104],corniceIntColor1:[5,6,21],corniceIntColor2:[40,25,51],corniceIntColor3:[58,24,104],lightColor1:[123,36,81],lightColor2:[79,122,90],lightColor3:[58,24,80],gradientStart:[79,122,90],gradientEnd:[159,244,181],textColor:[159,244,181],virus1:[255,255,255],virus2:[255,255,255],virus3:[255,255,255],strokeVirus:[235,0,0],additionalCPU1:[255,255,255],additionalCPU2:[255,255,255],additionalCPU3:[255,255,255],strokeaddCPU:[130,180,210],strokeAdditionalCPU:[30,150,210],probability:.1},{background1:[185,112,25],background2:[92,60,12],background3:[185,112,25],squareColor1:[200,87,11],squareColor2:[202,98,11],squareColor3:[205,119,30],rectColor1:[205,112,25],rectColor2:[205,112,25],rectColor3:[205,112,25],diskColor1:[205,112,25],diskColor2:[205,119,30],diskColor3:[202,98,11],screenBackground:[33,50,42],screenText:[255,112,25],smallRectColor1:[255,154,63],smallRectColor2:[205,112,25],smallRectColor3:[195,119,42],corniceIntColor1:[33,50,42],corniceIntColor2:[22,40,32],corniceIntColor3:[33,52,42],lightColor1:[240,87,11],lightColor2:[252,98,11],lightColor3:[255,119,30],gradientStart:[180,87,11],gradientEnd:[205,112,25],textColor:[205,112,25],virus1:[200,200,200],virus2:[210,210,210],virus3:[180,180,2180],strokeVirus:[235,0,0],additionalCPU1:[120,100,100],additionalCPU2:[100,150,80],additionalCPU3:[150,120,60],strokeaddCPU:[30,130,40],strokeAdditionalCPU:[10,150,40],probability:.18},{name:"allBlack",background1:[10,10,10],background2:[10,10,10],background3:[10,10,10],squareColor1:[0,0,0],squareColor2:[0,0,0],squareColor3:[0,0,0],rectColor1:[0,0,0],rectColor2:[0,0,0],rectColor3:[0,0,0],diskColor1:[0,0,0],diskColor2:[0,0,0],diskColor3:[0,0,0],screenBackground:[0,0,0],screenText:[0,0,0],smallRectColor1:[0,0,0],smallRectColor2:[0,0,0],smallRectColor3:[0,0,0],corniceIntColor1:[0,0,0],corniceIntColor2:[0,0,0],corniceIntColor3:[0,0,0],lightColor1:[0,0,0],lightColor2:[0,0,0],lightColor3:[0,0,0],gradientStart:[0,0,0],gradientEnd:[0,0,0],textColor:[0,0,0],virus1:[0,0,0],virus2:[0,0,0],virus3:[0,0,0],strokeVirus:[235,0,0],additionalCPU1:[0,0,0],additionalCPU2:[0,0,0],additionalCPU3:[0,0,0],strokeaddCPU:[0,0,0],strokeAdditionalCPU:[10,150,40],probability:.01},{background1:[69,83,110],background2:[36,64,84],background3:[69,83,109],squareColor1:[188,205,211],squareColor2:[193,207,220],squareColor3:[166,184,194],rectColor1:[147,167,186],rectColor2:[102,124,153],rectColor3:[117,139,168],diskColor1:[102,126,153],diskColor2:[125,142,168],diskColor3:[117,139,168],screenBackground:[69,83,109],screenText:[206,212,224],smallRectColor1:[193,207,220],smallRectColor2:[166,184,194],smallRectColor3:[147,167,186],corniceIntColor1:[122,144,173],corniceIntColor2:[117,139,168],corniceIntColor3:[102,126,153],lightColor1:[188,205,211],lightColor2:[166,184,194],lightColor3:[147,167,186],gradientStart:[236,247,251],gradientEnd:[255,255,255],textColor:[36,64,84],virus1:[250,160,160],virus2:[250,170,170],virus3:[250,180,180],strokeVirus:[255,120,140],additionalCPU1:[160,230,160],additionalCPU2:[180,123084,180],additionalCPU3:[200,230,200],strokeAdditionalCPU:[140,230,140],probability:.09}],lightProfiles=[{width:50,height:60,animationSpeed:10,rows:2,cols:3,horizontalSpacing:170,verticalSpacing:40,density:4,probability:.99},{width:26,height:15,animationSpeed:10,rows:4,cols:6,horizontalSpacing:100,verticalSpacing:15,density:4,probability:.25},{width:20,height:15,animationSpeed:10,rows:5,cols:7,horizontalSpacing:70,verticalSpacing:10,density:4,probability:.25},{width:50,height:25,animationSpeed:10,rows:3,cols:4,horizontalSpacing:150,verticalSpacing:20,density:4,probability:.25},{width:50,height:40,animationSpeed:10,rows:3,cols:4,horizontalSpacing:150,verticalSpacing:20,density:4,probability:.25}],rectProfiles=[{count:2,probability:.65}],ssdProfiles=[{count:9,width:20,height:30,lineSpacing:10,rectAngle:0,ssdRotation:0,animationSpeed:.1,rows:3,columns:3,spacing:120,ordered:!0,probability:.1},{count:2,width:90,height:80,lineSpacing:10,rectAngle:0,ssdRotation:90,animationSpeed:.1,rows:1,columns:1,spacing:50,ordered:!0,probability:.1},{count:2,width:90,height:80,lineSpacing:10,rectAngle:0,ssdRotation:0,animationSpeed:.1,rows:1,columns:2,spacing:50,ordered:!0,probability:.1},{count:6,width:40,height:60,lineSpacing:10,rectAngle:0,ssdRotation:0,animationSpeed:.1,rows:3,columns:2,spacing:50,ordered:!0,probability:.12},{count:6,width:60,height:60,lineSpacing:10,rectAngle:0,ssdRotation:0,animationSpeed:.1,rows:2,columns:3,spacing:50,ordered:!0,probability:.12},{count:6,width:45,height:60,lineSpacing:10,rectAngle:0,ssdRotation:90,animationSpeed:.1,rows:3,columns:2,spacing:50,ordered:!0,probability:.12},{count:3,width:50,height:40,lineSpacing:10,rectAngle:0,ssdRotation:0,animationSpeed:.1,rows:2,columns:3,spacing:100,ordered:!0,probability:.12},{count:3,width:50,height:40,lineSpacing:10,rectAngle:0,ssdRotation:90,animationSpeed:.1,rows:2,columns:3,spacing:80,ordered:!0,probability:.12}],rectAltProfiles=[{count:4,width:220,height:45,spacing:30,animationSpeed:.03,rotation:0,probability:.1},{count:6,width:250,height:35,spacing:20,animationSpeed:.03,rotation:0,probability:.1},{count:3,width:300,height:20,spacing:40,animationSpeed:.01,rotation:0,probability:.1},{count:5,width:220,height:25,spacing:35,animationSpeed:.04,rotation:0,probability:.15},{count:4,width:220,height:45,spacing:30,animationSpeed:.03,rotation:270,probability:.1},{count:6,width:250,height:35,spacing:20,animationSpeed:.03,rotation:270,probability:.1},{count:3,width:300,height:20,spacing:40,animationSpeed:.01,rotation:270,probability:.1},{count:5,width:220,height:25,spacing:35,animationSpeed:.04,rotation:270,probability:.15},{count:10,width:160,height:20,spacing:20,animationSpeed:.03,rotation:0,probability:.05},{count:10,width:160,height:20,spacing:20,animationSpeed:.03,rotation:270,probability:.05}],textProfiles=[{type:"binary",characters:"01",probability:.4},{type:"zeros",characters:"0",probability:.2},{type:"ascii",characters:"!@#$%^&*()_+[]{}|;:,.<>?/~",probability:.2},{type:"alphanumeric",characters:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",probability:.2}],corniceProfiles=[{type:"fourSquares",probability:.15},{type:"default",probability:.7},{type:"diagonalStrip",probability:.15}],screenProfiles=[{width:350,height:200,textSize:10,probability:.99},{width:220,height:140,textSize:14,probability:.00993},{width:300,height:150,textSize:24,probability:.0099}];function hashToSeed(e){let o=0;for(let t=0;tnextDataTextToggleTime&&(toggleDataTextVisibility(),nextDataTextToggleTime=millis()+random(1e3,3e3)),powerup&&drawPowerup(),powerup&&"overclock"===selectedPowerupProfile.type)for(let e=0;e<3;e++){let o=random(-selectedPowerupProfile.maxOffset,selectedPowerupProfile.maxOffset),t=random(-selectedPowerupProfile.maxOffset,selectedPowerupProfile.maxOffset),r=255,l=0,i=0,a=5+10*e;blendMode(OVERLAY),fill(r,l,i,a),noStroke(),rect(o,t,1.2*width,1.2*height),blendMode(BLEND)}}}function selectRectOrSmallRect(){return random(1)offsetX&&ooffsetY}function isInsideRectArea(e,o,t,r){return erectX&&orectY}function drawRectGroup(e,o,t,r){let l=[selectedColorProfile.rectColor1,selectedColorProfile.rectColor2,selectedColorProfile.rectColor3];drawRectParallelLines(e,o,t,r,l),push();let i=random(-5,5),a=random(-7,7);translate(i,i),drawRectVerticalLines(e,o,t,r,l),pop(),push(),translate(a,a),drawRectHorizontalLines(e,o,t,r,l),pop()}function drawRectParallelLines(e,o,t,r,l){let i=getHeatColor(dynamo),a=map(dynamo,1,10,0,10),n=map(dynamo,1,10,1,3);stroke(i.levels[0],i.levels[1],i.levels[2],alphaValue/2),strokeWeight(n),line(e-a,o-a,e+t+a,o-a),line(e-a,o+r+a,e+t+a,o+r+a),line(e-a,o-a,e-a,o+r+a),line(e+t+a,o-a,e+t+a,o+r+a);for(let i=0;i.3?e+=r.charAt(floor(random(r.length))):e+=" ";a+=e+"\n"}return a}function drawScreen(){let e=selectedColorProfile.screenBackground,o=selectedColorProfile.screenText;drawRectParallelLines(screenX,screenY,selectedScreenProfile.width,selectedScreenProfile.height,[e,e,e]),push();let t=random(-5,5),r=random(-7,7);translate(t,t),drawRectVerticalLines(screenX,screenY,selectedScreenProfile.width,selectedScreenProfile.height,[e,e,e]),pop(),push(),translate(r,r),drawRectHorizontalLines(screenX,screenY,selectedScreenProfile.width,selectedScreenProfile.height,[e,e,e]),pop();let l=.1*min(selectedScreenProfile.width,selectedScreenProfile.height),i=generateIncomprehensibleText(selectedScreenProfile.width,selectedScreenProfile.height,l);fill(o[0],o[1],o[2],alphaValue),textFont("Courier New"),textSize(l),textAlign(CENTER,CENTER),text(i,screenX+selectedScreenProfile.width/2,screenY+selectedScreenProfile.height/2)}function generateDiskPosition(){do{diskX=random(diskRadius,canvasSize-diskRadius),diskY=random(diskRadius,canvasSize-diskRadius)}while(isInsideSquareArea(diskX-diskRadius,diskY-diskRadius,2*diskRadius,2*diskRadius)||isInsideRectArea(diskX-diskRadius,diskY-diskRadius,2*diskRadius,2*diskRadius))}function drawDisk(){"original"===selectedDiskProfile.type?drawOriginalDisk():"new"===selectedDiskProfile.type&&drawNewDisk()}function drawOriginalDisk(){let e=[selectedColorProfile.diskColor1,selectedColorProfile.diskColor2,selectedColorProfile.diskColor3];push(),translate(diskX,diskY),drawDiskLayer(diskRadius,e[0],diskAngle,PI/4,1,diskCircles),drawDiskLayer(.8*diskRadius,e[1],1.2*diskAngle,-PI/4,1+speedFactor*dynamo,diskCircles),drawDiskLayer(.6*diskRadius,e[2],1.5*diskAngle,PI/4,1+2*speedFactor*dynamo,diskCircles),pop(),diskAngle+=.01*baseSpeed*dynamo}function drawNewDisk(){let e=selectedDiskProfile.numCircles||floor(random(2,4)),o=[selectedColorProfile.diskColor1,selectedColorProfile.diskColor2,selectedColorProfile.diskColor3],t=selectedDiskProfile.circleRotationSpeed||.01,r=selectedDiskProfile.circleThickness||5,l=r+(selectedDiskProfile.circleSpacing||10);push(),translate(diskX,diskY);for(let i=0;i=e.count)break;let n=o+a*(r+e.horizontalSpacing),s=t+i*(l+e.verticalSpacing);smallRects.push({x:n,y:s,initialX:n,width:r,height:l,colors:[selectedColorProfile.smallRectColor1,selectedColorProfile.smallRectColor2,selectedColorProfile.smallRectColor3]})}}else if("disordered"===e.type)for(let o=0;o100/dynamo){for(let e of lights)e.colors.push(e.colors.shift());lastSwitchTimeGlobal=e}for(let o of lights){let{x:t,y:r,colors:l,width:i,height:a,density:n,animationSpeed:s}=o,c=s*dynamo,d=map(dynamo,1,10,1,1.3),p=i*d,u=a*d;drawLightShadows(t,r,p,u,e,c);let f=0;for(let e of l)drawLightParallelLines(t+f,r,p,u,e,n),f+=p}}function drawLightShadows(e,o,t,r,l,i){let a=getHeatColor(dynamo),n=map(dynamo,1,10,0,10),s=map(dynamo,1,10,1,3),c=1e4/i,d=e+2.2*t*(1-l%c/c);stroke(a.levels[0],a.levels[1],a.levels[2],alphaValue/2),strokeWeight(s);let p=t;line(d,o-n-3,d+p,o-n-3),line(d,o+r+n+1,d+p,o+r+n+1)}function drawLightParallelLines(e,o,t,r,l,i){fill(l[0],l[1],l[2],alphaValue),noStroke();for(let a=0;al.x&&ol.y)return!0;return!1}function drawHdssd(){if(!hdssd)return;let e=millis();for(let o of hdssd){let{x:t,y:r,width:l,height:i,colors:a,rectAngle:n,ssdRotation:s,animationSpeed:c}=o,d=20*dynamo,p=.001,u=sin(e*p*c+d)*l/2,f=sin(e*p*c+d+PI/4)*l/2,m=sin(e*p*c+d+PI/2)*l/2,h=40*sin(e*p+u),g=40*sin(e*p+f),C=40*sin(e*p+m);push(),translate(t+l/2,r+i/2),rotate(radians(s)),drawHdssdLayer(-l/2+h,-i/2,l,i,a[0],u,n,-6),drawHdssdLayer(-l/2+g,-i/2,l,i,a[1],f,n,3),drawHdssdLayer(-l/2+C,-i/2,l,i,a[2],m,n,-5),pop()}}function drawHdssdLayer(e,o,t,r,l,i,a,n){let s=getHeatColor(dynamo),c=map(dynamo,1,10,3,13),d=map(dynamo,1,10,1,5),p=map(dynamo,1,10,1,3),u=map(dynamo,1,10,10,40);millis();for(let f=-t;f=a&&o>=a&&e+t<=canvasSize-a&&o+l*(r+i)<=canvasSize-a}function generateRectAltPosition(){let e=selectedRectAltProfile,o=.1*canvasSize;random(0,1)<.5?rectAltX=random(o,.35*canvasSize-e.width):rectAltX=random(.65*canvasSize,canvasSize-o-e.width),random(0,1)<.5?rectAltY=random(o,.35*canvasSize-(e.count*e.height+(e.count-1)*e.spacing)):rectAltY=random(.65*canvasSize-(e.count*e.height+(e.count-1)*e.spacing),canvasSize-o-(e.count*e.height+(e.count-1)*e.spacing))}function getHeatColor(e){if("allBlack"===selectedColorProfile.name)return color(random(255),random(255),random(255));let o=map(e,1,10,0,1),t=lerp(selectedColorProfile.gradientStart[0],selectedColorProfile.gradientEnd[0],o),r=lerp(selectedColorProfile.gradientStart[1],selectedColorProfile.gradientEnd[1],o),l=lerp(selectedColorProfile.gradientStart[2],selectedColorProfile.gradientEnd[2],o);return color(t,r,l)}function drawQuantic(){let e=selectedQuanticProfile.baseSpeed,o=.01*dynamo,t=selectedQuanticProfile.maxDimension;for(let r=0;r<5;r++){let l=quanticRects[r],i=r*TWO_PI/7;l.width=map(sin(frameCount*(e+o)+i),-1,1,t/3,t),l.height=map(cos(frameCount*(e+o)+i),-1,1,t/3,t);let a=[selectedColorProfile.squareColor1,selectedColorProfile.squareColor2,selectedColorProfile.squareColor3];drawQuanticRectangle(quanticCenterX,quanticCenterY,l.width,l.height,a)}}function drawQuanticRectangle(e,o,t,r,l){push(),translate(e,o);let i=getHeatColor(dynamo),a=map(dynamo,1,10,0,10),n=map(dynamo,1,10,1,5);stroke(i.levels[0],i.levels[1],i.levels[2],alphaValue/2),strokeWeight(n),line(-t/2-a,-r/2-a,t/2+a,-r/2-a),line(-t/2-a,r/2+a,t/2+a,r/2+a),line(-t/2-a,-r/2-a,-t/2-a,r/2+a),line(t/2+a,-r/2-a,t/2+a,r/2+a),strokeWeight(.5);for(let e=-r/2;edataTextUpdateInterval&&(updateDataTextValues(),lastDataTextUpdateTime=millis());let{x:e,y:o}=getDataTextPosition(),t=selectedColorProfile.textColor;fill(t[0],t[1],t[2],alphaValue/3),noStroke(),textSize(12),textAlign(LEFT,TOP),textFont("Courier New");let r=generateDataText().split("\n");for(let t=0;t=e.count)break;let a=o+r*(e.radius+e.horizontalSpacing),n=t+i*(e.radius+e.verticalSpacing);capacitors.push({x:a,y:n,radius:e.radius,numCircles:e.numCircles,animationSpeed:e.animationSpeed,colors:[selectedColorProfile.rectColor1,selectedColorProfile.rectColor2,selectedColorProfile.rectColor3]})}}function randomWeightedEdge(e,o){let t=(e+o)/2,r=random()<.97?random()*(t-e):random()*(o-t);return random()<.5?t-r:t+r}function drawCapacitors(){for(let e of capacitors)drawCapacitor(e.x,e.y,e.radius,e.numCircles,e.colors,e.animationSpeed)}function drawCapacitor(e,o,t,r,l,i){push(),translate(e,o);let a=millis()%1e3/1e3,n=i*dynamo,s=map(dynamo,1,10,1,2);for(let e=0;e.78){stroke(120,120,120);let e=int(random(width));line(e,0,e,height)}}function drawGlitchText(e,o,t){textSize(42),textAlign(CENTER,CENTER),noStroke();let r=[placeholderScreenBackgroundLayer1,placeholderScreenBackgroundLayer2,placeholderScreenBackgroundLayer3];for(let l=0;l<5;l++){let l=random(-5,5),i=random(-5,5),a=100;fill(r[0][0],r[0][1],r[0][2],a/2),text(e,o+l,t+i),l=random(-5,5),i=random(-5,5),fill(r[1][0],r[1][1],r[1][2],a/2),text(e,o+l,t+i),l=random(-5,5),i=random(-5,5),fill(r[2][0],r[2][1],r[2][2],a/2),text(e,o+l,t+i)}fill(225,100),text(e,o,t)}