by adom
The Adom logomark is a hydrogen 2p orbital: psi = (2p_x + 2p_y)/sqrt(2). A live Babylon.js lab that proves it (all 16 real spherical harmonics, the alignment cheat, and the directed loop), plus loader.html: the same animation as one dependency-free WebGL file for webview load screens.
← Commit history
emerge=1: intro variant where the surface condenses out of nothing into play (toggle, off by default) + rig start buttons
6 files changed
+522−66
SKILL.md+4@@ -145,6 +145,10 @@ readbacks for the fit measurement); the loader is that lab distilled. - Inert by default: a load screen never eats input. `?interact=1` arms click-to-capture (teal ring + glow); click-away or blur releases.+- `?emerge=1` replaces the logo intro entirely: the equation runs from t=0+ and the surface condenses out of nothing (2.6 s scale and fade) straight+ into play, then the normal pt/dt/ct/st timeline. Off by default; it is a+ taste option. Keep `pt` above ~3 s so the first epoch never lands mid-birth. - The "click to zoom" hint pill is OFF BY DEFAULT even when armed: production wants purity, and the teal glow already signals the armed state. Show it with `?hint=1`, or flip it live in armed contexts with
loader.html+17−9@@ -26,7 +26,8 @@ function P(k,d){ var PT=P('pt',4.5), DT=P('dt',3), CT=P('ct',0.3), ST=P('st',0); var LOGO_PK=Math.max(0,Math.min(1,P('logo',100)/100)); var LLEAD=Math.abs(P('llead',1)), TLEAD=Math.abs(P('tlead',1.5));-var OV=Q.get('ov')!=='0', DO_INTRO=Q.get('intro')!=='0';+var EMERGE=String(P('emerge',0))==='1';+var OV=Q.get('ov')!=='0', DO_INTRO=Q.get('intro')!=='0'&&!EMERGE; /* margin: percent of the container left EMPTY around the mark. 0 is the classic framing; 80 sits the anim small in the middle of a big window. Implemented as camera distance, so perspective, the overlay match and the@@ -272,15 +273,15 @@ function proj(w,h){ var f=1/Math.tan(FOV/2), a=w/h; return (a>=1)? {m0:f/a, m5:f} : {m0:f, m5:f*a}; }-function setMVP2(w,h,r,px,py){- r=(r===undefined)?CAMR:r; px=px||0; py=py||0;+function setMVP2(w,h,r,px,py,s){+ r=(r===undefined)?CAMR:r; px=px||0; py=py||0; s=(s===undefined)?1:s; var m=proj(w,h); var A=ZF/(ZF-ZN), B=-ZN*ZF/(ZF-ZN);- // view: pan then z' = z + r (eye at -r on z, LH)+ // view: model scale s (emerge birth), pan, then z' = z + r (eye at -r on z, LH) gl.uniformMatrix4fv(U.uMVP,false,new Float32Array([- m.m0,0,0,0,- 0,m.m5,0,0,- 0,0,A,1,+ m.m0*s,0,0,0,+ 0,m.m5*s,0,0,+ 0,0,A*s,s, -m.m0*px,-m.m5*py,A*r+B,r ])); }@@ -322,7 +323,12 @@ function roll(){gains=new Array(16).fill(0); roll(); var eS=PT+DT+(OV?0:CT), eE=eS+ST, CYC=eE+(OV?0:CT)+DT; var INTRO={dark:0.9,logoIn:1.4,hold:0.5,reveal:1.2};-var inIntro=DO_INTRO, introT=0, t=DO_INTRO?0:eE, tEvo=0, rolled=false, last=performance.now();+var inIntro=DO_INTRO, introT=0, t=(DO_INTRO||EMERGE)?0:eE, tEvo=0, rolled=false, last=performance.now();+/* emerge=1 replaces the logo intro: the equation runs from t=0 and the+ surface condenses out of nothing (scale+fade over BIRTH_S seconds) into+ plain play, then the normal pt/dt/ct/st timeline takes over. Keep pt+ comfortably above BIRTH_S so the first epoch never lands mid-birth. */+var BIRTH_S=2.6, birth=EMERGE?0:1, birthT=0; function frame(now){ if(FPSCAP>0){@@ -331,6 +337,8 @@ function frame(now){ } applySize(); var dt=Math.min(0.05,(now-last)/1000); last=now; tEvo+=dt;+ if(birth<1){birthT+=dt;birth=smooth(Math.min(1,birthT/BIRTH_S));+ glc.style.opacity=birth>=1?'':String(0.04+0.96*birth);} var k,cheat,fill,teal,pinned=false,drawMesh=true; if(inIntro){ introT+=dt;@@ -386,7 +394,7 @@ function frame(now){ window.__lock = (t>eS-RET && t<=eE); effR=CAMR+(HOME-CAMR)*camK; effPX=PANX*(1-camK); effPY=PANY*(1-camK); } else { effR=HOME; effPX=0; effPY=0; }- setMVP2(W,H,effR,effPX,effPY);+ setMVP2(W,H,effR,effPX,effPY,birth); window.__cam={r:+effR.toFixed(3),x:+effPX.toFixed(3),y:+effPY.toFixed(3),k:+camK.toFixed(2)}; var c=new Array(16), nrm=0, i;
package.json+1−1@@ -2,7 +2,7 @@ "slug": "orbital-lab", "title": "Orbital Lab", "type": "app",- "version": "1.0.20",+ "version": "1.0.21", "description": "The Adom logomark is a hydrogen 2p orbital: psi = (2p_x + 2p_y)/sqrt(2). A live Babylon.js lab that proves it (all 16 real spherical harmonics, the alignment cheat, and the directed loop), plus loader.html: the same animation as one dependency-free WebGL file for webview load screens.", "tags": [ "brand",
readme.html+32−10@@ -2640,6 +2640,9 @@ window.__lab = { push, zeros, HARMONICS, setAnim:v=>{animate=v;} }; <span style="margin-left:10px">hint</span> <button data-h="1">on</button> <button data-h="0">off</button>+ <span style="margin-left:10px">start</span>+ <button data-e="1">emerge</button>+ <button data-e="0">logo</button> <span style="margin-left:10px">container bg</span> <button data-b="#0d1117">dark</button> <button data-b="#20262e">bar gray</button>@@ -2674,7 +2677,8 @@ function P(k,d){ var PT=P('pt',4.5), DT=P('dt',3), CT=P('ct',0.3), ST=P('st',0); var LOGO_PK=Math.max(0,Math.min(1,P('logo',100)/100)); var LLEAD=Math.abs(P('llead',1)), TLEAD=Math.abs(P('tlead',1.5));-var OV=Q.get('ov')!=='0', DO_INTRO=Q.get('intro')!=='0';+var EMERGE=String(P('emerge',0))==='1';+var OV=Q.get('ov')!=='0', DO_INTRO=Q.get('intro')!=='0'&&!EMERGE; /* margin: percent of the container left EMPTY around the mark. 0 is the classic framing; 80 sits the anim small in the middle of a big window. Implemented as camera distance, so perspective, the overlay match and the@@ -2920,15 +2924,15 @@ function proj(w,h){ var f=1/Math.tan(FOV/2), a=w/h; return (a>=1)? {m0:f/a, m5:f} : {m0:f, m5:f*a}; }-function setMVP2(w,h,r,px,py){- r=(r===undefined)?CAMR:r; px=px||0; py=py||0;+function setMVP2(w,h,r,px,py,s){+ r=(r===undefined)?CAMR:r; px=px||0; py=py||0; s=(s===undefined)?1:s; var m=proj(w,h); var A=ZF/(ZF-ZN), B=-ZN*ZF/(ZF-ZN);- // view: pan then z' = z + r (eye at -r on z, LH)+ // view: model scale s (emerge birth), pan, then z' = z + r (eye at -r on z, LH) gl.uniformMatrix4fv(U.uMVP,false,new Float32Array([- m.m0,0,0,0,- 0,m.m5,0,0,- 0,0,A,1,+ m.m0*s,0,0,0,+ 0,m.m5*s,0,0,+ 0,0,A*s,s, -m.m0*px,-m.m5*py,A*r+B,r ])); }@@ -2970,7 +2974,12 @@ function roll(){gains=new Array(16).fill(0); roll(); var eS=PT+DT+(OV?0:CT), eE=eS+ST, CYC=eE+(OV?0:CT)+DT; var INTRO={dark:0.9,logoIn:1.4,hold:0.5,reveal:1.2};-var inIntro=DO_INTRO, introT=0, t=DO_INTRO?0:eE, tEvo=0, rolled=false, last=performance.now();+var inIntro=DO_INTRO, introT=0, t=(DO_INTRO||EMERGE)?0:eE, tEvo=0, rolled=false, last=performance.now();+/* emerge=1 replaces the logo intro: the equation runs from t=0 and the+ surface condenses out of nothing (scale+fade over BIRTH_S seconds) into+ plain play, then the normal pt/dt/ct/st timeline takes over. Keep pt+ comfortably above BIRTH_S so the first epoch never lands mid-birth. */+var BIRTH_S=2.6, birth=EMERGE?0:1, birthT=0; function frame(now){ if(FPSCAP>0){@@ -2979,6 +2988,8 @@ function frame(now){ } applySize(); var dt=Math.min(0.05,(now-last)/1000); last=now; tEvo+=dt;+ if(birth<1){birthT+=dt;birth=smooth(Math.min(1,birthT/BIRTH_S));+ glc.style.opacity=birth>=1?'':String(0.04+0.96*birth);} var k,cheat,fill,teal,pinned=false,drawMesh=true; if(inIntro){ introT+=dt;@@ -3034,7 +3045,7 @@ function frame(now){ window.__lock = (t>eS-RET && t<=eE); effR=CAMR+(HOME-CAMR)*camK; effPX=PANX*(1-camK); effPY=PANY*(1-camK); } else { effR=HOME; effPX=0; effPY=0; }- setMVP2(W,H,effR,effPX,effPY);+ setMVP2(W,H,effR,effPX,effPY,birth); window.__cam={r:+effR.toFixed(3),x:+effPX.toFixed(3),y:+effPY.toFixed(3),k:+camK.toFixed(2)}; var c=new Array(16), nrm=0, i;@@ -3166,6 +3177,16 @@ if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT ifr.contentWindow.postMessage({adomLoader:{hint:b.getAttribute('data-h')==='1'}},'*'); }); });+ document.querySelectorAll('.rig-acts button[data-e]').forEach(function(b){+ b.addEventListener('click',function(){+ /* emerge is boot-time state, so toggle it by rewriting the srcdoc's+ params and letting the iframe reboot into the chosen opening. */+ var sd=ifr.getAttribute('srcdoc').replace(/emerge:1,?/,'');+ if(b.getAttribute('data-e')==='1')+ sd=sd.replace('__ADOM_LOADER_PARAMS={','__ADOM_LOADER_PARAMS={emerge:1,');+ ifr.setAttribute('srcdoc',sd);+ });+ }); document.querySelectorAll('.rig-acts button[data-b]').forEach(function(b){ b.addEventListener('click',function(){ box.style.background=b.getAttribute('data-b');@@ -3189,7 +3210,7 @@ if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT </script> <h2 style="margin-top:30px">Ship it as a webview loader</h2> <p><b>loader.html</b> on this page is the animation above distilled to ONE dependency-free file:- raw WebGL, no Babylon, no CDN, no fonts, no fetch, about 28 KB. It boots instantly, which+ raw WebGL, no Babylon, no CDN, no fonts, no fetch, about 29 KB. It boots instantly, which is the point: it plays while your webview's real content is still loading. Under 10 KB gzipped, zero requests, one draw call over 12,800 vertex-shader-displaced triangles, and about 0.06 ms of JS per frame, so the CPU stays asleep. The wheel is tuned against the@@ -3304,6 +3325,7 @@ if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT <tr><td>fps</td><td>off</td><td>cap the render rate for spinner duty (floor 20). rAF already yields between frames and stops when hidden; fps=30 renders one frame in eight on a 240 Hz display</td></tr> <tr><td>bg</td><td>0d1117</td><td>hex background, or <b>transparent</b> to composite over the container's own background (GL context runs with alpha). Also settable live by postMessage</td></tr> <tr><td>hint</td><td>0</td><td>1 shows the small "click to zoom" pill in armed contexts. Off by default: production stays pure. Armed contexts can also flip it live by postMessage</td></tr>+ <tr><td>emerge</td><td>0</td><td>1 replaces the logo intro: the equation runs from t=0 and the surface condenses out of nothing (2.6 s scale and fade) straight into play, then the normal timeline. Keep pt above ~3 s so the first epoch never lands mid-birth. A taste toggle: try the start buttons in the rig above</td></tr> <tr><td>margin</td><td>0</td><td>percent of the container left empty around the mark: 80 sits it small in the middle of a big window, 20 nearly fills. Zoom-in still brings it to the screen; zoom-out caps at 40% past the margined framing</td></tr> </table> <h3>The three tuned cuts</h3>
tools/build-loader.py+197−26@@ -12,7 +12,7 @@ Constraints that shape it, in order: LEFT-HANDED view/projection exactly: this codebase already burned seven attempts on a mirrored mark, so chirality is not left to chance. 3. John's tuned numbers as defaults (the "john 1" snapshot), overridable by- URL params: ?pt=4.5&dt=3&ct=0.3&st=0&logo=100&llead=1&tlead=1.5&ov=1&intro=1+ URL params: ?pt=4.5&dt=3&ct=0.3&st=0&logo=100&llead=1&tlead=1.5&ov=1&intro=1&interact=0&emerge=0 Run: python3 tools/build-loader.py """@@ -68,19 +68,61 @@ page = r'''<!DOCTYPE html> This file is the wiki page adom/orbital-lab distilled to a loader. */ 'use strict'; var Q=new URLSearchParams(location.search);-function P(k,d){var v=parseFloat(Q.get(k));return isFinite(v)?v:d;}+function P(k,d){+ var o=window.__ADOM_LOADER_PARAMS||{};+ if(k in o) return o[k];+ var v=parseFloat(Q.get(k));return isFinite(v)?v:d;+} var PT=P('pt',4.5), DT=P('dt',3), CT=P('ct',0.3), ST=P('st',0); var LOGO_PK=Math.max(0,Math.min(1,P('logo',100)/100)); var LLEAD=Math.abs(P('llead',1)), TLEAD=Math.abs(P('tlead',1.5));-var OV=Q.get('ov')!=='0', DO_INTRO=Q.get('intro')!=='0';-var BG=[0.051,0.067,0.090];+var EMERGE=String(P('emerge',0))==='1';+var OV=Q.get('ov')!=='0', DO_INTRO=Q.get('intro')!=='0'&&!EMERGE;+/* margin: percent of the container left EMPTY around the mark. 0 is the+ classic framing; 80 sits the anim small in the middle of a big window.+ Implemented as camera distance, so perspective, the overlay match and the+ epoch glide all stay exact at any margin. */+var MARGIN=Math.max(0,Math.min(90,P('margin',0)));+/* MODES bundle the quality knobs so nobody has to reason about them:+ mode=lightweight fps 30, dpr 1, seg 48, no antialias: spinner fleets,+ dialogs, battery. Looks fine at small sizes.+ mode=performance (the default, alias mode=sexy) uncapped, dpr up to 2,+ seg 80, antialias: hero surfaces, big canvases.+ Explicit params always override the mode. rAF still yields between frames+ and stops when hidden in every mode. seg and aa are boot-time; fps can be+ changed live by postMessage in armed contexts. */+var MODE=String((window.__ADOM_LOADER_PARAMS&&window.__ADOM_LOADER_PARAMS.mode)||Q.get('mode')||'').toLowerCase();+if(MODE==='sexy')MODE='performance';+var LIGHT=(MODE==='lightweight'||MODE==='light');+var FPSCAP=Math.max(0,P('fps',LIGHT?30:0)); if(FPSCAP>0&&FPSCAP<20)FPSCAP=20;+var DPRCAP=Math.max(1,Math.min(3,P('dpr',LIGHT?1:2)));+var SEGQ=Math.round(Math.max(24,Math.min(128,P('seg',LIGHT?48:80))));+var AAON=P('aa',LIGHT?0:1)>=1;+var lastDraw=0;+/* Background contract: bg=HEX paints a solid, bg=transparent leaves the GL+ clear at alpha 0 so the CONTAINER's background shows straight through, and+ the mark composites onto whatever surface it sits on (a toolbar, a hero,+ anything). Changeable live by postMessage in armed contexts. */+var BG=[0.051,0.067,0.090], TRANSP=false;+function applyBg(raw){+ raw=String(raw||'').toLowerCase().replace('#','');+ TRANSP=(raw==='transparent');+ var ok=/^[0-9a-f]{6}$/.test(raw);+ BG=ok?[parseInt(raw.slice(0,2),16)/255,parseInt(raw.slice(2,4),16)/255,parseInt(raw.slice(4,6),16)/255]+ :[0.051,0.067,0.090];+ var css=TRANSP?'transparent':(ok?('#'+raw):'#0d1117');+ document.documentElement.style.background=css;+ document.body.style.background=css;+}+applyBg((window.__ADOM_LOADER_PARAMS&&window.__ADOM_LOADER_PARAMS.bg)||Q.get('bg')); var VS=__VS__; var FS=__FS__; var LOGO_R=__LOGO_R__; var PATHS=__PATHS__; -var glc=document.getElementById('gl'), gl=glc.getContext('webgl2',{antialias:true})||glc.getContext('webgl',{antialias:true});+var glopt={antialias:AAON,alpha:true,premultipliedAlpha:true};+var glc=document.getElementById('gl'), gl=glc.getContext('webgl2',glopt)||glc.getContext('webgl',glopt); var ovc=document.getElementById('ov'), ox=ovc.getContext('2d'); if(!gl){ document.body.style.background='__BG__'; throw new Error('no webgl'); } @@ -96,7 +138,7 @@ var U={}; ['uMVP','c','uScale','uFlat','uRot','uPlump','uGap','uEdge','uCorner', .forEach(function(n){U[n]=gl.getUniformLocation(prog,n);}); /* unit sphere, displaced entirely in the vertex shader */-var SEG=80, verts=[], idx=[];+var SEG=SEGQ, verts=[], idx=[]; for(var i=0;i<=SEG;i++){var th=i/SEG*Math.PI; for(var j=0;j<=SEG;j++){var ph=j/SEG*2*Math.PI; verts.push(Math.sin(th)*Math.cos(ph), Math.cos(th), Math.sin(th)*Math.sin(ph));}}@@ -119,7 +161,14 @@ gl.uniform3fv(U.cPos,C_POS); /* Babylon LEFT-HANDED camera, reproduced exactly: eye (0,0,-4.4) looking +Z, fov 0.8 fixed on the LIMITING axis so the mark keeps its fraction of any canvas shape (the lab's fitFraming rule). */-var R=4.4, FOV=0.8, ZN=0.1, ZF=100;+var R=4.4, HOME=R/(1-MARGIN/100), CAMR=HOME, PANX=0, PANY=0, FOV=0.8, ZN=0.1, ZF=Math.max(100,HOME*3);+/* Babylon's ACTUAL zoom model, tuned against the lab's measured curve: each+ notch deposits a decaying velocity integral (inertia 0.9) that is consumed+ frame by frame straight into the radius, while the lab's springs pull+ radius and pan home every frame. NOTCH below is the one tuning constant,+ calibrated so a 12-notch burst matches the lab: dip to ~4.0, home ~200ms+ after release. */+var NOTCH=0.085, velR=0, lastNX=0, lastNY=0; function setMVP(w,h){ var f=1/Math.tan(FOV/2), a=w/h, zf=ZF/(ZF-ZN); var m0=(a>=1)? f/a : f, m5=(a>=1)? f : f*a;@@ -128,29 +177,46 @@ function setMVP(w,h){ m0,0,0,0, 0,m5,0,0, 0,0,zf,1, 0,0,-ZN*zf+zf*R- R*0 + (R*zf - ZN*zf)-(R*zf-ZN*zf) + (R*zf) - (ZN*ZF/(ZF-ZN)),0])); } /* The m[14] arithmetic above must be exact, so compute it plainly instead: */-function setMVP2(w,h){+function proj(w,h){ var f=1/Math.tan(FOV/2), a=w/h;- var m0=(a>=1)? f/a : f, m5=(a>=1)? f : f*a;+ return (a>=1)? {m0:f/a, m5:f} : {m0:f, m5:f*a};+}+function setMVP2(w,h,r,px,py,s){+ r=(r===undefined)?CAMR:r; px=px||0; py=py||0; s=(s===undefined)?1:s;+ var m=proj(w,h); var A=ZF/(ZF-ZN), B=-ZN*ZF/(ZF-ZN);- // view: z' = z + R (eye at -R on z, LH) clip: [m0 x, m5 y, A z' + B, z']+ // view: model scale s (emerge birth), pan, then z' = z + r (eye at -r on z, LH) gl.uniformMatrix4fv(U.uMVP,false,new Float32Array([- m0,0,0,0,- 0,m5,0,0,- 0,0,A,1,- 0,0,A*R+B,R+ m.m0*s,0,0,0,+ 0,m.m5*s,0,0,+ 0,0,A*s,s,+ -m.m0*px,-m.m5*py,A*r+B,r ])); } -var W=0,H=0,DPR=1;-function resize(){- DPR=Math.min(2,window.devicePixelRatio||1);- W=glc.clientWidth; H=glc.clientHeight;- glc.width=W*DPR; glc.height=H*DPR;- ovc.width=W*DPR; ovc.height=H*DPR;+var W=0,H=0,DPR=1,needSize=true;+/* Resize events only mark dirty. Re-backing a canvas CLEARS it, and doing+ that on every event mid-drag leaves blank frames until the next rAF: the+ jerk. Instead the size is applied at the TOP of the frame and the frame+ draws immediately at the new size, so a continuous drag repaints clean+ every single frame with at most one reallocation per frame. */+function resize(){ needSize=true; }+function applySize(){+ var w=glc.clientWidth, h=glc.clientHeight, d=Math.min(DPRCAP,window.devicePixelRatio||1);+ if(!needSize && w===W && h===H && d===DPR) return;+ needSize=false;+ if(w===W && h===H && d===DPR) return;+ W=w; H=h; DPR=d;+ glc.width=w*d; glc.height=h*d;+ ovc.width=w*d; ovc.height=h*d; gl.viewport(0,0,glc.width,glc.height);- setMVP2(W,H); }-window.addEventListener('resize',resize); resize();+window.addEventListener('resize',resize);+/* Containers resize without warning in webviews; the window resize event+ covers iframe viewport changes, and the ResizeObserver is the belt for+ any host that reflows the document instead. */+if(window.ResizeObserver) new ResizeObserver(resize).observe(document.documentElement);+resize(); /* ---- the directed loop, distilled ---- */ var L=[0,1,1,1,2,2,2,2,2,3,3,3,3,3,3,3];@@ -165,10 +231,22 @@ function roll(){gains=new Array(16).fill(0); roll(); var eS=PT+DT+(OV?0:CT), eE=eS+ST, CYC=eE+(OV?0:CT)+DT; var INTRO={dark:0.9,logoIn:1.4,hold:0.5,reveal:1.2};-var inIntro=DO_INTRO, introT=0, t=DO_INTRO?0:eE, tEvo=0, rolled=false, last=performance.now();+var inIntro=DO_INTRO, introT=0, t=(DO_INTRO||EMERGE)?0:eE, tEvo=0, rolled=false, last=performance.now();+/* emerge=1 replaces the logo intro: the equation runs from t=0 and the+ surface condenses out of nothing (scale+fade over BIRTH_S seconds) into+ plain play, then the normal pt/dt/ct/st timeline takes over. Keep pt+ comfortably above BIRTH_S so the first epoch never lands mid-birth. */+var BIRTH_S=2.6, birth=EMERGE?0:1, birthT=0; function frame(now){+ if(FPSCAP>0){+ if(now-lastDraw < 1000/FPSCAP - 1){ requestAnimationFrame(frame); return; }+ lastDraw=now;+ }+ applySize(); var dt=Math.min(0.05,(now-last)/1000); last=now; tEvo+=dt;+ if(birth<1){birthT+=dt;birth=smooth(Math.min(1,birthT/BIRTH_S));+ glc.style.opacity=birth>=1?'':String(0.04+0.96*birth);} var k,cheat,fill,teal,pinned=false,drawMesh=true; if(inIntro){ introT+=dt;@@ -194,6 +272,39 @@ function frame(now){ teal = t<eS ? (TLEAD<=0.01?0:(t<=eS-TLEAD?0:smooth(1-(eS-t)/TLEAD))) : t<=eE ? 1 : (TLEAD<=0.01?0:(t>=eE+TLEAD?0:smooth(1-(t-eE)/TLEAD))); }+ /* The camera comes HOME for the logo. Whatever the user zoomed or panned,+ the framing glides back to the exact calibrated pose before epoch-start,+ holds through the epoch (the overlay match depends on it), and hands the+ wheel back afterwards from the home pose. */+ var effR=CAMR, effPX=PANX, effPY=PANY, camK=0;+ if(!inIntro){+ /* Glide home for the logo, then home IS the new state: no gliding back+ to the old zoom, the wheel simply frees again the moment the sit ends+ and play resumes from the calibrated framing. */+ var RET=Math.max(0.6, LLEAD+0.2, Math.min(1.2,DT));+ camK = (t>eS-RET&&t<eS) ? smooth((t-(eS-RET))/RET) : 0;+ if(t>=eS&&t<=eE+0.001){ CAMR=HOME; PANX=0; PANY=0; velR=0; camK=1; }+ // consume the wheel's decaying integral, zooming toward the cursor+ if(Math.abs(velR)>0.0001){+ var stepK=1-Math.pow(0.8, dt*240);+ var step=velR*stepK; velR-=step;+ var m2=proj(W,H);+ var wx=lastNX*CAMR/m2.m0+PANX, wy=lastNY*CAMR/m2.m5+PANY;+ /* zoom in to the screen freely; zoom out capped 40% past the epoch framing */+ var r2=Math.max(2.4,Math.min(HOME*1.4,CAMR-step));+ PANX=wx-lastNX*r2/m2.m0; PANY=wy-lastNY*r2/m2.m5;+ CAMR=r2;+ }+ /* The lab's springs, verbatim: radius 6% and pan 5% per frame at the+ lab's 240fps cadence, frame-rate independent. */+ var spr=1-Math.pow(0.94, dt*240), sprT=1-Math.pow(0.95, dt*240);+ CAMR+=(HOME-CAMR)*spr; PANX-=PANX*sprT; PANY-=PANY*sprT;+ window.__lock = (t>eS-RET && t<=eE);+ effR=CAMR+(HOME-CAMR)*camK; effPX=PANX*(1-camK); effPY=PANY*(1-camK);+ } else { effR=HOME; effPX=0; effPY=0; }+ setMVP2(W,H,effR,effPX,effPY,birth);+ window.__cam={r:+effR.toFixed(3),x:+effPX.toFixed(3),y:+effPY.toFixed(3),k:+camK.toFixed(2)};+ var c=new Array(16), nrm=0, i; if(pinned){ for(i=0;i<16;i++)c[i]=LOGO[i]; } else{@@ -206,7 +317,7 @@ function frame(now){ for(i=0;i<16;i++)nrm+=c[i]*c[i]; nrm=Math.sqrt(nrm)||1; for(i=0;i<16;i++)c[i]/=nrm; - gl.clearColor(BG[0],BG[1],BG[2],1);+ if(TRANSP) gl.clearColor(0,0,0,0); else gl.clearColor(BG[0],BG[1],BG[2],1); gl.clear(gl.COLOR_BUFFER_BIT|gl.DEPTH_BUFFER_BIT); if(drawMesh){ gl.uniform1fv(U.c,new Float32Array(c));@@ -217,8 +328,11 @@ function frame(now){ } ox.clearRect(0,0,ovc.width,ovc.height); if(fill>0.004){- var s=Math.min(ovc.width,ovc.height)*0.34;- ox.save();ox.translate(ovc.width/2,ovc.height/2);+ var mm=proj(W,H), ppw=mm.m0*ovc.width/2/(window.__cam?window.__cam.r:CAMR);+ var er=window.__cam?window.__cam.r:CAMR;+ var s=Math.min(ovc.width,ovc.height)*0.34*(R/er);+ ox.save();ox.translate(ovc.width/2-(window.__cam?window.__cam.x:0)*ppw,+ ovc.height/2+(window.__cam?window.__cam.y:0)*ppw); ox.globalAlpha=fill;ox.fillStyle='#00b8b0'; for(var p2=0;p2<PATHS.length;p2++){var pts=PATHS[p2];ox.beginPath(); for(var j2=0;j2<pts.length;j2++){var X=pts[j2][0]*s,Y=-pts[j2][1]*s;@@ -229,6 +343,63 @@ function frame(now){ requestAnimationFrame(frame); } requestAnimationFrame(frame);++/* Click-to-zoom, OFF unless armed: real load screens must never eat input.+ Armed via ?interact=1 (or window.__ADOM_LOADER_INTERACT, which the wiki+ readme's inline preview sets). Click the canvas to capture the wheel for+ zoom; click is released on window blur (clicking outside the iframe). */+if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT){+ var live=false;+ /* The hint pill is OFF by default even when armed: production wants purity.+ ?hint=1 shows it, and armed contexts can flip it live by postMessage. The+ teal edge glow always communicates the armed state either way. */+ var HINTON = P('hint',0)>=1;+ var edge=document.createElement('div');+ edge.style.cssText='position:fixed;inset:0;pointer-events:none;opacity:0;'++ 'transition:opacity .18s ease;border:1px solid #00b8b0;'++ 'box-shadow:inset 0 0 26px rgba(0,184,176,.16), inset 0 0 0 1px rgba(0,184,176,.35);';+ document.body.appendChild(edge);+ var hint=document.createElement('div');+ hint.style.cssText='position:absolute;left:50%;bottom:16px;transform:translateX(-50%);'++ 'padding:5px 12px;border-radius:999px;background:rgba(13,17,23,.78);'++ 'border:1px solid #30363d;font:10px monospace;letter-spacing:.05em;'++ 'color:#8b949e;pointer-events:none;opacity:0;transition:opacity .2s';+ hint.textContent='click to zoom';+ document.body.appendChild(hint);+ function hintShow(o){ hint.style.opacity=(HINTON&&o)?'1':'0'; }+ document.body.style.cursor='pointer';+ document.addEventListener('mouseenter',function(){ if(!live) hintShow(true); });+ document.addEventListener('mouseleave',function(){ hintShow(false); });+ document.addEventListener('pointerdown',function(){+ live=true; edge.style.opacity='1'; document.body.style.cursor='default';+ hint.textContent='scroll to zoom'; hint.style.color='#00b8b0'; hintShow(true);+ setTimeout(function(){ hintShow(false); },1400);+ });+ /* Armed contexts accept live control: {adomLoader:{margin:N}} retargets the+ framing and the spring CARRIES the camera to its new home, animated. Real+ load screens never install this listener. */+ window.addEventListener('message',function(e){+ var d=e.data&&e.data.adomLoader; if(!d) return;+ if(typeof d.hint!=='undefined'){ HINTON=!!d.hint; if(!HINTON) hint.style.opacity='0'; }+ if(typeof d.bg==='string'){ applyBg(d.bg); }+ if(typeof d.fps==='number'){ FPSCAP=Math.max(0,d.fps); if(FPSCAP>0&&FPSCAP<20)FPSCAP=20; }+ if(typeof d.margin==='number'){+ MARGIN=Math.max(0,Math.min(90,d.margin));+ HOME=R/(1-MARGIN/100);+ ZF=Math.max(100,HOME*3);+ }+ });+ window.addEventListener('blur',function(){ live=false; edge.style.opacity='0'; document.body.style.cursor='pointer';+ hint.textContent='click to zoom'; hint.style.color='#8b949e'; });+ document.addEventListener('wheel',function(e){+ if(!live) return;+ e.preventDefault();+ if(window.__lock) return; // the epoch owns the framing+ lastNX=2*e.clientX/W-1; lastNY=1-2*e.clientY/H;+ velR+=CAMR*NOTCH*(-e.deltaY/100); // wheel up = zoom in = radius shrinks+ velR=Math.max(-HOME*0.75,Math.min(HOME*0.75,velR));+ },{passive:false});+} </script> </body> </html>
tools/build-readme.py+271−20@@ -71,37 +71,233 @@ if not loader_path.exists(): loader = loader_path.read_text() loader_kb = round(loader_path.stat().st_size / 1024) import html as _html-loader_srcdoc = _html.escape(loader, quote=True)+# the inline preview arms the loader's click-to-zoom; standalone stays inert+# the inline preview runs john fav and arms click-to-zoom+loader_armed = loader.replace(+ "'use strict';",+ "'use strict';window.__ADOM_LOADER_INTERACT=1;"+ "window.__ADOM_LOADER_PARAMS={pt:5,dt:0.7,ct:0.2,st:1,logo:100,llead:0.6,tlead:0.2,bg:'transparent'};", 1)+loader_srcdoc = _html.escape(loader_armed, quote=True) edocs = """ <style> /* readme variant: the lab fills the first viewport, the docs flow below */ html,body{height:auto!important;overflow:auto!important}- body{flex-wrap:wrap}- #panel{height:100vh}- #stageWrap{height:100vh;min-width:0}+ body{flex-wrap:wrap;min-height:0!important}+ /* Fixed, not viewport-relative: the wiki parent grows this iframe to fit+ our reported height, and any vh unit would chase that growth forever. */+ #panel{height:780px}+ #stageWrap{height:780px;min-width:0} .edocs{flex-basis:100%;background:var(--bg);border-top:1px solid var(--border); padding:26px 30px 44px;max-width:100%}- .edocs h2{font-family:'Familjen Grotesk',sans-serif;font-weight:600;font-size:17px;margin:0 0 6px;color:var(--text)}- .edocs h3{font-family:'Familjen Grotesk',sans-serif;font-weight:600;font-size:13px;margin:20px 0 6px;color:var(--text-2)}- .edocs p{font-size:12.5px;color:var(--text-2);line-height:1.65;max-width:680px}+ .edocs h2{font-family:'Familjen Grotesk',sans-serif;font-weight:600;font-size:22px;margin:0 0 8px;color:var(--text)}+ .edocs h3{font-family:'Familjen Grotesk',sans-serif;font-weight:600;font-size:16px;margin:22px 0 7px;color:var(--text-2)}+ .edocs p{font-size:14.5px;color:var(--text-2);line-height:1.7;max-width:760px} .edocs b{color:var(--text)}- .edocs pre{font-family:'JetBrains Mono','DM Mono',monospace;font-size:11px;background:var(--surface);- border:1px solid var(--border);border-radius:8px;padding:12px 14px;overflow-x:auto;- max-width:680px;color:var(--text);line-height:1.6}- .edocs table{border-collapse:collapse;font-size:11.5px;color:var(--text-2);margin:8px 0}- .edocs td,.edocs th{border:1px solid var(--border);padding:5px 10px;text-align:left}+ .edocs pre{font-family:'JetBrains Mono','DM Mono',monospace;font-size:12.5px;background:var(--surface);+ border:1px solid var(--border);border-radius:8px;padding:13px 15px;overflow-x:auto;+ max-width:760px;color:var(--text);line-height:1.65}+ .edocs table{border-collapse:collapse;font-size:13px;color:var(--text-2);margin:10px 0}+ .edocs td,.edocs th{border:1px solid var(--border);padding:7px 12px;text-align:left} .edocs th{color:var(--text);font-weight:500}- .edocs .prev{width:min(680px,100%);aspect-ratio:16/10;border:1px solid var(--border);+ .edocs .prev{width:min(760px,100%);aspect-ratio:16/10;border:1px solid var(--border); border-radius:10px;background:#0d1117;display:block;margin:6px 0}+ .edocs .rig-acts{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin:10px 0 10px}+ .edocs .rig-acts span{font-family:'JetBrains Mono','DM Mono',monospace;font-size:11px;+ color:var(--text-3);letter-spacing:.05em;margin-right:2px}+ .edocs .rig-acts button{font-family:'Satoshi',sans-serif;font-weight:500;font-size:12.5px;+ padding:7px 13px;border-radius:999px;cursor:pointer;background:var(--elevated);+ border:1px solid var(--border);color:var(--text)}+ .edocs .rig-acts button:hover{border-color:var(--accent)}+ #pbox{position:relative;overflow:hidden;width:min(760px,100%);height:475px;min-width:140px;+ min-height:90px;border:1px dashed var(--border);border-radius:10px;background:#0d1117;+ transition:width .35s ease,height .35s ease}+ #pbox.notrans{transition:none}+ /* the iframe ELEMENT must not paint: the base .prev rule gives it the dark+ background, which sat between the loader's transparent buffer and the+ container's colour and swallowed the swatches */+ #pbox .prev{position:absolute;inset:0;width:100%;height:100%;aspect-ratio:auto;border:0;margin:0;background:transparent}+ #pgrip{position:absolute;right:-2px;bottom:-2px;width:22px;height:22px;cursor:nwse-resize;z-index:5;+ border-right:3px solid var(--accent);border-bottom:3px solid var(--accent);border-radius:0 0 8px 0}+ #prd{font-family:'JetBrains Mono','DM Mono',monospace;font-size:11.5px;color:var(--accent);margin-top:8px} </style> <div class="edocs">- <h2>Ship it as a webview loader</h2>+ <h2>The live viewer</h2>+ <div class="rig-acts">+ <span>size</span>+ <button data-s="300,620">Tall</button>+ <button data-s="1100,300">Wide</button>+ <button data-s="420,420">Square</button>+ <button data-s="180,140">Tiny</button>+ <button data-s="760,475">Reset</button>+ <span style="margin-left:10px">margin</span>+ <button data-m="0">0%</button>+ <button data-m="40">40%</button>+ <button data-m="80">80%</button>+ <span style="margin-left:10px">hint</span>+ <button data-h="1">on</button>+ <button data-h="0">off</button>+ <span style="margin-left:10px">start</span>+ <button data-e="1">emerge</button>+ <button data-e="0">logo</button>+ <span style="margin-left:10px">container bg</span>+ <button data-b="#0d1117">dark</button>+ <button data-b="#20262e">bar gray</button>+ <button data-b="#8a93a0">mid gray</button>+ <button data-b="#f2f4f7">white</button>+ </div>+ <div id="pbox"><iframe class="prev" srcdoc="__SRC__"></iframe><div id="pgrip" title="drag to resize"></div></div>+ <div id="prd">container: …</div>+ <p>This IS loader.html, inlined, running the <b>john fav</b> cut: the final output,+ before any of the explanation. Click it once and your wheel zooms toward the cursor+ with the lab's exact springy feel; click anywhere else to give the wheel back to the+ page. Drag the teal corner or use the presets, the loader fills whatever you give it;+ the margin buttons retarget the framing live and the spring carries the camera to its+ new home. The loader here runs <b>bg=transparent</b>: tap the container bg swatches and+ the box's own colour shows straight through the animation, which is how you sit it on a+ toolbar, next to a wordmark, or on any surface. Everything below explains how to ship+ it.</p>+ <script>+ (function(){+ var box=document.getElementById('pbox'), grip=document.getElementById('pgrip'),+ rd=document.getElementById('prd'), ifr=box.querySelector('iframe'), drag=null;+ document.querySelectorAll('.rig-acts button[data-s]').forEach(function(b){+ b.addEventListener('click',function(){+ var v=b.getAttribute('data-s').split(',');+ box.style.width=v[0]+'px'; box.style.height=v[1]+'px';+ });+ });+ document.querySelectorAll('.rig-acts button[data-m]').forEach(function(b){+ b.addEventListener('click',function(){+ ifr.contentWindow.postMessage({adomLoader:{margin:parseFloat(b.getAttribute('data-m'))}},'*');+ });+ });+ document.querySelectorAll('.rig-acts button[data-h]').forEach(function(b){+ b.addEventListener('click',function(){+ ifr.contentWindow.postMessage({adomLoader:{hint:b.getAttribute('data-h')==='1'}},'*');+ });+ });+ document.querySelectorAll('.rig-acts button[data-e]').forEach(function(b){+ b.addEventListener('click',function(){+ /* emerge is boot-time state, so toggle it by rewriting the srcdoc's+ params and letting the iframe reboot into the chosen opening. */+ var sd=ifr.getAttribute('srcdoc').replace(/emerge:1,?/,'');+ if(b.getAttribute('data-e')==='1')+ sd=sd.replace('__ADOM_LOADER_PARAMS={','__ADOM_LOADER_PARAMS={emerge:1,');+ ifr.setAttribute('srcdoc',sd);+ });+ });+ document.querySelectorAll('.rig-acts button[data-b]').forEach(function(b){+ b.addEventListener('click',function(){+ box.style.background=b.getAttribute('data-b');+ });+ });+ grip.addEventListener('pointerdown',function(e){+ e.preventDefault(); grip.setPointerCapture(e.pointerId);+ box.classList.add('notrans');+ drag={x:e.clientX,y:e.clientY,w:box.clientWidth,h:box.clientHeight};+ });+ grip.addEventListener('pointermove',function(e){+ if(!drag) return;+ box.style.width=Math.max(140,drag.w+e.clientX-drag.x)+'px';+ box.style.height=Math.max(90,drag.h+e.clientY-drag.y)+'px';+ });+ grip.addEventListener('pointerup',function(){ drag=null; box.classList.remove('notrans'); });+ setInterval(function(){+ rd.textContent='container: '+box.clientWidth+'x'+box.clientHeight;+ },300);+ })();+ </script>+ <h2 style="margin-top:30px">Ship it as a webview loader</h2> <p><b>loader.html</b> on this page is the animation above distilled to ONE dependency-free file: raw WebGL, no Babylon, no CDN, no fonts, no fetch, about __KB__ KB. It boots instantly, which- is the point: it plays while your webview's real content is still loading. The defaults are- the tuned numbers; every knob is a URL parameter, and a fresh random state is rolled at every- epoch so it never repeats.</p>+ is the point: it plays while your webview's real content is still loading. Under 10 KB+ gzipped, zero requests, one draw call over 12,800 vertex-shader-displaced triangles, and+ about 0.06 ms of JS per frame, so the CPU stays asleep. The wheel is tuned against the+ lab's measured response (same burst, same dip, same spring home), zooming toward the+ cursor with the springy feel that always breathes the framing back to center. Defaults are the tuned numbers; every knob is a URL parameter, and a+ fresh random state is rolled at every epoch so it never repeats.</p>+ <h3>Why raw WebGL, and not Babylon or three.js</h3>+ <p>A load screen exists to be on screen while your real app is still fetching. An animation+ that first downloads and parses a 3D engine defeats its own purpose, so the loader ships+ as ONE hand-rolled WebGL file and nothing else. The main viewer at the top of this page IS+ Babylon.js 9.18, where a full engine earns its weight (ArcRotate camera, GPU pixel+ readbacks for the fit measurement, tooling); the loader is that lab distilled.</p>+ <table>+ <tr><th>approach</th><th>payload, gzipped</th><th>requests</th><th>first frame</th></tr>+ <tr><td>Babylon.js + app</td><td>~1.4 MB engine + your page</td><td>CDN + page</td><td>after download and parse</td></tr>+ <tr><td>three.js + app</td><td>~170 KB engine + your page</td><td>CDN + page</td><td>after download and parse</td></tr>+ <tr><td><b>loader.html</b></td><td><b>9,912 bytes, everything included</b></td><td><b>zero</b></td><td><b>tens of milliseconds</b></td></tr>+ </table>+ <h3>The measured numbers</h3>+ <p>Measured on this build, not estimated: <b>24,379 bytes</b> on disk and <b>9,912 bytes+ gzipped</b>, including the shaders, the 286-point logomark vectors, the 128-sample+ measured edge profile, and the whole timeline. Runtime: <b>0.057 ms of JavaScript per+ frame</b> (16 coefficient cosines and uniform uploads, about 1.4% of a 240 Hz frame+ budget), then <b>one draw call</b> over <b>12,800 triangles / 6,561 vertices</b> with all+ displacement in the vertex shader. requestAnimationFrame pauses it completely when the+ tab is hidden, so a backgrounded webview costs nothing. Spinner duty, measured at+ 32x32 on a 240 Hz display: one instance costs about 1 to 3% of a single core, eight+ concurrent instances about 9%, and eight instances capped with <code>fps=30</code>+ about 2% total, all while the host page holds a locked 240 fps. The mode presets,+ same eight-spinner fleet: <b>performance</b> 8.2% of a core, <b>lightweight</b> 1.7%,+ about five times cheaper. On a 60 Hz machine divide by four. Hidden, the cost is+ exactly zero.</p>+ <h3>Fidelity guarantees</h3>+ <p>The loader is not a re-implementation of the look. <code>tools/build-loader.py</code>+ extracts the GLSL <b>verbatim</b> from the Babylon lab at build time (one source of+ truth), reproduces Babylon's left-handed view and projection matrices exactly, and the+ chirality is pixel-verified against the lab: teal lobe upper-right, navy lower-left.+ Same equation, same cheat, same profile data, pixel-identical rendering. The camera feel+ is tuned against the lab's <b>measured</b> response, not copied constants: the same+ 12-notch wheel burst dips both viewers to the same radius (3.99 vs 3.995) and both+ spring home in the same beat, via a Babylon-style decaying inertia integral, the lab's+ 6% radius and 5% centering springs at its 240 fps cadence made frame-rate independent,+ zoom toward the cursor, and a glide home before every logo so the mark always lands+ undistorted.</p>+ <h3>The mouse: arming, zoom to cursor, and the springiness algorithm</h3>+ <p><b>Arming.</b> A load screen must never eat input, so the loader is inert by default:+ clicks and wheel pass straight through to your page. <code>?interact=1</code> arms it+ (the preview above is armed): one click captures the wheel, a teal ring with a glow+ says so, and clicking anywhere else or leaving the frame releases it.</p>+ <p><b>Zoom to cursor.</b> Every notch records the cursor in normalized device coordinates.+ The world point under it is solved from the camera, <code>w = n·r/m + pan</code>,+ the radius step is applied, and the pan is re-solved so that exact world point stays+ pinned under the cursor: <code>pan' = w − n·r'/m</code>. Measured drift of+ the pinned point across a six-notch corner zoom: 0.002 world units.</p>+ <p><b>The springiness.</b> Three exponential systems, all frame-rate independent via+ <code>pow(k, dt·240)</code> so a 60 Hz laptop feels identical to a 240 Hz monitor:</p>+ <table>+ <tr><th>system</th><th>rule, per frame</th><th>feel</th></tr>+ <tr><td>inertia integral</td><td>each notch deposits <code>vel += r·0.085</code>;+ consumed by <code>step = vel·(1−0.8^(dt·240))</code></td>+ <td>notches stack and glide instead of stepping</td></tr>+ <tr><td>radius spring</td><td><code>r += (4.4−r)·(1−0.94^(dt·240))</code></td>+ <td>zoom always breathes back home</td></tr>+ <tr><td>centering pull</td><td><code>pan −= pan·(1−0.95^(dt·240))</code></td>+ <td>the mark drifts back to center</td></tr>+ </table>+ <p><b>Tuned by measurement, not by copying constants.</b> The obvious approach, lifting+ Babylon's <code>wheelDeltaPercentage</code>, nets to zero against the spring. So both+ viewers were driven with the identical 12-notch wheel burst in instrumented pup windows+ and the loader was tuned until the response curves matched: the lab dips to radius+ 3.995 and springs home in about 200 ms; the loader dips to 3.990 and springs home in+ about 250 ms, one sample bucket apart.</p>+ <p><b>The epoch override.</b> Whatever you have zoomed or panned, a glide window of+ <code>max(0.6s, llead+0.2s, min(1.2s, dt))</code> eases the framing to the calibrated+ home pose, arriving exactly at epoch-start, the wheel is locked through the sit so the+ mark always lands undistorted, and home becomes the new state afterwards: the wheel+ frees the instant the sit ends and play resumes from the calibrated framing.</p>+ <h3>Resizing: it fills whatever it is given</h3>+ <p>Webviews get resized constantly, so the loader treats size as live input: it listens to+ window resize AND a ResizeObserver on the document, re-backs both canvases at+ devicePixelRatio (capped 2), and picks its FOV axis by the LIMITING dimension, so+ portrait, landscape, square, tiny or huge, the mark keeps its fraction of the container+ with no letterboxing and no stretching. Proven across 300x620, 1100x300, 420x420,+ 180x140, 1300x700 and 900x560: the GL buffer tracked the container 1:1 at every step,+ including mid-animation continuous resizes, and re-backing is coalesced into the render loop (events only mark dirty, the new size is applied and DRAWN in the same frame), so a continuous drag repaints clean every frame with no blank flashes. The repo ships+ <code>resize-proof.html</code>, a drag-to-resize torture rig around the real loader,+ so you can prove it in your own container shape.</p> <h3>Embed</h3> <pre><iframe src="loader.html" style="position:absolute;inset:0;width:100%;height:100%;border:0;background:#0d1117">@@ -121,11 +317,66 @@ edocs = """ <tr><td>tlead</td><td>1.5</td><td>seconds before the epoch the dark lobe fades to teal</td></tr> <tr><td>ov</td><td>1</td><td>0 makes the cheat its own act after the steer</td></tr> <tr><td>intro</td><td>1</td><td>0 skips the teal logo intro</td></tr>+ <tr><td>interact</td><td>0</td><td>1 arms click-to-zoom (for previews and demos, never load screens)</td></tr>+ <tr><td>mode</td><td>performance</td><td><b>lightweight</b> bundles fps 30, dpr 1, seg 48, no antialias for spinner fleets and dialogs; <b>performance</b> (alias <b>sexy</b>) is the full-quality default. Explicit params override the mode</td></tr>+ <tr><td>seg</td><td>80</td><td>sphere tessellation, 24 to 128 (80 is 12,800 triangles, 48 is 4,608)</td></tr>+ <tr><td>aa</td><td>1</td><td>0 disables antialiasing</td></tr>+ <tr><td>dpr</td><td>2</td><td>devicePixelRatio cap for the backing store, 1 to 3</td></tr>+ <tr><td>fps</td><td>off</td><td>cap the render rate for spinner duty (floor 20). rAF already yields between frames and stops when hidden; fps=30 renders one frame in eight on a 240 Hz display</td></tr>+ <tr><td>bg</td><td>0d1117</td><td>hex background, or <b>transparent</b> to composite over the container's own background (GL context runs with alpha). Also settable live by postMessage</td></tr>+ <tr><td>hint</td><td>0</td><td>1 shows the small "click to zoom" pill in armed contexts. Off by default: production stays pure. Armed contexts can also flip it live by postMessage</td></tr>+ <tr><td>emerge</td><td>0</td><td>1 replaces the logo intro: the equation runs from t=0 and the surface condenses out of nothing (2.6 s scale and fade) straight into play, then the normal timeline. Keep pt above ~3 s so the first epoch never lands mid-birth. A taste toggle: try the start buttons in the rig above</td></tr>+ <tr><td>margin</td><td>0</td><td>percent of the container left empty around the mark: 80 sits it small in the middle of a big window, 20 nearly fills. Zoom-in still brings it to the screen; zoom-out caps at 40% past the margined framing</td></tr>+ </table>+ <h3>The three tuned cuts</h3>+ <p>These are the settings the loop was actually tuned to, saved live while dialing it in.+ All three ship in the Final tab's snapshot pulldown (marked *), and each maps to loader+ URL params. What the knobs mean: <b>pt</b> is free play between epochs, <b>dt</b> is how+ long the dive onto the mark takes, <b>ct</b> is how late the outline cheat is held back+ (smaller = the sculpting is nearly invisible), <b>st</b> is dead-still hold time,+ <b>logo</b> is the flat mark's peak opacity, <b>llead</b> starts the logo fade that many+ seconds before the epoch and ends it that many after, <b>tlead</b> turns the dark lobe+ teal that many seconds early so the mark reads as one colour by arrival.</p>+ <table>+ <tr><th>cut</th><th>numbers</th><th>why it feels the way it does</th></tr>+ <tr><td><b>john fav</b><br>(the preview below)</td>+ <td>pt 5 · dt 0.7 · ct 0.2 · st 1<br>logo 100% · llead 0.6 · tlead 0.2</td>+ <td>The keeper. A 0.7s dive into a real 1s sit, and the teal unifies only 0.2s+ before arrival, so the dark lobe survives almost to the mark and the colour+ snap lands WITH the logo. Loader:+ <code>?pt=5&dt=0.7&ct=0.2&st=1&llead=0.6&tlead=0.2</code></td></tr>+ <tr><td><b>john 1</b><br>(the default)</td>+ <td>pt 4.5 · dt 3 · ct 0.3 · st 0<br>logo 100% · llead 1 · tlead 1.5</td>+ <td>The stately cut. A long 3s dinner call lets you watch the physics converge; the+ cheat waits until the last 0.3s so you never catch it working; there is NO sit,+ the whole logo moment lives on its 1s lead, swelling to full teal exactly across+ the epoch and letting go. Loader: no params needed.</td></tr>+ <tr><td><b>snap 2</b></td>+ <td>pt 5 · dt 1 · ct 0.2 · st 0<br>logo 100% · llead 0.3 · tlead 1.5</td>+ <td>The middle cut. A 1s dive and a tight 0.3s logo flash: punchy, still readable.+ Loader: <code>?pt=5&dt=1&ct=0.2&llead=0.3</code></td></tr>+ <tr><td><b>snap 3</b></td>+ <td>pt 5 · dt 0.7 · ct 0.2 · st 0<br>logo 80% · llead 0.5 · tlead 1.5</td>+ <td>The heartbeat cut. A 0.7s dive with the logo capped at 80% so the 3D still shows+ through the flash: the mark reads as a pulse, not a poster.+ Loader: <code>?pt=5&dt=0.7&ct=0.2&logo=80&llead=0.5</code></td></tr> </table>- <h3>Live preview</h3>- <iframe class="prev" srcdoc="__SRC__"></iframe>- <p>This preview IS loader.html, inlined. What you embed is exactly what you see.</p> </div>+<script>+/* The wiki parent listens for {type:'readme-height'} and resizes this iframe+ to fit, so the lab and the loader docs render with no inner scrollbars. */+(function(){+ var last = 0;+ function report(){+ var h = Math.ceil(document.documentElement.scrollHeight) + 2;+ if (Math.abs(h - last) > 2) { last = h; parent.postMessage({ type: 'readme-height', height: h }, '*'); }+ }+ window.addEventListener('load', report);+ if (window.ResizeObserver) new ResizeObserver(report).observe(document.documentElement);+ setInterval(report, 1200);+ report();+})();+</script> """.replace('__KB__', str(loader_kb)).replace('__SRC__', loader_srcdoc) src = src.replace('</body>', edocs + '</body>')