constbgCol="#447abd";constgCol="#a2c2e8";constnGrid=20;letw;letgSpace;functionsetup(){w=max(400,min(windowWidth,windowHeight)*0.9);gSpace=(w/nGrid)*0.95;describe("4 aperigonal antiprism tilings moving in alternating directions horizontally across the screen on a blueprint design. ");createCanvas(w,w);rectMode(CENTER);d=w;angleMode(DEGREES);textSize(16);}functiondraw(){background(bgCol);translate(w/2,w/2);drawGrid();t=frameCount/3;noStroke();for(letj=0;j<4;j++){push();translate(0,-8*gSpace+j*gSpace*4.33);fill(255,255,255,150);rect(0,1.5*gSpace,w,2*gSpace);stroke(255);strokeWeight(1);fill(255,255,255,50);rect(0,0,w,gSpace);rect(0,3*gSpace,w,gSpace);stroke(255);strokeWeight(2);fill(255,255,255,20);t1=(pow(-1,j%2)*t)%(2*gSpace);for(leti=-w/2-gSpace;i<w/2;i+=2*gSpace){line(i+t1,0.5*gSpace,i+gSpace+t1,2.5*gSpace);line(i+gSpace+t1,2.5*gSpace,i+2*gSpace+t1,0.5*gSpace);}pop();}noStroke();noStroke();fill(bgCol);rect(-width/2+gSpace/2,0,gSpace,height);rect(width/2-gSpace/2,0,gSpace,height);rect(0,-width/2+gSpace/2,height,gSpace);rect(0,width/2-gSpace/2,height,gSpace);fill(gCol);text("antiprism",-w/2+10,w/2-5);}functiondrawGrid(){stroke(gCol);strokeWeight(0.3);for(leti=1;i<=nGrid;i++){for(letj=1;j<=nGrid;j++){line(-w/2+gSpace*i,-w/2+gSpace,-w/2+gSpace*i,w/2-gSpace);line(-w/2+gSpace,-w/2+gSpace*i,w/2-gSpace,-w/2+gSpace*i);}}noFill();strokeWeight(3);rect(0,0,w-2*gSpace);}functionmousePressed(){setup();draw();}functionwindowResized(){setup();draw();}