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.9
5 files changed
+173−75
loader.html+51−13@@ -223,17 +223,21 @@ 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, CAMR=R, FOV=0.8, ZN=0.1, ZF=100;-function setMVP2(w,h){+var R=4.4, CAMR=R, PANX=0, PANY=0, FOV=0.8, ZN=0.1, ZF=100;+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){+ r=(r===undefined)?CAMR:r; px=px||0; py=py||0;+ var m=proj(w,h); var A=ZF/(ZF-ZN), B=-ZN*ZF/(ZF-ZN);- // view: z' = z + CAMR (eye at -CAMR on z, LH)+ // view: 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,+ m.m0,0,0,0,+ 0,m.m5,0,0, 0,0,A,1,- 0,0,A*CAMR+B,CAMR+ -m.m0*px,-m.m5*py,A*r+B,r ])); } @@ -290,6 +294,26 @@ 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){+ /* Symmetric glide sized to cover the whole logo window, so the framing is+ exactly home while any part of the mark is showing, even at st=0 where+ the epoch is a single instant, and the user's zoom returns smoothly on+ the way out instead of snapping. */+ var RET=Math.max(0.6, LLEAD+0.2, Math.min(1.2,DT));+ camK = (t>=eS&&t<=eE) ? 1+ : (t>eS-RET&&t<eS) ? smooth((t-(eS-RET))/RET)+ : (t>eE&&t<eE+RET) ? smooth(1-(t-eE)/RET)+ : 0;+ effR=CAMR+(R-CAMR)*camK; effPX=PANX*(1-camK); effPY=PANY*(1-camK);+ } else { effR=R; effPX=0; effPY=0; }+ setMVP2(W,H,effR,effPX,effPY);+ 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{@@ -313,8 +337,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*(R/CAMR);- 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;@@ -332,6 +359,11 @@ requestAnimationFrame(frame); zoom; click is released on window blur (clicking outside the iframe). */ if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT){ var live=false;+ 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);'+@@ -343,17 +375,23 @@ if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT){ document.addEventListener('mouseenter',function(){ if(!live) hint.style.opacity='1'; }); document.addEventListener('mouseleave',function(){ hint.style.opacity='0'; }); document.addEventListener('pointerdown',function(){- live=true; document.body.style.cursor='default';+ live=true; edge.style.opacity='1'; document.body.style.cursor='default'; hint.textContent='scroll to zoom'; hint.style.color='#00b8b0'; hint.style.opacity='1'; setTimeout(function(){ hint.style.opacity='0'; },1400); });- window.addEventListener('blur',function(){ live=false; document.body.style.cursor='pointer';+ 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();- CAMR=Math.max(2.4,Math.min(9,CAMR*(1+(e.deltaY>0?0.08:-0.08))));- setMVP2(W,H);+ if(window.__cam && window.__cam.k>0) 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; },{passive:false}); } </script>
orbital-lab.html+34−23@@ -212,7 +212,13 @@ /* Mode LED: is the surface the untouched wavefunction, or are we bending it toward the brandmark? Purple, not teal, so it never reads as part of the artwork, and not green or red since those are reserved. */- #stageWrap.cam-live{outline:1px solid var(--accent);outline-offset:-1px}+ #stageWrap.cam-live{+ box-shadow:+ inset 0 0 0 1px var(--accent),+ inset 0 0 26px rgba(0,184,176,.16),+ 0 0 18px rgba(0,184,176,.35);+ transition:box-shadow .18s ease;+ } .stage-hint{ position:absolute;left:50%;bottom:44px;transform:translateX(-50%); padding:6px 13px;border-radius:var(--r-pill);@@ -450,26 +456,26 @@ </div> <div class="row"> <label title="pt, the playground timeline. The tab 1 animation exactly: Evolve running over this loop's rolled random state, free and alive, for this many seconds before mom calls.">pt play</label>- <span class="mark"><input type="range" id="l_pt" min="2" max="30" step="0.5" value="4.5"><i class="livepip" id="lp4pt"></i></span>- <output id="o_pt">4.5s</output>+ <span class="mark"><input type="range" id="l_pt" min="2" max="30" step="0.5" value="5"><i class="livepip" id="lp4pt"></i></span>+ <output id="o_pt">5.0s</output> </div> <div class="row"> <label title="dt, the dinner timeline. Mom calls: every coefficient steers from wherever play left it onto the known epoch numbers, p_x and p_y at 0.7071 and everything else 0, arriving exactly as these seconds end. The way back out to play afterwards uses this same length.">dt dinner</label>- <span class="mark"><input type="range" id="l_dt" min="0.5" max="8" step="0.1" value="3"><i class="livepip" id="lp4dt"></i></span>- <output id="o_dt">3.0s</output>+ <span class="mark"><input type="range" id="l_dt" min="0.5" max="8" step="0.1" value="0.7"><i class="livepip" id="lp4dt"></i></span>+ <output id="o_dt">0.7s</output> </div> <div class="row"> <label title="ct, the cheat timeline. The tab 2 trick, the quadrant clip and edge correction that force the exact logo outline, ramped 0 to 100% and reaching exactly 100% at the epoch. The harsh edges live here, so experiment with WHEN it runs. The un-cheat on the way out mirrors this length.">ct cheat</label>- <span class="mark"><input type="range" id="l_ct" min="0.2" max="5" step="0.1" value="0.3"><i class="livepip" id="lp4ct"></i></span>- <output id="o_ct">0.3s</output>+ <span class="mark"><input type="range" id="l_ct" min="0.2" max="5" step="0.1" value="0.2"><i class="livepip" id="lp4ct"></i></span>+ <output id="o_ct">0.2s</output> </div> <label class="chk" title="Checked: ct OVERLAYS the tail of dt, carving while the steer is still finishing underneath, busier and the cycle stays shorter. Unchecked: ct becomes its OWN act after dt, carving a finished, still 2p into the mark, calmer, and adds ct to each side of the cycle."> <input type="checkbox" id="l_ctMode" checked><span>ct is an overlay on dt</span> </label> <div class="row"> <label title="st, the sit timeline. Arrived. The shape pins to the mark and does nothing for this long, dead still. The fresh random roll for the NEXT playground happens the moment we arrive, invisibly, so the exit is always brand new.">st sit</label>- <span class="mark"><input type="range" id="l_st" min="0" max="5" step="0.1" value="0"><i class="livepip" id="lp4st"></i></span>- <output id="o_st">0.0s</output>+ <span class="mark"><input type="range" id="l_st" min="0" max="5" step="0.1" value="1"><i class="livepip" id="lp4st"></i></span>+ <output id="o_st">1.0s</output> </div> <label class="chk" title="Fade the flat teal logomark over the 3D during the sit: in across the first half of the sit, out across the second half."> <input type="checkbox" id="l_logoOn" checked><span>logo fade during the sit</span>@@ -481,13 +487,13 @@ </div> <div class="row"> <label title="Start the logo fade this many seconds BEFORE the sit begins, and let the fade-out run the same amount past its end. Negative means earlier. With sit at 0.0s this slider alone still creates a logo moment around the epoch instant.">logo lead</label>- <span class="mark"><input type="range" id="l_logoLead" min="-3" max="0" step="0.1" value="-1"><i class="livepip" id="lp4llead"></i></span>- <output id="o_logoLead">-1.0s</output>+ <span class="mark"><input type="range" id="l_logoLead" min="-3" max="0" step="0.1" value="-0.6"><i class="livepip" id="lp4llead"></i></span>+ <output id="o_logoLead">-0.6s</output> </div> <div class="row"> <label title="The dark negative lobe fades to the positive teal this many seconds before the epoch, and fades back the same amount after it, so the mark reads as one colour by the time the logo lands. Negative means earlier. At 0.0s the colour snaps exactly on the epoch.">teal lead</label>- <span class="mark"><input type="range" id="l_tealLead" min="-3" max="0" step="0.1" value="-1.5"><i class="livepip" id="lp4tlead"></i></span>- <output id="o_tealLead">-1.5s</output>+ <span class="mark"><input type="range" id="l_tealLead" min="-3" max="0" step="0.1" value="-0.2"><i class="livepip" id="lp4tlead"></i></span>+ <output id="o_tealLead">-0.2s</output> </div> <label class="chk" title="Draw the dashed logo vectors over the 3D as it steers in, for checking the match against the real mark. A debug aid: off is the clean look. Never shown during the intro."> <input type="checkbox" id="l_guides"><span>dashed logo guides</span>@@ -645,9 +651,14 @@ function setCamLive(on){ camLive = on; const w = document.getElementById('stageWrap'); if (w) w.classList.toggle('cam-live', on);- if (on) camera.attachControl(canvas, true); else camera.detachControl();+ /* noPreventDefault=false while armed: Babylon EATS wheel and pointer+ events, so the page cannot scroll underneath the zoom. Released, the+ camera is detached and the page gets everything back. */+ if (on) { camera.attachControl(canvas, false); canvas.focus(); }+ else { camera.detachControl(); canvas.blur(); } } camera.detachControl();+canvas.tabIndex = 0; // focusable, so arming truly takes focus canvas.addEventListener('pointerdown', () => setCamLive(true)); document.addEventListener('pointerdown', e => { if (camLive && e.target.closest && !e.target.closest('#stageWrap')) setCamLive(false);@@ -1447,7 +1458,7 @@ const SAY = { lSnapDel: () => ['Snapshot deleted', `${allSnaps().length} left · factory ones (*) ship with the page`], mLoop: () => ['Final', 'The final cut: teal intro, then play, dinner, cheat, sit, and back out, fresh roll every pass'], lRestart: () => ['Intro restarted', 'From the teal open'],- lDefaults:() => ['Loop defaults restored', 'john 1: pt 4.5s, dt 3s, ct 0.3s overlay, no sit, logo 100% on a 1s lead, teal lead 1.5s'],+ lDefaults:() => ['Loop defaults restored', 'john fav: pt 5s, dt 0.7s, ct 0.2s overlay, 1s sit, logo 100% on a 0.6s lead, teal lead 0.2s'], fDefaults:() => ['Defaults restored', 'Morph 2.6s each way, lead in and tail out 0.6s, ease 0.35, hold 1.0s, fill 50%'], }; document.addEventListener('click', e => {@@ -1821,7 +1832,7 @@ function driveFinal(dt){ const EPOCH_A = -Math.PI/2, EPOCH_B = Math.PI/2, EPOCH_R = 4.4; if (freeCam) { if (camK <= 0.001) {- if (camHeld) { if (camLive) camera.attachControl(canvas, true); camHeld = false; }+ if (camHeld) { if (camLive) camera.attachControl(canvas, false); camHeld = false; } userA = camera.alpha; userB = camera.beta; userR = camera.radius; } else { if (!camHeld) { camera.detachControl(); camHeld = true; }@@ -1832,7 +1843,7 @@ function driveFinal(dt){ camera.radius = userR + (EPOCH_R - userR) * camK; } } else {- if (camHeld) { if (camLive) camera.attachControl(canvas, true); camHeld = false; }+ if (camHeld) { if (camLive) camera.attachControl(canvas, false); camHeld = false; } const driftA = -Math.PI/2 + (camMotion ? Math.sin(tEvo*0.19)*0.55 : 0); const driftB = Math.PI/2 + (camMotion ? Math.sin(tEvo*0.13)*0.30 : 0); camera.alpha = driftA*(1-k) + EPOCH_A*k;@@ -1947,8 +1958,8 @@ function driveFinal(dt){ The whole thing opens with the teal intro: mark fades in alone, the 3D arrives underneath exactly on the epoch, mark lets go, loop runs. */ let loopMode=false, loopT=0, introT=0, inIntro=true, loopRolled=false;-let l_pt=4.5, l_dt=3, l_ct=0.3, l_ctOverlay=true, l_st=0; // john 1 ships as the default-let l_logoOn=true, l_logoPeak=1, l_logoLead=1, l_tealLead=1.5, l_guides=false; // leads kept positive+let l_pt=5, l_dt=0.7, l_ct=0.2, l_ctOverlay=true, l_st=1; // john fav ships as the default+let l_logoOn=true, l_logoPeak=1, l_logoLead=0.6, l_tealLead=0.2, l_guides=false; // leads kept positive let loopGains=null; function rollLoopGains(){ // tab 1's Randomise, verbatim@@ -2081,7 +2092,7 @@ function driveLoop(dt){ } /* ---- tab 4 controls ---- */-const LOOP_DEFAULTS={l_pt:4.5,l_dt:3,l_ct:0.3,l_st:0,l_logoPeak:1,l_logoLead:-1,l_tealLead:-1.5};+const LOOP_DEFAULTS={l_pt:5,l_dt:0.7,l_ct:0.2,l_st:1,l_logoPeak:1,l_logoLead:-0.6,l_tealLead:-0.2}; [['l_pt','o_pt',v=>{l_pt=v;return v.toFixed(1)+'s';}], ['l_dt','o_dt',v=>{l_dt=v;return v.toFixed(1)+'s';}], ['l_ct','o_ct',v=>{l_ct=v;return v.toFixed(1)+'s';}],@@ -2116,9 +2127,9 @@ const SNAP_KEY='orbital-lab-snapshots-v1'; including the wiki sandbox where there is no storage at all. Saved user snapshots live per browser origin and appear after these. */ const FACTORY_SNAPS = [- { name: 'john fav · pt5 dt0.7 ct0.2 st1', factory: true,+ { name: 'john fav · pt5 dt0.7 ct0.2 st1', factory: true, // the shipped default vals: { pt:5, dt:0.7, ct:0.2, ov:true, st:1, lo:true, lp:1, ll:0.6, tl:0.2, gd:false } },- { name: 'john 1 · pt4.5 dt3 ct0.3 st0', factory: true, // the shipped default+ { name: 'john 1 · pt4.5 dt3 ct0.3 st0', factory: true, vals: { pt:4.5, dt:3, ct:0.3, ov:true, st:0, lo:true, lp:1, ll:1, tl:1.5, gd:false } }, { name: 'snap 2 · pt5 dt1 ct0.2 st0', factory: true, vals: { pt:5, dt:1, ct:0.2, ov:true, st:0, lo:true, lp:1, ll:0.3, tl:1.5, gd:false } },@@ -2190,7 +2201,7 @@ document.getElementById('fFree').addEventListener('click', e => { camMotion = !freeCam; document.getElementById('fCam').classList.toggle('on', camMotion); document.getElementById('fCam').disabled = freeCam;- if (!freeCam && camHeld) { if (camLive) camera.attachControl(canvas, true); camHeld = false; }+ if (!freeCam && camHeld) { if (camLive) camera.attachControl(canvas, false); camHeld = false; } }); document.getElementById('fSpin').addEventListener('click', e => { spinOn = !spinOn; e.target.classList.toggle('on', spinOn);
package.json+1−1@@ -2,7 +2,7 @@ "slug": "orbital-lab", "title": "Orbital Lab", "type": "app",- "version": "1.0.8",+ "version": "1.0.9", "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.8",+ "version": "1.0.9", "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+86−37@@ -218,7 +218,13 @@ /* Mode LED: is the surface the untouched wavefunction, or are we bending it toward the brandmark? Purple, not teal, so it never reads as part of the artwork, and not green or red since those are reserved. */- #stageWrap.cam-live{outline:1px solid var(--accent);outline-offset:-1px}+ #stageWrap.cam-live{+ box-shadow:+ inset 0 0 0 1px var(--accent),+ inset 0 0 26px rgba(0,184,176,.16),+ 0 0 18px rgba(0,184,176,.35);+ transition:box-shadow .18s ease;+ } .stage-hint{ position:absolute;left:50%;bottom:44px;transform:translateX(-50%); padding:6px 13px;border-radius:var(--r-pill);@@ -456,26 +462,26 @@ </div> <div class="row"> <label title="pt, the playground timeline. The tab 1 animation exactly: Evolve running over this loop's rolled random state, free and alive, for this many seconds before mom calls.">pt play</label>- <span class="mark"><input type="range" id="l_pt" min="2" max="30" step="0.5" value="4.5"><i class="livepip" id="lp4pt"></i></span>- <output id="o_pt">4.5s</output>+ <span class="mark"><input type="range" id="l_pt" min="2" max="30" step="0.5" value="5"><i class="livepip" id="lp4pt"></i></span>+ <output id="o_pt">5.0s</output> </div> <div class="row"> <label title="dt, the dinner timeline. Mom calls: every coefficient steers from wherever play left it onto the known epoch numbers, p_x and p_y at 0.7071 and everything else 0, arriving exactly as these seconds end. The way back out to play afterwards uses this same length.">dt dinner</label>- <span class="mark"><input type="range" id="l_dt" min="0.5" max="8" step="0.1" value="3"><i class="livepip" id="lp4dt"></i></span>- <output id="o_dt">3.0s</output>+ <span class="mark"><input type="range" id="l_dt" min="0.5" max="8" step="0.1" value="0.7"><i class="livepip" id="lp4dt"></i></span>+ <output id="o_dt">0.7s</output> </div> <div class="row"> <label title="ct, the cheat timeline. The tab 2 trick, the quadrant clip and edge correction that force the exact logo outline, ramped 0 to 100% and reaching exactly 100% at the epoch. The harsh edges live here, so experiment with WHEN it runs. The un-cheat on the way out mirrors this length.">ct cheat</label>- <span class="mark"><input type="range" id="l_ct" min="0.2" max="5" step="0.1" value="0.3"><i class="livepip" id="lp4ct"></i></span>- <output id="o_ct">0.3s</output>+ <span class="mark"><input type="range" id="l_ct" min="0.2" max="5" step="0.1" value="0.2"><i class="livepip" id="lp4ct"></i></span>+ <output id="o_ct">0.2s</output> </div> <label class="chk" title="Checked: ct OVERLAYS the tail of dt, carving while the steer is still finishing underneath, busier and the cycle stays shorter. Unchecked: ct becomes its OWN act after dt, carving a finished, still 2p into the mark, calmer, and adds ct to each side of the cycle."> <input type="checkbox" id="l_ctMode" checked><span>ct is an overlay on dt</span> </label> <div class="row"> <label title="st, the sit timeline. Arrived. The shape pins to the mark and does nothing for this long, dead still. The fresh random roll for the NEXT playground happens the moment we arrive, invisibly, so the exit is always brand new.">st sit</label>- <span class="mark"><input type="range" id="l_st" min="0" max="5" step="0.1" value="0"><i class="livepip" id="lp4st"></i></span>- <output id="o_st">0.0s</output>+ <span class="mark"><input type="range" id="l_st" min="0" max="5" step="0.1" value="1"><i class="livepip" id="lp4st"></i></span>+ <output id="o_st">1.0s</output> </div> <label class="chk" title="Fade the flat teal logomark over the 3D during the sit: in across the first half of the sit, out across the second half."> <input type="checkbox" id="l_logoOn" checked><span>logo fade during the sit</span>@@ -487,13 +493,13 @@ </div> <div class="row"> <label title="Start the logo fade this many seconds BEFORE the sit begins, and let the fade-out run the same amount past its end. Negative means earlier. With sit at 0.0s this slider alone still creates a logo moment around the epoch instant.">logo lead</label>- <span class="mark"><input type="range" id="l_logoLead" min="-3" max="0" step="0.1" value="-1"><i class="livepip" id="lp4llead"></i></span>- <output id="o_logoLead">-1.0s</output>+ <span class="mark"><input type="range" id="l_logoLead" min="-3" max="0" step="0.1" value="-0.6"><i class="livepip" id="lp4llead"></i></span>+ <output id="o_logoLead">-0.6s</output> </div> <div class="row"> <label title="The dark negative lobe fades to the positive teal this many seconds before the epoch, and fades back the same amount after it, so the mark reads as one colour by the time the logo lands. Negative means earlier. At 0.0s the colour snaps exactly on the epoch.">teal lead</label>- <span class="mark"><input type="range" id="l_tealLead" min="-3" max="0" step="0.1" value="-1.5"><i class="livepip" id="lp4tlead"></i></span>- <output id="o_tealLead">-1.5s</output>+ <span class="mark"><input type="range" id="l_tealLead" min="-3" max="0" step="0.1" value="-0.2"><i class="livepip" id="lp4tlead"></i></span>+ <output id="o_tealLead">-0.2s</output> </div> <label class="chk" title="Draw the dashed logo vectors over the 3D as it steers in, for checking the match against the real mark. A debug aid: off is the clean look. Never shown during the intro."> <input type="checkbox" id="l_guides"><span>dashed logo guides</span>@@ -656,9 +662,14 @@ function setCamLive(on){ camLive = on; const w = document.getElementById('stageWrap'); if (w) w.classList.toggle('cam-live', on);- if (on) camera.attachControl(canvas, true); else camera.detachControl();+ /* noPreventDefault=false while armed: Babylon EATS wheel and pointer+ events, so the page cannot scroll underneath the zoom. Released, the+ camera is detached and the page gets everything back. */+ if (on) { camera.attachControl(canvas, false); canvas.focus(); }+ else { camera.detachControl(); canvas.blur(); } } camera.detachControl();+canvas.tabIndex = 0; // focusable, so arming truly takes focus canvas.addEventListener('pointerdown', () => setCamLive(true)); document.addEventListener('pointerdown', e => { if (camLive && e.target.closest && !e.target.closest('#stageWrap')) setCamLive(false);@@ -1457,7 +1468,7 @@ const SAY = { lSnapDel: () => ['Snapshot deleted', `${allSnaps().length} left · factory ones (*) ship with the page`], mLoop: () => ['Final', 'The final cut: teal intro, then play, dinner, cheat, sit, and back out, fresh roll every pass'], lRestart: () => ['Intro restarted', 'From the teal open'],- lDefaults:() => ['Loop defaults restored', 'john 1: pt 4.5s, dt 3s, ct 0.3s overlay, no sit, logo 100% on a 1s lead, teal lead 1.5s'],+ lDefaults:() => ['Loop defaults restored', 'john fav: pt 5s, dt 0.7s, ct 0.2s overlay, 1s sit, logo 100% on a 0.6s lead, teal lead 0.2s'], fDefaults:() => ['Defaults restored', 'Morph 2.6s each way, lead in and tail out 0.6s, ease 0.35, hold 1.0s, fill 50%'], }; document.addEventListener('click', e => {@@ -1831,7 +1842,7 @@ function driveFinal(dt){ const EPOCH_A = -Math.PI/2, EPOCH_B = Math.PI/2, EPOCH_R = 4.4; if (freeCam) { if (camK <= 0.001) {- if (camHeld) { if (camLive) camera.attachControl(canvas, true); camHeld = false; }+ if (camHeld) { if (camLive) camera.attachControl(canvas, false); camHeld = false; } userA = camera.alpha; userB = camera.beta; userR = camera.radius; } else { if (!camHeld) { camera.detachControl(); camHeld = true; }@@ -1842,7 +1853,7 @@ function driveFinal(dt){ camera.radius = userR + (EPOCH_R - userR) * camK; } } else {- if (camHeld) { if (camLive) camera.attachControl(canvas, true); camHeld = false; }+ if (camHeld) { if (camLive) camera.attachControl(canvas, false); camHeld = false; } const driftA = -Math.PI/2 + (camMotion ? Math.sin(tEvo*0.19)*0.55 : 0); const driftB = Math.PI/2 + (camMotion ? Math.sin(tEvo*0.13)*0.30 : 0); camera.alpha = driftA*(1-k) + EPOCH_A*k;@@ -1957,8 +1968,8 @@ function driveFinal(dt){ The whole thing opens with the teal intro: mark fades in alone, the 3D arrives underneath exactly on the epoch, mark lets go, loop runs. */ let loopMode=false, loopT=0, introT=0, inIntro=true, loopRolled=false;-let l_pt=4.5, l_dt=3, l_ct=0.3, l_ctOverlay=true, l_st=0; // john 1 ships as the default-let l_logoOn=true, l_logoPeak=1, l_logoLead=1, l_tealLead=1.5, l_guides=false; // leads kept positive+let l_pt=5, l_dt=0.7, l_ct=0.2, l_ctOverlay=true, l_st=1; // john fav ships as the default+let l_logoOn=true, l_logoPeak=1, l_logoLead=0.6, l_tealLead=0.2, l_guides=false; // leads kept positive let loopGains=null; function rollLoopGains(){ // tab 1's Randomise, verbatim@@ -2091,7 +2102,7 @@ function driveLoop(dt){ } /* ---- tab 4 controls ---- */-const LOOP_DEFAULTS={l_pt:4.5,l_dt:3,l_ct:0.3,l_st:0,l_logoPeak:1,l_logoLead:-1,l_tealLead:-1.5};+const LOOP_DEFAULTS={l_pt:5,l_dt:0.7,l_ct:0.2,l_st:1,l_logoPeak:1,l_logoLead:-0.6,l_tealLead:-0.2}; [['l_pt','o_pt',v=>{l_pt=v;return v.toFixed(1)+'s';}], ['l_dt','o_dt',v=>{l_dt=v;return v.toFixed(1)+'s';}], ['l_ct','o_ct',v=>{l_ct=v;return v.toFixed(1)+'s';}],@@ -2126,9 +2137,9 @@ const SNAP_KEY='orbital-lab-snapshots-v1'; including the wiki sandbox where there is no storage at all. Saved user snapshots live per browser origin and appear after these. */ const FACTORY_SNAPS = [- { name: 'john fav · pt5 dt0.7 ct0.2 st1', factory: true,+ { name: 'john fav · pt5 dt0.7 ct0.2 st1', factory: true, // the shipped default vals: { pt:5, dt:0.7, ct:0.2, ov:true, st:1, lo:true, lp:1, ll:0.6, tl:0.2, gd:false } },- { name: 'john 1 · pt4.5 dt3 ct0.3 st0', factory: true, // the shipped default+ { name: 'john 1 · pt4.5 dt3 ct0.3 st0', factory: true, vals: { pt:4.5, dt:3, ct:0.3, ov:true, st:0, lo:true, lp:1, ll:1, tl:1.5, gd:false } }, { name: 'snap 2 · pt5 dt1 ct0.2 st0', factory: true, vals: { pt:5, dt:1, ct:0.2, ov:true, st:0, lo:true, lp:1, ll:0.3, tl:1.5, gd:false } },@@ -2200,7 +2211,7 @@ document.getElementById('fFree').addEventListener('click', e => { camMotion = !freeCam; document.getElementById('fCam').classList.toggle('on', camMotion); document.getElementById('fCam').disabled = freeCam;- if (!freeCam && camHeld) { if (camLive) camera.attachControl(canvas, true); camHeld = false; }+ if (!freeCam && camHeld) { if (camLive) camera.attachControl(canvas, false); camHeld = false; } }); document.getElementById('fSpin').addEventListener('click', e => { spinOn = !spinOn; e.target.classList.toggle('on', spinOn);@@ -2598,7 +2609,7 @@ 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 21 KB. It boots instantly, which+ 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>@@ -2882,17 +2893,21 @@ 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, CAMR=R, FOV=0.8, ZN=0.1, ZF=100;-function setMVP2(w,h){+var R=4.4, CAMR=R, PANX=0, PANY=0, FOV=0.8, ZN=0.1, ZF=100;+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){+ r=(r===undefined)?CAMR:r; px=px||0; py=py||0;+ var m=proj(w,h); var A=ZF/(ZF-ZN), B=-ZN*ZF/(ZF-ZN);- // view: z' = z + CAMR (eye at -CAMR on z, LH)+ // view: 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,+ m.m0,0,0,0,+ 0,m.m5,0,0, 0,0,A,1,- 0,0,A*CAMR+B,CAMR+ -m.m0*px,-m.m5*py,A*r+B,r ])); } @@ -2949,6 +2964,26 @@ 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){+ /* Symmetric glide sized to cover the whole logo window, so the framing is+ exactly home while any part of the mark is showing, even at st=0 where+ the epoch is a single instant, and the user's zoom returns smoothly on+ the way out instead of snapping. */+ var RET=Math.max(0.6, LLEAD+0.2, Math.min(1.2,DT));+ camK = (t>=eS&&t<=eE) ? 1+ : (t>eS-RET&&t<eS) ? smooth((t-(eS-RET))/RET)+ : (t>eE&&t<eE+RET) ? smooth(1-(t-eE)/RET)+ : 0;+ effR=CAMR+(R-CAMR)*camK; effPX=PANX*(1-camK); effPY=PANY*(1-camK);+ } else { effR=R; effPX=0; effPY=0; }+ setMVP2(W,H,effR,effPX,effPY);+ 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{@@ -2972,8 +3007,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*(R/CAMR);- 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;@@ -2991,6 +3029,11 @@ requestAnimationFrame(frame); zoom; click is released on window blur (clicking outside the iframe). */ if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT){ var live=false;+ 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);'+@@ -3002,17 +3045,23 @@ if (Q.get('interact')==='1' || window.__ADOM_LOADER_INTERACT document.addEventListener('mouseenter',function(){ if(!live) hint.style.opacity='1'; }); document.addEventListener('mouseleave',function(){ hint.style.opacity='0'; }); document.addEventListener('pointerdown',function(){- live=true; document.body.style.cursor='default';+ live=true; edge.style.opacity='1'; document.body.style.cursor='default'; hint.textContent='scroll to zoom'; hint.style.color='#00b8b0'; hint.style.opacity='1'; setTimeout(function(){ hint.style.opacity='0'; },1400); });- window.addEventListener('blur',function(){ live=false; document.body.style.cursor='pointer';+ 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();- CAMR=Math.max(2.4,Math.min(9,CAMR*(1+(e.deltaY>0?0.08:-0.08))));- setMVP2(W,H);+ if(window.__cam && window.__cam.k>0) 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; },{passive:false}); } </script>