From 7a3110a952322a1ecd3f892cebd80250de8da8b3 Mon Sep 17 00:00:00 2001 From: Kevin Longe <273747162+kvlonge@users.noreply.github.com> Date: Mon, 30 Nov 2026 07:47:23 +0000 Subject: [PATCH] Show the tools as an exploded stack Replace the six-snippet grid with tilted panes stacked as in the hero. Picking a pane, a chip or a hero layer lifts that tool and shows its card beside the stack, one at a time, so each snippet can show its full output: SQLBuild's whole rule and compile run, and SQLLoad's complete plans. The stack cycles slowly until someone picks a tool, holds still under reduced motion, and without JavaScript the cards stay a plain grid. --- index.html | 5 +- styles.css | 40 ++++++++++++++ tests/website.spec.mjs | 11 +++- tools.js | 116 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 169 insertions(+), 3 deletions(-) create mode 100644 tools.js diff --git a/index.html b/index.html index a5f6365..0fb74cc 100644 --- a/index.html +++ b/index.html @@ -30,6 +30,7 @@ + @@ -101,7 +102,7 @@

Independent tools. Shared foundations.

SQL and Python transformations and orchestration. Turn your team's conventions into compile errors. - +
@@ -123,7 +124,7 @@

Independent tools. Shared foundations.

Load data into your warehouse. No hidden state. Your warehouse is the state. - +
diff --git a/styles.css b/styles.css index 108a2fd..0c556db 100644 --- a/styles.css +++ b/styles.css @@ -255,3 +255,43 @@ h1 { margin: 0; max-width: 11ch; font-size: clamp(44px, 5.4vw, 80px); line-heigh .terminal .ln { padding-left: min(var(--hang, 0), 6ch); text-indent: calc(-1 * min(var(--hang, 0), 6ch)); } } + +/* The exploded tool stack (tools.js): tilted panes beside 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); cursor: pointer; 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); } +.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); } +/* 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; } +.is-exploded .tool { grid-row: 1; grid-column: 1; align-self: start; grid-template-rows: auto auto auto 1fr; border: 1px solid var(--line); opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s .3s; } +.is-exploded .tool.is-active { opacity: 1; visibility: visible; transition: opacity .3s ease; box-shadow: 0 30px 80px color-mix(in srgb, var(--accent) 16%, transparent); } + +@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; } +} diff --git a/tests/website.spec.mjs b/tests/website.spec.mjs index 4635271..ffc1ad1 100644 --- a/tests/website.spec.mjs +++ b/tests/website.spec.mjs @@ -63,9 +63,14 @@ 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 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'); + 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/`)); const layer = (name === 'SQLTide' ? streaming : batch).getByRole('link', { name: new RegExp(`^${name} `) }); @@ -84,9 +89,12 @@ test('tools, stack layers, sharing assets and responsive layout work in both the await expect(caption).toHaveText('Streaming'); await tide.hover(); await expect(tide.locator('.label')).toHaveCSS('opacity', '1'); + // Pointing at a hero layer shows that tool's card below. + await expect(grid.getByRole('link', { name: 'SQLTide website', exact: true })).toBeVisible(); 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 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]) { @@ -94,13 +102,14 @@ test('tools, stack layers, sharing assets and responsive layout work in both the expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBe(true); // Snippets wrap rather than run past the card edge. expect(await page.locator('.tool .terminal').evaluateAll((panels) => panels.filter((panel) => panel.scrollWidth > panel.clientWidth).length)).toBe(0); + await page.evaluate(() => scrollTo(0, 0)); await expect(page.getByRole('button', { name: 'Dark mode', exact: true })).toBeInViewport(); } await page.getByRole('link', { name: 'Skip to tools', exact: true }).focus(); await page.keyboard.press('Enter'); await expect(page).toHaveURL(/#tools$/); await page.keyboard.press('Tab'); - await expect(grid.getByRole('link', { name: 'SQLBuild website', exact: true })).toBeFocused(); + await expect(chips.getByRole('button', { name: 'SQLBuild', exact: true })).toBeFocused(); } await expect(page.locator('link[rel="canonical"]')).toHaveAttribute('href', 'https://sqlstack.io/'); diff --git a/tools.js b/tools.js new file mode 100644 index 0000000..2936e6a --- /dev/null +++ b/tools.js @@ -0,0 +1,116 @@ +// The tool section as an exploded stack: one tilted pane per tool, stacked as in +// the hero, beside the card for the tool that is picked. Without this script the +// cards show as a plain grid. +(() => { + const TOWER = ['sqlload', 'sqltide', 'sqlbuild', 'sqlbabel', 'fensu', 'sqlclean']; // bottom to top + const CYCLE_MS = 4500; + + function init(section) { + const grid = section.querySelector('.tool-grid'); + const reduced = matchMedia('(prefers-reduced-motion: reduce)'); + const tools = [...grid.querySelectorAll(':scope > .tool')].map((article) => { + const key = [...article.classList].find((name) => name !== 'tool'); + article.id = `tool-${key}`; + return { key, article, name: article.querySelector('.tool-name').textContent }; + }); + const byKey = (key) => tools.find((tool) => tool.key === key); + // Scrolling under a still pointer fires pointerenter on whatever is now beneath it. Hover + // picks a tool only when the pointer itself moved, so scrolling never undoes a choice. + let lastX = null; + let lastY = null; + let moved = false; // whether the pointermove being dispatched moved the pointer + let movedAt = -Infinity; + window.addEventListener('pointermove', (event) => { + moved = event.clientX !== lastX || event.clientY !== lastY; + lastX = event.clientX; + lastY = event.clientY; + if (moved) movedAt = performance.now(); + }, { capture: true, passive: true }); + // A hero layer announces itself on pointerenter, just before the pointermove that caused it. + const ifPointerMoved = (fn) => setTimeout(() => { + if (performance.now() - movedAt < 60) fn(); + }); + const logos = (tool) => [...tool.article.querySelectorAll('.tool-head img')].map((img) => img.cloneNode()); + + const layout = document.createElement('div'); + layout.className = 'tool-x'; + const stack = document.createElement('div'); + stack.className = 'tool-x-stack'; + const tower = document.createElement('div'); + tower.className = 'tool-x-tower'; + tower.setAttribute('aria-hidden', 'true'); + const panes = TOWER.map((key, i) => { + const tool = byKey(key); + const pane = document.createElement('div'); + pane.className = `tool-x-pane ${key}`; + pane.style.setProperty('--i', i); + const name = document.createElement('span'); + name.className = 'tool-x-name'; + name.append(...logos(tool), tool.name); + const mini = tool.article.querySelector('.terminal').cloneNode(true); + mini.className = 'tool-x-mini'; + pane.append(name, mini); + pane.addEventListener('pointermove', (event) => { + if (event.pointerType === 'mouse' && moved) pick(key, true); + }); + pane.addEventListener('click', () => pick(key, true)); + tower.append(pane); + return pane; + }); + const chips = document.createElement('div'); + chips.className = 'tool-x-chips'; + chips.setAttribute('role', 'group'); + chips.setAttribute('aria-label', 'Show a tool'); + for (const tool of tools) { + const chip = document.createElement('button'); + chip.type = 'button'; + chip.className = `tool-x-chip ${tool.key}`; + chip.dataset.tool = tool.key; + chip.setAttribute('aria-controls', tool.article.id); + chip.append(...logos(tool), tool.name); + chip.addEventListener('click', () => pick(tool.key, true)); + chips.append(chip); + } + stack.append(tower, chips); + grid.before(layout); + layout.append(stack, grid); + section.classList.add('is-exploded'); + + let current = null; + let timer = null; + let visible = false; + function pick(key, byPerson) { + if (byPerson) stopCycle(); + if (key === current) return; + current = key; + for (const pane of panes) pane.classList.toggle('is-active', pane.classList.contains(key)); + for (const chip of chips.children) chip.setAttribute('aria-pressed', String(chip.dataset.tool === key)); + for (const tool of tools) tool.article.classList.toggle('is-active', tool.key === key); + } + function stopCycle() { + clearInterval(timer); + timer = 'stopped'; + } + // Until someone picks a tool, show each in turn while the section is on screen. + if (!reduced.matches) { + timer = setInterval(() => { + if (!visible || document.hidden) return; + const at = tools.findIndex((tool) => tool.key === current); + pick(tools[(at + 1) % tools.length].key, false); + }, CYCLE_MS); + } + reduced.addEventListener('change', () => { if (reduced.matches) stopCycle(); }); + new IntersectionObserver(([entry]) => { visible = entry.isIntersecting; }, { threshold: 0.4 }).observe(layout); + // Pointing at a layer in the hero shows that tool here too. + document.addEventListener('stack:active', ({ detail }) => { + if (!detail.tool || !byKey(detail.tool)) return; + if (detail.link === document.activeElement) pick(detail.tool, true); + else ifPointerMoved(() => pick(detail.tool, true)); + }); + pick(tools[0].key, false); + } + + document.addEventListener('DOMContentLoaded', () => { + document.querySelectorAll('.tools').forEach(init); + }); +})();