Isometric line figures that answer the pointer. For React and for anything with a DOM.
Skill page: the home's hero points to the skill in one quiet line under its two buttons
Lucas Marques557cf3ad1204
diff --git a/apps/site/app/page.tsx b/apps/site/app/page.tsxindex 38badf2..aa908b6 100644--- a/apps/site/app/page.tsx+++ b/apps/site/app/page.tsx@@ -31,6 +31,10 @@ export default function Page() {<a className="btn btn-primary press" href="/docs">Get started</a><a className="btn press" href={LINKS.github}><GitHub /> GitHub</a></div>+ {/* a quiet line, not a third button: the two above stay the way in */}+ <p className="mt-5 text-[14px] text-muted" style={at(4)}>+ <a className="hover:text-ink" href="/skill">Or make your own with the skill →</a>+ </p></section><section id="try" aria-label="Try it" className="scroll-mt-[calc(var(--topbar)+24px)]">diff --git a/apps/site/test/site.spec.ts b/apps/site/test/site.spec.tsindex cd5d3ca..ec83c0e 100644--- a/apps/site/test/site.spec.ts+++ b/apps/site/test/site.spec.ts@@ -213,7 +213,7 @@ test("the home's entrance settles within 1.4s, with its hero blocks 70ms apart",const end = Math.max(...[...document.querySelectorAll(".hero-rise > *, .enter")].flatMap((el) => of(el).map((t) => Number(t.endTime))));return { gaps: hero.slice(1).map((d, n) => d - hero[n]), end };});- expect(timing.gaps).toEqual([70, 70, 70]);+ expect(timing.gaps).toEqual([70, 70, 70, 70]);expect(timing.end).toBeLessThanOrEqual(1400);});diff --git a/apps/site/test/skill.spec.ts b/apps/site/test/skill.spec.tsindex 0590855..202b251 100644--- a/apps/site/test/skill.spec.ts+++ b/apps/site/test/skill.spec.ts@@ -140,3 +140,23 @@ test("the top bar fits a 320px screen with its five items on one row", async ({const last = (await page.locator(".topbar nav > *").last().boundingBox())!;expect(last.x + last.width).toBeLessThanOrEqual(bar.x + bar.width);});++test("the home's hero points to the skill in one quiet line under its two buttons, and the line reaches /skill", async ({ page }) => {+ for (const width of [1200, 320]) {+ await page.setViewportSize({ width, height: 800 });+ await page.goto("/");+ const link = page.locator(".hero-rise").getByRole("link", { name: "Or make your own with the skill →" });+ await expect(link).toHaveAttribute("href", "/skill");+ expect(await page.evaluate(() => document.documentElement.scrollWidth - document.documentElement.clientWidth)).toBe(0);+ const actions = (await page.locator(".hero-actions").boundingBox())!;+ const line = (await link.boundingBox())!;+ // under the buttons, clear of them, and on one line+ expect(line.y).toBeGreaterThanOrEqual(actions.y + actions.height);+ expect(line.height).toBeLessThan(28);+ // not a third button+ expect(await link.evaluate((a) => a.classList.contains("btn"))).toBe(false);+ }+ await page.locator(".hero-rise").getByRole("link", { name: "Or make your own with the skill →" }).click();+ await expect(page).toHaveURL(/\/skill$/);+ await expect(page.getByRole("heading", { level: 1 })).toHaveText("Make your own figure");+});