Deck.transition('flaps',{dur:1.2,frag:`void main(){ vec2 n=vec2(8.,4.), id=floor(vUv*n), f=fract(vUv*n); float dl=(id.x+(n.y-1.-id.y)*1.5)/(n.x-1.+(n.y-1.)*1.5)*.7+.3*hash12(id+3.); float t=sat(p*1.7-dl*.7), c=cos(t*3.14159265), s=sin(t*3.14159265); vec4 col; if(f.y>.5){ float h=(f.y-.5)*2.; if(c>0.&&h[a[0]*b[0]-a[1]*b[1],a[0]*b[1]+a[1]*b[0]]; const div=(a,b)=>{ const m=b[0]*b[0]+b[1]*b[1]; return [(a[0]*b[0]+a[1]*b[1])/m,(a[1]*b[0]-a[0]*b[1])/m]; }; const ZJ=[G[0]+26.5*25,G[1]+3.5*84], zJ=[729,674]; // 1 July: flat position, warped position const e0=div([zJ[0]-K[0],zJ[1]-K[1]],A), al=mul(A,[Math.log(Math.hypot(e0[0],e0[1])),Math.atan2(e0[1],e0[0])]); const F=[ZJ[0]-al[0],ZJ[1]-al[1]], D=[F[0]-K[0]-A[0],F[1]-K[1]-A[1]]; const fwd=(X,Y)=>{ const t=div([X-F[0],Y-F[1]],A), m=Math.exp(t[0]), w=mul(A,[m*Math.cos(t[1]),m*Math.sin(t[1])]); return [K[0]+w[0],K[1]+w[1]]; }; const ang=z=>{ const t=div([z[0]-K[0],z[1]-K[1]],A); return Math.atan2(t[1],t[0]); }; const zP=fwd(ZJ[0],ZJ[1]+12), phP=ang(zP), WP=100; // the inner planner inside the 1 July cell const cum=[0,31,59,90,120,151,181,212,243,273,304,334], nm=['JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC']; const strip=(str,x,y,size,a)=>{ if(a<=0) return; const b=d.text(str,{x,y,size,font:'text',show:0}); d.rect(b.x-13,b.y-5,b.w+36,b.h+24,'#000000',.3*a); d.rect(b.x-18,b.y-12,b.w+36,b.h+24,'#f4efe2',a); d.text(str,{x,y,size,font:'text',color:'#141414',alpha:a}); }; return { D, zJ, psiJ:ang(zJ), zP, phP, WP, zA:fwd(G[0]+15.5*25,G[1]+42), strip, U:{uW:0,uSel:0,uIn:0,uD:[0,0],uM:[0,0],uCam:[960,540,1,0],uIP:[zP[0],zP[1],phP,WP],uZone:[0,0,0]}, mons:nm.map((t,i)=>({t,x:G[0]+25*Math.ceil((cum[i]+4)/7)+2})), marks:[[282,122],[1639,122],[282,958],[1639,958]], wd:['M','T','W','T','F','S','S'], paper:d.pass(`uniform float uW,uSel,uIn; uniform vec2 uD,uM; uniform vec4 uCam,uIP; uniform vec3 uZone; const vec2 K=vec2(330.,860.), A=vec2(93.583,3.979), G=vec2(298.,350.), CS=vec2(25.,84.); const float CUM[12]=float[12](0.,31.,59.,90.,120.,151.,181.,212.,243.,273.,304.,334.); const int FONT[10]=int[10](31599,9362,29671,29647,23497,31183,31215,29257,31727,31695); vec2 cmul(vec2 a,vec2 b){ return vec2(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x); } vec2 cdiv(vec2 a,vec2 b){ return vec2(a.x*b.x+a.y*b.y,a.y*b.x-a.x*b.y)/dot(b,b); } float dig(float n,vec2 u){ if(u.x<0.||u.x>=3.||u.y<0.||u.y>=5.) return 0.; int b=FONT[int(clamp(n,0.,9.))]; return float((b>>((2-int(u.x))+(4-int(u.y))*3))&1); } float num(float v,vec2 u){ float t=floor(v/10.); if(t<.5) return dig(v,u-vec2(2.,0.)); return max(dig(t,u),dig(v-t*10.,u-vec2(4.,0.))); } vec3 cell(vec3 pap,vec2 f,float n,float row,float px,float mini){ float mo=0.; for(int i=1;i<12;i++){ if(n>=CUM[i]) mo=float(i); } float dm=n-CUM[int(mo)]+1., sun=step(5.5,mod(row+70.,7.)); vec3 c=pap*mix(1.,.93,mod(mo,2.))*mix(vec3(1.),vec3(1.,.84,.82),sun); vec2 dz=min(f,1.-f)*CS; float la=max(smoothstep(.5+px,.5,min(dz.x,dz.y))*.7,step(dm,1.5)*smoothstep(2.6+px,2.6,f.y*CS.y)); c=mix(c,vec3(.04),la); c=mix(c,mix(vec3(.03),vec3(.62,.03,.03),sun),num(dm,(f*CS-vec2(3.5,6.))/2.57)); if(mini>.5){ vec2 mp=(f-vec2(.5,.62))*CS; float dd=sdBox(mp,vec2(9.,5.2)); vec3 mc=vec3(.92,.91,.86); float gl=min(abs(fract(mp.x/1.5+.5)-.5)*1.5,abs(fract(mp.y/1.3+.5)-.5)*1.3); mc=mix(mc,vec3(.25),.55*smoothstep(.2+px,.2,gl)); mc=mix(mc,mix(vec3(.05),vec3(.6,.03,.03),sun),step(mp.y,-3.3)); c=mix(c,mc,smoothstep(px,-px,dd)); c=mix(c,vec3(.05),smoothstep(.3+px,.3,abs(dd))); } return mix(c,pap*.84,smoothstep(5.,12.,px)); } void main(){ vec2 q=design(vUv); vec2 z=uCam.xy+uCam.z*cmul(q-vec2(960.,540.),vec2(cos(uCam.w),sin(uCam.w))); // window light: soft mullion shadows and drifting leaf dapple vec2 wq=cmul(z-vec2(960.,540.),vec2(.94,-.34))/vec2(430.,620.)+vec2(.2,.1)+uM*.03+vec2(sin(uTime*.1)*.012,0.); vec2 wf=abs(fract(wq)-.5); float lit=smoothstep(.5,.38,wf.x)*smoothstep(.5,.42,wf.y); lit*=1.-.45*smoothstep(.45,.75,fbm(z*.0035+vec2(uTime*.03,0.))); lit=mix(lit,.92,uIn*.85); vec3 lc=mix(vec3(.46,.5,.6),vec3(1.05,1.,.92),lit); vec3 wall=vec3(.5,.035,.03)*(.8+.4*fbm(z*.005))*(.94+.12*fbm(z*.06)); // the warp: Z is the paper coordinate under this pixel vec2 ze=cdiv(z-K,A); float rho=max(length(ze),1e-5); vec2 zr=cmul(ze,vec2(.70711,.70711)); float th=atan(zr.y,zr.x)-.785398; float e1=1.-uW, e=max(e1,.02); vec2 pw=(pow(rho,e)*vec2(cos(e*th),sin(e*th))-vec2(1.,0.))/e; pw=mix(vec2(log(rho),th),pw,smoothstep(0.,.05,e1)); vec2 Z=K+A+uD+cmul(A,pw); float sc=pow(rho,uW)/uCam.z, px=1./sc, u=smoothstep(.1,.8,uW); vec2 bc=vec2(960.5,540.), bh=vec2(700.5,440.+3000.*u); float sd=sdBox(Z-bc,bh)*sc, sd2=sdBox(Z-bc-vec2(12.,16.),bh)*sc; wall*=1.-.5*smoothstep(26.,-6.,sd2); vec3 pap=vec3(.8,.78,.72)*(.97+.06*fbm(Z*.03)/(1.+px)); vec2 g=(Z-G)/CS, id=floor(g); float n=7.*id.x+id.y-4.; float ok=step(0.,n)*step(n,364.)*max(step(0.,id.y)*step(id.y,6.),smoothstep(.5,.9,uW)); vec3 c=pap; if(ok>0.) c=mix(pap,cell(pap,g-id,n,id.y,px,0.),ok); float hit=max(step(abs(n-181.),.5),step(abs(n-101.),.5))*ok; c*=mix(vec3(1.),vec3(1.,.93,.55),hit*uSel); if(uIn>0.&&abs(n-181.)<.5){ vec2 V=cmul(z-uIP.xy,vec2(cos(uIP.z),-sin(uIP.z)))/uIP.w*1400.+vec2(700.,393.75); float pV=1400.*uCam.z/uIP.w, di=sdBox(V-vec2(700.,393.75),vec2(700.,393.75)); vec3 ip=vec3(.86,.85,.8)*(.97+.06*fbm(V*.03)); vec2 hu=(V-vec2(40.,36.))/22.; float hk=max(max(dig(2.,hu),dig(0.,hu-vec2(4.,0.))),max(dig(2.,hu-vec2(8.,0.)),dig(7.,hu-vec2(12.,0.)))); ip=mix(ip,vec3(.03),hk); ip=mix(ip,vec3(.03),smoothstep(pV,0.,abs(V.y-168.)-2.)*step(37.,V.x)*step(V.x,1363.)); vec2 g2=(V-vec2(37.5,180.))/CS, id2=floor(g2); float n2=7.*id2.x+id2.y-4.; if(n2>=0.&&n2<=364.&&id2.y>=0.&&id2.y<=6.) ip=cell(ip,g2-id2,n2,id2.y,pV,1.); c=mix(c,c*.6,smoothstep(16.*pV+8.,0.,di)*step(0.,di)*uIn); c=mix(c,ip,smoothstep(pV,-pV,di)*uIn); c=mix(c,vec3(.05),smoothstep(1.5*pV+1.,0.,abs(di))*uIn*.8); } // calm paper under the words float zm=uZone.x*smoothstep(1420.,1300.,q.x)*smoothstep(330.,270.,q.y); zm=max(zm,uZone.y*smoothstep(985.,1005.,q.y)); zm=max(zm,uZone.z*smoothstep(1.25,.7,length((q-vec2(960.,505.))/vec2(830.,175.)))); c=mix(c,pap*1.03,zm*.9); // the knot: crumpled paper where the early months collapse c*=1.-uW*smoothstep(170.,0.,rho*93.67)*(.2+.55*fbm(vec2(th*5.,log(rho)*4.))); o=vec4(mix(wall,c,smoothstep(1.,-1.,sd))*lc,1.); }`,'calendar paper') }; }, draw(s,d,r){ const L=d.E.lin, c=d.ctx2d, U=r.U, V=d.view, ink='#141414'; const w=s.k(1,.4,5.2), zk=s.k(3,.3,5.2), out=1-s.k(3,0,.6,L); const s1=r.WP/1700, sc=Math.pow(s1,zk), m=(sc-s1)/(1-s1); U.uW=w; U.uSel=s.k(2,0,1.2)*out; U.uIn=s.k(3,.6,2.4); U.uD[0]=r.D[0]*w; U.uD[1]=r.D[1]*w; U.uM[0]=s.mouse.x; U.uM[1]=s.mouse.y; U.uCam[0]=r.zP[0]+(960-r.zP[0])*m; U.uCam[1]=r.zP[1]+(540-r.zP[1])*m; U.uCam[2]=sc; U.uCam[3]=r.phP*zk; U.uZone[0]=w*out; U.uZone[1]=s.k(2,2.6,3.4)*out; U.uZone[2]=s.k(3,3.8,5); r.paper.draw(U); // beat 1: the printed planner's furniture const fa=1-s.k(1,0,.5,L); if(fa>0){ d.text('2027',{x:300,y:112,size:170,font:'800 SIZEpx system-ui,sans-serif',color:ink,alpha:fa}); d.text('Every day the same size.',{x:780,y:176,size:60,font:'arialBold',color:ink,alpha:fa,show:s.k(0,.3,1.6,L)}); for(let i=0;i<12;i++) d.text(r.mons[i].t,{x:r.mons[i].x,y:324,size:17,font:'mono',color:ink,alpha:fa}); for(let i=0;i<7;i++) d.text(r.wd[i],{x:279,y:380+84*i,size:18,font:'mono',align:'center',color:i===6?'#b3261e':ink,alpha:fa}); c.globalAlpha=fa; c.strokeStyle=ink; c.lineWidth=1.5; for(let i=0;i<4;i++){ const x=r.marks[i][0], y=r.marks[i][1]; c.beginPath(); c.arc(x,y,7,0,6.2832); c.moveTo(x-12,y); c.lineTo(x+12,y); c.moveTo(x,y-12); c.lineTo(x,y+12); c.stroke(); } c.globalAlpha=1; } // beat 2: new header and the counter d.text('Now size each day\nby how much happens in it.',{x:300,y:112,size:72,font:'text',color:ink,show:s.k(1,.8,2.2,L),hide:s.k(3,0,.6,L)}); const ca=s.k(1,.6,1.4,L)*out, cx=V.x1-110, cy=V.y1-250; if(ca>0){ d.rect(cx-525,cy-14,550,150,'#f4efe2',ca); d.text(Math.round(Math.pow(10,9.6*w)).toLocaleString('en-US'),{x:cx,y:cy,size:64,font:'mono',color:ink,align:'right',alpha:ca}); d.text('one modelled run',{x:cx,y:cy+86,size:26,font:'mono',color:'#5a5a5a',align:'right',alpha:ca}); } // beat 3: label strips, selection box on the warped cell, caption const a1=s.k(2,.6,1.2,L)*out, a2=s.k(2,1.6,2.2,L)*out; if(a1>0){ c.globalAlpha=a1; c.strokeStyle=ink; c.lineWidth=2; c.beginPath(); c.moveTo(r.zA[0],r.zA[1]); c.lineTo(420,930); c.stroke(); c.globalAlpha=1; } r.strip('12 April: AI that beats the best human researchers',430,930,30,a1); r.strip('1 July: superintelligence',930,560,40,a2); c.save(); c.translate(r.zJ[0],r.zJ[1]); c.rotate(r.psiJ); d.select(-66,-205,132,410,{a:s.k(2,2,2.6,L)*out}); c.restore(); d.text("One example run, AI Futures Project, November 2026. Its authors' own medians are later.",{x:150,y:1012,size:26,font:'mono',color:ink,style:'fade',show:s.k(2,2.8,3.6,L),hide:s.k(3,0,.6,L)}); // beat 4: the day opens d.text('Then a year fits in a day.',{x:960,y:430,size:104,color:ink,align:'center',show:s.k(3,4.4,5.6,L)}); d.text('illustration',{x:960,y:572,size:32,font:'mono',color:'#4a4a4a',align:'center',style:'fade',show:s.k(3,5,6,L)}); } });