In this section
- Iterations — 03 Code Particle render · galaxies-wafers / iterations/03-code-particle/app.mjs lines 532–562
- Code Particle render · galaxies-wafers / iterations/03-code-particle/code-particle.mjs lines 1–129
- Iterations — 03 Code Particle Page render · galaxies-wafers / iterations/03-code-particle/index.html lines 1–44
- Questions render · galaxies-wafers / iterations/03-code-particle/questions.mjs lines 1–128
- Iterations — 03 Code Particle Style Sheet render · galaxies-wafers / iterations/03-code-particle/style.css lines 1–93
Iterations — 03 Code Particle
A JavaScript module in Galaxies Wafers that draws lines meta and families, using SHA-256. Served with the page at https://ventusltd.github.io/galaxies-wafers/iterations/03-code-particle/.
Set aside from the main view: 91% of its lines are the same as iterations/31-code-card-everywhere/app.mjs (galaxies-wafers), which stays. (near-copy-of, proposed by families.py). 90% of lines shared with Iterations — 31 Code Card Everywhere; read that one first. All set-aside files, with reasons. Nothing was deleted.
Evidence
- line-jaccard 0.9073 to galaxies-wafers@5814793812add74605660fa821e6a39b8de80588 iterations/31-code-card-everywhere/app.mjs:1-583 f469a8112fc2ad6e45e0695624b1e21f9647bd0a
- sha256 d928658d90230a4fcd0a3e974ffa00f15cc37095ff29160ac4ba8fcdf40a33af
- target sha256 26624832f9452671a5e7da874b43588975adc4ac8c134efe1f130cff94c815fc
- group of 7 (identity.json near-copy edges >= 0.9)
- canonical rule: reachable, newest stamp, core repo, most lines
rendergalaxies-wafers / iterations/03-code-particle/app.mjs · lines 532–562 of 562 (continued from section 1178) · Entry point · pattern nearestKeyAt (shared by 16 files)
- What it does
- It draws lines meta and families. Defines 31 functions or classes, including $, snapshot, indexOfKey, bin, tier1. Side effects: changes the web page (DOM); makes network requests.
- Why it exists in the grid workflow
- README: "The page (`index.html`, `app.mjs`, `lib.mjs`) is inherited unchanged from testcode/202609151339."
- Inputs & outputs
- In: JSON file all-lines.meta.json; JSON file families.json. Out: WebGL/WebGPU drawing.
- Downstream impact
- Used directly by 1 file: Iterations — 03 Code Particle Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/03-code-particle/). It is itself an entry point, published at https://ventusltd.github.io/galaxies-wafers/iterations/03-code-particle/.
- What it achieves
- It indexes key (`indexOfKey`), builds gl (`buildGL`) and draws marks (`drawMarks`). The Line Wafer. It responds to pointerdown, pointermove and pointerup events.
- Why it matters
- Loaded by the page of the same name at https://ventusltd.github.io/galaxies-wafers/iterations/03-code-particle/.
- Application
- galaxies-wafers · iterations/03-code-particle · JavaScript module
- Uses
- Galaxies Wafers — Lib (import), Code Particle (dynamic import)
- Used by
- loaded by Iterations — 03 Code Particle Page (script src)
- Produces
- $, snapshot, indexOfKey, bin, tier1, tier2, compile, initGL, fallback2d, buildGL, put, resize
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- galaxies-wafers@5814793812add74605660fa821e6a39b8de80588 iterations/03-code-particle/app.mjs:532-562 · blob cd48c6502c02b5f5c9132b25c7dc099a3aef6b64 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, network · domain stage: unknown · users: none · canonical: duplicate_candidate
(async function start() {
try {
await tier1();
} catch (e) {
$('count').textContent = 'Could not load the numbered database: ' + e.message
+ '. Check the internet connection and reload.';
return;
}
resize();
try { initGL(); } catch (e) {
ctx2d = stage.getContext('2d');
$('hint').textContent = 'GPU not available: drawn without animation';
}
home();
gestures();
window.addEventListener('resize', () => { resize(); draw(); });
$('beam').addEventListener('submit', e => {
e.preventDefault();
const pa = parseKey($('a').value), pb = parseKey($('b').value);
if (!pa.ok) { refuse(`That is not a line number: ${pa.why}.`); return; }
if ($('b').value.trim() && !pb.ok) { refuse(`Second number: ${pb.why}.`); return; }
if (pb.ok) { view.focus = -1; connect(pa.key, pb.key); writeURL(pa.key, pb.key); }
else { view.focus = pa.key; view.link = null; paintPanel(pa.key); flyTo(pa.key); writeURL(pa.key, null); }
document.activeElement?.blur();
});
$('close').addEventListener('click', () => { $('panel').hidden = true; view.focus = -1; view.link = null; draw(); });
readURL();
tier2().catch(e => { $('prov').textContent = 'family index unavailable: ' + e.message; });
})();Code Particle
A JavaScript module in the iterations folder of Galaxies Wafers that draws blocks and uses data from the stars repository. Served with the page at https://ventusltd.github.io/galaxies-wafers/iterations/03-code-particle/.
rendergalaxies-wafers / iterations/03-code-particle/code-particle.mjs · lines 1–129 of 129 · pattern readFile (shared by 2 files)
- What it does
- It draws blocks. Defines 6 functions or classes, including FetchQueue, el, loadRegister, readFile, openCode. Side effects: changes the web page (DOM); reads or writes files; makes network requests.
- Inputs & outputs
- In: data source: stars data; JSON file blocks.json.
- Downstream impact
- Used directly by 1 file: Iterations — 03 Code Particle (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/03-code-particle/). Reached from 1 other entry point, including Iterations — 03 Code Particle Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/03-code-particle/).
- What it achieves
- It fetches queue (`FetchQueue`), loads register (`loadRegister`) and reads file (`readFile`). The code particle: a tapped line opens the real code block it belongs to.
- Why it matters
- Imported by Iterations — 03 Code Particle.
- Application
- galaxies-wafers · iterations/03-code-particle · JavaScript module
- Uses
- none found
- Used by
- imported by Iterations — 03 Code Particle (dynamic import)
- Produces
- openCode
- Defines here
- FetchQueue, el, loadRegister, readFile, openCode, setTag
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- galaxies-wafers@5814793812add74605660fa821e6a39b8de80588 iterations/03-code-particle/code-particle.mjs:1-129 · blob e396f495a917aaaf0a89461fd21a9365f3265d21 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem, network · domain stage: unknown · users: none · canonical: unknown
/* The code particle: a tapped line opens the real code block it belongs to.
*
* Grid Atlas pattern, rewritten for one panel: nothing is fetched at page load;
* the block register is fetched once on first need; source files go through a
* FetchQueue of concurrency 2; setTag is the single writer of the WAIT/LOAD/OK/FAIL
* state shown in the panel. Fetched text only ever reaches the DOM via textContent.
*/
const REGISTER = 'https://ventusltd.github.io/stars/blocks/blocks.json';
const RAW = 'https://raw.githubusercontent.com/';
const SHOW = 200;
class FetchQueue {
constructor(concurrency) { this.concurrency = concurrency; this.active = 0; this.waiting = []; }
async add(task, onWait) {
if (this.active >= this.concurrency) { onWait?.(); await new Promise(r => this.waiting.push(r)); }
this.active++;
try { return await task(); }
finally { this.active--; if (this.waiting.length) this.waiting.shift()(); }
}
}
const queue = new FetchQueue(2);
const source = new Map(); /* repo@commit:path -> Promise<string> */
let register = null; /* Promise<Map<familyN, block>> */
let token = 0; /* the panel belongs to the latest tap only */
const el = (tag, cls, text) => {
const e = document.createElement(tag);
if (cls) e.className = cls;
if (text != null) e.textContent = text;
return e;
};
function loadRegister() {
if (!register) register = fetch(REGISTER, { cache: 'default' }).then(r => {
if (!r.ok) throw new Error(REGISTER + ' returned HTTP ' + r.status);
return r.json();
}).then(j => {
const byFamily = new Map();
for (const b of j.blocks) for (const i of b.inside || []) if (!byFamily.has(i.family)) byFamily.set(i.family, b);
return byFamily;
}).catch(e => { register = null; throw e; });
return register;
}
function readFile(file, onWait) {
const key = `${file.repo}@${file.commit}:${file.path}`;
if (!source.has(key)) {
const p = queue.add(async () => {
const url = `${RAW}${file.repo}/${file.commit}/${file.path}`;
const r = await fetch(url);
if (!r.ok) throw new Error(url + ' returned HTTP ' + r.status);
return r.text();
}, onWait);
p.catch(() => source.delete(key));
source.set(key, p);
}
return source.get(key);
}
/* families: the family records carrying the tapped line, in panel order. */
export async function openCode(families, host) {
const mine = ++token;
const box = el('div'); box.id = 'code';
const tag = el('span', 'tag');
const msg = el('span', 'dim');
const setTag = (state, text) => { /* the single writer */
if (mine !== token) return false;
tag.dataset.s = state; tag.textContent = state;
if (text != null) msg.textContent = text;
return true;
};
box.append(tag, msg);
host.querySelector('#code')?.remove();
host.appendChild(box);
setTag('LOAD', 'reading the block register…');
let byFamily;
try { byFamily = await loadRegister(); }
catch (e) { setTag('FAIL', 'Could not read the block register: ' + e.message); return; }
let fam = null, block = null;
for (const f of families) { const b = byFamily.get(f.n); if (b && b.files?.length) { fam = f; block = b; break; } }
if (!block) {
setTag('OK', `Resolved no block: none of the ${families.length} ${families.length === 1 ? 'family' : 'families'} carrying this line is inside any block in the register, so there is no pinned code to show.`);
return;
}
const where = el('p', 'dim', `Resolved block ${block.symbol} · ${block.title} — via family #${fam.n} ${fam.name}` +
(families.length > 1 ? ` (the first of the ${families.length} carrying families that a block contains)` : ''));
box.appendChild(where);
/* A block can pin several copies; read them in register order through the
queue and stop at the first that defines the family's function. */
const esc = fam.name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
const def = new RegExp(`(function\\s*\\*?\\s*${esc}\\b|\\b(const|let|var)\\s+${esc}\\s*=|^\\s*(async\\s+)?${esc}\\s*(\\(|:)|\\bdef\\s+${esc}\\b)`);
const word = new RegExp(`\\b${esc}\\b`);
let file = null, lines = null, hit = -1, lastErr = null;
for (const [n, f] of block.files.entries()) {
setTag('LOAD', `fetching file ${n + 1} of ${block.files.length} at its pinned commit…`);
let text;
try { text = await readFile(f, () => setTag('WAIT', 'queued behind other fetches…')); }
catch (e) { lastErr = e; continue; }
if (mine !== token) return;
const ls = text.split('\n'), h = ls.findIndex(l => def.test(l));
if (!file || h >= 0) { file = f; lines = ls; hit = h; }
if (h >= 0) break;
}
if (!file) { setTag('FAIL', 'Could not read the source: ' + lastErr.message); return; }
const defined = hit >= 0;
if (!defined) hit = lines.findIndex(l => word.test(l) && !/^\s*(\*|\/\/|\/\*|#)/.test(l));
const start = hit < 0 ? 0 : Math.max(0, Math.min(hit - 4, lines.length - SHOW));
const shown = lines.slice(start, start + SHOW);
const gh = `https://github.com/${file.repo}/blob/${file.commit}/${file.path}` + (hit >= 0 ? `#L${hit + 1}` : '');
const head = el('div', 'codehead');
head.append(`${file.path} · ${file.repo} @ ${file.commit.slice(0, 7)} · lines ${start + 1}–${start + shown.length} of ${lines.length}` +
(hit < 0 ? ` · "${fam.name}" not found in this file, showing the top`
: ` · ${fam.name} ${defined ? 'defined' : 'first used'} at line ${hit + 1}`) + ' · ');
const a = el('a', null, 'open on GitHub'); a.href = gh; a.target = '_blank'; a.rel = 'noopener';
head.appendChild(a);
const pre = el('pre');
pre.textContent = shown.map((l, i) => String(start + i + 1).padStart(5) + ' ' + l).join('\n');
box.append(head, pre);
setTag('OK', `file ${block.files.indexOf(file) + 1} of ${block.files.length} in the block, at the commit the register pins`);
if (hit >= 0) {
const lh = parseFloat(getComputedStyle(pre).lineHeight) || 16;
pre.scrollTop = (hit - start) * lh;
}
}Iterations — 03 Code Particle Page
A web page in Galaxies Wafers. Published at https://ventusltd.github.io/galaxies-wafers/iterations/03-code-particle/.
rendergalaxies-wafers / iterations/03-code-particle/index.html · lines 1–44 of 44 · Entry point
- What it does
- It draws its content. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- README: "The page (`index.html`, `app.mjs`, `lib.mjs`) is inherited unchanged from testcode/202609151339."
- Inputs & outputs
- In: form fields (user input). Out: web page.
- Downstream impact
- It is itself an entry point, published at https://ventusltd.github.io/galaxies-wafers/iterations/03-code-particle/.
- What it achieves
- Code Particle — tap a line, read its code.
- Why it matters
- No other file in the estate was found to import it; it is an entry point.
- Application
- galaxies-wafers · iterations/03-code-particle · page
- Uses
- Iterations — 03 Code Particle Style Sheet (stylesheet), Questions (stylesheet), Galaxies Wafers — Proof Page (link), Iterations — 03 Code Particle (script src), Questions (script src)
- Used by
- none found
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- galaxies-wafers@5814793812add74605660fa821e6a39b8de80588 iterations/03-code-particle/index.html:1-44 · blob 7c95662dcb8dc17065afabdc20750610495abbca · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: unknown
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover, maximum-scale=5">
<meta name="color-scheme" content="dark">
<title>Code Particle — tap a line, read its code</title>
<link rel="icon" href="data:,">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="questions.css">
</head>
<body>
<canvas id="stage" aria-label="Every permanently numbered line of code in the estate, placed by its own number."></canvas>
<header id="bar">
<span id="wordmark">THE LINE WAFER</span>
<span id="count" class="dim">loading the numbered database…</span>
<details id="questions"><summary>Questions</summary><dl id="qlist"></dl><p id="machine" class="dim"></p></details>
</header>
<form id="beam" autocomplete="off">
<input id="a" inputmode="numeric" pattern="[0-9]*" placeholder="line number" aria-label="line number to fly to">
<input id="b" inputmode="numeric" pattern="[0-9]*" placeholder="connect to…" aria-label="second line number to connect to">
<button id="go" type="submit">FLY</button>
</form>
<section id="panel" hidden>
<button id="close" type="button" aria-label="close">✕</button>
<div id="panelbody"></div>
</section>
<footer id="foot">
<span id="prov" class="dim">provenance loading</span>
<span id="hint" class="dim">drag to steer · pinch or scroll to focus the beam · tap a line</span>
<a id="proofs" href="../../proof/">check every claim on this page</a>
</footer>
<noscript><p class="dim" style="padding:1rem">This surface is drawn from the numbered database at run time, so it needs JavaScript. Nothing here is typed into the page.</p></noscript>
<script type="module" src="app.mjs"></script>
<script type="module" src="questions.mjs"></script>
</body>
</html>Questions
A JavaScript module in the iterations folder of Galaxies Wafers that draws blocks and uses data from the stars repository. Served with the page at https://ventusltd.github.io/galaxies-wafers/iterations/03-code-particle/.
rendergalaxies-wafers / iterations/03-code-particle/questions.mjs · lines 1–128 of 128 · Entry point · pattern sldSentence (shared by 8 files)
- What it does
- It draws blocks. Defines 13 functions or classes, including $, fmt, answer, fill, readJSON. Side effects: changes the web page (DOM); reads or writes files; makes network requests.
- Inputs & outputs
- In: data source: stars data; JSON file blocks.json.
- Downstream impact
- Used directly by 1 file: Iterations — 03 Code Particle Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/03-code-particle/). It is itself an entry point, published at https://ventusltd.github.io/galaxies-wafers/iterations/03-code-particle/.
- What it achieves
- It reads JSON (`readJSON`) and is built from the fmt step (`fmt`) and the answer step (`answer`). Iteration 03, Code Particle: the owner's three questions and the machine detail line. It responds to resize and toggle events.
- Why it matters
- Loaded by the 03 Code Particle page at https://ventusltd.github.io/galaxies-wafers/iterations/03-code-particle/.
- Application
- galaxies-wafers · iterations/03-code-particle · JavaScript module
- Uses
- none found
- Used by
- loaded by Iterations — 03 Code Particle Page (script src)
- Produces
- $, fmt, answer, fill, readJSON, layerTags, sldSentence, text, mount, fit, paint, cat
- Defines here
- $, fmt, answer, fill, readJSON, layerTags, sldSentence, text, mount, fit, paint, cat, list
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- galaxies-wafers@5814793812add74605660fa821e6a39b8de80588 iterations/03-code-particle/questions.mjs:1-128 · blob dec5b7ec80aa67e0e82232b6d125affda94ce198 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem, network · domain stage: unknown · users: none · canonical: unknown
/* questions.mjs — iteration 03, Code Particle: the owner's three questions and
* the machine detail line. Register counts are read at run time from the live
* block register when the reader opens the panel (the same URL and cache mode
* code-particle.mjs uses); functions are cited to file and line.
*/
const $ = id => document.getElementById(id);
const fmt = n => Number(n).toLocaleString('en-GB');
const DATA_PIN = 'https://globalgrid2050.com/testcode/202609142202/data/';
const SEARCH = 'repository search at ee082ea'; /* the commit the "who else" searches were run on */
/* One question and its answer. Parts are strings or [text, href] links; text only, never HTML. */
function answer(dl, q, parts) {
const dt = document.createElement('dt'); dt.textContent = q;
const dd = document.createElement('dd');
const fill = ps => {
dd.replaceChildren();
for (const p of [].concat(ps)) {
if (Array.isArray(p)) { const a = document.createElement('a'); a.textContent = p[0]; a.href = p[1]; dd.append(a); }
else dd.append(String(p));
}
};
fill(parts);
dl.append(dt, dd);
return fill;
}
/* One fetch, 15 s timeout, only when the reader opens the panel. */
async function readJSON(url) {
const c = new AbortController();
const t = setTimeout(() => c.abort(), 15000);
try {
const r = await fetch(url, { cache: 'default', signal: c.signal });
if (!r.ok) throw new Error(url + ' returned HTTP ' + r.status);
return await r.json();
} finally { clearTimeout(t); }
}
/* The layer rows' tags as the layers panel shows them now, counted from its own DOM. */
function layerTags() {
const c = new Map();
for (const t of document.querySelectorAll('#layersList .ltag')) {
const s = (t.textContent.match(/[A-Z]+/) || ['?'])[0];
c.set(s, (c.get(s) || 0) + 1);
}
return c.size ? [...c].map(([s, n]) => `${fmt(n)} ${s}`).join(', ') : 'layer rows not built yet';
}
/* Layers whose id names an SLD, read from a manifest at run time (name-match inference). */
function sldSentence(m, file) {
const hits = m.layers.filter(l => /sld/i.test(l.id));
if (!hits.length) return `None of the ${fmt(m.layers.length)} layers in ${file} carries "sld" in its id.`;
return `Of ${fmt(m.layers.length)} layers in ${file}, ${hits.length} carry "sld" in their id (name-match inference): ` +
hits.map(l => `${l.id} (${fmt(l.features)} features, draws ${l.draws})`).join(', ') + '.';
}
const text = id => ($(id)?.textContent || '').trim();
/* Collapsed by default. Nothing is read or fetched until the reader opens it; the
machine line repaints every 500 ms only while it is open. */
function mount(build, machine) {
const box = $('questions'), dl = $('qlist'), out = $('machine');
if (!box || !dl || !out) return;
let built = false, timer = 0;
/* Opened, the panel stops above whatever is drawn at the bottom (line panel, clock, strip, beam form), never over it. */
const fit = () => {
const top = box.getBoundingClientRect().top;
let floor = innerHeight;
for (const id of ['panel', 'clock', 'ptable', 'beam']) {
const el = $(id);
const r = el && !el.hidden ? el.getBoundingClientRect() : null;
if (r && r.height > 0 && r.top > top) floor = Math.min(floor, r.top);
}
box.style.maxHeight = Math.max(96, Math.min(innerHeight * 0.45, floor - top - 8)) + 'px';
};
const paint = () => {
fit();
try { out.textContent = 'Machine detail · ' + machine(); }
catch (e) { out.textContent = 'Machine detail · not established: ' + e.message; }
};
/* A bottom element that grows while the panel is open refits it at once, not at the next repaint. */
if ('ResizeObserver' in window) {
const ro = new ResizeObserver(() => { if (box.open) fit(); });
for (const id of ['panel', 'clock', 'ptable', 'beam']) if ($(id)) ro.observe($(id));
}
addEventListener('resize', () => { if (box.open) fit(); });
box.addEventListener('toggle', () => {
clearInterval(timer);
if (!box.open) return;
if (!built) { built = true; build(dl); }
paint();
timer = setInterval(paint, 500);
});
}
const COMMIT = 'e38ba10'; /* the commit that made this page; the Questions panel is added later */
const REGISTER = 'https://ventusltd.github.io/stars/blocks/blocks.json'; /* code-particle.mjs line 9 */
mount(dl => {
const q1 = answer(dl, '1 · How does this help draw a system or a single-line diagram?', 'reading the block register…');
answer(dl, '2 · What is this code used for?',
'Reading the real code behind a numbered line. app.mjs is the root page copied with two changes: the lib.mjs path and, at line 377, a dynamic import of code-particle.mjs after paintPanel() fills the line panel. ' +
'code-particle.mjs: loadRegister() line 34 fetches stars/blocks/blocks.json once and maps each family to its block; readFile() line 46 reads raw.githubusercontent at the commit the register pins, through FetchQueue(2) at line 22, cached per repo@commit:path; ' +
'openCode() line 62 finds the family\'s definition by pattern (line 95) and shows 200 lines around it, text only. ' +
`Who else: nothing imports code-particle.mjs but this page (${SEARCH}). Its pattern was copied, not imported, into the root app.mjs (comment at line 692) and iteration 31 card.mjs (line 12). ` +
`The register is also read by the root app.mjs, iterations 05, 26, 31, 32 and 37, and build/build_layers.py and build/build_layers_modules.py (${SEARCH}, text search). This page loads no layers panel (index.html has no layers-panel.mjs).`);
answer(dl, '3 · Where does it lead next?', [
['Iteration 31, Code Card Everywhere', '../31-code-card-everywhere/'],
' carries this reading of a register block\'s pinned file into a card on every tap (31-code-card-everywhere/card.mjs line 12). The code shown here leads to the block\'s file on GitHub at its pinned commit (openCode() line 114).']);
readJSON(REGISTER).then(reg => {
const cat = c => reg.blocks.filter(b => b.category === c);
const net = cat('network'), con = cat('connections');
const list = bs => bs.map(b => `${b.symbol} ${b.title}`).join('; ');
q1('It draws no electrical element; it maps code. A tapped line opens the pinned source of the register block that carries it, so where a block computes something about the grid its code can be read. ' +
`Measured from the live register now: ${fmt(reg.blocks.length)} blocks; category network holds ${net.length} (${list(net) || 'none'}), category connections holds ${con.length} (${list(con) || 'none'}). ` +
'That these concern grid elements is name-match inference from the register\'s category and title fields.');
}).catch(e => q1(`Not established: the block register could not be read (${e.message}). The page draws no electrical element.`));
}, () => {
const code = $('code');
const tag = code?.querySelector('.tag')?.textContent;
const where = code?.querySelector('p.dim')?.textContent;
return 'inputs: ?line= and ?to= (permanent line keys, positive integers, readURL() app.mjs line 498), a tap on the wafer (CSS px); ' +
`data: all-lines.meta.json, all-lines.bin, all-lines.len.bin, all-lines.family.bin, families.json and lines.bin from ${DATA_PIN} (app.mjs line 48), ${text('prov') || 'provenance not loaded yet'}; ` +
`the block register ${REGISTER} (live, not pinned to a commit); source files from raw.githubusercontent pinned to each file's commit in the register · ` +
`outputs: ${text('count') || 'count not loaded yet'}; code panel now ${tag ? `${tag}${where ? ' · ' + where : ''}` : 'not opened (tap a line carried by a family)'} · ` +
'refusals: FAIL with the HTTP status when the register or a source file cannot be read; OK "Resolved no block" when no carrying family is inside a block; refuse() app.mjs line 516 names why a linked or typed number cannot be used · ' +
`source: page commit ${COMMIT}; lib.mjs from this repository`;
});Iterations — 03 Code Particle Style Sheet
A style sheet in Galaxies Wafers. Served with the page at https://ventusltd.github.io/galaxies-wafers/iterations/03-code-particle/.
rendergalaxies-wafers / iterations/03-code-particle/style.css · lines 1–93 of 93 · Entry point
- What it does
- Side effects: changes the web page (DOM).
- Downstream impact
- Used directly by 1 file: Iterations — 03 Code Particle Page (galaxies-wafers, https://ventusltd.github.io/galaxies-wafers/iterations/03-code-particle/). It is itself an entry point, published at https://ventusltd.github.io/galaxies-wafers/iterations/03-code-particle/.
- What it achieves
- The Line Wafer. Designed at 430 px first; the desktop is the same layout with more room.
- Why it matters
- Loaded by the 03 Code Particle page at https://ventusltd.github.io/galaxies-wafers/iterations/03-code-particle/.
- Application
- galaxies-wafers · iterations/03-code-particle · style sheet
- Uses
- none found
- Used by
- loaded by Iterations — 03 Code Particle Page (stylesheet)
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- galaxies-wafers@5814793812add74605660fa821e6a39b8de80588 iterations/03-code-particle/style.css:1-93 · blob e493d3525eefaa58c049582d902eb68ca6ec3c2f · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: unknown
/* The Line Wafer. Designed at 430 px first; the desktop is the same layout with
more room. One canvas, three chrome strips, nothing that scrolls the page. */
:root{
--ink:#d8dee9; --dim:#8b93a7; --ground:#0b0d12; --edge:#1b2030;
--lit:#ffd54a; --beam:#5ec8f2;
--top:env(safe-area-inset-top,0px); --bot:env(safe-area-inset-bottom,0px);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
margin:0; background:var(--ground); color:var(--ink);
font:13px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
overflow:hidden; overscroll-behavior:none; -webkit-text-size-adjust:100%;
}
#stage{position:fixed; inset:0; width:100%; height:100%; display:block; touch-action:none}
#bar{
position:fixed; left:0; right:0; top:0; z-index:2;
display:flex; gap:.75rem; align-items:baseline; flex-wrap:wrap;
padding:calc(var(--top) + .5rem) .75rem .5rem;
background:linear-gradient(#0b0d12ee,#0b0d1200); pointer-events:none;
}
#wordmark{letter-spacing:.14em; font-size:11px}
.dim{color:var(--dim)}
#beam{
position:fixed; z-index:3; left:.5rem; right:.5rem;
bottom:calc(var(--bot) + 3.4rem);
display:flex; gap:.4rem;
}
#beam input{
flex:1 1 0; min-width:0; padding:.6rem .55rem;
background:#11151f; color:var(--ink); border:1px solid var(--edge); border-radius:6px;
font:inherit; font-size:16px; /* 16px stops iOS zooming the page on focus */
}
#beam input:focus{outline:none; border-color:var(--beam)}
#beam button{
flex:0 0 auto; padding:.6rem .9rem; border-radius:6px; cursor:pointer;
background:#11151f; color:var(--beam); border:1px solid var(--beam);
font:inherit; font-size:13px; letter-spacing:.1em;
}
#beam button:active{background:#16202c}
#panel{
position:fixed; z-index:4; left:.5rem; right:.5rem;
bottom:calc(var(--bot) + 6.6rem);
max-height:52vh; overflow:auto; -webkit-overflow-scrolling:touch;
background:#0e121bf2; border:1px solid var(--edge); border-radius:8px;
padding:.75rem .8rem 1rem;
}
#panel[hidden]{display:none!important}
#close{
position:absolute; top:.35rem; right:.4rem; width:2rem; height:2rem;
background:none; border:0; color:var(--dim); font:inherit; font-size:15px; cursor:pointer;
}
#panel h2{margin:0 .5rem .5rem 0; font-size:15px; font-weight:600; letter-spacing:.02em}
#panel h2 .n{color:var(--lit)}
#panel dl{display:grid; grid-template-columns:auto 1fr; gap:.15rem .6rem; margin:.5rem 0}
#panel dt{color:var(--dim)}
#panel dd{margin:0; overflow-wrap:anywhere}
#panel p{margin:.5rem 0 0}
#panel ul{margin:.35rem 0 0; padding-left:1.1rem}
#panel li{margin:.15rem 0}
.fam{color:var(--beam)}
.refuse{color:var(--lit)}
#foot{
position:fixed; z-index:2; left:0; right:0; bottom:0;
display:flex; gap:.15rem; flex-direction:column;
padding:.35rem .75rem calc(var(--bot) + .35rem);
background:linear-gradient(#0b0d1200,#0b0d12ee); pointer-events:none;
font-size:10.5px;
}
#hint{text-align:left}
#foot a{color:var(--beam); pointer-events:auto; text-decoration:underline}
@media (min-width:760px){
#beam{left:auto; right:1rem; width:26rem; bottom:calc(var(--bot) + 2.9rem)}
#foot{flex-direction:row; gap:.6rem; justify-content:space-between}
#hint{text-align:right}
#panel{left:1rem; right:auto; width:26rem; bottom:calc(var(--bot) + 2.5rem); max-height:66vh}
#foot{font-size:11px}
}
/* iteration 03: the code particle */
#code{margin-top:.6rem; border-top:1px solid #ffffff22; padding-top:.5rem}
#code .tag{display:inline-block; font:600 10px/1 ui-monospace,monospace; padding:.2rem .35rem; border:1px solid currentColor; border-radius:3px; margin-right:.4rem; letter-spacing:.06em}
#code .tag[data-s="WAIT"]{color:#9aa3b5} #code .tag[data-s="LOAD"]{color:#ffd54a}
#code .tag[data-s="OK"]{color:#39d353} #code .tag[data-s="FAIL"]{color:#ff6b6b}
#code .codehead{font:11px/1.4 ui-monospace,monospace; color:var(--dim); overflow-wrap:anywhere; margin:.35rem 0}
#code pre{max-height:40vh; overflow:auto; margin:.35rem 0 0; padding:.5rem; background:#0008; border:1px solid #ffffff1a; font:11px/1.45 ui-monospace,Consolas,monospace; white-space:pre; tab-size:2}
#code a{color:var(--lit)}