/* Passive process illustrations. No manipulation or completion actions. */ (() => { const units=[{id:'intake'},{id:'pretreat'},{id:'rapid'},{id:'floc'},{id:'settle',path:[[175,150],[540,150]]},{id:'ozone'},{id:'filter',path:[[320,82],[320,330]]},{id:'blend'},{id:'final'},{id:'contact',path:[[135,75],[495,75],[495,145],[145,145],[145,215],[495,215],[495,285],[145,285],[145,345],[540,345]]},{id:'tap'}]; const clamp=(v,a=0,b=1)=>Math.max(a,Math.min(b,v)); function at(path,p){const lengths=path.slice(1).map((b,i)=>Math.hypot(b[0]-path[i][0],b[1]-path[i][1]));let d=clamp(p)*lengths.reduce((a,b)=>a+b,0);for(let i=0;i''; const pipe=points=>line(points,'#87a8ad',64)+line(points,'#143140',48); const text=(t,x,y,color='#a9c7cd',size=12)=>''+String(t).replace(/&/g,'&').replace(/'; function droplet(x,y,p=0,small=false){const color=p<.3?'#a7bbac':p<.65?'#acd2c0':'#9ae3d9';return '';} function tank(x,y,w,h,water='#2e5960'){return '';} function scene(id,p=.65,time=0,source='river'){const s=units.find(x=>x.id===id);const u=clamp(p),rotation=s.id==='rapid'?time*65:s.id==='floc'?time*18:0;let body=''; if(s.id==='intake'){ if(source==='river'){ body=''+pipe([[150,240],[545,240]])+''; for(let i=0;i<6;i++)body+=''; body+=''+droplet(300+u*240,239,.1,true)+text('RIVER INTAKE',145,115,'#c3e0da',18)+text('SCREEN',240,190)+text('RAW-WATER PUMP',430,315)+text('TO PRETREATMENT',520,175); }else{ body=''+text('GROUND SURFACE',125,150,'#b1c6bc',12)+''; for(let i=0;i<8;i++)body+=''; body+=droplet(255,330-u*225,.1,true)+text('GROUNDWATER WELLS',340,47,'#c3e0da',18)+text('AQUIFER',470,330,'#a5c9cc',17)+text('WELL PUMP',374,246)+text('TO INFLUENT PUMPING',490,77); } } if(s.id==='pretreat'){ body=pipe([[45,220],[595,220]])+''+text('NaOCl',320,69,'#d6e8d8',17)+text('PRE-OXIDATION',320,92,'#a6c4bd',10)+''; if(u>0)body+=line([[75,220],[95+u*460,220]],'#9dc9be',10); for(let i=0;i<14;i++)body+=''; body+=droplet(90+u*460,220,.08)+''+text(source==='groundwater'?'GROUNDWATER':'RIVER WATER',130,170)+text('TO RAPID MIX',532,170)+text(source==='groundwater'?'As(III) → As(V)':'SOURCE-SPECIFIC PRE-OXIDATION',320,315,'#d1c48e',18)+text(source==='groundwater'?'OXIDATION, NOT REMOVAL':'CHEMISTRY DEPENDS ON THE SOURCE',320,346,'#a7bdc4',10); } if(s.id==='rapid'||s.id==='floc'){ body=tank(130,150,380,190,'#6b7050')+''; const growth=s.id==='floc'?u:0; for(let i=0;i<55;i++){const group=i%8,baseX=163+(i*67%310),baseY=177+(i*43%135),cx=178+(group*43%280),cy=184+(group*31%118),x=baseX+(cx-baseX)*growth+(1-growth)*Math.sin(time+i)*4,y=baseY+(cy-baseY)*growth;body+='';} body+=''+text(s.id==='rapid'?'FeCl3':'POLYMER',59,165,'#e1ddb7',11); body+=droplet(430,207,.16,true)+''+text(s.id==='rapid'?'RAPID MIX · FERRIC CHLORIDE':'GENTLE MIX · FLOCCULATION',320,373); } if(s.id==='settle'){ body=tank(95,110,405,220,'#406861')+pipe([[490,150],[590,150]])+''; for(let i=0;i<7;i++)body+=''; const settled=clamp(time/1.8);for(let i=0;i<28;i++){const x=122+i*61%350,y=170+i*31%115,base=305+i%4*3;body+='';} body+=''+text('WATER OUT',549,109)+text('SLUDGE → THICKENER → DRYING BEDS',300,360,'#c6ab7c',11); } if(s.id==='blend'){ body=pipe([[40,270],[320,270],[320,210],[570,210]])+pipe([[40,65],[190,65],[190,210],[320,210]])+''; body+=line([[45,270],[320,270],[320,210],[555,210]],'#8dd7cd',8); if(u>0)body+=line([[45,65],[190,65],[190,210],[320+u*230,210]],'#a8b9e7',u*10); body+=droplet(405+u*135,210,.85,true)+''+text(source==='groundwater'?'GROUNDWATER BYPASS':'OTHER COMPATIBLE FINISHED WATER',340,50,'#bdc9e8',12)+text('FILTER EFFLUENT PUMP',150,336)+text('TO FINAL TREATMENT',495,269)+text('ILLUSTRATIVE BLEND · NO OPERATING RATIO',320,385,'#a0bcc5',10); } if(s.id==='ozone'){ body=tank(220,100,310,235,'#37626b')+pipe([[520,150],[595,150]])+''+text('OZONE',105,155,'#c6dcdf')+text('FEED',105,176,'#c6dcdf')+''; for(let i=0;i';} for(let i=0;i<14;i++)body+=''; body+=droplet(435,172,.5,true)+''; body+=text('SETTLED WATER → GAC FILTRATION',390,377,'#a8c9c8',11); } if(s.id==='filter'){ body=pipe([[320,30],[320,105]])+tank(210,100,220,230,'#36626c')+pipe([[320,318],[320,372]])+''; for(let i=0;i<100;i++)body+=''; for(let i=0;i<15;i++){const caught=u>i/23,cy=caught?174+(i%4)*10:112+(i*13%31);body+='';} body+=text('GAC',480,197)+text('GAC',480,254)+text('SUPPORT',480,307)+text('NONIONIC POLYMER',125,104,'#c4d7b4',10)+''; } if(s.id==='final'){ body=pipe([[45,235],[595,235]])+''+text('NaOCl',235,77,'#dceadc',16)+text('PHOSPHATE',405,77,'#dae0eb',12)+''; for(let i=0;i'; body+=droplet(75+u*470,235,.95)+''+text('BLENDED WATER',120,293)+text('TO CHLORINE CONTACT',510,293)+text('FINAL DISINFECTION + CORROSION CONTROL',320,365,'#c4d9ce',12); } if(s.id==='contact'){ body=''+line(s.path,'#46727b',45)+line(s.path,'#acd8cf',2); for(let i=0;i<18;i++){const q=at(s.path,i/18),opacity=i/18';} body+=''; body+=text('IN',82,79)+text('OUT',584,348); } if(s.id==='tap'){ body=pipe([[90,210],[300,210],[300,155],[440,155],[440,210]])+''; if(u>0){body+=''+'';body+=droplet(440,Math.min(336,245+u*95),1,true);} body+=''+text('CUSTOMERS',440,397)+text(source==='groundwater'?'VIA CANUTILLO BOOSTER':'PUMPING & DISTRIBUTION',140,275,'#9fbdc4',10); } if(s.path){const pos=at(s.path,u);body+=''+droplet(...pos,s.id==='settle'?.38:s.id==='filter'?.65+u*.2:.9)+'';if(u<.05){const q=at(s.path,.11);body+='';}} return ''; } window.ProcessArt={scene}; })();