Site: shown names follow the camera; touch tests fail on console and request errors (R2.2)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-09 01:11:59 -04:00
1 parent a9f093ca26
commit 41fe64c74d
3 files changed
+29 -1

No files matched your search

+5 -1
View File
@@ -23,6 +23,7 @@ export function touch(host: HTMLElement, svg: SVGSVGElement, parts: Map<string,
caption.setAttribute("aria-hidden", "true");
host.append(caption);
const follow = () => place(caption, host, svg, blocks);
const show = () => {
const up = state.hover || state.focus;
for (const b of blocks) {
@@ -30,7 +31,10 @@ export function touch(host: HTMLElement, svg: SVGSVGElement, parts: Map<string,
b.classList.toggle("pressed", up && state.press);
}
caption.classList.toggle("shown", up);
if (up) place(caption, host, svg, blocks);
// The camera announces each move on the host.
if (up) host.addEventListener("moved", follow);
else host.removeEventListener("moved", follow);
if (up) follow();
};
const set = (change: Partial<typeof state>) => {
Object.assign(state, change);
+1
View File
@@ -319,6 +319,7 @@ export function tour(hero: HTMLElement): { section: HTMLElement; host: HTMLEleme
const tx = cam.ax - cam.s * (cam.cx - origin[0]);
const ty = cam.ay - cam.s * (cam.cy - origin[1]);
world.style.transform = `matrix(${cam.s}, 0, 0, ${cam.s}, ${tx}, ${ty})`;
host.dispatchEvent(new Event("moved"));
const fade = still() ? (p < 0.5 ? 1 : 0) : Math.max(0, 1 - p / HOLD);
hero.style.opacity = String(fade);
hero.style.visibility = fade > 0 ? "" : "hidden";