Split the game page into partials under src/, assembled into one index.html at build

site/index.html (900 KB of HTML, CSS and JS in one file) becomes src/: a shell
(src/index.html), styles/ and game/, concatenated in path order by
scripts/lib/page.js. The assembled page is byte-identical to the old file, so
load time and in-game performance are unchanged.

- scripts/build.js replaces build.sh (same env vars, same output)
- npm run dev: a zero-dependency dev server that assembles on every request
- tests assemble the page in memory; npm test runs every tests/*.test.js
- perf-bench takes --base-ref to build a git ref's page
- scripts/legacy/split-index-html.js is the splitter, kept for older branches
This commit is contained in:
Frederic Jung 2026-10-27 10:05:56 +01:00
parent 295e68cc46
commit 67a40942b4
No known key found for this signature in database
113 changed files with 5584 additions and 5195 deletions

View file

@ -0,0 +1,95 @@
/* The long tail: odd little networks with a sliver of traffic each, on one or two exchanges. */
const TAIL=[
['Grandma’s Basement Hosting','cdn',['fra'],tr('Three servers, one dehumidifier and a very patient grandmother.')],
['Hamster Wheel Networks','eye',['ams'],tr('Powered by renewable rodents. Uptime depends on snack schedule.')],
['Fjordnet Kooperativ','eye',['osl'],tr('A fiber co-op for one valley. Every member owns a metre of cable.')],
['Kebab-Link','eye',['ber','fra'],tr('An ISP run from the back of a kebab shop. Late-night support is excellent.')],
['Mesh Collective e.V.','eye',['ber','fra'],tr('Volunteers with rooftop antennas and strong opinions about IPv6.')],
['Village Fibre Co-op','eye',['lon'],tr('Dug the trench themselves, one field at a time.')],
['Tiny Swiss Bank Shield','cdn',['zrh'],tr('Hosts exactly one website and three lawyers.')],
['Clockwork ISP','eye',['zrh'],tr('Packets leave on time, to the second.')],
['LAN-Party Federation','cdn',['ams','fra'],tr('Game servers, energy drinks and a ping obsession.')],
['Former Church Datacenter','cdn',['ams'],tr('Racks in the nave, cooling in the crypt. Divine uptime.')],
['WISP on a Silo','eye',['dal','chi'],tr('Wireless internet from the top of a grain silo.')],
['Cornfield Broadband','eye',['chi'],tr('Rural fiber that follows the tractor routes.')],
['Moose Lake Telephone Co-op','eye',['tor','mtl'],tr('Has served the lake since 1912. Now with fiber.')],
['Surf Shop Networks','cdn',['lax'],tr('Hosting for surfboard shops. Closed when the waves are good.')],
['Ski Lift Fiber','eye',['den','zrh'],tr('Fiber strung along the chairlifts. Seasonal latency.')],
['Tumbleweed Telecom','eye',['phx','dal'],tr('Covers a lot of empty ground.')],
['Crypto Bro Colo','cdn',['ash','mia'],tr('Ten thousand GPUs and a podcast.')],
['Ye Olde University Network','eye',['bos','lon'],tr('Has had a /8 since before you were born.')],
['Mom & Pop Packet Shop','eye',['nyc'],tr('Family-run since dial-up. Still answers the phone.')],
['Space Cowboy Broadband','eye',['hou','dal'],tr('Yee-haw and low Earth orbit.')],
['Fry Sauce Fibre','eye',['slc'],tr('Utah’s dipping-sauce of an ISP.')],
['Sauna Uplink Oy','cdn',['hel','sto'],tr('Servers cooled by the lake, then used to heat the sauna.')],
['Reindeer Relay','eye',['sto','osl','hel'],tr('Wireless links across the tundra. Antlers occasionally in the way.')],
['Pierogi Hosting','cdn',['waw'],tr('Cheap, filling hosting. Ask for the potato-and-cheese plan.')],
['Sunflower Uplink','eye',['kyv','waw'],tr('Kept the lights on in its town through every blackout.')],
['Tram Line Telecom','eye',['prg','vie'],tr('Fiber laid under the tram tracks during a night shift.')],
['Paprika Peering','eye',['bud'],tr('Spicy pricing, mild latency.')],
['Dracula Datacenter','cdn',['buh'],tr('Only comes online at night.')],
['Bosphorus Ferry Net','eye',['ist'],tr('Wi-Fi on every ferry, backhaul on every bridge.')],
['Gondola Gigabit','eye',['mil','rom'],tr('Started in Venice. Upgraded to land.')],
['Nonna’s Pasta Pipes','cdn',['rom','pmo'],tr('Hosting for every family restaurant in the south.')],
['Tram 28 Telecom','eye',['lis'],tr('Slow on the hills, fast on the flat.')],
['Olive Grove Online','eye',['ath'],tr('Rural broadband for the islands, one olive tree at a time.')],
['Siesta Server Hotel','cdn',['mad'],tr('Down from 2 to 5 p.m. every day. By design.')],
['Bouillabaisse Bits','cdn',['mrs','par'],tr('A rich mix of everything the fishermen brought in.')],
['Baguette Bandwidth Associés','eye',['par'],tr('Delivered fresh every morning.')],
['Pub Quiz Internet','eye',['dub','lon'],tr('Founded after a pub quiz, by the losing team.')],
['Gaming Café Net','eye',['lag'],tr('Internet cafe turned ISP. The gamers came for the ping.')],
['Matatu Mobile Mesh','eye',['nbo'],tr('Wi-Fi on minibuses, and the music is free.')],
['Load-Shedding Survivors','eye',['jnb','cpt'],tr('Has more batteries than customers.')],
['Bollywood Buffer','cdn',['bom','del'],tr('Three-hour films, zero-second start times.')],
['Hawker Centre Hosting','cdn',['sin','kul'],tr('Cheap, fast and open late.')],
['Karaoke Box Networks','cdn',['tok','osa','icn'],tr('Lyrics servers, low latency, high pitch.')],
['Night Market Net','eye',['tpe','hkg'],tr('Comes alive after dark.')],
['Kangaroo Courier','eye',['syd','mel','bne'],tr('Packets hop. Sometimes backwards.')],
['Hobbit Hole Hosting','cdn',['akl'],tr('Cosy racks under a hill. Second breakfast at 11.')],
['Capybara Connect','eye',['sao','poa','bue'],tr('Gets along with every other network. Famously chill.')],
['Llama Link','eye',['lim','scl','bog'],tr('Mountain wireless. Will spit at bad routes.')],
['Supercar Hosting','cdn',['dxb'],tr('Gold-plated servers, valet parking for packets.')],
['Tango Transit Co-op','eye',['bue','cor'],tr('It takes two to peer.')],
['Bánh Mì Broadband','eye',['sgn'],tr('Crispy on the outside, cheap on the inside.')],
['Jeepney Jumpnet','eye',['mnl'],tr('Colourful, crowded and gets you there eventually.')],
['Game Server Gremlins','cdn',['fra','ams','lon','nyc','sjc'],tr('Hosts every game you play at 2 a.m. Hates jitter.'),0.003],
['Discord-ant Voice Relay','cdn',['ams','fra','ash'],tr('Voice chat for millions of gamers who all talk at once.'),0.003],
['Mastodon Instance Herd','cdn',['ber','ams','par'],tr('A thousand tiny social networks on one rack.')],
['Dutch Bike Fibre','eye',['ams'],tr('Fiber laid along the bike lanes. Fastest in the rain.')],
['Chip Fab Cleanroom Net','cdn',['tpe','phx'],tr('Bunny suits mandatory in the server room.')],
['Volunteer Fire Brigade Wi-Fi','eye',['vie','zrh'],tr('Runs the village network between call-outs.')],
['Peach State Hosting','cdn',['atn'],tr('Sweet, fuzzy and surprisingly reliable.')],
['Chowder Hosting','cdn',['bos'],tr('Thick, comforting and very New England.')],
];
function ixStatic(c){const o=[];if(CITY[c]&&CITY[c].ix)o.push(c);for(const x of XIX)if(x.c===c)o.push(x.id);return o;}
TAIL.forEach(([name,type,home,blurb,sh],i)=>{const h=hstr(name),cand=home.flatMap(ixStatic),ix=[];
if(cand.length){ix.push(cand[h%cand.length]);if(cand.length>1&&(h>>>8)%100<40){const o=cand[(h>>>12)%cand.length];if(!ix.includes(o))ix.push(o);}}
const sel=(h>>>4)%10>=8;
NETS.push({id:'tail'+i,name,asn:200000+(h%190000),type,tail:true,pol:sel?'selective':'open',...(sel?{minIx:1+(h>>>16)%3,minPni:6+(h>>>18)%8}:{}),share:sh||+(0.0006+((h>>>20)%15)*0.0001).toFixed(4),col:`hsl(${h%360} 55% 46%)`,pops:home.slice(),ix,blurb});});
NETS.push(
{id:'ktt',name:'Kay-Tea',asn:4766,type:'eye',pol:'paid',paidFee:5000,perG:90,kr:true,share:.012,col:'#E4002B',pops:['icn','hkg','tok','lax'],ix:[],blurb:tr('Korea’s incumbent. Sender pays: every gigabit you hand it is billed, on top of the port.')},
{id:'skb',name:'SK Broadbandit',asn:9318,type:'eye',pol:'paid',paidFee:4000,perG:110,kr:true,share:.01,col:'#EA002C',pops:['icn','hkg','sjc'],ix:[],blurb:tr('Took a streaming giant to court over who pays for the traffic its own customers asked for. Paid peering, per gigabit.')},
{id:'lgu',name:'LG You-Pay-Plus',asn:3786,type:'eye',pol:'paid',paidFee:3000,perG:80,kr:true,share:.008,col:'#E6007E',pops:['icn','tok'],ix:[],blurb:tr('The plus is a usage fee. Paid peering, per gigabit.')});
NETS.push(
{id:'btt',name:'Bee-Tee',asn:2856,type:'eye',pol:'selective',minIx:10,minPni:30,share:.012,col:'#5514B4',pops:['lon','man','edi','bde'],ix:['lon','man'],blurb:tr('The UK’s incumbent. Buzzes politely, stings on price.')},
{id:'sky',name:'Sky-High Broadband',asn:5607,type:'eye',pol:'selective',minIx:6,minPni:25,share:.008,col:'#0072C9',pops:['lon','man','edi','dub'],ix:['lon','man','edi'],blurb:tr('Football, films and a router that looks like a spaceship.')},
{id:'vmo',name:'Virgin Mediocre',asn:5089,type:'eye',pol:'selective',minIx:6,minPni:25,share:.007,col:'#E10A0A',pops:['lon','man','edi'],ix:['lon','man'],blurb:tr('Cable broadband for half of Britain. Fast on a good day.')},
{id:'tnr',name:'Tele-Nor-Way',asn:2119,type:'eye',pol:'selective',minIx:5,minPni:20,share:.006,col:'#00A9E0',pops:['osl','svg','sto','cph'],ix:['osl','svg'],blurb:tr('Norway’s incumbent. Neither yes nor no, until you send enough traffic.')});
NETS.push(
{id:'hwt',name:'Hawaiian Telecombo',asn:36149,type:'eye',pol:'selective',minIx:3,minPni:15,share:.004,up:['ntt','lvl'],col:'#5B2A86',pops:['hnl'],ix:['hnl'],blurb:tr('Hawaii’s incumbent. Every plan comes with two scoops of rice and a side of macaroni salad.')},
{id:'gtg',name:'Grand Theft Teleguam',asn:9246,type:'t2',pol:'open',share:.002,price:8,up:['ntt','tat'],col:'#0072CE',pops:['gum','ror','maj','hnl','tok'],ix:['gum','hnl'],blurb:tr('Guam’s incumbent and the way out for half of Micronesia. The prices are a heist, but nobody else is selling.')},
{id:'dcp',name:'Docomoco Pacific',asn:3605,type:'eye',pol:'selective',minIx:2,minPni:10,share:.002,up:['ntt'],col:'#E4002B',pops:['gum','ror'],ix:['gum'],blurb:tr('Guam’s mobile network: rice, a burger, a fried egg and lots of gravy, served over 5G.')},
{id:'dsp',name:'Digi-Sell Pacific',asn:38442,type:'t2',pol:'open',share:.005,price:9,up:['ntt','tat'],col:'#E2001A',pops:['pom','suv','tbu','apw','syd'],ix:['suv'],blurb:tr('Phones on every island from Papua New Guinea to Tonga, and transit to sell on each one.')},
{id:'fnt',name:'FINTEL-ligent',asn:9241,type:'t2',pol:'open',share:.002,price:8,up:['ntt','tly'],col:'#00A3AD',pops:['suv','tbu','apw','ppg','syd','hnl'],ix:['suv'],blurb:tr('Fiji’s international gateway. Very clever about where your traffic should go, as long as it goes through Suva.')},
{id:'pft',name:'Postes et Télé-Croissant',asn:56055,type:'t2',pol:'selective',minIx:3,minPni:15,share:.003,price:10,up:['tly','cog'],col:'#F7B500',pops:['nou','ppt','syd','lax'],ix:['nou'],blurb:tr('Runs the post, the phones and the internet in New Caledonia and French Polynesia. Packets arrive stamped, with a croissant.')},
{id:'tkp',name:'Telly-Kom PNG',asn:17828,type:'eye',pol:'selective',minIx:2,minPni:10,share:.003,up:['tat'],col:'#C8102E',pops:['pom'],ix:[],blurb:tr('Papua New Guinea’s state telco: eight hundred languages, one billing system.')},
{id:'otk',name:'Ours-Truly Telekom',asn:45891,type:'eye',pol:'selective',minIx:1,minPni:8,share:.001,up:['tly'],col:'#00843D',pops:['hir'],ix:['hir'],blurb:tr('The Solomon Islands’ incumbent. Yours sincerely, eventually.')},
{id:'tcc',name:'Tongue-in-Cheek Comms',asn:38201,type:'eye',pol:'selective',minIx:1,minPni:8,share:.001,up:['ntt'],col:'#C10230',pops:['tbu'],ix:[],blurb:tr('Tonga’s own telco. Lived through a volcano that cut its only cable, and jokes about it now.')},
{id:'bsk',name:'Blue-Sky-Pie Samoa',asn:17993,type:'eye',pol:'selective',minIx:1,minPni:8,share:.001,up:['tly'],col:'#0096D6',pops:['apw','ppg'],ix:[],blurb:tr('Samoa’s broadband, promised with a slice of something sweet.')},
{id:'pnc',name:'PNC-See',asn:9534,type:'eye',pol:'selective',minIx:1,minPni:8,share:.0005,up:['ntt'],col:'#1B75BB',pops:['ror'],ix:[],blurb:tr('Palau’s telco. Snorkel down and you can see the cable.')},
{id:'nta',name:'Never Too Atoll',asn:21581,type:'eye',pol:'selective',minIx:1,minPni:8,share:.0005,up:['ntt'],col:'#2E8B57',pops:['maj'],ix:[],blurb:tr('The Marshall Islands’ telco, two metres above the sea and proud of every centimetre.')});
NETS.push(
{id:'onc',name:'One Commotion',asn:3855,type:'eye',pol:'selective',minIx:1,minPni:8,share:.001,up:['lvl','tly'],col:'#E4007C',pops:['bda'],ix:[],blurb:tr('Bermuda’s phones, TV and internet from one very busy office. Half its business customers are reinsurers, and they have priced in the Triangle.')},
{id:'cvt',name:'Curriculum Vitae Telecom',asn:37517,type:'t2',pol:'open',share:.002,price:8,up:['tat','tly'],col:'#004B87',pops:['rai','lis','for','dkr'],ix:['rai'],blurb:tr('Cape Verde’s incumbent and the islands’ way out. Its CV lists every cable between Europe, Africa and Brazil, and it brings it up at every meeting.')},
{id:'pss',name:'Pretty Sure South Atlantic',asn:210841,type:'t2',pol:'open',share:.0005,price:12,up:['tat'],col:'#7D2B8B',pops:['jam','cpt'],ix:[],blurb:tr('The telco for St Helena, Ascension and the Falklands. Is the link up? Pretty sure.')},
{id:'bst',name:'Beastlink',asn:11260,type:'eye',pol:'selective',minIx:2,minPni:10,share:.002,up:['cog','lvl'],col:'#EE3124',pops:['hfx','tor'],ix:['hfx'],blurb:tr('Atlantic Canada’s cable company, raised on lobster and long winters. Polite on the phone, a beast at the peering table.')});