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.5
6 files changed
+197−71
README.md+6−5@@ -43,15 +43,16 @@ state is rolled at every epoch. | param | default | meaning | |---|---|---|-| pt | 5 | playground seconds of free evolution between epochs |-| dt | 0.7 | seconds to steer onto the mark, and back out |-| ct | 0.2 | seconds before the epoch the outline cheat fades in |+| pt | 4.5 | playground seconds of free evolution between epochs |+| dt | 3 | seconds to steer onto the mark, and back out |+| ct | 0.3 | seconds before the epoch the outline cheat fades in | | st | 0 | seconds the mark is held dead still |-| logo | 80 | peak opacity of the flat teal mark, in percent |-| llead | 0.5 | seconds the logo fade starts before the sit and ends after it |+| logo | 100 | peak opacity of the flat teal mark, in percent |+| llead | 1 | seconds the logo fade starts before the sit and ends after it | | tlead | 1.5 | seconds before the epoch the dark lobe fades to teal | | ov | 1 | 0 makes the cheat its own act after the steer | | intro | 1 | 0 skips the teal logo intro |+| interact | 0 | 1 arms click-to-zoom (previews and demos, never load screens) | ## Rebuilding
loader.html+38−7@@ -19,9 +19,9 @@ 'use strict'; var Q=new URLSearchParams(location.search); function P(k,d){var v=parseFloat(Q.get(k));return isFinite(v)?v:d;}-var PT=P('pt',5), DT=P('dt',0.7), CT=P('ct',0.2), ST=P('st',0);-var LOGO_PK=Math.max(0,Math.min(1,P('logo',80)/100));-var LLEAD=Math.abs(P('llead',0.5)), TLEAD=Math.abs(P('tlead',1.5));+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]; @@ -219,17 +219,17 @@ 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, CAMR=R, FOV=0.8, ZN=0.1, ZF=100; function setMVP2(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; 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: z' = z + CAMR (eye at -CAMR 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+ 0,0,A*CAMR+B,CAMR ])); } @@ -309,7 +309,7 @@ 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;+ var s=Math.min(ovc.width,ovc.height)*0.34*(R/CAMR); ox.save();ox.translate(ovc.width/2,ovc.height/2); ox.globalAlpha=fill;ox.fillStyle='#00b8b0'; for(var p2=0;p2<PATHS.length;p2++){var pts=PATHS[p2];ox.beginPath();@@ -321,6 +321,37 @@ 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;+ 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);+ document.body.style.cursor='pointer';+ 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';+ 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';+ 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);+ },{passive:false});+} </script> </body> </html>
orbital-lab.html+52−21@@ -212,6 +212,17 @@ /* 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}+ .stage-hint{+ position:absolute;left:50%;bottom:44px;transform:translateX(-50%);+ padding:6px 13px;border-radius:var(--r-pill);+ background:rgba(13,17,23,.78);border:1px solid var(--border);+ font-family:'JetBrains Mono','DM Mono',monospace;font-size:10px;letter-spacing:.05em;+ color:var(--text-2);pointer-events:none;opacity:0;transition:opacity .2s ease;+ }+ #stageWrap:hover .stage-hint{opacity:1}+ #stageWrap.cam-live .stage-hint{opacity:0}+ #stageWrap.cam-live:hover .stage-hint.live{opacity:1;color:var(--accent)} .led-stack{position:absolute;left:18px;top:44px;display:flex;flex-direction:column;gap:6px;align-items:flex-start} .led-badge{ display:flex;align-items:center;gap:9px;@@ -439,18 +450,18 @@ </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="5"><i class="livepip" id="lp4pt"></i></span>- <output id="o_pt">5.0s</output>+ <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> </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="0.7"><i class="livepip" id="lp4dt"></i></span>- <output id="o_dt">0.7s</output>+ <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> </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.2"><i class="livepip" id="lp4ct"></i></span>- <output id="o_ct">0.2s</output>+ <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> </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>@@ -465,13 +476,13 @@ </label> <div class="row"> <label title="Peak opacity the logo fade reaches, halfway through the sit. 0% never shows it, 100% fully covers the shading.">logo peak</label>- <span class="mark"><input type="range" id="l_logoPeak" min="0" max="1" step="0.01" value="0.8"><i class="livepip" id="lp4peak"></i></span>- <output id="o_logoPeak">80%</output>+ <span class="mark"><input type="range" id="l_logoPeak" min="0" max="1" step="0.01" value="1"><i class="livepip" id="lp4peak"></i></span>+ <output id="o_logoPeak">100%</output> </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="-0.5"><i class="livepip" id="lp4llead"></i></span>- <output id="o_logoLead">-0.5s</output>+ <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> </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>@@ -554,6 +565,8 @@ <canvas id="stage"></canvas> <canvas id="ghost"></canvas> <div class="toast-wrap" id="toasts"></div>+ <div class="stage-hint">click to zoom and orbit</div>+ <div class="stage-hint live">interactive · click outside to release</div> <div class="led-stack" id="ledBadge" style="display:none"> <div class="led-badge" id="ledMorphBadge" title="Manipulating WHICH state: the coefficients are pulled toward the 2p target. The points are still computed from the equation, so the surface is a real orbital, just not the one free evolution would have reached."> <span class="led" id="ledMorph"></span>@@ -621,6 +634,24 @@ const camera = new BABYLON.ArcRotateCamera('cam', -Math.PI/2, Math.PI/2.4, 4.4, BABYLON.Vector3.Zero(), scene); camera.attachControl(canvas, true); camera.zoomToMouseLocation = true;+/* Click-to-interact: embedded in a scrolling page, a permanently-attached+ camera hijacks the wheel and page scrolling dies over the viewer. So the+ camera is DETACHED until the viewer is clicked, and released again the+ moment anything outside it is clicked. camLive gates every attach the+ drive paths make too. */+let camLive = false;+function setCamLive(on){+ if (camLive === on) return;+ camLive = on;+ const w = document.getElementById('stageWrap');+ if (w) w.classList.toggle('cam-live', on);+ if (on) camera.attachControl(canvas, true); else camera.detachControl();+}+camera.detachControl();+canvas.addEventListener('pointerdown', () => setCamLive(true));+document.addEventListener('pointerdown', e => {+ if (camLive && e.target.closest && !e.target.closest('#stageWrap')) setCamLive(false);+}, true); camera.lowerRadiusLimit = 2.0; camera.upperRadiusLimit = 14; camera.wheelDeltaPercentage = 0.012;@@ -1416,7 +1447,7 @@ const SAY = { lSnapDel: () => ['Snapshot deleted', `${allSnaps().length} left · factory ones (*) ship with the page`], mLoop: () => ['Loop', 'The directed 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', 'The tuned cut: pt 5s, dt 0.7s, ct 0.2s overlay, no sit, logo 80% on a 0.5s lead, teal lead 1.5s'],+ 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'], 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 => {@@ -1790,7 +1821,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) { camera.attachControl(canvas, true); camHeld = false; }+ if (camHeld) { if (camLive) camera.attachControl(canvas, true); camHeld = false; } userA = camera.alpha; userB = camera.beta; userR = camera.radius; } else { if (!camHeld) { camera.detachControl(); camHeld = true; }@@ -1801,7 +1832,7 @@ function driveFinal(dt){ camera.radius = userR + (EPOCH_R - userR) * camK; } } else {- if (camHeld) { camera.attachControl(canvas, true); camHeld = false; }+ if (camHeld) { if (camLive) camera.attachControl(canvas, true); 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;@@ -1916,8 +1947,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=5, l_dt=0.7, l_ct=0.2, l_ctOverlay=true, l_st=0; // John's tuned numbers ship as the defaults-let l_logoOn=true, l_logoPeak=0.8, l_logoLead=0.5, l_tealLead=1.5, l_guides=false; // leads kept positive+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 loopGains=null; function rollLoopGains(){ // tab 1's Randomise, verbatim@@ -2050,7 +2081,7 @@ function driveLoop(dt){ } /* ---- tab 4 controls ---- */-const LOOP_DEFAULTS={l_pt:5,l_dt:0.7,l_ct:0.2,l_st:0,l_logoPeak:0.8,l_logoLead:-0.5,l_tealLead:-1.5};+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}; [['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';}],@@ -2085,12 +2116,12 @@ 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: 'snap 3 · pt5 dt0.7 ct0.2 st0', factory: true, // the shipped defaults- vals: { pt:5, dt:0.7, ct:0.2, ov:true, st:0, lo:true, lp:0.8, ll:0.5, tl:1.5, gd:false } },+ { name: 'john 1 · pt4.5 dt3 ct0.3 st0', factory: true, // the shipped default+ 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 } },- { 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 3 · pt5 dt0.7 ct0.2 st0', factory: true,+ vals: { pt:5, dt:0.7, ct:0.2, ov:true, st:0, lo:true, lp:0.8, ll:0.5, tl:1.5, gd:false } } ]; function allSnaps(){ const stored = loadSnaps().filter(s => !FACTORY_SNAPS.some(f => f.name === s.name));@@ -2157,7 +2188,7 @@ document.getElementById('fFree').addEventListener('click', e => { camMotion = !freeCam; document.getElementById('fCam').classList.toggle('on', camMotion); document.getElementById('fCam').disabled = freeCam;- if (!freeCam && camHeld) { camera.attachControl(canvas, true); camHeld = false; }+ if (!freeCam && camHeld) { if (camLive) camera.attachControl(canvas, true); 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.4",+ "version": "1.0.5", "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.4",+ "version": "1.0.5", "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+99−36@@ -218,6 +218,17 @@ /* 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}+ .stage-hint{+ position:absolute;left:50%;bottom:44px;transform:translateX(-50%);+ padding:6px 13px;border-radius:var(--r-pill);+ background:rgba(13,17,23,.78);border:1px solid var(--border);+ font-family:'JetBrains Mono','DM Mono',monospace;font-size:10px;letter-spacing:.05em;+ color:var(--text-2);pointer-events:none;opacity:0;transition:opacity .2s ease;+ }+ #stageWrap:hover .stage-hint{opacity:1}+ #stageWrap.cam-live .stage-hint{opacity:0}+ #stageWrap.cam-live:hover .stage-hint.live{opacity:1;color:var(--accent)} .led-stack{position:absolute;left:18px;top:44px;display:flex;flex-direction:column;gap:6px;align-items:flex-start} .led-badge{ display:flex;align-items:center;gap:9px;@@ -445,18 +456,18 @@ </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="5"><i class="livepip" id="lp4pt"></i></span>- <output id="o_pt">5.0s</output>+ <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> </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="0.7"><i class="livepip" id="lp4dt"></i></span>- <output id="o_dt">0.7s</output>+ <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> </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.2"><i class="livepip" id="lp4ct"></i></span>- <output id="o_ct">0.2s</output>+ <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> </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>@@ -471,13 +482,13 @@ </label> <div class="row"> <label title="Peak opacity the logo fade reaches, halfway through the sit. 0% never shows it, 100% fully covers the shading.">logo peak</label>- <span class="mark"><input type="range" id="l_logoPeak" min="0" max="1" step="0.01" value="0.8"><i class="livepip" id="lp4peak"></i></span>- <output id="o_logoPeak">80%</output>+ <span class="mark"><input type="range" id="l_logoPeak" min="0" max="1" step="0.01" value="1"><i class="livepip" id="lp4peak"></i></span>+ <output id="o_logoPeak">100%</output> </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="-0.5"><i class="livepip" id="lp4llead"></i></span>- <output id="o_logoLead">-0.5s</output>+ <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> </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>@@ -560,6 +571,8 @@ <canvas id="stage"></canvas> <canvas id="ghost"></canvas> <div class="toast-wrap" id="toasts"></div>+ <div class="stage-hint">click to zoom and orbit</div>+ <div class="stage-hint live">interactive · click outside to release</div> <div class="led-stack" id="ledBadge" style="display:none"> <div class="led-badge" id="ledMorphBadge" title="Manipulating WHICH state: the coefficients are pulled toward the 2p target. The points are still computed from the equation, so the surface is a real orbital, just not the one free evolution would have reached."> <span class="led" id="ledMorph"></span>@@ -632,6 +645,24 @@ const camera = new BABYLON.ArcRotateCamera('cam', -Math.PI/2, Math.PI/2.4, 4.4, BABYLON.Vector3.Zero(), scene); camera.attachControl(canvas, true); camera.zoomToMouseLocation = true;+/* Click-to-interact: embedded in a scrolling page, a permanently-attached+ camera hijacks the wheel and page scrolling dies over the viewer. So the+ camera is DETACHED until the viewer is clicked, and released again the+ moment anything outside it is clicked. camLive gates every attach the+ drive paths make too. */+let camLive = false;+function setCamLive(on){+ if (camLive === on) return;+ camLive = on;+ const w = document.getElementById('stageWrap');+ if (w) w.classList.toggle('cam-live', on);+ if (on) camera.attachControl(canvas, true); else camera.detachControl();+}+camera.detachControl();+canvas.addEventListener('pointerdown', () => setCamLive(true));+document.addEventListener('pointerdown', e => {+ if (camLive && e.target.closest && !e.target.closest('#stageWrap')) setCamLive(false);+}, true); camera.lowerRadiusLimit = 2.0; camera.upperRadiusLimit = 14; camera.wheelDeltaPercentage = 0.012;@@ -1426,7 +1457,7 @@ const SAY = { lSnapDel: () => ['Snapshot deleted', `${allSnaps().length} left · factory ones (*) ship with the page`], mLoop: () => ['Loop', 'The directed 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', 'The tuned cut: pt 5s, dt 0.7s, ct 0.2s overlay, no sit, logo 80% on a 0.5s lead, teal lead 1.5s'],+ 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'], 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 => {@@ -1800,7 +1831,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) { camera.attachControl(canvas, true); camHeld = false; }+ if (camHeld) { if (camLive) camera.attachControl(canvas, true); camHeld = false; } userA = camera.alpha; userB = camera.beta; userR = camera.radius; } else { if (!camHeld) { camera.detachControl(); camHeld = true; }@@ -1811,7 +1842,7 @@ function driveFinal(dt){ camera.radius = userR + (EPOCH_R - userR) * camK; } } else {- if (camHeld) { camera.attachControl(canvas, true); camHeld = false; }+ if (camHeld) { if (camLive) camera.attachControl(canvas, true); 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;@@ -1926,8 +1957,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=5, l_dt=0.7, l_ct=0.2, l_ctOverlay=true, l_st=0; // John's tuned numbers ship as the defaults-let l_logoOn=true, l_logoPeak=0.8, l_logoLead=0.5, l_tealLead=1.5, l_guides=false; // leads kept positive+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 loopGains=null; function rollLoopGains(){ // tab 1's Randomise, verbatim@@ -2060,7 +2091,7 @@ function driveLoop(dt){ } /* ---- tab 4 controls ---- */-const LOOP_DEFAULTS={l_pt:5,l_dt:0.7,l_ct:0.2,l_st:0,l_logoPeak:0.8,l_logoLead:-0.5,l_tealLead:-1.5};+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}; [['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';}],@@ -2095,12 +2126,12 @@ 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: 'snap 3 · pt5 dt0.7 ct0.2 st0', factory: true, // the shipped defaults- vals: { pt:5, dt:0.7, ct:0.2, ov:true, st:0, lo:true, lp:0.8, ll:0.5, tl:1.5, gd:false } },+ { name: 'john 1 · pt4.5 dt3 ct0.3 st0', factory: true, // the shipped default+ 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 } },- { 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 3 · pt5 dt0.7 ct0.2 st0', factory: true,+ vals: { pt:5, dt:0.7, ct:0.2, ov:true, st:0, lo:true, lp:0.8, ll:0.5, tl:1.5, gd:false } } ]; function allSnaps(){ const stored = loadSnaps().filter(s => !FACTORY_SNAPS.some(f => f.name === s.name));@@ -2167,7 +2198,7 @@ document.getElementById('fFree').addEventListener('click', e => { camMotion = !freeCam; document.getElementById('fCam').classList.toggle('on', camMotion); document.getElementById('fCam').disabled = freeCam;- if (!freeCam && camHeld) { camera.attachControl(canvas, true); camHeld = false; }+ if (!freeCam && camHeld) { if (camLive) camera.attachControl(canvas, true); camHeld = false; } }); document.getElementById('fSpin').addEventListener('click', e => { spinOn = !spinOn; e.target.classList.toggle('on', spinOn);@@ -2565,7 +2596,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 19 KB. It boots instantly, which+ raw WebGL, no Babylon, no CDN, no fonts, no fetch, about 21 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>@@ -2579,15 +2610,16 @@ window.__lab = { push, zeros, HARMONICS, setAnim:v=>{animate=v;} }; <h3>Parameters</h3> <table> <tr><th>param</th><th>default</th><th>meaning</th></tr>- <tr><td>pt</td><td>5</td><td>playground seconds of free evolution between epochs</td></tr>- <tr><td>dt</td><td>0.7</td><td>seconds to steer onto the mark, and back out</td></tr>- <tr><td>ct</td><td>0.2</td><td>seconds before the epoch the outline cheat fades in</td></tr>+ <tr><td>pt</td><td>4.5</td><td>playground seconds of free evolution between epochs</td></tr>+ <tr><td>dt</td><td>3</td><td>seconds to steer onto the mark, and back out</td></tr>+ <tr><td>ct</td><td>0.3</td><td>seconds before the epoch the outline cheat fades in</td></tr> <tr><td>st</td><td>0</td><td>seconds the mark is held dead still</td></tr>- <tr><td>logo</td><td>80</td><td>peak opacity of the flat teal mark, in percent</td></tr>- <tr><td>llead</td><td>0.5</td><td>seconds the logo fade starts before the sit and ends after it</td></tr>+ <tr><td>logo</td><td>100</td><td>peak opacity of the flat teal mark, in percent</td></tr>+ <tr><td>llead</td><td>1</td><td>seconds the logo fade starts before the sit and ends after it</td></tr> <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> </table> <h3>Live preview</h3> <iframe class="prev" srcdoc="<!DOCTYPE html>@@ -2608,12 +2640,12 @@ window.__lab = { push, zeros, HARMONICS, setAnim:v=>{animate=v;} }; <script> /* The Adom logomark is a hydrogen 2p orbital: psi = (2p_x + 2p_y)/sqrt(2). This file is the wiki page adom/orbital-lab distilled to a loader. */-'use strict';+'use strict';window.__ADOM_LOADER_INTERACT=1; var Q=new URLSearchParams(location.search); function P(k,d){var v=parseFloat(Q.get(k));return isFinite(v)?v:d;}-var PT=P('pt',5), DT=P('dt',0.7), CT=P('ct',0.2), ST=P('st',0);-var LOGO_PK=Math.max(0,Math.min(1,P('logo',80)/100));-var LLEAD=Math.abs(P('llead',0.5)), TLEAD=Math.abs(P('tlead',1.5));+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]; @@ -2811,17 +2843,17 @@ 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, CAMR=R, FOV=0.8, ZN=0.1, ZF=100; function setMVP2(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; 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: z' = z + CAMR (eye at -CAMR 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+ 0,0,A*CAMR+B,CAMR ])); } @@ -2901,7 +2933,7 @@ 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;+ var s=Math.min(ovc.width,ovc.height)*0.34*(R/CAMR); ox.save();ox.translate(ovc.width/2,ovc.height/2); ox.globalAlpha=fill;ox.fillStyle='#00b8b0'; for(var p2=0;p2<PATHS.length;p2++){var pts=PATHS[p2];ox.beginPath();@@ -2913,11 +2945,42 @@ 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;+ 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);+ document.body.style.cursor='pointer';+ 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';+ 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';+ 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);+ },{passive:false});+} </script> </body> </html> "></iframe>- <p>This preview IS loader.html, inlined. What you embed is exactly what you see.</p>+ <p>This preview IS loader.html, inlined. What you embed is exactly what you see. Click it once and your wheel zooms; click anywhere else to give the wheel back to the page.</p> </div> <script> /* The wiki parent listens for {type:'readme-height'} and resizes this iframe