Deck.transition('portal-out',{ dur:1.45, frag:`void main(){ if(p<=0.){o=texture(tA,vUv);return;} if(p>=1.){o=texture(tB,vUv);return;} float e=p*p*(3.-2.*p); float z=exp(-5.6*e); vec2 uv=(vUv-.5)/z+.5; vec2 px=(abs(vUv-.5)-.5*z)*uRes; float edge=max(px.x,px.y); vec4 paper=texture(tB,vUv); float ink=sin(3.14159*e); paper.rgb*=1.-.23*ink*exp(-max(edge,0.)/4.); o=mix(paper,texture(tA,clamp(uv,0.,1.)), (1.-smoothstep(-.8,.8,edge))*(1.-smoothstep(.72,1.,e))); }` }); Deck.scene({ id:'questions',title:'Any questions?',enterWith:'portal-out', post:{tone:'none',bloom:0,grain:0,vignette:0}, beats:[{dur:1.35,hold:5},{dur:3.2,hold:4},{dur:9.2,hold:6}], notes:[ 'Any questions? (Back to the dull template. Let people think it is over.)', '(Press next and look at the screen, not at the room.)', 'Leave it up. That is the question the whole talk comes down to: something is going to be able to edit the world, and we have to be able to say what we want. (After a few seconds the slide tilts by one degree.)' ], setup(d){ return {sheet:d.pass(`uniform vec2 uCenter,uExtent; uniform float uTurn,uScale; void main(){ vec2 q=design(vUv)-uCenter; float cs=cos(uTurn),sn=sin(uTurn); vec2 local=vec2(cs*q.x+sn*q.y,-sn*q.x+cs*q.y)/uScale; float edge=sdBox(local,uExtent); float sh=sdBox(local-vec2(4.,16.),uExtent); vec3 desk=vec3(.135,.143,.156)*(.93+.07*vnoise(q*.008)); desk*=1.-.64*exp(-max(sh,0.)/14.); vec3 page=mix(vec3(.983),vec3(.16,.35,.62), smoothstep(uExtent.y-10.5,uExtent.y-9.5,local.y)); o=vec4(mix(desk,page,1.-smoothstep(-.6,.6,edge)),1.); }`,'questions / office paper')}; }, draw(s,d,r){ const v=d.view,c=d.ctx2d,cx=(v.x0+v.x1)/2,cy=(v.y0+v.y1)/2; const turn=s.k(2,7.4,9.2),angle=turn*Math.PI/180,scale=1-.066*turn; r.sheet.draw({uCenter:[cx,cy],uExtent:[v.w/2,v.h/2],uTurn:angle,uScale:scale}); c.save(); c.translate(cx,cy);c.rotate(angle);c.scale(scale,scale); d.text('Any questions?',{x:0,y:-120,size:108,font:'arial',align:'center', color:'#080808',show:s.k(0,.12,1.35,d.E.lin),style:'fade'}); const a=s.k(1,.08,.65),first='I have one.',last='What do you want?'; const erase=s.k(2,.18,.95,d.E.lin),write=s.k(2,1.18,3.05,d.E.lin); const str=write>0?last.slice(0,Math.round(last.length*write)): first.slice(0,Math.round(first.length*s.k(1,.85,3.2,d.E.lin)*(1-erase))); const grow=s.k(2,3.55,5.55),breath=grow*Math.sin(s.t*1.6)*2; const small=332+197*s.k(2,.95,1.65); const w=small+(v.w-78-small)*grow+2*breath; const h=90+(v.h-134-90)*grow+2*breath; const y=109*(1-grow)+9*grow; if(a>0){ const b=d.text(str,{x:0,y:76,size:51,font:'arial',color:'#111111',align:'center',style:'fade'}); if((Math.floor(s.t*2)%2===0 || (write>0&&write<1)) && grow<1) d.rect((str.length?b.w/2:0)+3,80,3,54,'#111111',a*(1-grow)); d.select(-w/2,y-h/2,w,h,{a}); } c.restore(); } });