Self-finding: newest MMR master auto-discovered from root, every Space listed live, blocked feeds bounce via GitHub mirrors
Browse files- index.html +52 -25
index.html
CHANGED
|
@@ -24,6 +24,7 @@ summary{font-size:20px;padding:14px;cursor:pointer;font-weight:600}
|
|
| 24 |
.item{display:grid;grid-template-columns:30px 1fr auto;align-items:center;gap:8px;padding:11px 12px;border-top:1px solid #12203a;font-size:16px}
|
| 25 |
.item input{width:24px;height:24px}
|
| 26 |
.item small{display:block;color:#7a9;font-size:11px}
|
|
|
|
| 27 |
.st{font-size:11px;padding:3px 7px;border-radius:8px;background:#222;white-space:nowrap}
|
| 28 |
.ok{background:#164a2a}.bad{background:#5a1a1a}.wait{background:#4a3a10}
|
| 29 |
.row{display:grid;grid-template-columns:70px 1fr;gap:8px;align-items:center;padding:8px 12px;font-size:15px}
|
|
@@ -48,19 +49,23 @@ td a{color:#7fe3ff;text-decoration:none}
|
|
| 48 |
<div class="scroll" id="catalog"></div>
|
| 49 |
</div>
|
| 50 |
<div class="panel" id="reg">
|
| 51 |
-
<div class="ph"><h1>MIRROR REGISTRY ·
|
| 52 |
<div style="padding:8px;display:grid;gap:6px"><input type="text" id="q" placeholder="Search the registry…"><select id="fSuite"></select><div id="count" style="font-size:12px;color:#8ab"></div></div>
|
| 53 |
<div class="scroll" style="padding:0"><table><thead><tr id="hd"></tr></thead><tbody id="bd"></tbody></table></div>
|
| 54 |
</div>
|
| 55 |
<script>
|
| 56 |
const $=id=>document.getElementById(id);
|
|
|
|
| 57 |
const tog=id=>{const p=$(id),o=!p.classList.contains('open');document.querySelectorAll('.panel').forEach(x=>x.classList.remove('open'));if(o)p.classList.add('open');};
|
| 58 |
$('fabCat').onclick=()=>tog('cat');$('fabReg').onclick=()=>tog('reg');
|
| 59 |
document.querySelectorAll('[data-close]').forEach(b=>b.onclick=()=>$(b.dataset.close).classList.remove('open'));
|
|
|
|
|
|
|
|
|
|
| 60 |
const CATALOG=[
|
| 61 |
-
{folder:'✈ AIR',items:[{id:'flights',name:'Live flights worldwide',src:'OpenSky
|
| 62 |
-
{folder:'🛰 SPACE',items:[{id:'iss',name:'ISS live position',src:'wheretheiss.at',url:'https://wheretheiss.at',z:'orbit'},{id:'sats',name:'Space stations + satellites',src:'CelesTrak',url:'https://celestrak.org',z:'orbit'}]},
|
| 63 |
-
{folder:'🌐 INTERNET · COMMUNICATION',items:[{id:'cables',name:'Undersea internet cables',src:'Submarine Cable Map',url:'https://www.submarinecablemap.com',z:'sea floor'},{id:'comms',name:'Communication arcs · data · voice · video',src:'Node mesh',url:'
|
| 64 |
{folder:'🌋 EARTH',items:[{id:'quakes',name:'Earthquakes · last 24h · true depth',src:'USGS',url:'https://earthquake.usgs.gov',z:'below ground'}]},
|
| 65 |
{folder:'🏙 CITIES',items:[{id:'city3d',name:'3D skylines · every city',src:'OpenStreetMap · OpenFreeMap',url:'https://openfreemap.org',z:'building height'}]},
|
| 66 |
{folder:'🗺 MAP TYPES',maps:[['Liberty','https://tiles.openfreemap.org/styles/liberty'],['Bright','https://tiles.openfreemap.org/styles/bright'],['Positron','https://tiles.openfreemap.org/styles/positron'],['Satellite · Esri','raster:https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}'],['Topo · OpenTopoMap','raster:https://a.tile.opentopomap.org/{z}/{x}/{y}.png'],['Night lights · NASA','raster:https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/VIIRS_CityLights_2012/default/GoogleMapsCompatible_Level8/{z}/{y}/{x}.jpg']]},
|
|
@@ -68,13 +73,21 @@ const CATALOG=[
|
|
| 68 |
const ON={flights:true,routes:true,iss:true,sats:true,cables:true,comms:true,quakes:true,city3d:true};
|
| 69 |
let html='';
|
| 70 |
CATALOG.forEach(f=>{html+=`<details open><summary>${f.folder}</summary>`;
|
| 71 |
-
if(f.items)f.items.forEach(it=>{html+=`<label class="item"><input type="checkbox" data-id="${it.id}" checked><span><a href="${it.url}" target="_blank"
|
| 72 |
if(f.maps)html+=`<div class="row"><span>Base</span><select id="basemap">${f.maps.map(m=>`<option value="${m[1]}">${m[0]}</option>`).join('')}</select></div>`;
|
| 73 |
html+='</details>';});
|
|
|
|
|
|
|
| 74 |
html+=`<details open><summary>⇕ DEPTH · XYZTN</summary><div class="row"><span>Z depth</span><input type="range" id="zx" min="1" max="60" value="15"></div><div class="row"><span>View</span><select id="view"><option value="3d">3D tilted</option><option value="globe">Globe</option><option value="flat">Flat</option></select></div><div class="row"><span>City</span><select id="city"></select></div></details>`;
|
| 75 |
$('catalog').innerHTML=html;
|
| 76 |
function st(id,s,cls){const e=$('st-'+id);if(e){e.textContent=s;e.className='st '+cls;}}
|
| 77 |
document.querySelectorAll('[data-id]').forEach(cb=>cb.onchange=()=>{ON[cb.dataset.id]=cb.checked;if(cb.dataset.id==='city3d'&&map.getLayer('city3d'))map.setLayoutProperty('city3d','visibility',cb.checked?'visible':'none');render();});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
const N=[["Tampa",-82.4572,27.9506],["Las Vegas",-115.172,36.121],["Tokyo",139.7671,35.6812],["New York",-74.006,40.7128],["London",-0.1276,51.5072],["Paris",2.3522,48.8566],["Dubai",55.2744,25.1972],["Singapore",103.8519,1.2903],["Hong Kong",114.1694,22.3193],["Shanghai",121.4737,31.2304],["Sydney",151.2093,-33.8688],["São Paulo",-46.6333,-23.5505],["San Juan",-66.1057,18.4655],["Chicago",-87.6298,41.8781],["Los Angeles",-118.2437,34.0522],["Toronto",-79.3832,43.6532],["Mexico City",-99.1332,19.4326],["Miami",-80.1918,25.7617],["Seoul",126.978,37.5665],["Mumbai",72.8777,19.076],["Lagos",3.3792,6.5244],["Cairo",31.2357,30.0444],["Istanbul",28.9784,41.0082],["Berlin",13.405,52.52],["Johannesburg",28.0473,-26.2041],["Buenos Aires",-58.3816,-34.6037],["Frankfurt",8.6821,50.1109],["Honolulu",-157.8583,21.3069]];
|
| 79 |
$('city').innerHTML='<option value="">World</option>'+N.map((n,i)=>`<option value="${i}">${n[0]}</option>`).join('');
|
| 80 |
function rasterStyle(u){return{version:8,glyphs:'https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf',sources:{r:{type:'raster',tiles:[u],tileSize:256,maxzoom:u.includes('VIIRS')?8:18,attribution:'© providers'}},layers:[{id:'r',type:'raster',source:'r'}]};}
|
|
@@ -91,40 +104,54 @@ $('zx').oninput=render;
|
|
| 91 |
const D={flights:[],iss:[],sats:[],cables:[],quakes:[]};
|
| 92 |
const routes=[];N.forEach((a,i)=>{for(let j=i+1;j<N.length;j++)if((i*5+j*3)%4===0)routes.push({s:[a[1],a[2]],t:[N[j][1],N[j][2]],n:a[0]+' ⇄ '+N[j][0],k:(i+j)%4});});
|
| 93 |
st('routes','live','ok');st('comms','live','ok');
|
| 94 |
-
async function
|
| 95 |
-
|
|
|
|
|
|
|
| 96 |
async function iss(){try{const j=await J('https://api.wheretheiss.at/v1/satellites/25544');D.iss=[{p:[j.longitude,j.latitude,j.altitude*1000],n:'ISS',t:j.timestamp}];st('iss','live','ok');}catch(e){st('iss','blocked','bad');}render();}
|
| 97 |
let TLE=[];async function sats(){try{TLE=(await J('https://celestrak.org/NORAD/elements/gp.php?GROUP=stations&FORMAT=json')).map(g=>({n:g.OBJECT_NAME,rec:satellite.json2satrec?satellite.json2satrec(g):null})).filter(s=>s.rec);st('sats',TLE.length+' objects','ok');}catch(e){st('sats','blocked','bad');}}
|
| 98 |
function satPos(){const now=new Date(),gm=satellite.gstime(now);D.sats=TLE.map(s=>{const pv=satellite.propagate(s.rec,now);if(!pv.position)return null;const g=satellite.eciToGeodetic(pv.position,gm);return{p:[satellite.degreesLong(g.longitude),satellite.degreesLat(g.latitude),g.height*1000],n:s.n,t:now.getTime()/1000};}).filter(Boolean);}
|
| 99 |
-
async function cables(){
|
| 100 |
-
async function quakes(){try{const j=await J('https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.geojson');D.quakes=j.features.map(f=>({p:[f.geometry.coordinates[0],f.geometry.coordinates[1],-f.geometry.coordinates[2]*1000],m:f.properties.mag||0,n:f.properties.place,t:f.properties.time/1000
|
| 101 |
flights();iss();sats();cables();quakes();
|
| 102 |
setInterval(flights,20000);setInterval(iss,5000);setInterval(quakes,300000);
|
| 103 |
function show(o,layer){if(!o||!o.object)return;const ob=o.object,p=ob.p||(ob.s?[...ob.s,0]:ob.path?ob.path[0].concat(0):[o.coordinate[0],o.coordinate[1],0]);
|
| 104 |
$('xyztn').innerHTML=`<b>N</b> ${ob.n||''} · ${layer}<br><b>X</b> ${(+p[0]).toFixed(3)} <b>Y</b> ${(+p[1]).toFixed(3)} <b>Z</b> ${Math.round(p[2]||0)} m <b>T</b> ${ob.t?new Date(ob.t*1000).toISOString().slice(0,19):new Date().toISOString().slice(0,19)}`;}
|
| 105 |
function render(){const zx=+$('zx').value,L=[];
|
| 106 |
-
|
| 107 |
-
if(ON.
|
| 108 |
-
if(ON.
|
| 109 |
-
if(ON.
|
| 110 |
-
if(ON.
|
| 111 |
-
if(ON.
|
| 112 |
-
if(ON.
|
|
|
|
| 113 |
L.push(new deck.ScatterplotLayer({id:'nodes',data:N,getPosition:d=>[d[1],d[2],0],getRadius:50000,radiusMinPixels:5,getFillColor:[255,79,163,255],pickable:true,onClick:o=>{const i=N.indexOf(o.object);$('city').value=i;$('city').onchange({target:$('city')});}}));
|
| 114 |
overlay.setProps({layers:L});}
|
| 115 |
setInterval(()=>{if(TLE.length){satPos();render();}$('t').textContent=new Date().toLocaleTimeString();},2000);
|
| 116 |
-
|
| 117 |
-
const VIEW='https://huggingface.co/datasets/autobahn247365/mmr/viewer/default/train?row=';
|
| 118 |
const COLS=['tab','suite','layer','type','status','time','redirect'];
|
| 119 |
-
let ROWS=[],sk='suite',sd=1;
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
$('
|
| 124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
['q','fSuite'].forEach(id=>$(id).addEventListener('input',draw));
|
| 126 |
function draw(){const q=$('q').value.toLowerCase(),fs=$('fSuite').value;
|
| 127 |
const v=ROWS.filter(r=>(!fs||r.suite===fs)&&(!q||Object.values(r).join(' ').toLowerCase().includes(q))).sort((a,b)=>String(a[sk]||'').localeCompare(String(b[sk]||''),undefined,{numeric:true})*sd);
|
| 128 |
-
$('count').textContent=`${v.length} of ${ROWS.length} rows · mirror registry · nothing saved`;
|
| 129 |
$('bd').innerHTML=v.map(r=>'<tr>'+COLS.map(c=>{const val=(r[c]||'').toString();const href=c==='redirect'&&val?val:VIEW+r._i;return `<td><a href="${href}" target="_blank">${c==='redirect'&&val?'open ↗':val.slice(0,90)||'·'}</a></td>`;}).join('')+'</tr>').join('');}
|
| 130 |
</script></body></html>
|
|
|
|
| 24 |
.item{display:grid;grid-template-columns:30px 1fr auto;align-items:center;gap:8px;padding:11px 12px;border-top:1px solid #12203a;font-size:16px}
|
| 25 |
.item input{width:24px;height:24px}
|
| 26 |
.item small{display:block;color:#7a9;font-size:11px}
|
| 27 |
+
.item a{color:#cfe;text-decoration:none}
|
| 28 |
.st{font-size:11px;padding:3px 7px;border-radius:8px;background:#222;white-space:nowrap}
|
| 29 |
.ok{background:#164a2a}.bad{background:#5a1a1a}.wait{background:#4a3a10}
|
| 30 |
.row{display:grid;grid-template-columns:70px 1fr;gap:8px;align-items:center;padding:8px 12px;font-size:15px}
|
|
|
|
| 49 |
<div class="scroll" id="catalog"></div>
|
| 50 |
</div>
|
| 51 |
<div class="panel" id="reg">
|
| 52 |
+
<div class="ph"><h1>MIRROR REGISTRY · <span id="mver">finding root…</span></h1><button class="x" data-close="reg">✕</button></div>
|
| 53 |
<div style="padding:8px;display:grid;gap:6px"><input type="text" id="q" placeholder="Search the registry…"><select id="fSuite"></select><div id="count" style="font-size:12px;color:#8ab"></div></div>
|
| 54 |
<div class="scroll" style="padding:0"><table><thead><tr id="hd"></tr></thead><tbody id="bd"></tbody></table></div>
|
| 55 |
</div>
|
| 56 |
<script>
|
| 57 |
const $=id=>document.getElementById(id);
|
| 58 |
+
const OWNER='autobahn247365',DS=OWNER+'/mmr',HF='https://huggingface.co/';
|
| 59 |
const tog=id=>{const p=$(id),o=!p.classList.contains('open');document.querySelectorAll('.panel').forEach(x=>x.classList.remove('open'));if(o)p.classList.add('open');};
|
| 60 |
$('fabCat').onclick=()=>tog('cat');$('fabReg').onclick=()=>tog('reg');
|
| 61 |
document.querySelectorAll('[data-close]').forEach(b=>b.onclick=()=>$(b.dataset.close).classList.remove('open'));
|
| 62 |
+
// ===== mirror bounce: try each mirror until one answers =====
|
| 63 |
+
async function J(urls){if(!Array.isArray(urls))urls=[urls];let last;for(const u of urls){try{const r=await fetch(u);if(r.ok)return await r.json();last=r.status;}catch(e){last=e.message||e;}}throw last;}
|
| 64 |
+
const GH=(repo,path)=>[`https://cdn.jsdelivr.net/gh/${repo}@master/${path}`,`https://raw.githubusercontent.com/${repo}/master/${path}`];
|
| 65 |
const CATALOG=[
|
| 66 |
+
{folder:'✈ AIR',items:[{id:'flights',name:'Live flights worldwide',src:'OpenSky · adsb.lol mirror',url:'https://opensky-network.org',z:'altitude'},{id:'routes',name:'City-to-city flight paths',src:'Node mesh',url:HF+'spaces/'+OWNER+'/ghost',z:'arc'}]},
|
| 67 |
+
{folder:'🛰 SPACE',items:[{id:'iss',name:'ISS live position',src:'wheretheiss.at · open-notify',url:'https://wheretheiss.at',z:'orbit'},{id:'sats',name:'Space stations + satellites',src:'CelesTrak',url:'https://celestrak.org',z:'orbit'}]},
|
| 68 |
+
{folder:'🌐 INTERNET · COMMUNICATION',items:[{id:'cables',name:'Undersea internet cables',src:'Submarine Cable Map · GitHub mirror',url:'https://www.submarinecablemap.com',z:'sea floor'},{id:'comms',name:'Communication arcs · data · voice · video',src:'Node mesh',url:HF+'spaces/'+OWNER+'/ghost',z:'arc'}]},
|
| 69 |
{folder:'🌋 EARTH',items:[{id:'quakes',name:'Earthquakes · last 24h · true depth',src:'USGS',url:'https://earthquake.usgs.gov',z:'below ground'}]},
|
| 70 |
{folder:'🏙 CITIES',items:[{id:'city3d',name:'3D skylines · every city',src:'OpenStreetMap · OpenFreeMap',url:'https://openfreemap.org',z:'building height'}]},
|
| 71 |
{folder:'🗺 MAP TYPES',maps:[['Liberty','https://tiles.openfreemap.org/styles/liberty'],['Bright','https://tiles.openfreemap.org/styles/bright'],['Positron','https://tiles.openfreemap.org/styles/positron'],['Satellite · Esri','raster:https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}'],['Topo · OpenTopoMap','raster:https://a.tile.opentopomap.org/{z}/{x}/{y}.png'],['Night lights · NASA','raster:https://gibs.earthdata.nasa.gov/wmts/epsg3857/best/VIIRS_CityLights_2012/default/GoogleMapsCompatible_Level8/{z}/{y}/{x}.jpg']]},
|
|
|
|
| 73 |
const ON={flights:true,routes:true,iss:true,sats:true,cables:true,comms:true,quakes:true,city3d:true};
|
| 74 |
let html='';
|
| 75 |
CATALOG.forEach(f=>{html+=`<details open><summary>${f.folder}</summary>`;
|
| 76 |
+
if(f.items)f.items.forEach(it=>{html+=`<label class="item"><input type="checkbox" data-id="${it.id}" checked><span><a href="${it.url}" target="_blank">${it.name}</a><small>${it.src} · Z = ${it.z}</small></span><span class="st wait" id="st-${it.id}">…</span></label>`;});
|
| 77 |
if(f.maps)html+=`<div class="row"><span>Base</span><select id="basemap">${f.maps.map(m=>`<option value="${m[1]}">${m[0]}</option>`).join('')}</select></div>`;
|
| 78 |
html+='</details>';});
|
| 79 |
+
html+=`<details open><summary>🧩 SAND SPACES · live from Hugging Face</summary><div id="spaces"><div class="item"><span></span><span>Finding every Space…</span><span></span></div></div></details>`;
|
| 80 |
+
html+=`<details><summary>📁 MMR FILES · root</summary><div id="files"></div></details>`;
|
| 81 |
html+=`<details open><summary>⇕ DEPTH · XYZTN</summary><div class="row"><span>Z depth</span><input type="range" id="zx" min="1" max="60" value="15"></div><div class="row"><span>View</span><select id="view"><option value="3d">3D tilted</option><option value="globe">Globe</option><option value="flat">Flat</option></select></div><div class="row"><span>City</span><select id="city"></select></div></details>`;
|
| 82 |
$('catalog').innerHTML=html;
|
| 83 |
function st(id,s,cls){const e=$('st-'+id);if(e){e.textContent=s;e.className='st '+cls;}}
|
| 84 |
document.querySelectorAll('[data-id]').forEach(cb=>cb.onchange=()=>{ON[cb.dataset.id]=cb.checked;if(cb.dataset.id==='city3d'&&map.getLayer('city3d'))map.setLayoutProperty('city3d','visibility',cb.checked?'visible':'none');render();});
|
| 85 |
+
// ===== every Space, found live =====
|
| 86 |
+
J(HF+'api/spaces?author='+OWNER+'&limit=500&full=true').then(list=>{
|
| 87 |
+
list.sort((a,b)=>(b.lastModified||'').localeCompare(a.lastModified||''));
|
| 88 |
+
$('spaces').innerHTML=list.map(s=>{const n=s.id.split('/')[1];return `<div class="item"><span>▸</span><span><a href="${HF}spaces/${s.id}" target="_blank">${n}</a><small>${s.sdk||''} · ${(s.lastModified||'').slice(0,10)}</small></span><a class="st ok" href="https://${s.id.replace('/','-').replace(/_/g,'-').toLowerCase()}.${s.sdk==='static'?'static.':''}hf.space" target="_blank">open ↗</a></div>`;}).join('')+`<div class="item"><span>▸</span><span><a href="${HF}${OWNER}" target="_blank">All of ${OWNER} · incl. private</a><small>private Spaces show when you're signed in</small></span><span></span></div>`;
|
| 89 |
+
}).catch(e=>{$('spaces').innerHTML=`<div class="item"><span></span><span><a href="${HF}${OWNER}" target="_blank">Open all Spaces ↗</a></span><span class="st bad">${e}</span></div>`;});
|
| 90 |
+
// ===== MAP =====
|
| 91 |
const N=[["Tampa",-82.4572,27.9506],["Las Vegas",-115.172,36.121],["Tokyo",139.7671,35.6812],["New York",-74.006,40.7128],["London",-0.1276,51.5072],["Paris",2.3522,48.8566],["Dubai",55.2744,25.1972],["Singapore",103.8519,1.2903],["Hong Kong",114.1694,22.3193],["Shanghai",121.4737,31.2304],["Sydney",151.2093,-33.8688],["São Paulo",-46.6333,-23.5505],["San Juan",-66.1057,18.4655],["Chicago",-87.6298,41.8781],["Los Angeles",-118.2437,34.0522],["Toronto",-79.3832,43.6532],["Mexico City",-99.1332,19.4326],["Miami",-80.1918,25.7617],["Seoul",126.978,37.5665],["Mumbai",72.8777,19.076],["Lagos",3.3792,6.5244],["Cairo",31.2357,30.0444],["Istanbul",28.9784,41.0082],["Berlin",13.405,52.52],["Johannesburg",28.0473,-26.2041],["Buenos Aires",-58.3816,-34.6037],["Frankfurt",8.6821,50.1109],["Honolulu",-157.8583,21.3069]];
|
| 92 |
$('city').innerHTML='<option value="">World</option>'+N.map((n,i)=>`<option value="${i}">${n[0]}</option>`).join('');
|
| 93 |
function rasterStyle(u){return{version:8,glyphs:'https://tiles.openfreemap.org/fonts/{fontstack}/{range}.pbf',sources:{r:{type:'raster',tiles:[u],tileSize:256,maxzoom:u.includes('VIIRS')?8:18,attribution:'© providers'}},layers:[{id:'r',type:'raster',source:'r'}]};}
|
|
|
|
| 104 |
const D={flights:[],iss:[],sats:[],cables:[],quakes:[]};
|
| 105 |
const routes=[];N.forEach((a,i)=>{for(let j=i+1;j<N.length;j++)if((i*5+j*3)%4===0)routes.push({s:[a[1],a[2]],t:[N[j][1],N[j][2]],n:a[0]+' ⇄ '+N[j][0],k:(i+j)%4});});
|
| 106 |
st('routes','live','ok');st('comms','live','ok');
|
| 107 |
+
async function flights(){
|
| 108 |
+
try{const j=await J('https://opensky-network.org/api/states/all');D.flights=(j.states||[]).filter(s=>s[5]!=null&&s[6]!=null).map(s=>({p:[s[5],s[6],(s[7]||s[13]||0)],n:(s[1]||'').trim()||s[0],t:j.time}));st('flights',D.flights.length+' planes · OpenSky','ok');}
|
| 109 |
+
catch(e){try{const j=await J(['https://api.adsb.lol/v2/lat/40/lon/-40/dist/5000','https://api.airplanes.live/v2/point/40/-40/250']);D.flights=(j.ac||j.aircraft||[]).filter(a=>a.lat!=null).map(a=>({p:[a.lon,a.lat,(+a.alt_baro||0)*0.3048],n:(a.flight||a.hex||'').trim(),t:Date.now()/1000}));st('flights',D.flights.length+' planes · mirror','ok');}catch(e2){st('flights','blocked','bad');}}
|
| 110 |
+
render();}
|
| 111 |
async function iss(){try{const j=await J('https://api.wheretheiss.at/v1/satellites/25544');D.iss=[{p:[j.longitude,j.latitude,j.altitude*1000],n:'ISS',t:j.timestamp}];st('iss','live','ok');}catch(e){st('iss','blocked','bad');}render();}
|
| 112 |
let TLE=[];async function sats(){try{TLE=(await J('https://celestrak.org/NORAD/elements/gp.php?GROUP=stations&FORMAT=json')).map(g=>({n:g.OBJECT_NAME,rec:satellite.json2satrec?satellite.json2satrec(g):null})).filter(s=>s.rec);st('sats',TLE.length+' objects','ok');}catch(e){st('sats','blocked','bad');}}
|
| 113 |
function satPos(){const now=new Date(),gm=satellite.gstime(now);D.sats=TLE.map(s=>{const pv=satellite.propagate(s.rec,now);if(!pv.position)return null;const g=satellite.eciToGeodetic(pv.position,gm);return{p:[satellite.degreesLong(g.longitude),satellite.degreesLat(g.latitude),g.height*1000],n:s.n,t:now.getTime()/1000};}).filter(Boolean);}
|
| 114 |
+
async function cables(){try{const j=await J(['https://www.submarinecablemap.com/api/v3/cable/cable-geo.json',...GH('telegeography/www.submarinecablemap.com','web/public/api/v3/cable/cable-geo.json')]);D.cables=[];j.features.forEach(f=>{const g=f.geometry,cs=g.type==='MultiLineString'?g.coordinates:[g.coordinates];cs.forEach(c=>D.cables.push({path:c,n:f.properties.name,col:f.properties.color}));});st('cables',j.features.length+' cables','ok');}catch(e){st('cables','blocked','bad');}render();}
|
| 115 |
+
async function quakes(){try{const j=await J('https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.geojson');D.quakes=j.features.map(f=>({p:[f.geometry.coordinates[0],f.geometry.coordinates[1],-f.geometry.coordinates[2]*1000],m:f.properties.mag||0,n:f.properties.place,t:f.properties.time/1000}));st('quakes',D.quakes.length+' quakes','ok');}catch(e){st('quakes','blocked','bad');}render();}
|
| 116 |
flights();iss();sats();cables();quakes();
|
| 117 |
setInterval(flights,20000);setInterval(iss,5000);setInterval(quakes,300000);
|
| 118 |
function show(o,layer){if(!o||!o.object)return;const ob=o.object,p=ob.p||(ob.s?[...ob.s,0]:ob.path?ob.path[0].concat(0):[o.coordinate[0],o.coordinate[1],0]);
|
| 119 |
$('xyztn').innerHTML=`<b>N</b> ${ob.n||''} · ${layer}<br><b>X</b> ${(+p[0]).toFixed(3)} <b>Y</b> ${(+p[1]).toFixed(3)} <b>Z</b> ${Math.round(p[2]||0)} m <b>T</b> ${ob.t?new Date(ob.t*1000).toISOString().slice(0,19):new Date().toISOString().slice(0,19)}`;}
|
| 120 |
function render(){const zx=+$('zx').value,L=[];
|
| 121 |
+
const P=(id,name)=>({pickable:true,onHover:o=>show(o,name),onClick:o=>show(o,name)});
|
| 122 |
+
if(ON.quakes)L.push(new deck.ScatterplotLayer({id:'quakes',data:D.quakes,getPosition:d=>[d.p[0],d.p[1],d.p[2]*zx/15],getRadius:d=>20000*Math.max(.5,d.m),getFillColor:[255,90,40,200],...P('q','quakes')}));
|
| 123 |
+
if(ON.cables)L.push(new deck.PathLayer({id:'cables',data:D.cables,getPath:d=>d.path.map(c=>[c[0],c[1],-2000*zx]),getColor:d=>{const h=(d.col||'#40e0ff').replace('#','');return[parseInt(h.slice(0,2),16),parseInt(h.slice(2,4),16),parseInt(h.slice(4,6),16),180];},widthMinPixels:1.5,...P('c','cables')}));
|
| 124 |
+
if(ON.comms)L.push(new deck.ArcLayer({id:'comms',data:routes,getSourcePosition:d=>d.s,getTargetPosition:d=>d.t,getSourceColor:d=>[[64,224,255],[255,176,0],[208,128,255],[255,112,192]][d.k].concat(200),getTargetColor:[255,255,255,120],getHeight:.25,getWidth:2,...P('m','comms')}));
|
| 125 |
+
if(ON.routes)L.push(new deck.ArcLayer({id:'routes',data:routes,getSourcePosition:d=>d.s,getTargetPosition:d=>d.t,getSourceColor:[255,79,163,160],getTargetColor:[255,176,0,160],getHeight:.9,getWidth:1,...P('r','flight paths')}));
|
| 126 |
+
if(ON.flights)L.push(new deck.ScatterplotLayer({id:'flights',data:D.flights,getPosition:d=>[d.p[0],d.p[1],d.p[2]*zx],getRadius:6000,radiusMinPixels:1.5,getFillColor:[255,230,120,220],...P('f','flights')}));
|
| 127 |
+
if(ON.sats)L.push(new deck.ScatterplotLayer({id:'sats',data:D.sats,getPosition:d=>[d.p[0],d.p[1],d.p[2]*zx/15],getRadius:40000,getFillColor:[120,200,255,230],...P('s','satellites')}));
|
| 128 |
+
if(ON.iss)L.push(new deck.ScatterplotLayer({id:'iss',data:D.iss,getPosition:d=>[d.p[0],d.p[1],d.p[2]*zx/15],getRadius:120000,getFillColor:[0,255,136,255],...P('i','ISS')}));
|
| 129 |
L.push(new deck.ScatterplotLayer({id:'nodes',data:N,getPosition:d=>[d[1],d[2],0],getRadius:50000,radiusMinPixels:5,getFillColor:[255,79,163,255],pickable:true,onClick:o=>{const i=N.indexOf(o.object);$('city').value=i;$('city').onchange({target:$('city')});}}));
|
| 130 |
overlay.setProps({layers:L});}
|
| 131 |
setInterval(()=>{if(TLE.length){satPos();render();}$('t').textContent=new Date().toLocaleTimeString();},2000);
|
| 132 |
+
// ===== MIRROR REGISTRY: finds the newest master at the root, every time =====
|
|
|
|
| 133 |
const COLS=['tab','suite','layer','type','status','time','redirect'];
|
| 134 |
+
let ROWS=[],sk='suite',sd=1,VIEW='';
|
| 135 |
+
function ver(p){const m=p.match(/v(\d+)\.(\d+)/);return m?(+m[1])*1000+(+m[2]):-1;}
|
| 136 |
+
J(HF+'api/datasets/'+DS+'/tree/main?recursive=true').then(tree=>{
|
| 137 |
+
const files=tree.filter(f=>f.type==='file');
|
| 138 |
+
$('files').innerHTML=files.map(f=>`<div class="item"><span>▸</span><span><a href="${HF}datasets/${DS}/blob/main/${f.path}" target="_blank">${f.path}</a><small>${(f.size/1024).toFixed(1)} KB</small></span><span></span></div>`).join('');
|
| 139 |
+
const masters=files.filter(f=>/^mmr_master_v[\d.]+\.csv$/.test(f.path)).sort((a,b)=>ver(b.path)-ver(a.path));
|
| 140 |
+
const pick=(masters[0]||{path:'mmr_master_v1.0.csv'}).path;
|
| 141 |
+
$('mver').innerHTML=`<a href="${HF}datasets/${DS}/blob/main/${pick}" target="_blank" style="color:#00ff88;text-decoration:none">${pick}</a>`;
|
| 142 |
+
load(HF+'datasets/'+DS+'/resolve/main/'+pick);
|
| 143 |
+
}).catch(()=>{$('mver').textContent='mmr_master_v1.0.csv';load(HF+'datasets/'+DS+'/resolve/main/mmr_master_v1.0.csv');});
|
| 144 |
+
function load(src){VIEW=HF+'datasets/'+DS+'/viewer?row=';
|
| 145 |
+
Papa.parse(src,{download:true,header:true,skipEmptyLines:true,complete:r=>{
|
| 146 |
+
const keys=r.meta.fields||[];const nameKey=keys.includes('tab')?'tab':keys[1]||keys[0];const linkKey=keys.includes('redirect')?'redirect':keys.find(k=>r.data.some(x=>String(x[k]||'').startsWith('http')))||'redirect';
|
| 147 |
+
ROWS=r.data.map((x,i)=>({...x,_i:i,tab:x[nameKey]||x.gid||x[linkKey],redirect:x[linkKey],suite:x.suite||'Roots'}));
|
| 148 |
+
$('fSuite').innerHTML='<option value="">Suite link: all</option>'+[...new Set(ROWS.map(x=>x.suite))].sort().map(s=>`<option>${s}</option>`).join('');
|
| 149 |
+
$('hd').innerHTML=COLS.map(c=>`<th data-k="${c}">${c==='tab'?'name':c} link ⇅</th>`).join('');
|
| 150 |
+
document.querySelectorAll('#hd th').forEach(th=>th.onclick=()=>{sd=sk===th.dataset.k?-sd:1;sk=th.dataset.k;draw();});draw();},
|
| 151 |
+
error:e=>{$('count').textContent='Master did not load: '+e;}});}
|
| 152 |
['q','fSuite'].forEach(id=>$(id).addEventListener('input',draw));
|
| 153 |
function draw(){const q=$('q').value.toLowerCase(),fs=$('fSuite').value;
|
| 154 |
const v=ROWS.filter(r=>(!fs||r.suite===fs)&&(!q||Object.values(r).join(' ').toLowerCase().includes(q))).sort((a,b)=>String(a[sk]||'').localeCompare(String(b[sk]||''),undefined,{numeric:true})*sd);
|
| 155 |
+
$('count').textContent=`${v.length} of ${ROWS.length} rows · newest master · mirror registry · nothing saved`;
|
| 156 |
$('bd').innerHTML=v.map(r=>'<tr>'+COLS.map(c=>{const val=(r[c]||'').toString();const href=c==='redirect'&&val?val:VIEW+r._i;return `<td><a href="${href}" target="_blank">${c==='redirect'&&val?'open ↗':val.slice(0,90)||'·'}</a></td>`;}).join('')+'</tr>').join('');}
|
| 157 |
</script></body></html>
|