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
Publish 1.0.11
5 files changed
+57−20
README.md+6−2@@ -30,8 +30,12 @@ This page is the working proof. ## Use it as a webview loader -`loader.html` is raw WebGL: no Babylon, no CDN, no fonts, no fetch, roughly 20 KB,-boots instantly. Serve it beside your app and overlay it while the real content loads:+`loader.html` is raw WebGL: no Babylon, no CDN, no fonts, no fetch. One file, about+24 KB on disk and under 10 KB gzipped, zero external requests, one draw call over+12,800 vertex-shader-displaced triangles, roughly 0.06 ms of JS per frame. The GLSL+is extracted verbatim from the Babylon lab at build time, so the two render+identically; the wheel reproduces the lab's exact feel (1.2% per notch, inertia,+zoom toward the cursor, and the spring that breathes the framing back home). Serve it beside your app and overlay it while the real content loads: <iframe src="loader.html" style="position:absolute;inset:0;width:100%;height:100%;border:0;background:#0d1117">
loader.html+21−6@@ -224,6 +224,11 @@ gl.uniform3fv(U.cPos,C_POS); 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, CAMR=R, PANX=0, PANY=0, FOV=0.8, ZN=0.1, ZF=100;+/* Zoom targets: the wheel moves TARGETS, and the camera eases toward them+ with Babylon's own feel reproduced exactly: wheelDeltaPercentage 0.012+ (1.2% of radius per notch) and inertia 0.9 per frame at 60fps, made+ frame-rate independent. That is the smoothness of the main lab viewer. */+var CAMRT=R, PANXT=0, PANYT=0; 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};@@ -305,7 +310,16 @@ function frame(now){ 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=R; PANX=0; PANY=0; camK=1; }+ if(t>=eS&&t<=eE+0.001){ CAMR=R; PANX=0; PANY=0; CAMRT=R; PANXT=0; PANYT=0; camK=1; }+ /* The lab's SPRING, reproduced: every frame the lab pulls radius 6% and+ the pan 5% back toward home (at its 240fps cadence), so play always+ relaxes back to center. Wheeling fights the spring and wins while you+ keep scrolling; let go and it breathes home in a beat. */+ var spr=1-Math.pow(0.94, dt*240), sprT=1-Math.pow(0.95, dt*240);+ CAMRT+=(R-CAMRT)*spr; PANXT-=PANXT*sprT; PANYT-=PANYT*sprT;+ // Babylon-style inertia toward the wheel targets+ var ease=1-Math.pow(0.9, dt*60);+ CAMR+=(CAMRT-CAMR)*ease; PANX+=(PANXT-PANX)*ease; PANY+=(PANYT-PANY)*ease; window.__lock = (t>eS-RET && t<=eE); effR=CAMR+(R-CAMR)*camK; effPX=PANX*(1-camK); effPY=PANY*(1-camK); } else { effR=R; effPX=0; effPY=0; }@@ -385,11 +399,12 @@ if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT){ if(window.__lock) return; // the epoch owns the framing var m=proj(W,H); var nx=2*e.clientX/W-1, ny=1-2*e.clientY/H;- // world point under the cursor, kept stationary through the zoom- var wx=nx*CAMR/m.m0+PANX, wy=ny*CAMR/m.m5+PANY;- var r2=Math.max(2.4,Math.min(9,CAMR*(1+(e.deltaY>0?0.08:-0.08))));- PANX=wx-nx*r2/m.m0; PANY=wy-ny*r2/m.m5;- CAMR=r2;+ // world point under the cursor, kept stationary through the zoom,+ // computed against the TARGETS so stacked notches chain cleanly+ var wx=nx*CAMRT/m.m0+PANXT, wy=ny*CAMRT/m.m5+PANYT;+ var r2=Math.max(2.4,Math.min(9,CAMRT*(1+0.012*(e.deltaY/100))));+ PANXT=wx-nx*r2/m.m0; PANYT=wy-ny*r2/m.m5;+ CAMRT=r2; },{passive:false}); } </script>
package.json+1−1@@ -2,7 +2,7 @@ "slug": "orbital-lab", "title": "Orbital Lab", "type": "app",- "version": "1.0.10",+ "version": "1.0.11", "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", "physics", "babylon", "webgl", "animation", "loader"], "dependencies": {},
page.json+1−1@@ -2,7 +2,7 @@ "slug": "orbital-lab", "title": "Orbital Lab", "type": "app",- "version": "1.0.10",+ "version": "1.0.11", "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+28−10@@ -2609,10 +2609,13 @@ window.__lab = { push, zeros, HARMONICS, setAnim:v=>{animate=v;} }; <div class="edocs"> <h2>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 23 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>+ raw WebGL, no Babylon, no CDN, no fonts, no fetch, about 24 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 has the lab's exact feel:+ 1.2% per notch, inertia, zoom toward the cursor, and the same spring that always breathes+ the framing back home. 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>Embed</h3> <pre><iframe src="loader.html" style="position:absolute;inset:0;width:100%;height:100%;border:0;background:#0d1117">@@ -2894,6 +2897,11 @@ gl.uniform3fv(U.cPos,C_POS); 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, CAMR=R, PANX=0, PANY=0, FOV=0.8, ZN=0.1, ZF=100;+/* Zoom targets: the wheel moves TARGETS, and the camera eases toward them+ with Babylon's own feel reproduced exactly: wheelDeltaPercentage 0.012+ (1.2% of radius per notch) and inertia 0.9 per frame at 60fps, made+ frame-rate independent. That is the smoothness of the main lab viewer. */+var CAMRT=R, PANXT=0, PANYT=0; 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};@@ -2975,7 +2983,16 @@ function frame(now){ 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=R; PANX=0; PANY=0; camK=1; }+ if(t>=eS&&t<=eE+0.001){ CAMR=R; PANX=0; PANY=0; CAMRT=R; PANXT=0; PANYT=0; camK=1; }+ /* The lab's SPRING, reproduced: every frame the lab pulls radius 6% and+ the pan 5% back toward home (at its 240fps cadence), so play always+ relaxes back to center. Wheeling fights the spring and wins while you+ keep scrolling; let go and it breathes home in a beat. */+ var spr=1-Math.pow(0.94, dt*240), sprT=1-Math.pow(0.95, dt*240);+ CAMRT+=(R-CAMRT)*spr; PANXT-=PANXT*sprT; PANYT-=PANYT*sprT;+ // Babylon-style inertia toward the wheel targets+ var ease=1-Math.pow(0.9, dt*60);+ CAMR+=(CAMRT-CAMR)*ease; PANX+=(PANXT-PANX)*ease; PANY+=(PANYT-PANY)*ease; window.__lock = (t>eS-RET && t<=eE); effR=CAMR+(R-CAMR)*camK; effPX=PANX*(1-camK); effPY=PANY*(1-camK); } else { effR=R; effPX=0; effPY=0; }@@ -3055,11 +3072,12 @@ if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT if(window.__lock) return; // the epoch owns the framing var m=proj(W,H); var nx=2*e.clientX/W-1, ny=1-2*e.clientY/H;- // world point under the cursor, kept stationary through the zoom- var wx=nx*CAMR/m.m0+PANX, wy=ny*CAMR/m.m5+PANY;- var r2=Math.max(2.4,Math.min(9,CAMR*(1+(e.deltaY>0?0.08:-0.08))));- PANX=wx-nx*r2/m.m0; PANY=wy-ny*r2/m.m5;- CAMR=r2;+ // world point under the cursor, kept stationary through the zoom,+ // computed against the TARGETS so stacked notches chain cleanly+ var wx=nx*CAMRT/m.m0+PANXT, wy=ny*CAMRT/m.m5+PANYT;+ var r2=Math.max(2.4,Math.min(9,CAMRT*(1+0.012*(e.deltaY/100))));+ PANXT=wx-nx*r2/m.m0; PANYT=wy-ny*r2/m.m5;+ CAMRT=r2; },{passive:false}); } </script>