← Commit history

Publish 1.0.2

John Lauer ·f5f7aba9ee · ·parent 08029c7
4 files changed +64−26
orbital-lab.html+31−12
@@ -1411,8 +1411,9 @@ const SAY = {   fWanderAll:() => ['All 16 in the pool', 'Every harmonic can appear in a roll'],   fWanderNoF:() => ['f shell excluded', 'The nine remaining harmonics stay in the pool'],   fWanderP: () => ['p shell only', 'Rolls stay in the shell the logo itself lives in, so they never stray far'],-  lSnapSave:() => ['Snapshot saved', (loadSnaps().slice(-1)[0]||{}).name || 'stored'],-  lSnapDel: () => ['Snapshot deleted', `${loadSnaps().length} remaining in the pulldown`],+  lSnapSave:() => lsOK ? ['Snapshot saved', (loadSnaps().slice(-1)[0]||{}).name || 'stored']+                       : ['No storage on this surface', 'The wiki sandbox cannot save. Factory snapshots still apply; tune and save on the lab page.'],+  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', 'pt 10s, dt 3s, ct 1.5s as overlay, sit 1s, logo on at 50%, teal lead -1.5s'],@@ -2080,6 +2081,17 @@ document.getElementById('l_guides').addEventListener('change',e=>{ l_guides=e.ta    pulldown. Stored separately from the auto-persist, so clearing one never    touches the other. ---- */ const SNAP_KEY='orbital-lab-snapshots-v1';+/* Factory snapshots ship IN the page, so they exist on every surface,+   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 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 } }+];+function allSnaps(){+  const stored = loadSnaps().filter(s => !FACTORY_SNAPS.some(f => f.name === s.name));+  return FACTORY_SNAPS.concat(stored);+} function snapVals(){ return { pt:l_pt, dt:l_dt, ct:l_ct, ov:l_ctOverlay, st:l_st,   lo:l_logoOn, lp:l_logoPeak, ll:l_logoLead, tl:l_tealLead, gd:l_guides }; } function loadSnaps(){ try{ return JSON.parse(localStorage.getItem(SNAP_KEY)||'[]'); }catch(e){ return []; } }@@ -2095,23 +2107,30 @@ function applySnap(v){   const gd=document.getElementById('l_guides'); gd.checked=!!v.gd; gd.dispatchEvent(new Event('change')); } function refreshSnapList(sel){-  const el=document.getElementById('l_snaps'); const snaps=loadSnaps();-  el.innerHTML = '<option value="">saved snapshots (' + snaps.length + ')</option>' +-    snaps.map((s,i)=>`<option value="${i}"${i===sel?' selected':''}>${s.name}</option>`).join('');+  const el=document.getElementById('l_snaps'); const snaps=allSnaps();+  const head = lsOK ? 'snapshots (' + snaps.length + ')'+                    : 'snapshots · no storage on this surface';+  el.innerHTML = '<option value="">' + head + '</option>' ++    snaps.map((s,i)=>`<option value="${i}"${i===sel?' selected':''}>${s.name}${s.factory?' *':''}</option>`).join(''); } document.getElementById('lSnapSave').addEventListener('click',()=>{-  const snaps=loadSnaps();-  const name=`snap ${snaps.length+1} · pt${l_pt} dt${l_dt} ct${l_ct}${l_ctOverlay?'':' seq'} st${l_st}`;-  snaps.push({ name, vals:snapVals() });-  saveSnaps(snaps); refreshSnapList(snaps.length-1);+  if (!lsOK) return;                       // the SAY toast explains why+  const stored=loadSnaps();+  const name=`snap ${allSnaps().length+1} · pt${l_pt} dt${l_dt} ct${l_ct}${l_ctOverlay?'':' seq'} st${l_st}`;+  stored.push({ name, vals:snapVals() });+  saveSnaps(stored); refreshSnapList(allSnaps().length-1); }); document.getElementById('lSnapDel').addEventListener('click',()=>{   const el=document.getElementById('l_snaps'); const i=parseInt(el.value,10);-  const snaps=loadSnaps(); if (isNaN(i)||!snaps[i]) return;-  snaps.splice(i,1); saveSnaps(snaps); refreshSnapList();+  const snaps=allSnaps(); if (isNaN(i)||!snaps[i]) return;+  if (snaps[i].factory) return;            // ships with the page, cannot be deleted+  const stored=loadSnaps();+  const j=stored.findIndex(s=>s.name===snaps[i].name);+  if (j>=0){ stored.splice(j,1); saveSnaps(stored); }+  refreshSnapList(); }); document.getElementById('l_snaps').addEventListener('change',e=>{-  const i=parseInt(e.target.value,10); const snaps=loadSnaps();+  const i=parseInt(e.target.value,10); const snaps=allSnaps();   if (isNaN(i)||!snaps[i]) return;   applySnap(snaps[i].vals);   toast('Snapshot applied', snaps[i].name, { duration:2400 });
package.json+1−1
@@ -2,7 +2,7 @@   "slug": "orbital-lab",   "title": "Orbital Lab",   "type": "app",-  "version": "1.0.1",+  "version": "1.0.2",   "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.1",+  "version": "1.0.2",   "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+31−12
@@ -1421,8 +1421,9 @@ const SAY = {   fWanderAll:() => ['All 16 in the pool', 'Every harmonic can appear in a roll'],   fWanderNoF:() => ['f shell excluded', 'The nine remaining harmonics stay in the pool'],   fWanderP: () => ['p shell only', 'Rolls stay in the shell the logo itself lives in, so they never stray far'],-  lSnapSave:() => ['Snapshot saved', (loadSnaps().slice(-1)[0]||{}).name || 'stored'],-  lSnapDel: () => ['Snapshot deleted', `${loadSnaps().length} remaining in the pulldown`],+  lSnapSave:() => lsOK ? ['Snapshot saved', (loadSnaps().slice(-1)[0]||{}).name || 'stored']+                       : ['No storage on this surface', 'The wiki sandbox cannot save. Factory snapshots still apply; tune and save on the lab page.'],+  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', 'pt 10s, dt 3s, ct 1.5s as overlay, sit 1s, logo on at 50%, teal lead -1.5s'],@@ -2090,6 +2091,17 @@ document.getElementById('l_guides').addEventListener('change',e=>{ l_guides=e.ta    pulldown. Stored separately from the auto-persist, so clearing one never    touches the other. ---- */ const SNAP_KEY='orbital-lab-snapshots-v1';+/* Factory snapshots ship IN the page, so they exist on every surface,+   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 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 } }+];+function allSnaps(){+  const stored = loadSnaps().filter(s => !FACTORY_SNAPS.some(f => f.name === s.name));+  return FACTORY_SNAPS.concat(stored);+} function snapVals(){ return { pt:l_pt, dt:l_dt, ct:l_ct, ov:l_ctOverlay, st:l_st,   lo:l_logoOn, lp:l_logoPeak, ll:l_logoLead, tl:l_tealLead, gd:l_guides }; } function loadSnaps(){ try{ return JSON.parse(localStorage.getItem(SNAP_KEY)||'[]'); }catch(e){ return []; } }@@ -2105,23 +2117,30 @@ function applySnap(v){   const gd=document.getElementById('l_guides'); gd.checked=!!v.gd; gd.dispatchEvent(new Event('change')); } function refreshSnapList(sel){-  const el=document.getElementById('l_snaps'); const snaps=loadSnaps();-  el.innerHTML = '<option value="">saved snapshots (' + snaps.length + ')</option>' +-    snaps.map((s,i)=>`<option value="${i}"${i===sel?' selected':''}>${s.name}</option>`).join('');+  const el=document.getElementById('l_snaps'); const snaps=allSnaps();+  const head = lsOK ? 'snapshots (' + snaps.length + ')'+                    : 'snapshots · no storage on this surface';+  el.innerHTML = '<option value="">' + head + '</option>' ++    snaps.map((s,i)=>`<option value="${i}"${i===sel?' selected':''}>${s.name}${s.factory?' *':''}</option>`).join(''); } document.getElementById('lSnapSave').addEventListener('click',()=>{-  const snaps=loadSnaps();-  const name=`snap ${snaps.length+1} · pt${l_pt} dt${l_dt} ct${l_ct}${l_ctOverlay?'':' seq'} st${l_st}`;-  snaps.push({ name, vals:snapVals() });-  saveSnaps(snaps); refreshSnapList(snaps.length-1);+  if (!lsOK) return;                       // the SAY toast explains why+  const stored=loadSnaps();+  const name=`snap ${allSnaps().length+1} · pt${l_pt} dt${l_dt} ct${l_ct}${l_ctOverlay?'':' seq'} st${l_st}`;+  stored.push({ name, vals:snapVals() });+  saveSnaps(stored); refreshSnapList(allSnaps().length-1); }); document.getElementById('lSnapDel').addEventListener('click',()=>{   const el=document.getElementById('l_snaps'); const i=parseInt(el.value,10);-  const snaps=loadSnaps(); if (isNaN(i)||!snaps[i]) return;-  snaps.splice(i,1); saveSnaps(snaps); refreshSnapList();+  const snaps=allSnaps(); if (isNaN(i)||!snaps[i]) return;+  if (snaps[i].factory) return;            // ships with the page, cannot be deleted+  const stored=loadSnaps();+  const j=stored.findIndex(s=>s.name===snaps[i].name);+  if (j>=0){ stored.splice(j,1); saveSnaps(stored); }+  refreshSnapList(); }); document.getElementById('l_snaps').addEventListener('change',e=>{-  const i=parseInt(e.target.value,10); const snaps=loadSnaps();+  const i=parseInt(e.target.value,10); const snaps=allSnaps();   if (isNaN(i)||!snaps[i]) return;   applySnap(snaps[i].vals);   toast('Snapshot applied', snaps[i].name, { duration:2400 });