Curated website design inspiration gallery, open zero-auth MCP server for AI agents, and shareable moodboard lists.
JavaScript ai-agentschatgptclaude-codecodexcurated-listcursordesign-gallerydesign-inspirationdesign-systemsdesign-tastefrontendmcpmcp-servermodel-context-protocolmoodboardopen-sourceui-designweb-design
Add recorded smooth-scroll video previews for scroll-motion sites
Ethan41405a9f790c
diff --git a/apps/gallery/assets/anywr.jpg b/apps/gallery/assets/anywr.jpgindex f3a0b37..a0f50d3 100644Binary files a/apps/gallery/assets/anywr.jpg and b/apps/gallery/assets/anywr.jpg differdiff --git a/apps/gallery/assets/anywr.mp4 b/apps/gallery/assets/anywr.mp4new file mode 100644index 0000000..31eb7bdBinary files /dev/null and b/apps/gallery/assets/anywr.mp4 differdiff --git a/apps/gallery/assets/basement-studio.jpg b/apps/gallery/assets/basement-studio.jpgindex 8212cd4..ca63fd9 100644Binary files a/apps/gallery/assets/basement-studio.jpg and b/apps/gallery/assets/basement-studio.jpg differdiff --git a/apps/gallery/assets/basement-studio.mp4 b/apps/gallery/assets/basement-studio.mp4new file mode 100644index 0000000..6ef6e07Binary files /dev/null and b/apps/gallery/assets/basement-studio.mp4 differdiff --git a/apps/gallery/assets/graphite.jpg b/apps/gallery/assets/graphite.jpgindex aa9b84c..a115189 100644Binary files a/apps/gallery/assets/graphite.jpg and b/apps/gallery/assets/graphite.jpg differdiff --git a/apps/gallery/assets/graphite.mp4 b/apps/gallery/assets/graphite.mp4new file mode 100644index 0000000..ac87ce7Binary files /dev/null and b/apps/gallery/assets/graphite.mp4 differdiff --git a/apps/gallery/assets/inflight.jpg b/apps/gallery/assets/inflight.jpgindex adf9d36..ed4a76c 100644Binary files a/apps/gallery/assets/inflight.jpg and b/apps/gallery/assets/inflight.jpg differdiff --git a/apps/gallery/assets/inflight.mp4 b/apps/gallery/assets/inflight.mp4new file mode 100644index 0000000..08009d8Binary files /dev/null and b/apps/gallery/assets/inflight.mp4 differdiff --git a/apps/gallery/assets/isidor.jpg b/apps/gallery/assets/isidor.jpgindex 01bc8f9..6e3b5cc 100644Binary files a/apps/gallery/assets/isidor.jpg and b/apps/gallery/assets/isidor.jpg differdiff --git a/apps/gallery/assets/isidor.mp4 b/apps/gallery/assets/isidor.mp4new file mode 100644index 0000000..23d2036Binary files /dev/null and b/apps/gallery/assets/isidor.mp4 differdiff --git a/apps/gallery/assets/lusion.jpg b/apps/gallery/assets/lusion.jpgindex b403dfb..8a7bc18 100644Binary files a/apps/gallery/assets/lusion.jpg and b/apps/gallery/assets/lusion.jpg differdiff --git a/apps/gallery/assets/lusion.mp4 b/apps/gallery/assets/lusion.mp4new file mode 100644index 0000000..3960637Binary files /dev/null and b/apps/gallery/assets/lusion.mp4 differdiff --git a/apps/gallery/assets/microsoft-ai.jpg b/apps/gallery/assets/microsoft-ai.jpgindex fd5630a..341f7d0 100644Binary files a/apps/gallery/assets/microsoft-ai.jpg and b/apps/gallery/assets/microsoft-ai.jpg differdiff --git a/apps/gallery/assets/microsoft-ai.mp4 b/apps/gallery/assets/microsoft-ai.mp4new file mode 100644index 0000000..ba1afb4Binary files /dev/null and b/apps/gallery/assets/microsoft-ai.mp4 differdiff --git a/apps/gallery/assets/obys.jpg b/apps/gallery/assets/obys.jpgindex 103e68b..ee69f16 100644Binary files a/apps/gallery/assets/obys.jpg and b/apps/gallery/assets/obys.jpg differdiff --git a/apps/gallery/assets/obys.mp4 b/apps/gallery/assets/obys.mp4new file mode 100644index 0000000..f3d1759Binary files /dev/null and b/apps/gallery/assets/obys.mp4 differdiff --git a/apps/gallery/assets/pitch.jpg b/apps/gallery/assets/pitch.jpgindex aa98987..daf6fb4 100644Binary files a/apps/gallery/assets/pitch.jpg and b/apps/gallery/assets/pitch.jpg differdiff --git a/apps/gallery/assets/pitch.mp4 b/apps/gallery/assets/pitch.mp4new file mode 100644index 0000000..c30c53fBinary files /dev/null and b/apps/gallery/assets/pitch.mp4 differdiff --git a/apps/gallery/assets/sunday.jpg b/apps/gallery/assets/sunday.jpgindex 15cbc01..40c9d44 100644Binary files a/apps/gallery/assets/sunday.jpg and b/apps/gallery/assets/sunday.jpg differdiff --git a/apps/gallery/assets/sunday.mp4 b/apps/gallery/assets/sunday.mp4new file mode 100644index 0000000..76d12dcBinary files /dev/null and b/apps/gallery/assets/sunday.mp4 differdiff --git a/apps/gallery/assets/the-content-architecture.jpg b/apps/gallery/assets/the-content-architecture.jpgindex 9f4d5e2..62e53c7 100644Binary files a/apps/gallery/assets/the-content-architecture.jpg and b/apps/gallery/assets/the-content-architecture.jpg differdiff --git a/apps/gallery/assets/the-content-architecture.mp4 b/apps/gallery/assets/the-content-architecture.mp4new file mode 100644index 0000000..248f8efBinary files /dev/null and b/apps/gallery/assets/the-content-architecture.mp4 differdiff --git a/apps/gallery/assets/ux-folio.jpg b/apps/gallery/assets/ux-folio.jpgindex a599ee0..e3b7c69 100644Binary files a/apps/gallery/assets/ux-folio.jpg and b/apps/gallery/assets/ux-folio.jpg differdiff --git a/apps/gallery/assets/ux-folio.mp4 b/apps/gallery/assets/ux-folio.mp4new file mode 100644index 0000000..e1ff967Binary files /dev/null and b/apps/gallery/assets/ux-folio.mp4 differdiff --git a/apps/gallery/assets/waabi.jpg b/apps/gallery/assets/waabi.jpgindex a11c7d3..3b11dc5 100644Binary files a/apps/gallery/assets/waabi.jpg and b/apps/gallery/assets/waabi.jpg differdiff --git a/apps/gallery/assets/waabi.mp4 b/apps/gallery/assets/waabi.mp4new file mode 100644index 0000000..01de67cBinary files /dev/null and b/apps/gallery/assets/waabi.mp4 differdiff --git a/apps/gallery/gallery.css b/apps/gallery/gallery.cssindex e03bed3..c96d7e1 100644--- a/apps/gallery/gallery.css+++ b/apps/gallery/gallery.css@@ -840,6 +840,63 @@ textarea:focus-visible {opacity 160ms ease;}+/* Recorded smooth-scroll video layer for scroll-choreographed sites */+.preview-video {+ position: absolute;+ inset: 0;+ width: 100%;+ height: 100%;+ object-fit: cover;+ object-position: top;+ z-index: 1;+ opacity: 0;+ pointer-events: none;+ transition: opacity 180ms ease;+}++.preview.video-ready .preview-video {+ opacity: 1;+}++.preview.has-video.video-playing .scroll-progress {+ opacity: 0.9;+ transform: scaleX(var(--video-progress, 0));+ transition: opacity 160ms ease;+}++.preview-motion-badge {+ position: absolute;+ top: 11px;+ left: 11px;+ z-index: 3;+ display: inline-flex;+ align-items: center;+ gap: 5px;+ padding: 5px 9px;+ border-radius: 999px;+ font-family: var(--font-mono);+ font-size: 10.5px;+ font-weight: 500;+ letter-spacing: 0.04em;+ text-transform: uppercase;+ color: rgba(244, 244, 246, 0.9);+ background: rgba(11, 11, 14, 0.76);+ border: 1px solid rgba(255, 255, 255, 0.14);+ backdrop-filter: blur(8px);+ pointer-events: none;+ transition: opacity 160ms var(--ease);+}++.preview-motion-badge .play-svg {+ width: 9px;+ height: 9px;+ color: var(--iris);+}++.preview.video-playing .preview-motion-badge {+ opacity: 0;+}+.preview-visit {position: absolute;left: 12px;@@ -1426,6 +1483,68 @@ textarea:focus-visible {height: auto;}+.detail-media {+ position: relative;+ border-radius: 16px;+ overflow: hidden;+ aspect-ratio: 16 / 10;+ background: #141417;+ box-shadow: var(--shadow-window);+}++.detail-video-link {+ display: block;+ width: 100%;+ height: 100%;+}++.detail-video {+ display: block;+ width: 100%;+ height: 100%;+ object-fit: cover;+ object-position: top;+}++.detail-video-toggle {+ position: absolute;+ right: 14px;+ bottom: 14px;+ z-index: 3;+ padding: 7px 13px;+ border-radius: 999px;+ font-family: var(--font-mono);+ font-size: 11.5px;+ font-weight: 500;+ color: #f4f4f6;+ background: rgba(11, 11, 14, 0.84);+ border: 1px solid rgba(255, 255, 255, 0.18);+ backdrop-filter: blur(10px);+ cursor: pointer;+ transition:+ background 160ms var(--ease),+ border-color 160ms var(--ease);+}++.detail-video-toggle:hover,+.detail-video-toggle:focus-visible {+ background: rgba(20, 20, 26, 0.96);+ border-color: rgba(165, 180, 252, 0.45);+}++.detail-video-progress {+ position: absolute;+ left: 0;+ right: 0;+ bottom: 0;+ height: 2.5px;+ z-index: 4;+ background: linear-gradient(90deg, var(--iris), #ff7ea3);+ transform-origin: left center;+ transform: scaleX(0);+ pointer-events: none;+}+.detail-aside {position: sticky;top: 84px;diff --git a/apps/gallery/gallery.js b/apps/gallery/gallery.jsindex 7b40a51..bec3d1f 100644--- a/apps/gallery/gallery.js+++ b/apps/gallery/gallery.js@@ -28,6 +28,19 @@ function syncMotion() {document.querySelectorAll(".scrolling").forEach((el) => el.classList.remove("scrolling"));+ document.querySelectorAll(".preview-video").forEach((v) => {+ try {+ v.pause();+ v.currentTime = 0;+ } catch {}+ v.closest(".preview")?.classList.remove("video-playing", "video-ready");+ });+ const detailVid = document.querySelector(".detail-video");+ if (detailVid && !detailVid.paused) {+ try {+ detailVid.pause();+ } catch {}+ }}}syncMotion();@@ -149,11 +162,15 @@ addEventListener("storage", (e) => {syncSavedUI();-/* ---------- Hover-to-scroll previews ---------- */+/* ---------- Hover-to-scroll & real-video previews ---------- */const cards = [...document.querySelectorAll(".site-card")];const previews = [...document.querySelectorAll(".preview")];function measure(a) {+ if (a.dataset.video) {+ a.classList.remove("can-scroll");+ return 0;+ }const img = a.querySelector("img");if (!img?.naturalWidth) return 0;const imgHeight = img.getBoundingClientRect().height;@@ -171,6 +188,75 @@ function measure(a) {for (const a of previews) {const img = a.querySelector("img");+ const videoSrc = a.dataset.video;++ if (videoSrc) {+ let vid = null;+ let rafId = 0;+ let active = false;++ const tickProgress = () => {+ if (!active || !vid) return;+ const pct =+ vid.duration && Number.isFinite(vid.duration)+ ? Math.min(1, Math.max(0, vid.currentTime / vid.duration))+ : 0;+ a.style.setProperty("--video-progress", pct.toFixed(4));+ rafId = requestAnimationFrame(tickProgress);+ };++ const enterVideo = () => {+ if (paused || reduced.matches) return;+ active = true;+ if (!vid) {+ vid = document.createElement("video");+ vid.className = "preview-video";+ vid.muted = true;+ vid.loop = true;+ vid.playsInline = true;+ vid.preload = "auto";+ vid.setAttribute("aria-hidden", "true");+ vid.src = videoSrc;+ vid.addEventListener("playing", () => {+ if (active) a.classList.add("video-ready");+ });+ a.insertBefore(vid, a.querySelector(".scroll-progress"));+ }+ a.classList.add("video-playing");+ try {+ const p = vid.play();+ if (p && typeof p.catch === "function") p.catch(() => {});+ } catch {}+ cancelAnimationFrame(rafId);+ rafId = requestAnimationFrame(tickProgress);+ };++ const leaveVideo = () => {+ active = false;+ cancelAnimationFrame(rafId);+ a.classList.remove("video-playing", "video-ready");+ a.style.setProperty("--video-progress", "0");+ if (vid) {+ try {+ vid.pause();+ vid.currentTime = 0;+ } catch {}+ }+ };++ a.addEventListener("pointerenter", (e) => {+ if (e.pointerType !== "touch") enterVideo();+ });+ a.addEventListener("pointerleave", leaveVideo);+ a.addEventListener("focus", enterVideo);+ a.addEventListener("blur", leaveVideo);+ img.addEventListener("error", () => {+ a.classList.add("image-unavailable");+ img.alt = "Preview unavailable — visit the website";+ });+ continue;+ }+img.addEventListener("load", () => measure(a));if (img.complete) measure(a);@@ -193,6 +279,65 @@ for (const a of previews) {});}+/* ---------- Detail page recorded scroll video player ---------- */+const detailMedia = document.querySelector("[data-detail-media]");+if (detailMedia) {+ const detailVideo = detailMedia.querySelector(".detail-video");+ const detailToggle = detailMedia.querySelector("[data-detail-video-toggle]");+ const detailProgress = detailMedia.querySelector(".detail-video-progress");+ if (detailVideo && detailToggle) {+ let detailRaf = 0;+ const syncDetailBtn = () => {+ const playing = !detailVideo.paused && !detailVideo.ended;+ detailToggle.textContent = playing ? "Pause" : "Play scroll";+ detailToggle.setAttribute("aria-pressed", String(!playing));+ detailToggle.setAttribute(+ "aria-label",+ playing ? "Pause scroll preview" : "Play scroll preview",+ );+ detailMedia.classList.toggle("is-playing", playing);+ };+ const tickDetail = () => {+ if (detailProgress && detailVideo.duration) {+ const pct = Math.min(+ 1,+ Math.max(0, detailVideo.currentTime / detailVideo.duration),+ );+ detailProgress.style.transform = `scaleX(${pct.toFixed(4)})`;+ }+ if (!detailVideo.paused && !detailVideo.ended) {+ detailRaf = requestAnimationFrame(tickDetail);+ }+ };+ detailVideo.addEventListener("play", () => {+ syncDetailBtn();+ cancelAnimationFrame(detailRaf);+ detailRaf = requestAnimationFrame(tickDetail);+ });+ detailVideo.addEventListener("pause", () => {+ syncDetailBtn();+ cancelAnimationFrame(detailRaf);+ });+ detailToggle.addEventListener("click", (e) => {+ e.preventDefault();+ e.stopPropagation();+ if (detailVideo.paused) {+ const p = detailVideo.play();+ if (p && typeof p.catch === "function") p.catch(() => {});+ } else {+ detailVideo.pause();+ }+ });+ if (!paused && !reduced.matches) {+ try {+ const p = detailVideo.play();+ if (p && typeof p.catch === "function") p.catch(() => syncDetailBtn());+ } catch {}+ }+ syncDetailBtn();+ }+}+let resizeFrame;addEventListener("resize", () => {cancelAnimationFrame(resizeFrame);diff --git a/apps/gallery/render.mjs b/apps/gallery/render.mjsindex 624055c..ef0d9ab 100644--- a/apps/gallery/render.mjs+++ b/apps/gallery/render.mjs@@ -53,6 +53,8 @@ const plusIcon = `<svg class="plus-svg" viewBox="0 0 16 16" fill="none" aria-hidconst shareIcon = `<svg class="share-svg" viewBox="0 0 16 16" fill="none" aria-hidden="true"><path d="M8 10.5V2.75M5.25 5.25 8 2.5l2.75 2.75M3.25 9.25v2.5A1.5 1.5 0 0 0 4.75 13.25h6.5a1.5 1.5 0 0 0 1.5-1.5v-2.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/></svg>`;+const playIcon = `<svg class="play-svg" viewBox="0 0 12 12" fill="currentColor" aria-hidden="true"><path d="M3 2.15v7.7a.65.65 0 0 0 .99.55l6.1-3.85a.65.65 0 0 0 0-1.1L3.99 1.6A.65.65 0 0 0 3 2.15Z"/></svg>`;+const githubIcon = `<svg class="gh-svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27s1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"/></svg>`;export function card(site, index = 0) {@@ -70,14 +72,16 @@ export function card(site, index = 0) {}})();const visitUrl = outboundUrl(site.url);+ const hasVideo = Boolean(site.video);return `<article class="site-card" data-id="${e(site.id)}" data-name="${e(site.name)}" data-url="${e(site.url)}" data-image="/${e(site.image)}" data-note="${e(site.observation || site.description)}" data-date="${e(site.capturedAt)}" data-category="${e(site.category)}" data-search="${e([site.name, host, site.category, ...site.tags, site.description].join(" ").toLowerCase())}"><div class="preview-wrap">- <a class="preview" href="${e(visitUrl)}" target="_blank" rel="noopener" aria-label="Visit ${e(site.name)} (opens in a new tab)">+ <a class="preview${hasVideo ? " has-video" : ""}"${hasVideo ? ` data-video="/${e(site.video)}"` : ""} href="${e(visitUrl)}" target="_blank" rel="noopener" aria-label="Visit ${e(site.name)} (opens in a new tab)"><picture><source media="(hover: hover) and (min-width: 760px)" srcset="/images/${e(site.id)}-720.jpg"><img src="/images/${e(site.id)}-thumb.jpg" width="640" height="400" alt="${e(site.name)} website screenshot" ${imgPriority} decoding="async"></picture>+ ${hasVideo ? `<span class="preview-motion-badge" aria-hidden="true">${playIcon}<span>Scroll</span></span>` : ""}<span class="preview-visit" aria-hidden="true">Visit ${arrowUpRight}</span><span class="scroll-progress" aria-hidden="true"></span></a>@@ -343,9 +347,19 @@ export function detail(site, sites) {</div></div><div class="detail-layout">- <a class="detail-image" href="${e(outboundUrl(site.url))}" target="_blank" rel="noopener" aria-label="Visit ${e(site.name)} (opens in a new tab)">+ ${+ site.video+ ? `<div class="detail-media" data-detail-media>+ <a class="detail-video-link" href="${e(outboundUrl(site.url))}" target="_blank" rel="noopener" aria-label="Visit ${e(site.name)} (opens in a new tab)">+ <video class="detail-video" src="/${e(site.video)}" poster="/${e(site.image)}" width="${site.imageDimensions.width}" height="${site.imageDimensions.height}" muted loop playsinline preload="metadata" aria-label="${e(site.name)} recorded scroll preview"></video>+ </a>+ <button class="detail-video-toggle" type="button" data-detail-video-toggle aria-pressed="false" aria-label="Pause scroll preview">Pause</button>+ <span class="detail-video-progress" aria-hidden="true"></span>+ </div>`+ : `<a class="detail-image" href="${e(outboundUrl(site.url))}" target="_blank" rel="noopener" aria-label="Visit ${e(site.name)} (opens in a new tab)"><img src="/${e(site.image)}" width="${site.imageDimensions.width}" height="${site.imageDimensions.height}" alt="${e(site.name)} website captured on ${e(site.capturedAt)}" fetchpriority="high">- </a>+ </a>`+ }<aside class="detail-aside"><section class="aside-card"><h2>What caught our eye</h2>@@ -366,7 +380,7 @@ export function detail(site, sites) {</dl><div class="tags">${site.tags.map((t) => `<span>${e(t)}</span>`).join("")}</div></section>- <p class="capture-note">Captured snapshot, not a live embed. Designs and trademarks belong to their creators.${site.captureMethod ? " " + e(site.captureMethod) : ""}</p>+ <p class="capture-note">${site.video ? "Recorded scroll preview, not a live embed." : "Captured snapshot, not a live embed."} Designs and trademarks belong to their creators.${site.captureMethod ? " " + e(site.captureMethod) : ""}</p><a class="text-link" href="${REPO}/edit/${sourceRef}/apps/gallery/sites.json">Suggest a correction</a></aside></div>diff --git a/apps/gallery/sites.json b/apps/gallery/sites.jsonindex a6caa8e..6ff1e87 100644--- a/apps/gallery/sites.json+++ b/apps/gallery/sites.json@@ -88,15 +88,17 @@"credit": "Microsoft AI","imageDimensions": {"width": 1280,- "height": 3733+ "height": 800},"discoveredVia": {"name": "Minimal Gallery","url": "https://minimal.gallery/microsoft-ai/"},- "captureSha256": "1b2f2d264713eaeb388bd513ee3d6d22c737b97ecc6cd9e7056cb8a70f13ca4e",+ "captureSha256": "02033d5dbd31b888c4d711d55463235587c91c60eb8f2868e6e81b95f497855f","rank": 2,- "captureMethod": "Stitched full-page capture at 1440px viewport with repeated sticky chrome hidden."+ "captureMethod": "Recorded smooth-scroll video preview at 1440×900 with 1280×800 hero poster.",+ "video": "assets/microsoft-ai.mp4",+ "videoSha256": "63f3576f6134182fca07171014be4fb887c1ad34dbfc110786f1ff3679de3143"},{"id": "linear",@@ -648,15 +650,17 @@"credit": "Pitch","imageDimensions": {"width": 1280,- "height": 3733+ "height": 800},"discoveredVia": {"name": "DesignTaste selection","url": "https://pitch.com/"},- "captureSha256": "37796dac9c78d7f501da3161cf530e6e121e85016b5abaf805af29f7116148e2",+ "captureSha256": "dc223ef775db50f1121b806f969e2d1a01a658820238fd2bd7354b5ef347e12b","rank": 19,- "captureMethod": "Stitched full-page capture at 1440px viewport with repeated sticky chrome hidden."+ "captureMethod": "Recorded smooth-scroll video preview at 1440×900 with 1280×800 hero poster.",+ "video": "assets/pitch.mp4",+ "videoSha256": "20a3171218b9636b7b827fd02133b3333b47fe5093694f535ab619ef8acaf9ae"},{"id": "kyoso",@@ -780,15 +784,17 @@"credit": "The Content Architecture","imageDimensions": {"width": 1280,- "height": 3733+ "height": 800},"discoveredVia": {"name": "Minimal Gallery","url": "https://minimal.gallery/the-content-architecture/"},- "captureSha256": "e6a65b29a97bbf40b2931098e4e440073a4f46f5828ff21d16e10edd8aa2829d",+ "captureSha256": "a1401f9e999ae36910f5da00ee0c4f006738e143f87f006deb65b9eedbff15d5","rank": 23,- "captureMethod": "Stitched full-page capture at 1440px viewport with repeated sticky chrome hidden."+ "captureMethod": "Recorded smooth-scroll video preview at 1440×900 with 1280×800 hero poster.",+ "video": "assets/the-content-architecture.mp4",+ "videoSha256": "cbce7d548bb5db73feaf56f21c2fb8127107b53491d8b7c1f0ccaf935d72d8a6"},{"id": "osmo",@@ -1076,15 +1082,17 @@"credit": "Inflight","imageDimensions": {"width": 1280,- "height": 3733+ "height": 800},"discoveredVia": {"name": "Curated","url": "https://curated.design/sites/s/140630/"},- "captureSha256": "b371134fdecc40905cbf336d00497dbd3846eb705dd8df9226d2692ffc144a03",+ "captureSha256": "d78b4fc768223c56275b051f623a9cbd5c0a627f50f28e67d3b4874d51c0cae3","rank": 32,- "captureMethod": "Stitched full-page capture at 1440px viewport with repeated sticky chrome hidden."+ "captureMethod": "Recorded smooth-scroll video preview at 1440×900 with 1280×800 hero poster.",+ "video": "assets/inflight.mp4",+ "videoSha256": "eeef91f3a0fc959c8dfae42ee014030503f977a0d565617c3abca4c4f4c62c75"},{"id": "ux-folio",@@ -1109,15 +1117,17 @@"credit": "UX Folio","imageDimensions": {"width": 1280,- "height": 3733+ "height": 800},"discoveredVia": {"name": "Curated","url": "https://curated.design/sites/s/140629/"},- "captureSha256": "212dd3d96989ccbaf183140b46462057da96bd5af5528301d850babcb4e0fa40",+ "captureSha256": "941ebeff9ce7aae8f06ea1aee9079c6a4791bf13bdc952e9f8c07d6e862006c3","rank": 33,- "captureMethod": "Stitched full-page capture at 1440px viewport with repeated sticky chrome hidden."+ "captureMethod": "Recorded smooth-scroll video preview at 1440×900 with 1280×800 hero poster.",+ "video": "assets/ux-folio.mp4",+ "videoSha256": "527e7c964c5c2e00e7f8bada9646f0237b9b63a3401b7efe38d9ee1f642505f3"},{"id": "askairank",@@ -2000,15 +2010,17 @@"credit": "Isidor","imageDimensions": {"width": 1280,- "height": 3733+ "height": 800},"discoveredVia": {"name": "Minimal Gallery","url": "https://minimal.gallery/isidor/"},- "captureSha256": "4237003d95374e57202f98cdc9b1043a3a6457af26c1a3228e1aa6e1dd51c324",+ "captureSha256": "5ebc7444415f6ada1d89f5c0491f82e2bb25d73318ca2d124f3e692cca00dc8f","rank": 60,- "captureMethod": "Stitched full-page capture at 1440px viewport with repeated sticky chrome hidden."+ "captureMethod": "Recorded smooth-scroll video preview at 1440×900 with 1280×800 hero poster.",+ "video": "assets/isidor.mp4",+ "videoSha256": "c98340d566741262581fe41b709bdd6c25aa034934cb423b6c523ce8188e71f2"},{"id": "letta",@@ -2066,15 +2078,17 @@"credit": "Sunday","imageDimensions": {"width": 1280,- "height": 3733+ "height": 800},"discoveredVia": {"name": "Minimal Gallery","url": "https://minimal.gallery/sunday/"},- "captureSha256": "093de82c801d0255240eedf5053d5cf4b6092f26b1eb2ea30a36ac2076adf02d",+ "captureSha256": "dc88c17b4bf18d2ad99ffcc2f7731658c16a1f6d5b4536bfee9805bf5c863928","rank": 62,- "captureMethod": "Stitched full-page capture at 1440px viewport with repeated sticky chrome hidden."+ "captureMethod": "Recorded smooth-scroll video preview at 1440×900 with 1280×800 hero poster.",+ "video": "assets/sunday.mp4",+ "videoSha256": "a661d70e2760bf4d57b09ad21065b62203b4f9be2e3a540e1c87306c170279ee"},{"id": "layer9",@@ -2132,15 +2146,17 @@"credit": "Waabi","imageDimensions": {"width": 1280,- "height": 3733+ "height": 800},"discoveredVia": {"name": "Minimal Gallery","url": "https://minimal.gallery/waabi/"},- "captureSha256": "75f1c0126d810c564b361746690e0696596235f84f8815b9fc3d92f6f0a2fc34",+ "captureSha256": "c83282893177ffc4d9701ab4a405e52bb6947f9c2bdf184887518eeed73d974b","rank": 64,- "captureMethod": "Stitched full-page capture at 1440px viewport with repeated sticky chrome hidden."+ "captureMethod": "Recorded smooth-scroll video preview at 1440×900 with 1280×800 hero poster.",+ "video": "assets/waabi.mp4",+ "videoSha256": "2b90026c773f0fdbe51ad92b74d2a91d63d7b48f6b477945e81f851fb357f68a"},{"id": "dropshot",@@ -3541,11 +3557,13 @@"credit": "Basement Studio","imageDimensions": {"width": 1280,- "height": 3733+ "height": 800},- "captureSha256": "26c1cd1daf4c52906a51b83804a79dc9bdbbf157b334ef85ccc1c2944e244878",- "captureMethod": "Stitched full-page capture at 1440px viewport with repeated sticky chrome hidden.",- "rank": 109+ "captureSha256": "8f96c4023b6d899ff5e206ccf265091eb2275015e8cd4ea7c6d459fde2b4b933",+ "captureMethod": "Recorded smooth-scroll video preview at 1440×900 with 1280×800 hero poster.",+ "rank": 109,+ "video": "assets/basement-studio.mp4",+ "videoSha256": "9125ece6ac10e140cac25b79799b395571e4c2bc49e038e15cda6dfe963e8ce3"},{"id": "shopify-design",@@ -4189,11 +4207,13 @@"credit": "Anywhere","imageDimensions": {"width": 1280,- "height": 3733+ "height": 800},- "captureSha256": "a32519d63a220d7b541ee606dd2a428e823252beade5ba2a3c17af74bbccb47c",- "captureMethod": "Stitched full-page capture at 1440px viewport with repeated sticky chrome hidden.",- "rank": 133+ "captureSha256": "eed35ad216f42f39d47e3829c35f21b1fe6fc5f18f714529eb0a12f600406e63",+ "captureMethod": "Recorded smooth-scroll video preview at 1440×900 with 1280×800 hero poster.",+ "rank": 133,+ "video": "assets/anywr.mp4",+ "videoSha256": "3e637ebfa3a94e7be2e48c2f031f371c55d7e7819cc15897d1bd72398a6bed7a"},{"id": "webflow",@@ -5485,11 +5505,13 @@"credit": "Graphite","imageDimensions": {"width": 1280,- "height": 3733+ "height": 800},- "captureSha256": "8ffb85b0260eb71abf1e602295a6c7854812fd4e009ce12204252720fa447390",- "captureMethod": "Stitched full-page capture at 1440px viewport with repeated sticky chrome hidden.",- "rank": 181+ "captureSha256": "735054e4dd7a1c6593dbfead1ce5e238ba06a95354a5038a884d08fac59b7f73",+ "captureMethod": "Recorded smooth-scroll video preview at 1440×900 with 1280×800 hero poster.",+ "rank": 181,+ "video": "assets/graphite.mp4",+ "videoSha256": "3a4998802ecfe5400a1f91ce3fa1e3925ee29190f2ca69ba9a0ec4a53c1e7cab"},{"id": "scalar",@@ -7431,9 +7453,11 @@"width": 1280,"height": 800},- "captureSha256": "fd27256c33fb056b37369dd920ac0e2baed50c4709267422c77c888abe2c99a9",- "captureMethod": "Single-viewport capture at 1440×900.",- "rank": 253+ "captureSha256": "9833229baa2f8c750e5442e7f9807014b91e5d86bb2484618a2d474ef8471c68",+ "captureMethod": "Recorded smooth-scroll video preview at 1440×900 with 1280×800 hero poster.",+ "rank": 253,+ "video": "assets/obys.mp4",+ "videoSha256": "1f37e3d557e6a06b0a39a13707ea664554e642091c33a58db7695769422ac188"},{"id": "locomotive",@@ -7620,9 +7644,11 @@"width": 1280,"height": 800},- "captureSha256": "9d60760c8a71734f0a542f7e29d2d65b6855199d096c4b98aa5b609476624fde",- "captureMethod": "Single-viewport capture at 1440×900.",- "rank": 260+ "captureSha256": "171bf37660a63c79be8583ddda8268a89d46a386a807e3d9e8689b766c7f6bc2",+ "captureMethod": "Recorded smooth-scroll video preview at 1440×900 with 1280×800 hero poster.",+ "rank": 260,+ "video": "assets/lusion.mp4",+ "videoSha256": "55be8af354fc14c5ee7a415ffda9b82417048cb5b9873e36012dbb777e52262c"},{"id": "bruno-simon",diff --git a/scripts/build-gallery.mjs b/scripts/build-gallery.mjsindex c3ca4b8..7781ec5 100644--- a/scripts/build-gallery.mjs+++ b/scripts/build-gallery.mjs@@ -79,7 +79,7 @@ async function processSiteWorker() {while (cursor < sites.length) {const site = sites[cursor++];const image = join(root, site.image);- await Promise.all([+ const tasks = [cp(image, join(out, site.image)),page("sites/" + site.id, detail(site, sites)),// Lightweight 16:10 card thumbnail for mobile/touch (prevents iOS Safari Jetsam OOM).@@ -103,7 +103,11 @@ async function processSiteWorker() {.resize(1200, 630, { fit: "cover", position: "top" }).jpeg({ quality: 85 }).toFile(join(out, "images", `${site.id}-og.jpg`)),- ]);+ ];+ if (site.video) {+ tasks.push(cp(join(root, site.video), join(out, site.video)));+ }+ await Promise.all(tasks);}}await Promise.all(diff --git a/scripts/capture-lib.mjs b/scripts/capture-lib.mjsindex cef4c13..632e5c3 100644--- a/scripts/capture-lib.mjs+++ b/scripts/capture-lib.mjs@@ -1,6 +1,7 @@-import { existsSync, readdirSync } from "node:fs";-import { homedir } from "node:os";+import { existsSync, mkdtempSync, readdirSync, readFileSync, rmSync } from "node:fs";+import { homedir, tmpdir } from "node:os";import { join } from "node:path";+import { execFileSync } from "node:child_process";import { createHash } from "node:crypto";import { lookup } from "node:dns/promises";import { isIP } from "node:net";@@ -628,3 +629,318 @@ export async function captureStitchedWebsite(await context.close().catch(() => {});}}++export async function detectScrollMotion(page) {+ return page+ .evaluate(() => {+ const vw = window.innerWidth;+ const vh = window.innerHeight;+ let tallStickyCount = 0;+ let fullCanvasCount = 0;++ for (const el of document.querySelectorAll("*")) {+ const cs = getComputedStyle(el);+ const r = el.getBoundingClientRect();+ if (r.width <= 0 || r.height <= 0) continue;++ if (cs.position === "sticky") {+ const tag = el.tagName;+ const role = (el.getAttribute("role") || "").toLowerCase();+ const isNav =+ tag === "HEADER" ||+ tag === "NAV" ||+ role === "banner" ||+ role === "navigation";+ if (!isNav && r.height >= 260 && r.width >= vw * 0.28) {+ tallStickyCount++;+ }+ }+ if (+ el.tagName === "CANVAS" &&+ r.width >= vw * 0.7 &&+ r.height >= vh * 0.6+ ) {+ fullCanvasCount++;+ }+ }++ const scrollHeight = Math.max(+ document.body?.scrollHeight || 0,+ document.documentElement?.scrollHeight || 0,+ );+ const isScrollJacked = scrollHeight <= vh + 120 && fullCanvasCount > 0;+ return {+ isScrollMotion: tallStickyCount > 0 || isScrollJacked,+ tallStickyCount,+ fullCanvasCount,+ isScrollJacked,+ };+ })+ .catch(() => ({+ isScrollMotion: false,+ tallStickyCount: 0,+ fullCanvasCount: 0,+ isScrollJacked: false,+ }));+}++export async function captureScrollVideo(+ browser,+ url,+ {+ viewportWidth = 1440,+ viewportHeight = 900,+ outputWidth = 1280,+ outputHeight = 800,+ videoWidth = 960,+ videoHeight = 600,+ maxScrollY = 3800,+ scrollDurationMs = 7400,+ holdStartMs = 650,+ holdEndMs = 850,+ timeoutMs = 30000,+ } = {},+) {+ await assertPublicTargetUrl(url);++ const tmpDir = mkdtempSync(join(tmpdir(), "dt-scroll-vid-"));+ const context = await browser.newContext({+ viewport: { width: viewportWidth, height: viewportHeight },+ deviceScaleFactor: 1,+ recordVideo: {+ dir: tmpDir,+ size: { width: outputWidth, height: outputHeight },+ },+ userAgent:+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36",+ locale: "en-US",+ });++ const recordStart = Date.now();+ const page = await context.newPage();+ page.setDefaultTimeout(12000);+ page.setDefaultNavigationTimeout(timeoutMs);+ await page.route("**/*", async (route) => {+ const reqUrl = route.request().url();+ if (reqUrl.startsWith("data:") || reqUrl.startsWith("blob:")) {+ return route.continue().catch(() => {});+ }+ try {+ await assertPublicTargetUrl(reqUrl);+ return route.continue().catch(() => {});+ } catch {+ return route.abort("blockedbyclient").catch(() => {});+ }+ });++ let hardTimer;+ const hardTimeout = new Promise((_, reject) => {+ hardTimer = setTimeout(() => {+ context.close().catch(() => {});+ reject(new Error("Hard video capture timeout (90s)"));+ }, 90000);+ });++ const runVideoCapture = async () => {+ let response = null;+ try {+ response = await page.goto(url, {+ waitUntil: "domcontentloaded",+ timeout: timeoutMs,+ });+ } catch {+ response = null;+ }+ await page.waitForLoadState("load", { timeout: 10000 }).catch(() => {});+ await page.waitForLoadState("networkidle", { timeout: 8000 }).catch(() => {});++ const status = response?.status() ?? 0;+ if (status >= 400 && !/404/.test(url)) {+ throw new Error(`HTTP ${status}`);+ }+ await assertPublicTargetUrl(page.url());++ await page.waitForTimeout(1000);+ await page+ .evaluate(() => document.fonts?.ready?.catch?.(() => {}))+ .catch(() => {});+ await waitOutPreloader(page);++ const title = (await page.title().catch(() => "")).trim();+ if (BLOCKED_TITLE_RE.test(title) && !/404/.test(url)) {+ throw new Error(`Blocked or error page ("${title}")`);+ }++ await dismissBanners(page);+ await waitForVisibleImages(page, 2000);+ await primeVisibleVideos(page);+ await waitForSettle(page, 450);++ // Pixel-matched hero poster right at y = 0 before scrolling begins.+ const heroPng = await page.screenshot({+ type: "png",+ timeout: 12000,+ animations: "allow",+ });+ const heroJpg = await sharp(heroPng)+ .resize(outputWidth, outputHeight, { fit: "cover", position: "top" })+ .jpeg({ quality: 85, mozjpeg: true })+ .toBuffer();++ const heroMeta = await sharp(heroJpg).metadata();+ const heroStats = await sharp(heroJpg).stats();+ const avgStdDev =+ heroStats.channels.reduce((sum, c) => sum + c.stdev, 0) /+ heroStats.channels.length;+ if (avgStdDev < 4.5) {+ throw new Error(`Blank or uniform hero frame (stdev=${avgStdDev.toFixed(1)})`);+ }++ const trimStartSec = Math.max(0, (Date.now() - recordStart) / 1000);+ await page.waitForTimeout(holdStartMs);++ const totalHeight = await page.evaluate(() =>+ Math.max(+ document.body?.scrollHeight || 0,+ document.documentElement?.scrollHeight || 0,+ window.innerHeight,+ ),+ );+ const maxScroll = Math.min(maxScrollY, Math.max(0, totalHeight - viewportHeight));++ if (maxScroll > 120) {+ // Silky 60fps eased native scroll through sticky/scroll-choreographed sections.+ await page.evaluate(+ async ({ targetY, duration }) => {+ const start = performance.now();+ const ease = (t) =>+ t < 0.5 ? 2 * t * t : 1 - Math.pow(-2 * t + 2, 2) / 2;+ await new Promise((resolve) => {+ function frame(now) {+ const p = Math.min(1, (now - start) / duration);+ window.scrollTo({+ top: Math.round(targetY * ease(p)),+ behavior: "instant",+ });+ if (p < 1) requestAnimationFrame(frame);+ else resolve();+ }+ requestAnimationFrame(frame);+ });+ },+ { targetY: maxScroll, duration: scrollDurationMs },+ );+ } else {+ // Scroll-jacked / WebGL virtual-scroll site: drive with smooth wheel events.+ await page.mouse.move(viewportWidth / 2, viewportHeight / 2);+ const ticks = 90;+ const tickMs = Math.round(Math.min(6200, scrollDurationMs) / ticks);+ for (let i = 0; i < ticks; i++) {+ await page.mouse.wheel(0, 68);+ await page.waitForTimeout(tickMs);+ }+ }++ await page.waitForTimeout(holdEndMs);++ const videoObj = page.video();+ await page.close();+ const rawWebmPath = await videoObj.path();+ await context.close();++ const outMp4Path = join(tmpDir, "out.mp4");+ execFileSync(+ "ffmpeg",+ [+ "-y",+ "-ss",+ trimStartSec.toFixed(2),+ "-i",+ rawWebmPath,+ "-vf",+ `scale=${videoWidth}:${videoHeight}:flags=lanczos,fps=30`,+ "-c:v",+ "libx264",+ "-pix_fmt",+ "yuv420p",+ "-profile:v",+ "main",+ "-level",+ "3.1",+ "-crf",+ "24",+ "-preset",+ "medium",+ "-movflags",+ "+faststart",+ "-an",+ outMp4Path,+ ],+ { stdio: "pipe" },+ );++ const videoBuffer = readFileSync(outMp4Path);+ if (videoBuffer.length < 16 * 1024) {+ throw new Error(`Recorded video too small (${videoBuffer.length} bytes)`);+ }+ if (videoBuffer.length > 5 * 1024 * 1024) {+ // Re-encode with slightly higher CRF if a dense video exceeded 5MB cap.+ execFileSync(+ "ffmpeg",+ [+ "-y",+ "-ss",+ trimStartSec.toFixed(2),+ "-i",+ rawWebmPath,+ "-vf",+ `scale=${videoWidth}:${videoHeight}:flags=lanczos,fps=24`,+ "-c:v",+ "libx264",+ "-pix_fmt",+ "yuv420p",+ "-profile:v",+ "main",+ "-level",+ "3.1",+ "-crf",+ "28",+ "-preset",+ "medium",+ "-movflags",+ "+faststart",+ "-an",+ outMp4Path,+ ],+ { stdio: "pipe" },+ );+ }++ const finalVideoBuffer = readFileSync(outMp4Path);+ if (finalVideoBuffer.length > 5 * 1024 * 1024) {+ throw new Error(`Recorded video exceeds 5MB cap (${finalVideoBuffer.length} bytes)`);+ }++ return {+ buffer: heroJpg,+ width: heroMeta.width,+ height: heroMeta.height,+ sha256: createHash("sha256").update(heroJpg).digest("hex"),+ videoBuffer: finalVideoBuffer,+ videoSha256: createHash("sha256").update(finalVideoBuffer).digest("hex"),+ videoBytes: finalVideoBuffer.length,+ title,+ captureMethod: `Recorded smooth-scroll video preview at ${viewportWidth}×${viewportHeight} with ${outputWidth}×${outputHeight} hero poster.`,+ };+ };++ try {+ return await Promise.race([runVideoCapture(), hardTimeout]);+ } finally {+ clearTimeout(hardTimer);+ await context.close().catch(() => {});+ try {+ rmSync(tmpDir, { recursive: true, force: true });+ } catch {}+ }+}diff --git a/scripts/capture-site.mjs b/scripts/capture-site.mjsindex ca0b1eb..23d36c3 100644--- a/scripts/capture-site.mjs+++ b/scripts/capture-site.mjs@@ -5,11 +5,13 @@ import { CATEGORIES, safeWebsite, validateSites } from "./gallery-catalog.mjs";import {launchCaptureBrowser,captureStitchedWebsite,+ captureScrollVideo,+ detectScrollMotion,} from "./capture-lib.mjs";const args = process.argv.slice(2);if (args.includes("--help") || !args.length) {- console.log(`Capture a live website into a tall scrollable screenshot and add it to the gallery.+ console.log(`Capture a live website into a tall scrollable screenshot (or smooth-scroll video for scroll-motion sites) and add it to the gallery.Usage:npm run site:capture -- \\@@ -21,6 +23,7 @@ Usage:[--observation "What stood out visually."] \\[--tags "Dark,Minimal,Editorial"] \\[--credit "Creator or brand"] \\+ [--mode auto|video|stitched] \\[--max-height 4200]Categories: ${CATEGORIES.join(", ")}`);@@ -72,16 +75,48 @@ if (const browser = await launchCaptureBrowser();try {- console.log(`Capturing ${parsed.toString()} ...`);- const result = await captureStitchedWebsite(browser, parsed.toString(), {- maxHeight: Number(opt["max-height"] || 4200),- });+ const mode = (opt.mode || "auto").toLowerCase();+ let useVideo = mode === "video";+ if (mode === "auto") {+ const probeCtx = await browser.newContext({ viewport: { width: 1440, height: 900 } });+ const probePage = await probeCtx.newPage();+ try {+ await probePage.goto(parsed.toString(), { waitUntil: "domcontentloaded", timeout: 20000 });+ await probePage.waitForLoadState("load", { timeout: 8000 }).catch(() => {});+ await probePage.waitForTimeout(800);+ const motion = await detectScrollMotion(probePage);+ useVideo = motion.isScrollMotion;+ if (useVideo) {+ console.log(+ `Detected scroll-motion layout (sticky=${motion.tallStickyCount}, canvas=${motion.fullCanvasCount}) — recording smooth-scroll video.`,+ );+ }+ } catch {+ useVideo = false;+ } finally {+ await probeCtx.close().catch(() => {});+ }+ }++ console.log(`Capturing ${parsed.toString()} (${useVideo ? "video" : "stitched"}) ...`);+ const result = useVideo+ ? await captureScrollVideo(browser, parsed.toString())+ : await captureStitchedWebsite(browser, parsed.toString(), {+ maxHeight: Number(opt["max-height"] || 4200),+ });const today = new Date().toISOString().slice(0, 10);const imageRel = `assets/${id}.jpg`;await mkdir(join(root, "assets"), { recursive: true });await writeFile(join(root, imageRel), result.buffer);+ let videoFields = {};+ if (useVideo && result.videoBuffer) {+ const videoRel = `assets/${id}.mp4`;+ await writeFile(join(root, videoRel), result.videoBuffer);+ videoFields = { video: videoRel, videoSha256: result.videoSha256 };+ }+const description = (opt.description ||`Considered web design from ${opt.name}.`@@ -101,6 +136,7 @@ try {description,observation,image: imageRel,+ ...videoFields,capturedAt: today,viewport: { width: 1440, height: 900 },credit: (opt.credit || opt.name).trim(),@@ -114,7 +150,9 @@ try {await validateSites(sites, root);await writeFile(catalogPath, JSON.stringify(sites, null, 2) + "\n");console.log(- `Added ${entry.name} (${entry.id}) — ${result.width}×${result.height} (${result.slices} slices). Run npm run verify to rebuild.`,+ useVideo+ ? `Added ${entry.name} (${entry.id}) — poster ${result.width}×${result.height} + ${(result.videoBytes / 1024).toFixed(0)}KB scroll video. Run npm run verify to rebuild.`+ : `Added ${entry.name} (${entry.id}) — ${result.width}×${result.height} (${result.slices} slices). Run npm run verify to rebuild.`,);} finally {await browser.close();diff --git a/scripts/check-gallery.mjs b/scripts/check-gallery.mjsindex 5f8f743..7e7ef08 100644--- a/scripts/check-gallery.mjs+++ b/scripts/check-gallery.mjs@@ -18,25 +18,30 @@ async function walk(dir) {assert.ok(doc.querySelector('meta[property="og:image"]'), p);assert.ok(doc.querySelector('link[rel="canonical"]'), p);for (const el of doc.querySelectorAll(- "a[href],img[src],source[srcset],script[src],link[href]",+ "a[href],img[src],source[srcset],source[src],video[src],video[poster],[data-video],script[src],link[href]",)) {- const url =- el.getAttribute("href") ||- el.getAttribute("src") ||- el.getAttribute("srcset")?.split(/[\s,]+/)[0];- if (- !url?.startsWith("/") ||- url.startsWith("//") ||- url.startsWith("/_vercel/")- )- continue;- const dest = join(root, url.split(/[?#]/)[0]);- await stat(url.endsWith("/") ? join(dest, "index.html") : dest).catch(- () => {- throw Error(`Broken link in ${p}: ${url}`);- },- );- links++;+ const urls = [+ el.getAttribute("href"),+ el.getAttribute("src"),+ el.getAttribute("poster"),+ el.getAttribute("data-video"),+ el.getAttribute("srcset")?.split(/[\s,]+/)[0],+ ].filter(Boolean);+ for (const url of urls) {+ if (+ !url.startsWith("/") ||+ url.startsWith("//") ||+ url.startsWith("/_vercel/")+ )+ continue;+ const dest = join(root, url.split(/[?#]/)[0]);+ await stat(url.endsWith("/") ? join(dest, "index.html") : dest).catch(+ () => {+ throw Error(`Broken link in ${p}: ${url}`);+ },+ );+ links++;+ }}for (const s of doc.querySelectorAll('script[type="application/ld+json"]',diff --git a/scripts/gallery-catalog.mjs b/scripts/gallery-catalog.mjsindex a0b1570..ecda260 100644--- a/scripts/gallery-catalog.mjs+++ b/scripts/gallery-catalog.mjs@@ -117,6 +117,22 @@ export async function validateSites(sites, root) {throw Error(`${s.id}: screenshot dimensions do not match`);if (createHash("sha256").update(data).digest("hex") !== s.captureSha256)throw Error(`${s.id}: screenshot hash does not match`);+ if (s.video !== undefined) {+ if (+ typeof s.video !== "string" ||+ !/^assets\/[a-z0-9-]+\.mp4$/.test(s.video)+ )+ throw Error(`${s.id}: use a local mp4 scroll preview`);+ const vp = resolve(root, s.video);+ if (+ !realpathSync(vp).startsWith(assets + sep) ||+ statSync(vp).size > 5 * 1024 * 1024+ )+ throw Error(`${s.id}: video preview exceeds bounds`);+ const vdata = readFileSync(vp);+ if (createHash("sha256").update(vdata).digest("hex") !== s.videoSha256)+ throw Error(`${s.id}: video hash does not match`);+ }}return sites;}diff --git a/scripts/recapture-gallery.mjs b/scripts/recapture-gallery.mjsindex 66caddc..f9f0a65 100644--- a/scripts/recapture-gallery.mjs+++ b/scripts/recapture-gallery.mjs@@ -1,14 +1,17 @@-import { readFile, writeFile } from "node:fs/promises";+import { readFile, writeFile, rm } from "node:fs/promises";import { fileURLToPath } from "node:url";import { join } from "node:path";import { validateSites } from "./gallery-catalog.mjs";import {launchCaptureBrowser,captureStitchedWebsite,+ captureScrollVideo,} from "./capture-lib.mjs";const args = process.argv.slice(2);const forceAll = args.includes("--all");+const videoMode = args.includes("--video");+const staticMode = args.includes("--static");const idsIdx = args.indexOf("--ids");const onlyIds =idsIdx > -1 && args[idsIdx + 1]@@ -21,7 +24,7 @@ const onlyIds =: null;const concurrencyIdx = args.indexOf("--concurrency");const concurrency = Number(- (concurrencyIdx > -1 && args[concurrencyIdx + 1]) || 6,+ (concurrencyIdx > -1 && args[concurrencyIdx + 1]) || (videoMode ? 1 : 6),);const limitIdx = args.indexOf("--limit");const limit = limitIdx > -1 ? Number(args[limitIdx + 1]) : Infinity;@@ -40,7 +43,7 @@ const targets = sites.slice(0, limit);console.log(- `Re-capturing ${targets.length} sites (concurrency=${concurrency})...`,+ `Re-capturing ${targets.length} sites (mode=${videoMode ? "video" : "stitched"}, concurrency=${concurrency})...`,);const today = new Date().toISOString().slice(0, 10);@@ -56,6 +59,27 @@ async function worker() {const site = targets[cursor++];const prevRatio = site.imageDimensions.height / site.imageDimensions.width;try {+ if (videoMode) {+ const result = await captureScrollVideo(browser, site.url, {+ timeoutMs: 25000,+ });+ const videoRel = `assets/${site.id}.mp4`;+ await writeFile(join(root, site.image), result.buffer);+ await writeFile(join(root, videoRel), result.videoBuffer);+ site.imageDimensions = { width: result.width, height: result.height };+ site.captureSha256 = result.sha256;+ site.video = videoRel;+ site.videoSha256 = result.videoSha256;+ site.capturedAt = today;+ site.viewport = { width: 1440, height: 900 };+ site.captureMethod = result.captureMethod;+ updated++;+ console.log(+ ` [ok:video] ${site.id}: poster ${result.width}×${result.height} + ${(result.videoBytes / 1024).toFixed(0)}KB mp4`,+ );+ continue;+ }+const result = await captureStitchedWebsite(browser, site.url, {maxHeight: 4200,timeoutMs: 25000,@@ -66,6 +90,11 @@ async function worker() {await writeFile(join(root, site.image), result.buffer);site.imageDimensions = { width: result.width, height: result.height };site.captureSha256 = result.sha256;+ if (staticMode && site.video) {+ await rm(join(root, site.video), { force: true }).catch(() => {});+ delete site.video;+ delete site.videoSha256;+ }site.capturedAt = today;site.viewport = { width: 1440, height: 900 };site.captureMethod = result.captureMethod;diff --git a/tests/gallery.test.mjs b/tests/gallery.test.mjsindex ef37f54..ce52138 100644--- a/tests/gallery.test.mjs+++ b/tests/gallery.test.mjs@@ -741,3 +741,36 @@ test("outbound links include ref=designtaste.wtf and preserve Referer while keepassert.equal(ldJson.about.url, "https://sellbird.ai/");detailDom.window.close();});++test("scroll-motion sites expose lazy hover video previews, detail video players, and validated video hashes", async () => {+ const anywr = sites.find((s) => s.id === "anywr");+ assert.ok(anywr?.video, "anywr should have a recorded scroll video");+ assert.equal(anywr.video, "assets/anywr.mp4");+ assert.equal(anywr.imageDimensions.width, 1280);+ assert.equal(anywr.imageDimensions.height, 800);++ const homeDom = dom(gallery(sites));+ const card = homeDom.window.document.querySelector('[data-id="anywr"]');+ const preview = card.querySelector("a.preview");+ assert.equal(preview.getAttribute("data-video"), "/assets/anywr.mp4");+ assert.ok(preview.classList.contains("has-video"));+ assert.equal(preview.querySelector("video"), null, "video should load lazily on hover/focus");+ assert.ok(preview.querySelector(".preview-motion-badge"));+ homeDom.window.close();++ const detailDom = dom(detail(anywr, sites));+ const vid = detailDom.window.document.querySelector("video.detail-video");+ assert.ok(vid, "detail page should render recorded scroll video");+ assert.equal(vid.getAttribute("src"), "/assets/anywr.mp4");+ assert.equal(vid.getAttribute("poster"), "/assets/anywr.jpg");+ assert.ok(detailDom.window.document.querySelector("[data-detail-video-toggle]"));+ detailDom.window.close();++ await assert.rejects(+ validateSites(+ sites.map((s) => (s.id === "anywr" ? { ...s, videoSha256: "0".repeat(64) } : s)),+ root,+ ),+ /video hash does not match/,+ );+});diff --git a/vercel.json b/vercel.jsonindex f12e6bc..1c21cc6 100644--- a/vercel.json+++ b/vercel.json@@ -28,6 +28,12 @@{ "key": "Cache-Control", "value": "public, max-age=31536000, immutable" }]},+ {+ "source": "/assets/(.*)\\.mp4",+ "headers": [+ { "key": "Cache-Control", "value": "public, max-age=31536000, immutable" }+ ]+ },{"source": "/(favicon\\.svg|icon-192\\.png|icon-512\\.png|apple-touch-icon\\.png)","headers": [