Skip to content

A Claude skill that turns vibecoded, AI-looking UI into a designed interface

JavaScript

Preserve selected responsive images in snapshots

Garv Rao30aa08d99309
diff --git a/skills/unslop/scripts/snapshot.mjs b/skills/unslop/scripts/snapshot.mjs
index f4af5ce..f199b21 100644
--- a/skills/unslop/scripts/snapshot.mjs
+++ b/skills/unslop/scripts/snapshot.mjs
@@ -99,6 +99,12 @@ try {
}
const copy = document.documentElement.cloneNode(true);
+ // Freeze the browser's selected image before removing responsive markup.
+ const images = document.querySelectorAll("img");
+ copy.querySelectorAll("img").forEach((node, index) => {
+ const selected = images[index].currentSrc;
+ if (selected) node.setAttribute("src", selected);
+ });
copy.querySelectorAll("script, noscript, link[rel='stylesheet'], link[rel='preload'], link[rel='modulepreload'], style").forEach((node) => node.remove());
copy.querySelectorAll("[srcset]").forEach((node) => node.removeAttribute("srcset"));
copy.querySelectorAll("source").forEach((node) => node.remove());