Skip to content

A Claude Code skill that reverse-engineers any animation frame by frame, then proves the copy moves the same.

Add the Clerk CLI card to the examples

NiazMorshed2007b71deab13151
diff --git a/site/public/examples/clerk-bento/src/bento.js b/site/public/examples/clerk-bento/src/bento.js
index 2217008..59798e2 100644
--- a/site/public/examples/clerk-bento/src/bento.js
+++ b/site/public/examples/clerk-bento/src/bento.js
@@ -27,7 +27,7 @@ function loadCss(slug) {
const link = document.createElement("link");
link.rel = "stylesheet";
link.href = new URL(`${slug}.css`, WIDGETS).href;
- link.dataset.widget = slug;
+ link.dataset.widgetCss = slug; // not data-widget: that marks the slots
link.onload = () => resolve(true);
link.onerror = () => {
link.remove();
diff --git a/site/public/examples/clerk-bento/src/widgets/clerk-cli.js b/site/public/examples/clerk-bento/src/widgets/clerk-cli.js
index 052a9f7..06f3daa 100644
--- a/site/public/examples/clerk-bento/src/widgets/clerk-cli.js
+++ b/site/public/examples/clerk-bento/src/widgets/clerk-cli.js
@@ -21,7 +21,11 @@
// card is hovered, exit {opacity: 0}. Re-hovering while they fade revives the same instances (and re-renders
// them: Meteor's effect re-runs, clock kept); after removal a new hover starts a new clock.
// - Carousel: setTimeout(550) → setInterval(1350) while hovered; each tick moves logo r to slot (r + step) % 6
-// (useAnimate sequence, all six at once). `step` persists across hovers.
+// (useAnimate sequence, all six at once, created on the next frame and back-dated to the tick). `step`
+// persists across hovers.
+// - Timing (checked frame by frame against clerk.com): hover-in tweens start at the pointer event, the streak
+// canvases mount on the next frame (their clock starts on the frame after), hover-out is applied on the next
+// frame with its WAAPI tweens back-dated to the event.
// - Hover: react-aria useHover on the card root (pointerenter/pointerleave, touch ignored).
// With prefers-reduced-motion: reduce, hover switches the cyan state instantly and runs no streaks or carousel.
diff --git a/site/public/media/clerk-cli/poster.webp b/site/public/media/clerk-cli/poster.webp
new file mode 100644
index 0000000..291f68e
Binary files /dev/null and b/site/public/media/clerk-cli/poster.webp differ
diff --git a/site/scripts/_clerk-posters.ts b/site/scripts/_clerk-posters.ts
deleted file mode 100644
index 9e158f7..0000000
--- a/site/scripts/_clerk-posters.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import { chromium } from "playwright";
-import { execFileSync } from "node:child_process";
-import { mkdirSync, rmSync } from "node:fs";
-const browser = await chromium.launch({ channel: "chromium", args: ["--enable-gpu", "--use-angle=metal", "--ignore-gpu-blocklist"] });
-const page = await browser.newPage({ viewport: { width: 900, height: 700 }, deviceScaleFactor: 2 });
-for (const card of process.argv.slice(2)) {
- await page.goto(`http://localhost:3000/examples/clerk-bento/?card=${card}&embed`);
- await page.waitForSelector('html[data-widgets="ready"]');
- await page.evaluate(() => document.fonts.ready);
- await page.waitForTimeout(800);
- const v = (await page.locator(`.clerk-card--${card}`).boundingBox())!;
- const s = (await page.locator(`.clerk-card--${card} .clerk-card__visual`).boundingBox())!;
- const h = Math.min(s.height, v.height, (v.width * 3) / 4);
- const w = (h * 4) / 3;
- const clip = { x: s.x + (s.width - w) / 2, y: Math.max(v.y, Math.min(s.y + (s.height - h) / 2, v.y + v.height - h)), width: w, height: h };
- mkdirSync(`public/media/clerk-${card}`, { recursive: true });
- const png = `public/media/clerk-${card}/poster.png`;
- await page.screenshot({ path: png, clip });
- execFileSync("cwebp", ["-quiet", "-q", "86", "-m", "6", "-sharp_yuv", "-resize", "288", "0", png, "-o", png.replace(".png", ".webp")]);
- rmSync(png);
- console.log(card, clip);
-}
-await browser.close();
diff --git a/site/src/examples.ts b/site/src/examples.ts
index 05cba1f..dd28dc4 100644
--- a/site/src/examples.ts
+++ b/site/src/examples.ts
@@ -231,6 +231,21 @@ export const examples: Example[] = [
["Random lights", "144 lights for 20 s, same random numbers", "0 differ"],
],
},
+ {
+ slug: "clerk-cli",
+ title: "Clerk CLI",
+ source: CLERK,
+ about:
+ "The Clerk logo lights up cyan while light streaks run from the terminal panel into the button and on into a ring of AI-tool logos. Every 1.35 s the logos step one slot round the ring.",
+ note: "The ring keeps its place between hovers, so each visit carries on where the last one stopped.",
+ show: { kind: "live", width: 443, height: 328 },
+ live: "/examples/clerk-bento/?card=clerk-cli",
+ results: [
+ ["Frame match", "pixels that differ in the visual, four hover runs", "≤ 0.01 %"],
+ ["Timing", "start and end of every motion", "0 ms"],
+ ["Logo steps", "position during each step", "0 px"],
+ ],
+ },
];
export const media = (slug: string, file: string) => `/media/${slug}/${file}`;