Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<link rel="preload" href="assets/fonts/space-grotesk-bold.woff2" as="font" type="font/woff2" crossorigin>
<link rel="preload" href="assets/fonts/ibm-plex-mono-latin-400-normal.woff2" as="font" type="font/woff2" crossorigin>
<script src="theme.js"></script>
<link rel="stylesheet" href="styles.css?v=4">
<link rel="stylesheet" href="styles.css?v=5">
<script src="stack.js" defer></script>
<script src="tools.js" defer></script>
</head>
Expand Down
40 changes: 15 additions & 25 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -258,25 +258,21 @@ h1 { margin: 0; max-width: 11ch; font-size: clamp(44px, 5.4vw, 80px); line-heigh
}


/* The exploded tool stack (tools.js): tilted panes beside the picked tool's card. */
/* The tool stack (tools.js): the hero's dotted discs, each named beside it, next to the picked tool's card. */
.tool-x { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); align-items: center; gap: 48px; }
.tool-x-stack { display: grid; justify-items: center; gap: 8px; }
.tool-x-tower { position: relative; width: 340px; height: 220px; margin: 170px 0 90px; transform-style: preserve-3d; transform: perspective(2000px) rotateX(58deg) rotateZ(-38deg); }
.tool-x-pane { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--accent) 60%, var(--line)); border-radius: 2px; background: color-mix(in srgb, var(--background) 82%, transparent); color: var(--muted); pointer-events: none; transform: translateZ(calc(var(--i) * 58px)); transition: transform .45s cubic-bezier(.2, .7, .2, 1), background-color .3s ease, box-shadow .3s ease, color .3s ease; box-shadow: 0 30px 50px -30px rgb(0 0 0 / .25); }
/* The panes' fixed twins (tools.js): transparent, never lifted, and the only part that takes the pointer. */
.tool-x-hit { position: absolute; inset: 0; cursor: pointer; transform: translateZ(calc(var(--i) * 58px)); }
.tool-x-pane::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--accent) 45%, transparent) 1px, transparent 1.6px) 0 0 / 9px 9px; opacity: .35; pointer-events: none; transition: opacity .3s ease; }
.tool-x-pane.is-active { color: var(--ink); background: color-mix(in srgb, var(--accent) 10%, var(--background)); transform: translateZ(calc(var(--i) * 58px + 34px)); box-shadow: 0 0 0 1px var(--accent), 0 40px 60px -30px color-mix(in srgb, var(--accent) 60%, transparent); }
.tool-x-pane.is-active::after { opacity: .7; }
.tool-x-name { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; font: 700 16px "Space Grotesk", sans-serif; }
.tool-x-name img, .tool-x-chip img { width: 20px; height: 20px; }
.tool-x-name img.wide, .tool-x-chip img.wide { width: 24px; }
.tool-x-mini { position: relative; z-index: 1; margin: 0; overflow: hidden; color: inherit; font-family: var(--mono); font-size: 6.5px; line-height: 1.5; opacity: .75; }
.tool-x-mini .ln { display: block; white-space: pre; }
.tool-x-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tool-x-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 2px; background: var(--background); color: var(--muted); font: 500 14px Inter, sans-serif; cursor: pointer; }
.tool-x-chip:hover { color: var(--ink); border-color: var(--muted); }
.tool-x-chip[aria-pressed="true"] { color: var(--ink); border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tool-x-stack { display: grid; }
/* Clipped, so names placed for the previous width can't widen the page in the frame before tools.js moves them. */
.tool-x-discs { position: relative; width: 100%; max-width: 520px; justify-self: center; overflow: clip; overflow-clip-margin: 8px; }
.tool-x-discs canvas { position: absolute; inset: 0; width: 100%; height: 100%; -webkit-tap-highlight-color: transparent; }
.tool-x-chips { position: absolute; inset: 0; pointer-events: none; }
/* Names in the stack's order; tools.js places each beside its disc and keeps it within the gap between discs. */
.tool-x-chip { position: absolute; left: var(--label-x); display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 2px; color: var(--muted); font: 700 16px "Space Grotesk", sans-serif; text-decoration: none; white-space: nowrap; pointer-events: auto; transform: translateY(-50%); transition: color .2s ease; }
.tool-x-chip::before { content: ""; position: absolute; right: calc(100% + 6px); top: 50%; width: 10px; border-top: 1px dotted var(--line); }
.tool-x-chip:hover { color: var(--ink); }
.tool-x-chip.is-on { color: var(--accent); }
.tool-x-chip.is-on::before { width: 14px; border-top-color: var(--accent); }
.tool-x-chip img { width: 20px; height: 20px; }
.tool-x-chip img.wide { width: 24px; }
/* Every card sits in the same cell, so the section is as tall as the longest card and nothing below
jumps; each card keeps its own height and starts at the top, so a short one has no empty terminal. */
.is-exploded .tool-grid { grid-template-columns: minmax(0, 1fr); border: 0; }
Expand All @@ -285,17 +281,11 @@ h1 { margin: 0; max-width: 11ch; font-size: clamp(44px, 5.4vw, 80px); line-heigh

@media (max-width: 900px) {
.tool-x { grid-template-columns: minmax(0, 1fr); gap: 32px; }
.tool-x-tower { margin: 220px 0 70px; transform: perspective(2000px) rotateX(58deg) rotateZ(-38deg) scale(.8); }
}
@media (max-width: 620px) {
.tool-x-tower { margin: 170px 0 30px; transform: perspective(2000px) rotateX(58deg) rotateZ(-38deg) scale(.6); }
.tool-x-chip { padding: 0 10px; gap: 6px; font-size: 13px; }
/* On a phone each card takes its own height, so a short one has no empty terminal under it. */
.is-exploded .tool:not(.is-active) { display: none; }
}
@media (max-width: 380px) {
.tool-x-chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
.tool-x-pane, .is-exploded .tool, .is-exploded .tool.is-active { transition: none; }
.tool-x-chip, .is-exploded .tool, .is-exploded .tool.is-active { transition: none; }
}
35 changes: 29 additions & 6 deletions tests/website.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,15 @@ test('tools, stack layers, sharing assets and responsive layout work in both the
await expect(page.getByRole('link', { name: 'SQLStack on GitHub', exact: true })).toHaveAttribute('href', 'https://github.com/sqlstack-io');

const grid = page.locator('.tool-grid');
const chips = page.getByRole('group', { name: 'Show a tool' });
const names = page.getByRole('navigation', { name: 'All tools' });
const batch = page.getByRole('navigation', { name: 'Batch tools' });
const streaming = page.getByRole('navigation', { name: 'Streaming tools' });
for (const [name, website] of tools) {
// One card shows at a time; its chip picks it.
await chips.getByRole('button', { name, exact: true }).click();
await expect(chips.getByRole('button', { name, exact: true })).toHaveAttribute('aria-pressed', 'true');
// One card shows at a time; focusing a tool's name beside the discs picks it, and the name links to its site.
const label = names.getByRole('link', { name, exact: true });
await expect(label).toHaveAttribute('href', website);
await label.focus();
await expect(label).toHaveClass(/is-on/);
await expect(grid.getByRole('link', { name: /website$/ })).toHaveCount(1);
await expect(grid.getByRole('link', { name: `${name} website`, exact: true })).toHaveAttribute('href', website);
await expect(grid.getByRole('link', { name: new RegExp(`^${name} docs: `) })).toHaveAttribute('href', new RegExp(`^${website.replace(/\/$/, '')}/docs/`));
Expand All @@ -94,7 +96,7 @@ test('tools, stack layers, sharing assets and responsive layout work in both the
await expect(caption).toHaveCSS('opacity', '0');
await page.mouse.move(5, 5);
await expect(tide.locator('.label')).toHaveCSS('opacity', '0');
await chips.getByRole('button', { name: 'SQLBuild', exact: true }).click();
await names.getByRole('link', { name: 'SQLBuild', exact: true }).focus();
await expect(page.getByRole('article', { name: 'SQLBuild', exact: true })).toHaveAccessibleDescription(/^SQL and Python transformations and orchestration\. /);

for (const width of [320, 390, 700, 768, 1101, 1536]) {
Expand All @@ -109,7 +111,7 @@ test('tools, stack layers, sharing assets and responsive layout work in both the
await page.keyboard.press('Enter');
await expect(page).toHaveURL(/#tools$/);
await page.keyboard.press('Tab');
await expect(chips.getByRole('button', { name: 'SQLBuild', exact: true })).toBeFocused();
await expect(names.getByRole('link', { name: 'SQLClean', exact: true })).toBeFocused();
}

await expect(page.locator('link[rel="canonical"]')).toHaveAttribute('href', 'https://sqlstack.io/');
Expand Down Expand Up @@ -205,3 +207,24 @@ for (const input of ['touch', 'mouse']) {
await context.close();
});
}

test('a tool name beside the discs shows its card when pointed at and opens its site on a click', async ({ browser }) => {
const context = await browser.newContext({ viewport: { width: 1280, height: 800 } });
await context.route('https://sqltide.io/**', (route) => route.fulfill({ body: 'SQLTide' }));
const page = await context.newPage();
await page.goto('/#tools');
const name = page.getByRole('navigation', { name: 'All tools' }).getByRole('link', { name: 'SQLTide', exact: true });
const box = await name.boundingBox();
await page.mouse.move(box.x + box.width / 2, box.y - 40);
await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2, { steps: 4 });
await expect(name).toHaveClass(/is-on/);
await expect(page.locator('article.tool.sqltide')).toHaveClass(/is-active/);
// Tabbing quickly past the last name lands in its card, not in the card that is fading out.
const names = page.getByRole('navigation', { name: 'All tools' }).getByRole('link');
await names.first().focus();
for (let i = 0; i < 6; i += 1) await page.keyboard.press('Tab', { delay: 20 });
await expect(page.getByRole('link', { name: 'SQLLoad website', exact: true })).toBeFocused();
await name.click();
await page.waitForURL('https://sqltide.io/');
await context.close();
});
Loading