/* global React, Reveal */ const { useState:useShxS, useEffect:useShxE, useRef:useShxR } = React; const SHX_BOOKS=[['Alzheimer Disease','Neurology'],['Type 2 Diabetes','Metabolic'],['Melanoma','Oncology'],['Heart Failure','Cardiovascular'],['Multiple Sclerosis','Neurology'],['Asthma','Respiratory'],['Parkinson Disease','Neurology'],['Rheumatoid Arthritis','Autoimmune'],['Tuberculosis','Infectious'],['Glioblastoma','Oncology'],['Cystic Fibrosis','Genetic'],['Crohn Disease','Autoimmune'],['Sickle Cell Disease','Hematologic'],['Schizophrenia','Psychiatry'],['Pancreatic Cancer','Oncology'],['Hypertension','Cardiovascular'],['Psoriasis','Dermatologic'],['Malaria','Infectious'],['ALS','Neurology'],['Lupus','Autoimmune'],['Glaucoma','Ophthalmic'],['Hepatitis C','Infectious'],['Osteoporosis','Metabolic'],['Epilepsy','Neurology']]; const SHX_PAL=[['#F3ECDA','#182E2B','#B58C3B'],['#174F49','#F7F1E1','#E0C184'],['#B58C3B','#0D2624','#FFFCF5'],['#092D2C','#EADFC4','#D4AF37'],['#E0D3B1','#182E2B','#174F49']]; const shxHash=s=>{let h=7;for(const c of s)h=(h*31+c.charCodeAt(0))>>>0;return h}; const SHX_SHELF_URL='AetherCore%20Shelf.html',SHX_ACADEMY_URL='AetherCore%20Academy.html'; function ShelfShowcase(){ const [q,setQ]=useShxS(''); const go=(e)=>{e.preventDefault();window.location.href=SHX_SHELF_URL+(q.trim()?'?q='+encodeURIComponent(q.trim()):'')}; const spine=([n,c],k)=>{const p=SHX_PAL[shxHash(n)%SHX_PAL.length],fs=Math.max(11,Math.min(21,150/n.length*1.9)); return {n.toUpperCase()} VHS}; return
THE SHELF EVERY DISEASE, ON ONE SHELF. Search any condition, open its book, and keep your place. Fifteen live reading pages and five videos in every one. setQ(e.target.value)} placeholder="SEARCH ANY DISEASE" aria-label="Search the shelf"/> 265+ BOOKS15 PAGES EACH14 SYSTEMSOPEN THE SHELF →
{SHX_BOOKS.map(spine)}{SHX_BOOKS.map((b,i)=>spine(b,'d'+i))}
; } const ACA_MODES=[ {k:'SIMULATE',t:'LIVE MODELS.',d:'Move a slider. Watch biology respond.',tag:'3D MODEL'}, {k:'SKETCH',t:'DRAW IT.',d:'Sketch the mechanism on the model.',tag:'BLUEPRINT'}, {k:'DISCOVER',t:'TRACE THE SOURCE.',d:'Every claim links to its evidence.',tag:'EVIDENCE'}, ]; /* 3D DNA double helix: one canvas that morphs between the three steps. */ function DnaCanvas({mode}){ const ref=useShxR(null),st=useShxR({}); st.current.mode=mode; useShxE(()=>{ const cv=ref.current,ctx=cv.getContext('2d'),s=st.current,par=cv.parentNode; Object.assign(s,{wire:0,unzip:0,dr:1,rot:0,spin:.5,lx:0,ly:0,tx:0,ty:0,prev:performance.now(),last:0,vis:true,pm:-1,mt:0,t0:performance.now()}); const reduce=matchMedia('(prefers-reduced-motion:reduce)').matches; const BASE=['#D4AF37','#FFF2C4','#D9442B','#8aa2ff'],N=26,TURNS=2.25,M=150; const lerp=(a,b,k)=>a+(b-a)*k,cl=(x,a,b)=>Math.max(a,Math.min(b,x)),sm=x=>x*x*(3-2*x); let W=0,H=0,dpr=1,dead=false,raf=0; const size=()=>{const w=cv.clientWidth,h=cv.clientHeight,d=Math.min(2,devicePixelRatio||1);if(w!==W||h!==H||d!==dpr){W=w;H=h;dpr=d;cv.width=Math.round(w*d);cv.height=Math.round(h*d)}}; function render(now){ size();if(!W)return; const dt=Math.min(.05,Math.max(.001,(now-s.prev)/1000));s.prev=now;const time=(now-s.t0)/1000,md=s.mode; if(md!==s.pm){s.pm=md;s.mt=time;if(md===1)s.dr=0} const k=1-Math.exp(-3.2*dt); s.wire=lerp(s.wire,md===1?1:0,k);s.unzip=lerp(s.unzip,md===2?1:0,1-Math.exp(-2.2*dt)); s.dr=md===1?cl((time-s.mt)/3.4,0,1):lerp(s.dr,1,1-Math.exp(-6*dt)); s.spin=lerp(s.spin,md===0?.55:md===1?.26:.4,k);if(!reduce)s.rot+=s.spin*dt; s.lx=lerp(s.lx,s.tx,1-Math.exp(-5*dt));s.ly=lerp(s.ly,s.ty,1-Math.exp(-5*dt)); ctx.setTransform(dpr,0,0,dpr,0,0);ctx.clearRect(0,0,W,H); const cx=W*(W>520?.6:.5),cy=H*.33,Hh=H*.27,R=Math.min(W,H)*.125,D=Math.min(W,H)*3.2; const lean=-.36+s.lx*.18,tilt=.3+s.ly*.22,cL=Math.cos(lean),sL=Math.sin(lean),cT=Math.cos(tilt),sT=Math.sin(tilt); const wi=s.wire,solid=1-wi,dr=s.dr*1.1; const open=t=>s.unzip*sm(cl(1-Math.abs(t-.5)/.42,0,1))*(.92+.08*Math.sin(time*2)); const P=(t,strand,rm)=>{const y=(t-.5)*2*Hh,a=t*TURNS*Math.PI*2+s.rot+(strand?Math.PI:0); const x=Math.cos(a)*rm,z=Math.sin(a)*rm,y1=y*cT-z*sT,z1=y*sT+z*cT,x2=x*cL-y1*sL,y2=x*sL+y1*cL,sc=D/(D-z1); return{x:cx+x2*sc,y:cy+y2*sc,z:z1,sc,f:cl((z1/R+1)/2,0,1)}}; const Rm=t=>R*(1+.85*open(t)); // halo const hg=ctx.createRadialGradient(cx,cy,0,cx,cy,Math.max(W,H)*.5);hg.addColorStop(0,'rgba(212,175,55,'+(.2-.12*wi)+')');hg.addColorStop(1,'rgba(212,175,55,0)'); ctx.fillStyle=hg;ctx.fillRect(0,0,W,H); // sketch guides if(wi>.02){ctx.save();ctx.globalAlpha=wi*.55;ctx.strokeStyle='#E7D49B';ctx.lineWidth=1;ctx.setLineDash([5,6]); const bx=cx-R*1.9,bw=R*3.8,by=cy-Hh*1.12,bh=Hh*2.24;ctx.strokeRect(bx,by,bw,bh);ctx.setLineDash([]); [[bx,by],[bx+bw,by],[bx,by+bh],[bx+bw,by+bh]].forEach((c,i)=>{const sx=i%2?-1:1,sy=i>1?-1:1;ctx.beginPath();ctx.moveTo(c[0],c[1]+sy*14);ctx.lineTo(c[0],c[1]);ctx.lineTo(c[0]+sx*14,c[1]);ctx.stroke()}); ctx.beginPath();ctx.moveTo(bx+bw+16,by);ctx.lineTo(bx+bw+16,by+bh);ctx.stroke(); for(let i=0;i<=8;i++){const yy=by+bh*i/8;ctx.beginPath();ctx.moveTo(bx+bw+12,yy);ctx.lineTo(bx+bw+20,yy);ctx.stroke()} ctx.restore()} const items=[]; // strands for(let st2=0;st2<2;st2++)for(let j=0;j{const f=(p0.f+p1.f)/2;ctx.globalAlpha=vis*(solid*(.3+.7*f)+wi*(.45+.4*f)); ctx.strokeStyle=wi>.5?'#F4EBD0':'#D4AF37';ctx.lineWidth=(wi>.5?1.1:2.2+2.4*f)*(p0.sc+p1.sc)/2;ctx.lineCap='round'; ctx.beginPath();ctx.moveTo(p0.x,p0.y);ctx.lineTo(p1.x,p1.y);ctx.stroke()}})} for(let i=0;i{const L=lerp(.5,.16,sm(o)),mx=A.x+(B.x-A.x)*L,my=A.y+(B.y-A.y)*L,nx=B.x+(A.x-B.x)*L,ny=B.y+(A.y-B.y)*L,sc=(A.sc+B.sc)/2,f=(A.f+B.f)/2; ctx.globalAlpha=vis*(.35+.65*f);ctx.lineCap='round';ctx.lineWidth=(wi>.5?1:3.2)*sc; if(wi>.5)ctx.setLineDash([4,5]); ctx.strokeStyle=wi>.5?'#E7D49B':cA;ctx.beginPath();ctx.moveTo(A.x,A.y);ctx.lineTo(mx,my);ctx.stroke(); ctx.strokeStyle=wi>.5?'#E7D49B':cB;ctx.beginPath();ctx.moveTo(B.x,B.y);ctx.lineTo(nx,ny);ctx.stroke();ctx.setLineDash([]); if(o>.45){const pu=1+.35*Math.sin(time*3+i);ctx.globalAlpha=vis*sm(cl((o-.45)*3,0,1)); [[mx,my,cA],[nx,ny,cB]].forEach(n=>{const gr=ctx.createRadialGradient(n[0],n[1],0,n[0],n[1],11*sc*pu);gr.addColorStop(0,'#fff');gr.addColorStop(.35,n[2]);gr.addColorStop(1,'rgba(212,175,55,0)');ctx.fillStyle=gr;ctx.beginPath();ctx.arc(n[0],n[1],11*sc*pu,0,6.283);ctx.fill()})}}}); // backbone spheres [A,B].forEach((p,si)=>items.push({z:p.z+.01,fn:()=>{const r=R*.2*p.sc*(.82+.34*p.f); if(solid>.02){ctx.globalAlpha=vis*solid*(.45+.55*p.f);const gr=ctx.createRadialGradient(p.x-r*.35,p.y-r*.4,r*.1,p.x,p.y,r);gr.addColorStop(0,'#fffbe6');gr.addColorStop(.45,si?'#E7D49B':'#D4AF37');gr.addColorStop(1,'#7a5a12');ctx.fillStyle=gr;ctx.beginPath();ctx.arc(p.x,p.y,r,0,6.283);ctx.fill()} if(wi>.02){ctx.globalAlpha=vis*wi*(.5+.4*p.f);ctx.strokeStyle='#F4EBD0';ctx.lineWidth=1;ctx.beginPath();ctx.arc(p.x,p.y,r*.8,0,6.283);ctx.stroke()}}}))} items.sort((a,b)=>a.z-b.z);items.forEach(it=>{ctx.save();it.fn();ctx.restore()}); // simulate pulses if(md===0||s.unzip<.5){const e=1-wi;for(let j=0;j<6;j++)for(let st2=0;st2<2;st2++){const t=((time*.16+j/6+st2*.08)%1),p=P(t,st2,Rm(t)); const gr=ctx.createRadialGradient(p.x,p.y,0,p.x,p.y,R*.45*p.sc);gr.addColorStop(0,'rgba(255,248,214,'+(.9*e)+')');gr.addColorStop(1,'rgba(212,175,55,0)');ctx.fillStyle=gr;ctx.beginPath();ctx.arc(p.x,p.y,R*.45*p.sc,0,6.283);ctx.fill()}} // sketch pencil if(md===1&&s.dr<1){const t=cl(s.dr,0,1),p=P(t,0,R),q=P(t,1,R),x=(p.x+q.x)/2,y=(p.y+q.y)/2,gr=ctx.createRadialGradient(x,y,0,x,y,26); gr.addColorStop(0,'rgba(255,255,255,.95)');gr.addColorStop(1,'rgba(255,255,255,0)');ctx.fillStyle=gr;ctx.beginPath();ctx.arc(x,y,26,0,6.283);ctx.fill(); ctx.strokeStyle='#fff';ctx.lineWidth=1;ctx.beginPath();ctx.moveTo(x-12,y);ctx.lineTo(x+12,y);ctx.moveTo(x,y-12);ctx.lineTo(x,y+12);ctx.stroke()} // discover scan ring if(s.unzip>.05){const t=.5+Math.sin(time*.9)*.45,c=P(t,0,0),rx=R*(1.9+.85*open(t)),gr=ctx.createLinearGradient(c.x-rx,c.y,c.x+rx,c.y); gr.addColorStop(0,'rgba(212,175,55,0)');gr.addColorStop(.5,'rgba(255,240,180,'+(.9*s.unzip)+')');gr.addColorStop(1,'rgba(212,175,55,0)'); ctx.strokeStyle=gr;ctx.lineWidth=2;ctx.beginPath();ctx.ellipse(c.x,c.y,rx*c.sc,rx*.34*c.sc,lean,0,6.283);ctx.stroke()} } const tick=n=>{if(dead)return;if(s.vis){s.last=performance.now();render(n)}raf=requestAnimationFrame(tick)};raf=requestAnimationFrame(tick); const iv=setInterval(()=>{if(s.vis&&performance.now()-s.last>160){s.last=performance.now();render(performance.now())}},80); const io=new IntersectionObserver(es=>{s.vis=es[0].isIntersecting});io.observe(cv); const mv=e=>{const r=par.getBoundingClientRect();s.tx=((e.clientX-r.left)/r.width-.5)*2;s.ty=((e.clientY-r.top)/r.height-.5)*2;if(e.buttons&1)s.rot+=e.movementX*.012}; const lv=()=>{s.tx=0;s.ty=0};par.addEventListener('pointermove',mv);par.addEventListener('pointerleave',lv); return()=>{dead=true;cancelAnimationFrame(raf);clearInterval(iv);io.disconnect();par.removeEventListener('pointermove',mv);par.removeEventListener('pointerleave',lv)}; },[]); return ; } function AcademyShowcase(){ const [i,setI]=useShxS(0),[hold,setHold]=useShxS(false); useShxE(()=>{if(hold||matchMedia('(prefers-reduced-motion:reduce)').matches)return;const id=setInterval(()=>setI(x=>(x+1)%ACA_MODES.length),5600);return()=>clearInterval(id)},[hold,i]); const m=ACA_MODES[i]; return
setHold(true)} onMouseLeave={()=>setHold(false)} onFocus={()=>setHold(true)} onBlur={e=>{if(!e.currentTarget.contains(e.relatedTarget))setHold(false)}}>
THE ACADEMY SIMULATE. SKETCH. DISCOVER.
{ACA_MODES.map((x,k)=>)}
STEP 0{i+1} / 03
{m.tag}

{m.t}

{m.d}

; } Object.assign(window,{ShelfShowcase,AcademyShowcase});