Deck.scene({ id:'office', title:'The Future of AI', enterWith:'fade', post:{tone:'none'}, beats:[{dur:.6,hold:5},{dur:1,hold:6},{dur:12,hold:4}], notes:[ 'Hello. This is a talk about the future of AI. (Say it flatly. Let the slide be boring. Wait.)', 'Here is the agenda. We will start with an introduction, then look at benefits and challenges… (Read the bullets out loud, slowly. Then press next and stop talking.)', 'Do not touch anything. Let the deck work. Pick up again when the chart is on screen.' ], setup(d){ const words=['Fine.','Bigger.','Better.']; const times=[[0,.5,.9,1.2],[1.3,1.9,2.4,2.8],[2.9,3.7,99,100]]; const cl=x=>Math.max(0,Math.min(1,x)); // reversible typing: a pure function of the time parameter u const typed=u=>{ let out=''; for(let i=0;i<3;i++){ const t=times[i], w=words[i]; if(ut[2]) n=Math.round((1-cl((u-t[2])/(t[3]-t[2])))*w.length); out=w.slice(0,n); } return out; }; return { typed, bullets:['Introduction','Benefits and challenges','Best practices','Next steps','Questions'], heavy:'800 SIZEpx system-ui,sans-serif', bg:d.pass(`uniform float uOff,uR; void main(){ vec2 q=design(vUv); vec3 c=mix(vec3(1.),vec3(.955,.935,.895),uOff); float m=smoothstep(1.5,-1.5,length(q-vec2(1420.,540.))-uR)*sat(uR); c=mix(c,vec3(.87,.2,.14),m); c*=1.+uOff*(.1*fbm(q*vec2(.4,.9))-.05); c+=uOff*(hash12(floor(q))-.5)*.03; o=vec4(c,1.); }`,'office paper') }; }, draw(s,d,r){ const c=d.ctx2d, L=d.E.lin; const off=s.k(2,6.6,8), circ=s.k(2,10.4,11.8,d.E.out3); r.bg.draw({uOff:off,uR:300*circ}); // beat 1: the boring title slide const a0=1-s.k(1,0,.3,L); d.text('The Future of AI',{x:960,y:400,size:110,font:'arial',color:'#000',align:'center',style:'fade',alpha:a0}); d.text('An Overview',{x:960,y:560,size:52,font:'arial',color:'#7f7f7f',align:'center',style:'fade',alpha:a0}); // beat 2: agenda slide const A1=s.k(1,.3,.8,L); const delT=s.k(2,.8,.95,L); const tb=d.text('Agenda',{x:150,y:110,size:96,font:'arial',color:'#000',style:'fade',alpha:A1*(1-delT)}); d.select(tb.x-24,tb.y-12,tb.w+48,tb.h+24,{a:s.k(2,.2,.5,L)*(1-delT)}); for(let i=0;i<5;i++){ const t0=1.1+i*.65, del=s.k(2,t0+.42,t0+.55,L); const b=d.text('• '+r.bullets[i],{x:190,y:320+i*96,size:50,font:'arial',color:'#000',style:'fade',alpha:A1*(1-del)}); d.select(b.x-20,b.y-12,b.w+40,b.h+24,{a:s.k(2,t0,t0+.3,L)*(1-del)}); } // chart furniture: frame, gridlines, axes, labels, legend const X0=1010,X1=1740,Y0=800,PH=470; const fur=A1*(1-s.k(2,4.4,5.2,L)); if(fur>0){ c.save(); c.globalAlpha=fur; c.strokeStyle='#d9d9d9'; c.lineWidth=2; c.strokeRect(900,220,900,720); c.beginPath(); for(let v=0;v<=100;v+=20){ const y=Y0-v/100*PH; c.moveTo(X0,y); c.lineTo(X1,y); } c.stroke(); c.strokeStyle='#8c8c8c'; c.beginPath(); c.moveTo(X0,Y0-PH); c.lineTo(X0,Y0); c.lineTo(X1,Y0); c.stroke(); c.strokeStyle='#4472c4'; c.lineWidth=5; c.beginPath(); c.moveTo(1270,892); c.lineTo(1330,892); c.stroke(); c.restore(); d.text('AI Progress (Projected)',{x:1375,y:256,size:36,font:'arial',color:'#595959',align:'center',style:'fade',alpha:fur}); for(let v=0;v<=100;v+=20) d.text(String(v),{x:X0-16,y:Y0-v/100*PH-13,size:22,font:'arial',color:'#595959',align:'right',style:'fade',alpha:fur}); for(let i=0;i<6;i++) d.text(String(2020+i*10),{x:X0+i*(X1-X0)/5,y:Y0+14,size:22,font:'arial',color:'#595959',align:'center',style:'fade',alpha:fur}); d.text('Series 1',{x:1344,y:878,size:24,font:'arial',color:'#595959',style:'fade',alpha:fur}); } // the line: straight, then bends into an exponential that leaves the slide const bend=s.k(2,4.8,7,d.E.io3), la=A1*(1-s.k(2,7.2,8,L)); if(la>0){ c.save(); c.globalAlpha=la; c.strokeStyle='#4472c4'; c.lineWidth=5+3*bend; c.lineJoin=c.lineCap='round'; c.beginPath(); for(let i=0;i<=90;i++){ const f=i/90; const v=(5+75*f)*(1-bend)+5*Math.exp(f*6.5)*bend; const y=Y0-v/100*PH; c.lineTo(X0+f*(X1-X0),Math.max(y,-80)); if(y<-80) break; } c.stroke(); c.restore(); } // beat 3: the editor types, deletes, retypes and lands on one word const boxA=s.k(2,7.4,7.9,L); const str=r.typed(s.k(2,7.8,11.5,L)*3.7); const full=d.text('Better.',{x:200,y:420,size:220,font:r.heavy,show:0}); const b=d.text(str,{x:200,y:420,size:220,font:r.heavy,color:'#111',alpha:boxA}); const blink=Math.sin(s.t*6)>-.3?1:0; d.rect(full.x+b.w+10,full.y+12,9,full.h-24,'#111',boxA*blink*(1-s.k(2,11.6,12,L))); d.select(full.x-28,full.y-16,Math.max(b.w,40)+56,full.h+32,{a:boxA}); } });