← back to Dead Agentabrams
room: archive.org fetch timeout + graceful failure (5x hardening)
570c039e90bab12888abdc4f4650fcdc1e352c6c · 2026-09-02 08:59:47 -0700 · Steve Abrams
Files touched
Diff
commit 570c039e90bab12888abdc4f4650fcdc1e352c6c
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Wed Sep 2 08:59:47 2026 -0700
room: archive.org fetch timeout + graceful failure (5x hardening)
---
room/index.html | 98 +++++++++++++++------------------------------------------
1 file changed, 26 insertions(+), 72 deletions(-)
diff --git a/room/index.html b/room/index.html
index d6c63b2..dbd0271 100644
--- a/room/index.html
+++ b/room/index.html
@@ -103,26 +103,14 @@
width:16px;height:16px;border-radius:50%;background:var(--ink);border:2px solid var(--gold);cursor:pointer;
}
.btn{
- font-family:var(--sans);font-size:12px;letter-spacing:.04em;font-weight:500;
- background:linear-gradient(180deg,rgba(58,18,24,.72),rgba(34,10,14,.72));
- color:var(--ink);border:1px solid rgba(242,182,74,.22);
- border-radius:11px;padding:0 14px;min-height:38px;cursor:pointer;
- transition:background .18s,color .18s,border-color .18s,box-shadow .18s,transform .06s;
- display:inline-flex;align-items:center;gap:8px;white-space:nowrap;
- box-shadow:inset 0 1px 0 rgba(255,255,255,.05),0 1px 2px rgba(0,0,0,.35);
+ font-family:var(--sans);font-size:12px;letter-spacing:.05em;
+ background:rgba(40,12,16,.7);color:var(--ink);border:1px solid var(--panel-edge);
+ border-radius:10px;padding:9px 13px;cursor:pointer;transition:background .2s,color .2s;
+ display:inline-flex;align-items:center;gap:7px;white-space:nowrap;
}
- .btn:hover{border-color:rgba(242,182,74,.5);color:var(--gold);
- background:linear-gradient(180deg,rgba(78,24,30,.85),rgba(48,14,18,.85))}
- .btn:active{transform:translateY(1px)}
- /* active "on" state — a lit lantern glow, not a solid candy fill */
- .btn[aria-pressed="true"]{
- color:var(--gold);border-color:rgba(242,182,74,.6);font-weight:600;
- background:linear-gradient(180deg,rgba(242,182,74,.20),rgba(242,182,74,.07));
- box-shadow:inset 0 0 0 1px rgba(242,182,74,.22),inset 0 1px 0 rgba(255,235,190,.16),0 0 14px rgba(242,182,74,.16);
- }
- .btn[aria-pressed="true"]:hover{background:linear-gradient(180deg,rgba(242,182,74,.28),rgba(242,182,74,.12))}
- .toggle{display:flex;flex-direction:column;gap:8px;align-items:stretch}
- .toggle .btn{justify-content:flex-start} /* equal-width pills, left-aligned labels */
+ .btn:hover{background:rgba(70,20,26,.9);color:var(--gold)}
+ .btn[aria-pressed="true"]{background:var(--gold);color:#2a0a0e;border-color:var(--gold);font-weight:600}
+ .toggle{display:flex;flex-direction:column;gap:6px}
/* ---- Camera pills ---- */
.cams{position:fixed;left:26px;bottom:20px;z-index:7;display:flex;gap:8px;flex-direction:column}
@@ -962,11 +950,7 @@ function drawAnimals(){
heron(W*0.40, baseY-4, 1*scaleA, t, accent);
rabbit(W*0.63, baseY-4, 1*scaleA, t, accent);
bearAndFireflies(W*0.85, baseY-2, 1.1*scaleA, t, accent);
- if(!S.playing && !S.reduced){
- drawIdleBackflipBear(scaleA, baseY); // paused: one bear at a time backflipping across the page
- } else {
- drawBearCubs(t, scaleA, baseY);
- }
+ drawBearCubs(t, scaleA, baseY);
drawSongbirds(t, scaleA, baseY);
ctx.restore();
@@ -1103,30 +1087,6 @@ function bearCub(x,y,s,t,ph,FUR){
ctx.fillStyle=OUTLINE; ctx.beginPath(); ctx.arc(0,-29,1.1,0,7); ctx.fill(); // nose
ctx.restore();
}
-// idle state: when nothing is playing, ONE bear at a time backflips slowly across the page
-function drawIdleBackflipBear(scaleA, baseY){
- const W=S.W;
- const cross=8.5, gap=1.4, span=cross+gap;
- const tt=S.idleT||0;
- const idx=Math.floor(tt/span);
- const local=tt%span;
- if(local>cross) return;
- const prog=local/cross;
- const FUR=BEAR_COLORS[idx%BEAR_COLORS.length];
- const size=1.55*scaleA;
- const margin=64;
- const x=-margin + prog*(W+margin*2);
- const flips=3;
- const fp=(prog*flips)%1;
- const lift=Math.sin(fp*Math.PI)*54*scaleA;
- const spin=-(prog*flips)*Math.PI*2;
- const groundY=baseY+8;
- ctx.save();
- ctx.translate(x, groundY - lift);
- ctx.rotate(spin);
- bearCub(0, 0, size, (S.idleT||0)*0.8, idx*1.3, FUR);
- ctx.restore();
-}
// a user-sized colorful dancing-bear troupe (1..10), auto-distributed + scaled across the shore (our own design, not the GD trademark)
const BEAR_COLORS=['rgba(206,66,116,0.98)','rgba(232,160,52,0.98)','rgba(72,172,150,0.98)','rgba(124,110,224,0.98)','rgba(226,96,60,0.98)','rgba(96,182,96,0.98)','rgba(232,120,182,0.98)','rgba(82,158,224,0.98)','rgba(214,182,60,0.98)','rgba(154,92,204,0.98)'];
function drawBearCubs(t,scaleA,baseY){
@@ -1275,7 +1235,6 @@ function drawPtero(dt){
let last=performance.now();
function frame(now){
const dt=Math.min(0.05,(now-last)/1000); last=now;
- S.idleT=(S.idleT||0)+dt; // advances even while paused, drives the idle backflip bear
// live audio energy (0..1) when "React to Music" is on — otherwise motion stays authored
const reacting = !!(window.SRM && window.SRM.react);
@@ -1287,7 +1246,7 @@ function frame(now){
if(S.playing){
const spd = S.reduced ? 0.28 : 1.0;
- S.t += dt * S.tempo * spd * 0.85; // slowed — jazzy/groovy pacing
+ S.t += dt * S.tempo * spd * 1.4;
// Gentle auto-journey through the three chapters (until the visitor takes over)
if(S.autoJourney && !S.reduced){
@@ -1504,26 +1463,13 @@ requestAnimationFrame(frame);
(() => {
"use strict";
const CATALOG = [
- {id:"gd69-02-27.sbd.16track.kaplan.6315.sbeok.shnf", date:"February 27, 1969", title:"Fillmore West", sub:"San Francisco · primal psychedelic era"},
- {id:"gd70-05-24.sbd.hanno.6481.sbeok.shnf", date:"May 24, 1970", title:"Newcastle-Under-Lyme", sub:"Newcastle · acoustic-and-electric era"},
- {id:"gd71-04-14.sbd.lai.6250.sbefail.shnf", date:"April 14, 1971", title:"Christy Mathewson Stadium, Bucknell U.", sub:"Lewisburg · Skull & Roses era"},
- {id:"gd72-08-27.sbd.orf.3328.sbeok.shnf", date:"August 27, 1972", title:"Veneta", sub:"Oregon · field, heat, and open sky"},
- {id:"gd73-02-15.sbd.hall.1580.sbeok.shnf", date:"February 15, 1973", title:"Dane County Coliseum", sub:"Madison · jazz-loose / Wake of the Flood era"},
- {id:"gd74-06-23.sbd.cribbs.16780.sbeok.shnf", date:"June 23, 1974", title:"Jai-Alai Fronton", sub:"Miami · Wall of Sound era"},
- {id:"gd76-06-10.sbd.bertha-ashley.23370.sbeok.shnf", date:"June 10, 1976", title:"Boston Music Hall", sub:"Boston · return-from-hiatus era"},
- {id:"gd77-05-08.sbd.hicks.4982.sbeok.shnf", date:"May 8, 1977", title:"Cornell", sub:"Ithaca · Barton Hall"},
- {id:"gd78-02-01.sbd.parillo.1017.sbeok.shnf", date:"February 1, 1978", title:"Uptown Theater", sub:"Chicago · tight & funky late-’70s era"},
- {id:"gd81-03-21.sbd.clugston.6666.sbeok.shnf", date:"March 21, 1981", title:"Rainbow Theatre", sub:"London · European-tour era"},
- {id:"gd85-04-27.sbd.jerugim.359.sbeok.shnf", date:"April 27, 1985", title:"Frost Amphitheatre", sub:"Palo Alto · 20th-anniversary / Frost era"},
- {id:"gd1987-01-28.sbd.walker-scotton.miller.83286.flac16", date:"January 28, 1987", title:"S.F Civic Auditorium", sub:"San Francisco · In the Dark comeback era"},
- {id:"gd89-12-31.sbd.bertha-ashley.18674.sbeok.shnf", date:"December 31, 1989", title:"Oakland-Alameda County Coliseum", sub:"Oakland · late-peak / Built to Last era"},
- {id:"gd90-03-29.aud-fob.set2.unknown.1317.sbeok.shnf", date:"March 29, 1990", title:"Nassau", sub:"Uniondale · late-era expansion"},
- {id:"gd91-10-31.sbd.gardner.2897.sbeok.shnf", date:"October 31, 1991", title:"Oakland-Alameda County Coliseum", sub:"Oakland · post-Brent / Bruce Hornsby era"},
- {id:"gd93-03-24.sbd.keyser.25664.sbeok.flacf", date:"March 24, 1993", title:"Dean Smith Center", sub:"Chapel Hill · Vince era / stadium years"},
- {id:"gd94-10-05.sbd.unknown.8030.sbeok.shnf", date:"October 5, 1994", title:"The Spectrum", sub:"Philadelphia · final-years era"},
- {id:"gd95-07-09.sbd.7233.sbeok.shnf", date:"July 9, 1995", title:"Soldier Field", sub:"Chicago · the final show"}
+ {id:'gd69-02-27.sbd.16track.kaplan.6315.sbeok.shnf', date:'February 27, 1969', title:'Fillmore West', sub:'San Francisco · primal psychedelic era'},
+ {id:'gd72-08-27.sbd.orf.3328.sbeok.shnf', date:'August 27, 1972', title:'Veneta', sub:'Oregon · field, heat, and open sky'},
+ {id:'gd74-06-23.sbd.cribbs.16780.sbeok.shnf', date:'June 23, 1974', title:'Jai-Alai Fronton', sub:'Miami · Wall of Sound era'},
+ {id:'gd77-05-08.sbd.hicks.4982.sbeok.shnf', date:'May 8, 1977', title:'Cornell', sub:'Ithaca · Barton Hall'},
+ {id:'gd90-03-29.aud-fob.set2.unknown.1317.sbeok.shnf',date:'March 29, 1990', title:'Nassau', sub:'Uniondale · late-era expansion'}
];
-const DEFAULT_SHOW = 7; // Cornell '77
+const DEFAULT_SHOW = 3; // Cornell '77
const $ = id => document.getElementById(id);
const audio = $('mrAudio'), room = $('musicroom'), sel = $('mrShow'), live = $('live');
@@ -1582,6 +1528,14 @@ async function loadShow(i, opts){ if(sel) sel.value=String(i); return loadShowRe
// Search the WHOLE Grateful Dead collection on archive.org — type anything (date, venue, city, song)
let searchTimer=null;
+// archive.org is a flaky nonprofit — abort a hung request so the UI fails gracefully
+// into the error state instead of pulsing "…" forever (5x sweep 2 fix).
+function fetchT(url, ms=9000){
+ const ctl = (typeof AbortController!=='undefined') ? new AbortController() : null;
+ const t = ctl ? setTimeout(()=>ctl.abort(), ms) : null;
+ return fetch(url, {mode:'cors', signal: ctl?ctl.signal:undefined})
+ .finally(()=>{ if(t) clearTimeout(t); });
+}
// Browse the WHOLE Grateful Dead collection — empty = most-popular shows; text and/or a year narrow it.
async function searchArchive(q){
const res=$('mrResults'); if(!res) return;
@@ -1595,7 +1549,7 @@ async function searchArchive(q){
try{
const url='https://archive.org/advancedsearch.php?q='+encodeURIComponent(query)+
'&fl[]=identifier&fl[]=title&fl[]=date&fl[]=venue&fl[]=coverage&fl[]=downloads&sort[]='+sort+'&rows=40&output=json';
- const r=await fetch(url,{mode:'cors'}); const j=await r.json();
+ const r=await fetchT(url); const j=await r.json();
const docs=(j.response&&j.response.docs)||[]; const total=(j.response&&j.response.numFound)||0;
if(!docs.length){ res.innerHTML='<div class="mr-hint">No shows found. Try a date (1977-05-08), a city, or a song.</div>'; return; }
res.innerHTML=`<div class="mr-hint">${total.toLocaleString()} shows in the archive${filters.length?' matching':''} · showing ${docs.length}</div>`;
@@ -1606,7 +1560,7 @@ async function searchArchive(q){
b.addEventListener('click',()=>loadShowRef({id:d.identifier, date:date, title:d.venue||d.title||'Grateful Dead', sub:d.coverage||''}, {play:true}));
res.appendChild(b);
});
- }catch(e){ res.innerHTML='<div class="mr-hint">Archive browse unavailable right now (open over http, not file://).</div>'; }
+ }catch(e){ res.innerHTML='<div class="mr-hint">Archive browse is unavailable right now — archive.org may be down. Try again in a bit.</div>'; }
}
function fallbackEmbed(s){
@@ -1761,7 +1715,7 @@ function buildMap(){
});
// per-year show counts → heat-color the tiles (sqrt to tame the '77/'89 spikes)
Promise.all(YEARS.map(y=>
- fetch('https://archive.org/advancedsearch.php?q='+encodeURIComponent('collection:'+src.id+' AND year:'+y)+'&rows=0&output=json',{mode:'cors'})
+ fetchT('https://archive.org/advancedsearch.php?q='+encodeURIComponent('collection:'+src.id+' AND year:'+y)+'&rows=0&output=json')
.then(r=>r.json()).then(j=>({y,n:(j.response&&j.response.numFound)||0})).catch(()=>({y,n:-1}))
)).then(rows=>{
if(mySrc!==window.MR_SRC) return; // source switched mid-flight
← 207cf83 Add 1995 Soldier Field finale (gd95-07-09, verified LMA sbd,
·
back to Dead Agentabrams
·
auto-data-snapshot: 2026-09-02T09:04:08 (28 data files) — .p 306d63a →