- Phone camera or photo -> WebGL shader that classifies every pixel against the sampled screen colour; colour-blind friendly (stripes, motion, words) - Views: Spill, Screen (flat colour), rough live Key, Evenness - Spill = worse of lean toward the screen hue and the green/blue despill limit, tuned on a real Alexa car-interior plate (teal screen, green bounce) - Plain-English verdict incl. widespread colour cast; tap for readouts - Pick screen / pick white (neutral reference), freeze, exposure/WB lock - Service worker caches each /set page under its own path (spill page no longer overwrites the markers page offline); link from /set Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+9
-5
@@ -1,4 +1,4 @@
|
||||
// Offline cache for /set (screen markers). Crews often have no signal on set:
|
||||
// Offline cache for /set (screen markers, spill checker). Crews often have no signal on set:
|
||||
// once the page has loaded once, it and every marker image work offline.
|
||||
// Must match OFFLINE_CACHE in components/set/MarkerPicker.tsx
|
||||
const CACHE = "ttvfx-set-v1";
|
||||
@@ -22,16 +22,20 @@ self.addEventListener("fetch", (event) => {
|
||||
const url = new URL(req.url);
|
||||
if (url.origin !== self.location.origin) return;
|
||||
|
||||
// Page: network first so updates arrive, cached copy when offline
|
||||
// Pages (/set/, /set/spill/): network first so updates arrive, cached copy when offline.
|
||||
// Each page is cached under its own path so one never replaces the other.
|
||||
if (req.mode === "navigate") {
|
||||
const page = url.pathname.endsWith("/") ? url.pathname : url.pathname + "/";
|
||||
event.respondWith(
|
||||
fetch(req)
|
||||
.then((res) => {
|
||||
const copy = res.clone();
|
||||
caches.open(CACHE).then((c) => c.put("/set/", copy));
|
||||
if (res.ok) {
|
||||
const copy = res.clone();
|
||||
caches.open(CACHE).then((c) => c.put(page, copy));
|
||||
}
|
||||
return res;
|
||||
})
|
||||
.catch(() => caches.match("/set/")),
|
||||
.catch(() => caches.match(page).then((hit) => hit || caches.match("/set/"))),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user