* feat(website): add local introduction and DX-Ball showcase * feat(website): illustrate REA and DX-Ball reconstruction Add two explanatory figures and an interactive comparison of recorded DX-Ball x86 instructions with maintained C. Preserve the full instruction listing, caller excerpt, constant reads, figure prompts and evidence provenance. Validation: Chrome preview at local root and /rea/; five comparison steps; 22 clipboard checks; keyboard navigation; responsive widths 1440, 768, 390 and 320. Verify assembly against saved REA Evidence and C against the pinned public source. Existing execution and compiler results are cited, not rerun. * docs(website): show the REA queries behind source recovery Present compact function, caller and byte-read request excerpts alongside recorded evidence. Keep the overview and case narrative focused on REA, with provider provenance in contributor notes. Replace raster references with maintained SVG source diagrams while retaining the established layout and image-generation prompts. Validation: local and /rea/ Chrome previews, five comparison steps, 22 clipboard checks, responsive widths and keyboard navigation passed. SVG XML and all 41 local links/assets passed checks.
58 lines
2.0 KiB
JavaScript
58 lines
2.0 KiB
JavaScript
function initializeCopyButtons() {
|
|
document.querySelectorAll("[data-copy]").forEach((button) => {
|
|
button.addEventListener("click", async () => {
|
|
const target = document.getElementById(button.getAttribute("data-copy"));
|
|
if (target === null) return;
|
|
|
|
const status = document.getElementById("copy-status");
|
|
try {
|
|
await navigator.clipboard.writeText(target.textContent.trim());
|
|
button.textContent = "Copied";
|
|
if (status !== null) status.textContent = "Code copied to clipboard.";
|
|
} catch {
|
|
const range = document.createRange();
|
|
range.selectNodeContents(target);
|
|
const selection = window.getSelection();
|
|
if (selection !== null) {
|
|
selection.removeAllRanges();
|
|
selection.addRange(range);
|
|
}
|
|
button.textContent = "Selected";
|
|
if (status !== null)
|
|
status.textContent = "Code selected. Use your keyboard to copy it.";
|
|
}
|
|
|
|
window.setTimeout(() => {
|
|
button.textContent = "Copy";
|
|
}, 2000);
|
|
});
|
|
});
|
|
}
|
|
|
|
initializeCopyButtons();
|
|
|
|
function initializeStepComparisons() {
|
|
document.querySelectorAll("[data-step-comparison]").forEach((comparison) => {
|
|
const buttons = comparison.querySelectorAll("[data-select-step]");
|
|
buttons.forEach((button) => {
|
|
button.addEventListener("click", () => {
|
|
const selected = button.getAttribute("data-select-step");
|
|
buttons.forEach((candidate) => {
|
|
candidate.setAttribute("aria-pressed", String(candidate === button));
|
|
});
|
|
comparison.querySelectorAll("[data-step]").forEach((fragment) => {
|
|
fragment.classList.toggle(
|
|
"is-active",
|
|
fragment.getAttribute("data-step") === selected,
|
|
);
|
|
});
|
|
comparison.querySelectorAll("[data-step-note]").forEach((note) => {
|
|
note.hidden = note.getAttribute("data-step-note") !== selected;
|
|
});
|
|
});
|
|
});
|
|
});
|
|
}
|
|
|
|
initializeStepComparisons();
|