Sharper first view and smoke loader sign-off

The loader now measures throughput from whole tile batches, not just the
two probe tiles, and after a session settles inside its deadline it tops
up in the background: the needed level if the budget cut it short, then
one level above it on capable devices with a fast connection (drawn
downscaled), within time and memory caps and never under Save-Data.

The chop in the album end card and the page footer is replaced by the
LUCIO loader in smoke from lucioIP, falling back to the SVG loader
without WebGL. sync-brand.sh now copies lucio-loaders.js and defaults to
../lucioIP.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Guoliang ChenandClaude Opus 5.5 committed 2026-11-07 01:47:44 -08:00
1 parent e48a1eacf4
commit 4cdbd66fcf
10 files changed
+990 -41

No files matched your search

+19 -10
View File
@@ -1,4 +1,4 @@
import { cloneChop, mountWordmark } from "./brand";
import { mountSignoffMark, mountWordmark } from "./brand";
import { CaptionPanel, setLang } from "./caption";
import type { View } from "./geometry";
import { guardLink, type GuardOptions } from "./gate";
@@ -110,6 +110,7 @@ export class Viewer {
private readonly indicator: BusyIndicator;
private readonly progress: ProgressLine;
private readonly homeMark: HTMLElement | null;
private readonly signoffMark: HTMLElement;
private nextStrip: Strip | null = null;
private nextSlug = "";
private idleTimer = 0;
@@ -184,6 +185,9 @@ export class Viewer {
throw new Error("canvas 2d unavailable");
}
this.g = g;
this.signoffMark = document.createElement("span");
this.signoffMark.className = "chop";
this.signoffMark.setAttribute("aria-hidden", "true");
this.endCard = this.buildEndCard();
this.nextLink = this.endCard.querySelector("a.next-album") as HTMLAnchorElement;
this.nextFrame = this.endCard.querySelector(".next-strip") as HTMLElement;
@@ -234,10 +238,7 @@ export class Viewer {
next.appendChild(frame);
const signoff = document.createElement("div");
signoff.className = "signoff";
const chop = cloneChop();
if (chop) {
signoff.appendChild(chop);
}
signoff.appendChild(this.signoffMark);
const signature = document.createElement("p");
signature.className = "signature";
signature.textContent = "— Lucio";
@@ -882,6 +883,9 @@ export class Viewer {
if (stop.photo >= 0) {
this.startSession();
}
if (stop.photo < 0 || stop.photo === this.manifest.photos.length - 1) {
mountSignoffMark(this.signoffMark);
}
this.syncNextStrip();
this.updateCaption();
}
@@ -984,11 +988,16 @@ export class Viewer {
}
const index = this.current;
const loader = this.loader(stop.photo);
loader.start(this.viewAt(stop), this.dpr, () => {
if (this.current === index) {
this.prefetchAround(index);
}
});
loader.start(
this.viewAt(stop),
this.dpr,
() => {
if (this.current === index) {
this.prefetchAround(index);
}
},
true,
);
this.indicator.watch(loader);
this.progress.watch(loader);
}