Skip to content

Curated website design inspiration gallery, open zero-auth MCP server for AI agents, and shareable moodboard lists.

Upgrade <1MB social-preview.gif to crisp split-panel 12.5fps 96-color lossless-sourced loop

Ethanec32ea8f3b57
diff --git a/docs/images/social-preview.gif b/docs/images/social-preview.gif
index 96756e5..c8edaef 100644
Binary files a/docs/images/social-preview.gif and b/docs/images/social-preview.gif differ
diff --git a/scripts/render-og.mjs b/scripts/render-og.mjs
index 4d19706..5fa37fc 100644
--- a/scripts/render-og.mjs
+++ b/scripts/render-og.mjs
@@ -4,7 +4,7 @@
* 1. apps/gallery/og.jpg (1200×630 static hero OG for social unfurls)
* 2. docs/images/og-motion.mp4 (1200×630 60fps seamless 8s H.264 loop)
* 3. docs/images/og-motion.gif (720×378 16fps seamless 8s optimized GIF)
- * 4. docs/images/social-preview.gif (640×320 10fps seamless 2.8s <1MB GIF for GitHub Social Preview)
+ * 4. docs/images/social-preview.gif (640×320 12.5fps seamless 2.4s <1MB GIF for GitHub Social Preview)
*
* Pass --social-only to regenerate only docs/images/social-preview.gif.
*
@@ -355,15 +355,15 @@ async function runCmd(cmd, args) {
async function renderSocialPreviewGif(browser, data) {
const W = 640;
const H = 320;
- const SP_FRAMES = 26; // 2.6s @ 10fps (exact 100ms/frame GIF delay, seamless loop)
- const SP_FPS = 10;
+ const SP_FRAMES = 30; // 2.4s @ 12.5fps (exact 80ms/frame GIF delay, exact 10px/frame step!)
+ const SP_FPS = 12.5;
const SP_COLS = [
["linear", "stripe-press", "raycast"],
- ["cursor", "stripe", "playdate"],
- ["recraft", "rive", "figma"],
- ["krea-3", "mercury", "daylight"],
+ ["stripe", "playdate", "mercury"],
+ ["recraft", "rive", "daylight"],
];
- const SP_PHASES = [0.18, 0.34, 0.22, 0.48];
+ const SP_PHASES = [0.08, 0.42, 0.22];
+ const SP_DIRS = [1, -1, 1];
const byId = new Map(data.columns.flat().map((c) => [c.id, c]));
const geistSans = fs
@@ -373,11 +373,11 @@ async function renderSocialPreviewGif(browser, data) {
.readFileSync(path.join(GALLERY_DIR, "fonts/geist-mono-variable.woff2"))
.toString("base64");
- const CARD_W = 172;
- const CARD_H = 107;
- const GAP = 9;
- const STRIDE = CARD_H + GAP;
- const SET_H = 3 * STRIDE;
+ const CARD_W = 110;
+ const CARD_H = 92;
+ const GAP = 8;
+ const STRIDE = CARD_H + GAP; // 100px exact
+ const SET_H = 3 * STRIDE; // 300px exact -> 300 / 30 = 10.000px per frame!
const colsHtml = SP_COLS.map((ids, ci) => {
const cards = ids.map((id) => byId.get(id));
@@ -396,61 +396,142 @@ async function renderSocialPreviewGif(browser, data) {
@font-face{font-family:"Geist Mono";src:url("data:font/woff2;base64,${geistMono}") format("woff2");font-weight:100 900;font-display:block}
*{box-sizing:border-box;margin:0;padding:0}
html,body{width:${W}px;height:${H}px;overflow:hidden;background:#070709;font-family:"Geist",-apple-system,sans-serif;-webkit-font-smoothing:antialiased}
-.stage{position:relative;width:${W}px;height:${H}px;overflow:hidden;background:#070709}
-.wall{position:absolute;top:50%;left:50%;width:725px;height:660px;display:grid;grid-template-columns:repeat(4,${CARD_W}px);gap:${GAP}px;transform:translate(-50%,-50%) rotate(-7deg);opacity:0.96}
-.col{position:relative;height:100%;overflow:visible}
+.stage{position:relative;width:${W}px;height:${H}px;overflow:hidden;background:#070709;display:flex}
+
+/* Static obsidian studio left panel: 0 moving pixels after frame 0 -> rich 128-color budget for right wall */
+.left{
+ position:relative;
+ z-index:3;
+ width:288px;
+ height:100%;
+ padding:32px 24px 30px 34px;
+ display:flex;
+ flex-direction:column;
+ justify-content:center;
+ gap:14px;
+ background:#070709;
+}
+.left::after{
+ content:"";
+ position:absolute;
+ top:0;
+ right:-26px;
+ width:26px;
+ height:100%;
+ background:linear-gradient(90deg,#070709 0%,rgba(7,7,9,0.72) 45%,rgba(7,7,9,0) 100%);
+ pointer-events:none;
+}
+.brand-row{display:inline-flex;align-items:center;gap:8px}
+.brand-name{font-size:14px;font-weight:620;letter-spacing:-0.025em;color:#f6f6f9}
+.brand-name .dot{color:#8b8b9b;font-weight:450}
+.mcp-pill{
+ font-family:"Geist Mono",monospace;
+ font-size:8.5px;
+ font-weight:600;
+ letter-spacing:0.06em;
+ text-transform:uppercase;
+ padding:3px 7px;
+ border-radius:999px;
+ color:#d6deff;
+ background:#191c34;
+ border:1px solid rgba(165,180,252,0.44);
+}
+.headline{
+ font-size:32px;
+ font-weight:670;
+ letter-spacing:-0.042em;
+ line-height:1.05;
+ color:#f7f8fc;
+}
+.sub{
+ font-size:11.5px;
+ font-weight:430;
+ line-height:1.45;
+ letter-spacing:-0.01em;
+ color:#a2a4b8;
+}
+.meta{
+ display:flex;
+ align-items:center;
+ gap:7px;
+ margin-top:2px;
+ font-family:"Geist Mono",monospace;
+ font-size:9px;
+ color:#7e8094;
+}
+.meta .dot-accent{width:5px;height:5px;border-radius:999px;background:#818cf8}
+
+/* Right moving 3-column showcase wall (straight vertical columns for razor-sharp LZW compression) */
+.right{
+ position:relative;
+ flex:1;
+ height:100%;
+ overflow:hidden;
+}
+.wall{
+ position:absolute;
+ top:0;
+ left:4px;
+ display:grid;
+ grid-template-columns:repeat(3,${CARD_W}px);
+ gap:${GAP}px;
+}
+.col{position:relative;overflow:visible}
.track{display:flex;flex-direction:column;gap:${GAP}px;will-change:transform}
-.card{width:${CARD_W}px;height:${CARD_H}px;border-radius:8px;overflow:hidden;background:#141418;border:1px solid rgba(255,255,255,0.16);flex-shrink:0}
+.card{
+ width:${CARD_W}px;
+ height:${CARD_H}px;
+ border-radius:8px;
+ overflow:hidden;
+ background:#141418;
+ border:1px solid rgba(255,255,255,0.16);
+ flex-shrink:0;
+}
.card img{display:block;width:100%;height:100%;object-fit:cover;object-position:top center}
-.vignette{position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,rgba(7,7,9,0.72) 0%,rgba(7,7,9,0.04) 22%,rgba(7,7,9,0.04) 78%,rgba(7,7,9,0.76) 100%),linear-gradient(90deg,rgba(7,7,9,0.4) 0%,rgba(7,7,9,0) 12%,rgba(7,7,9,0) 88%,rgba(7,7,9,0.4) 100%)}
-.hero-wrap{position:absolute;inset:0;display:flex;align-items:center;justify-content:center}
-/* Solid obsidian center card stays pixel-identical across frames so GIF frame-diff compression stays well under 1MB */
-.hero-card{display:flex;flex-direction:column;align-items:center;text-align:center;gap:7px;padding:15px 26px 16px;border-radius:14px;background:#0c0c10;border:1px solid rgba(255,255,255,0.22);box-shadow:0 16px 40px -4px rgba(0,0,0,0.95)}
-.brand-row{display:inline-flex;align-items:center;gap:6px}
-.brand-name{font-size:11.5px;font-weight:620;letter-spacing:-0.02em;color:#f6f6f9}
-.brand-name .dot{color:#8b8b9b;font-weight:450}
-.mcp-pill{font-family:"Geist Mono",monospace;font-size:7px;font-weight:600;letter-spacing:0.06em;text-transform:uppercase;padding:2.5px 6.5px;border-radius:999px;color:#d6deff;background:#1d2038;border:1px solid rgba(165,180,252,0.44)}
-.headline{font-size:25.5px;font-weight:680;letter-spacing:-0.04em;line-height:1.05;color:#f5f6fa}
-.sub{font-size:9.2px;font-weight:460;letter-spacing:-0.01em;color:#b8b9c8;display:flex;align-items:center;gap:5px}
-.sub .sep{color:#5b5c6e}
+.fade-y{
+ position:absolute;
+ inset:0;
+ pointer-events:none;
+ z-index:2;
+ background:linear-gradient(180deg,#070709 0%,rgba(7,7,9,0) 16%,rgba(7,7,9,0) 84%,#070709 100%);
+}
</style>
</head>
<body>
<div class="stage">
- <div class="wall">${colsHtml}</div>
- <div class="vignette"></div>
- <div class="hero-wrap">
- <div class="hero-card">
- <div class="brand-row">
- <svg width="18" height="18" viewBox="0 0 40 40" fill="none" aria-hidden="true">
- <rect width="40" height="40" rx="11" fill="#17171f" stroke="#ffffff" stroke-opacity="0.25" stroke-width="1.8"/>
- <path d="M13 11.5h6.2c5.4 0 8.8 3.3 8.8 8.5s-3.4 8.5-8.8 8.5H13V11.5Zm4.2 3.5v10h1.9c3 0 4.6-1.8 4.6-5s-1.6-5-4.6-5h-1.9Z" fill="#e4e8ff"/>
- <circle cx="29.5" cy="11.5" r="2.8" fill="#ff4d6d"/>
- </svg>
- <span class="brand-name">designtaste<span class="dot">.wtf</span></span>
- <span class="mcp-pill">Open MCP</span>
- </div>
- <h1 class="headline">Curated web design taste.</h1>
- <p class="sub">
- <span>${data.totalSites} standout websites</span>
- <span class="sep">·</span>
- <span>Zero-auth MCP</span>
- <span class="sep">·</span>
- <span>Shareable moodboards</span>
- </p>
+ <div class="left">
+ <div class="brand-row">
+ <svg width="22" height="22" viewBox="0 0 40 40" fill="none" aria-hidden="true">
+ <rect width="40" height="40" rx="11" fill="#17171f" stroke="#ffffff" stroke-opacity="0.24" stroke-width="1.6"/>
+ <path d="M13 11.5h6.2c5.4 0 8.8 3.3 8.8 8.5s-3.4 8.5-8.8 8.5H13V11.5Zm4.2 3.5v10h1.9c3 0 4.6-1.8 4.6-5s-1.6-5-4.6-5h-1.9Z" fill="#e6eaff"/>
+ <circle cx="29.5" cy="11.5" r="2.8" fill="#ff4d6d"/>
+ </svg>
+ <span class="brand-name">designtaste<span class="dot">.wtf</span></span>
+ <span class="mcp-pill">Open MCP</span>
+ </div>
+ <h1 class="headline">Curated web<br>design taste.</h1>
+ <p class="sub">${data.totalSites} standout websites, zero-auth MCP for AI agents, and shareable moodboards.</p>
+ <div class="meta">
+ <span class="dot-accent"></span>
+ <span>MIT · OPEN GALLERY · MCP APPS UI</span>
</div>
</div>
+ <div class="right">
+ <div class="wall">${colsHtml}</div>
+ <div class="fade-y"></div>
+ </div>
</div>
<script>
const SET_H = ${SET_H};
const PHASES = ${JSON.stringify(SP_PHASES)};
-const DIRS = ${JSON.stringify(DIRECTIONS)};
+const DIRS = ${JSON.stringify(SP_DIRS)};
const tracks = [...document.querySelectorAll(".track")];
window.setProgress = function (t) {
for (let i = 0; i < tracks.length; i++) {
const r = DIRS[i] > 0 ? (PHASES[i] + t) % 1 : (PHASES[i] + (1 - (t % 1))) % 1;
- const y = -(SET_H + r * SET_H);
- tracks[i].style.transform = "translate3d(0," + y.toFixed(2) + "px,0)";
+ // Exact integer pixel step keeps every card razor-sharp with zero subpixel shimmer
+ const y = -Math.round(SET_H + r * SET_H);
+ tracks[i].style.transform = "translate3d(0," + y + "px,0)";
}
};
window.setProgress(0);
@@ -465,85 +546,78 @@ window.setProgress(0);
await page.setContent(html, { waitUntil: "load" });
await page.evaluate(() => document.fonts.ready);
- const tmpMp4 = "/tmp/designtaste-sp.mp4";
- const tmpPal = "/tmp/designtaste-sp-pal.png";
- const tmpGif = "/tmp/designtaste-sp-raw.gif";
+ // Capture direct lossless RGB PNG frames (no H.264/YUV420 round-trip noise on dark solids!)
+ const tmpDir = "/tmp/designtaste-sp-frames";
+ fs.rmSync(tmpDir, { recursive: true, force: true });
+ fs.mkdirSync(tmpDir, { recursive: true });
+
+ for (let frame = 0; frame < SP_FRAMES; frame++) {
+ await page.evaluate((p) => window.setProgress(p), frame / SP_FRAMES);
+ const framePath = path.join(tmpDir, `f_${String(frame).padStart(3, "0")}.png`);
+ await page.screenshot({ path: framePath, type: "png" });
+ }
+ await page.close();
+
+ const tmpPal = path.join(tmpDir, "pal.png");
+ const tmpGif = path.join(tmpDir, "raw.gif");
const outGif = path.join(DOCS_IMG_DIR, "social-preview.gif");
- const ff = spawn(
- "ffmpeg",
- [
+ // Pick highest visual quality preset (colors + minimal lossy) that stays strictly < 970KB
+ const presets = [
+ { colors: 128, lossy: 20 },
+ { colors: 128, lossy: 30 },
+ { colors: 112, lossy: 25 },
+ { colors: 96, lossy: 25 },
+ { colors: 96, lossy: 35 },
+ ];
+
+ let chosen = null;
+ for (const preset of presets) {
+ await runCmd("ffmpeg", [
"-y",
- "-f",
- "image2pipe",
- "-vcodec",
- "png",
- "-r",
+ "-framerate",
String(SP_FPS),
"-i",
- "-",
- "-c:v",
- "libx264",
- "-pix_fmt",
- "yuv420p",
- "-crf",
- "12",
- tmpMp4,
- ],
- { stdio: ["pipe", "ignore", "pipe"] },
- );
- let ffErr = "";
- ff.stderr.on("data", (d) => (ffErr += d.toString()));
- const ffDone = new Promise((resolve, reject) => {
- ff.on("close", (code) => {
- if (code === 0) resolve();
- else reject(new Error(`ffmpeg exited ${code}: ${ffErr.slice(-400)}`));
- });
- });
-
- for (let frame = 0; frame < SP_FRAMES; frame++) {
- await page.evaluate((p) => window.setProgress(p), frame / SP_FRAMES);
- const png = await page.screenshot({ type: "png" });
- if (!ff.stdin.write(png)) {
- await new Promise((r) => ff.stdin.once("drain", r));
+ path.join(tmpDir, "f_%03d.png"),
+ "-vf",
+ `palettegen=max_colors=${preset.colors}:stats_mode=diff`,
+ tmpPal,
+ ]);
+ await runCmd("ffmpeg", [
+ "-y",
+ "-framerate",
+ String(SP_FPS),
+ "-i",
+ path.join(tmpDir, "f_%03d.png"),
+ "-i",
+ tmpPal,
+ "-lavfi",
+ "paletteuse=dither=bayer:bayer_scale=5:diff_mode=rectangle",
+ "-loop",
+ "0",
+ tmpGif,
+ ]);
+ await runCmd("gifsicle", [
+ "-O3",
+ `--lossy=${preset.lossy}`,
+ tmpGif,
+ "-o",
+ outGif,
+ ]);
+ const bytes = fs.statSync(outGif).size;
+ if (bytes < 970_000) {
+ chosen = { ...preset, bytes };
+ break;
}
}
- ff.stdin.end();
- await ffDone;
- await page.close();
-
- await runCmd("ffmpeg", [
- "-y",
- "-i",
- tmpMp4,
- "-vf",
- "palettegen=max_colors=48:stats_mode=full",
- tmpPal,
- ]);
- await runCmd("ffmpeg", [
- "-y",
- "-i",
- tmpMp4,
- "-i",
- tmpPal,
- "-lavfi",
- "paletteuse=dither=none:diff_mode=rectangle",
- "-loop",
- "0",
- tmpGif,
- ]);
- await runCmd("gifsicle", ["-O3", "--lossy=95", tmpGif, "-o", outGif]);
- fs.rmSync(tmpMp4, { force: true });
- fs.rmSync(tmpPal, { force: true });
- fs.rmSync(tmpGif, { force: true });
+ fs.rmSync(tmpDir, { recursive: true, force: true });
- const bytes = fs.statSync(outGif).size;
- if (bytes >= 980_000) {
- throw new Error(`social-preview.gif exceeded 980KB decimal cap: ${bytes} bytes`);
+ if (!chosen) {
+ throw new Error("Could not fit social-preview.gif under 970KB.");
}
console.log(
- `Wrote <1MB GitHub social preview GIF: ${outGif} (${(bytes / 1024).toFixed(1)} KB / ${bytes} bytes)`,
+ `Wrote <1MB GitHub social preview GIF: ${outGif} (${(chosen.bytes / 1024).toFixed(1)} KB / ${chosen.bytes} bytes, ${chosen.colors} colors, lossy=${chosen.lossy})`,
);
}