let config={letters:["R","O","T","A"],noiseColor:255,currentUrlIndex:0,clickCounter:0,dynamicOpacityEnabled:!0},contentLoaded=!0;const cssString="\nbody, html {\n margin: 0;\n padding: 0;\n height: 100vh;\n overflow: hidden;\n}\n#container {\n\n}\ncanvas {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 2;\n}\n#iframe {\n}\n",urls=["/content/5a1e991817e0bcaa2147872cde63b2b6bf19c1b0d0cff4625acd09631a9cc35ci0","/0869c6220ef298c11f6b78f0318ea4de897af32577d7ecfa534938ebd4408ddci0","/content/0f34b3b81c9580926694378e22e267cd234802b44cfc10517d70675378e83eaai0"];function fetchData(){const e=urls[config.currentUrlIndex];fetch(e).then((e=>{if(!e.ok)throw new Error("Network response was not ok");return e.text()})).then((e=>{document.getElementById("content-display").innerText=e,config.currentUrlIndex=(config.currentUrlIndex+1)%urls.length})).catch((e=>console.error("There has been a problem with your fetch operation:",e)))}function keyPressed(){"o"!==key&&"O"!==key||(config.dynamicOpacityEnabled=!config.dynamicOpacityEnabled)}function setup(){createCanvas(windowWidth,windowHeight),recalculateSizesAndPositions(),background(0),noiseDetail(3.7,.88),pixelDensity(1);let e=document.createElement("style");e.type="text/css",e.innerHTML=cssString,document.head.appendChild(e);let t=createDiv("").id("container");t.style("width","100%"),t.style("height","100%"),t.style("display","flex"),t.style("justify-content","center"),t.style("align-items","center"),t.style("position","relative");let n=createElement("iframe","").id("iframe");n.attribute("src",urls[config.currentUrlIndex]),n.style("z-index: 1; width: 80vw; height: 80vh; align-self: center; transform: translateX(1%) translateY(-5%) scale(1) rotate(); position: absolute; filter:hue-rotate(355deg) saturate(90%) brightness(90%) contrast(90%); border: none;"),n.parent(t),n.elt.onload=()=>{contentLoaded=!0,console.log("Iframe content loaded:",n.attribute("src"))}}function draw(){background(0),drawStaticElements(),drawPerlinNoiseTriangle(),drawDynamicOpacityTriangle(),drawTriangleStrokes(),drawRotatingLogo()}function recalculateSizesAndPositions(){frameThickness=.004*width,padding=.02*width,cornerRadius=.01*width;let e=min(width,height);logoDiameter=.08*e,logoStrokeWeight=.0019*e,logoTextSize=.022*e,logoYPosition=.1*windowHeight,vertexDistance=.35*min(windowWidth,windowHeight);let t=windowWidth/2,n=windowHeight/2;vertex1=createVector(t,n-vertexDistance),vertex2=createVector(t-vertexDistance*Math.sin(PI/3),n+vertexDistance/2),vertex3=createVector(t+vertexDistance*Math.sin(PI/3),n+vertexDistance/2),fontPositionY=.92*windowHeight,upperLineY=.865*windowHeight,separatorStrokeWeight=.0022*windowWidth}function windowResized(){resizeCanvas(windowWidth,windowHeight),recalculateSizesAndPositions()}function drawStaticElements(){stroke(255),strokeWeight(frameThickness),noFill(),rect(padding,padding,width-2*padding,height-2*padding,cornerRadius),textAlign(CENTER,CENTER),textSize(.047*windowWidth),fill(255),stroke(2),text("ACE x FIRE",width/2,fontPositionY),stroke(255),strokeWeight(separatorStrokeWeight),line(0,upperLineY,width,upperLineY)}function drawPerlinNoiseTriangle(){loadPixels();let e=.42*frameCount;for(let t=0;t{glow("rgb(255,0,0)",e),drawTriangle()})),drawingContext.shadowBlur=0}function glow(e,t){drawingContext.shadowBlur=t,drawingContext.shadowColor=e}function drawTriangle(){beginShape(),vertex(vertex1.x,vertex1.y),vertex(vertex2.x,vertex2.y),vertex(vertex3.x,vertex3.y),endShape(CLOSE)}function glow(e,t){drawingContext.shadowBlur=t,drawingContext.shadowColor=e}function drawRotatingLogo(){push(),translate(width/2,logoYPosition),stroke(255,0,0),strokeWeight(logoStrokeWeight),noFill(),ellipse(0,0,logoDiameter),textFont("Courier New"),textSize(logoTextSize),textAlign(CENTER,CENTER),drawLetter(config.letters[0],0,-logoDiameter/2),drawLetter(config.letters[1],logoDiameter/2,0),drawLetter(config.letters[2],0,logoDiameter/2),drawLetter(config.letters[3],-logoDiameter/2,0),pop()}function drawLetter(e,t,n){push(),translate(t,n),stroke(255),fill(255),text(e,0,0),pop()}function mousePressed(){if(config.clickCounter++,config.noiseColor=255===config.noiseColor?0:255,contentLoaded&&config.clickCounter%2==0){contentLoaded=!1,config.currentUrlIndex=(config.currentUrlIndex+1)%urls.length;let e=document.getElementById("iframe");e?(e.src=urls[config.currentUrlIndex]+"?timestamp="+(new Date).getTime(),console.log("New URL set for iframe:",e.src),e.onload=()=>{console.log("Iframe content loaded."),contentLoaded=!0}):console.error("Iframe not found!")}if(dist(mouseX,mouseY,width/2,height/2)0&&s>0&&1-d-s>0}