From c4450b1fd8978a954eb73813309838cead5b7a08 Mon Sep 17 00:00:00 2001 From: Eric Dahl Date: Thu, 3 Dec 2026 02:07:21 -0500 Subject: [PATCH] Website: the header, title and type line up with showrecorder.app (#100) The width (1120 px plus 16/24/32 px sides), the 64 px sticky header, the logo and wordmark, the type scale (17/18 px body, its h1, h2 and h3), the section spacing, the buttons and the footer type are now showrecorder.app's values. The hero uses its mechanism too: one column under 1024 px, then two columns centered in the first screen. The hero block is given showrecorder.app's height, so the title lands at the same x and y at any window height. The eyebrow moves under the title (Eric's call), so the title starts where showrecorder.app's does. Its wording is unchanged, and it stays a paragraph, not a heading. The green and the green hero gradient stay. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VCgWWutwEqKiC9aQMQxaR5 --- website/README.md | 2 + website/app/globals.css | 269 +++++++++++++++++++++++++--------- website/app/page.tsx | 3 +- website/tests/layout.test.tsx | 35 +++++ 4 files changed, 235 insertions(+), 74 deletions(-) create mode 100644 website/tests/layout.test.tsx diff --git a/website/README.md b/website/README.md index b5fb834..fb58c52 100644 --- a/website/README.md +++ b/website/README.md @@ -39,6 +39,8 @@ changes. - `tests/site.test.ts` checks the tagged showrecorder.app links and where "Get the beta" goes. - `tests/metadata.test.ts` checks the title and description lengths, the canonical address, and that the share image is a 1200 x 630 PNG on the Open Graph card and a large Twitter card. +- `tests/layout.test.tsx` checks that the width, header, type scale and hero order are showrecorder.app's (#100), so + the two sites' headers and titles line up. - `tests/analytics.test.ts` checks the PostHog setup, the `?internal=1` opt-out and the Content-Security-Policy. ## Where things live diff --git a/website/app/globals.css b/website/app/globals.css index a5968aa..d150cb8 100644 --- a/website/app/globals.css +++ b/website/app/globals.css @@ -24,6 +24,27 @@ --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + + /* Layout and type tokens, the same values as showrecorder.app (its website/app/globals.css and home.css), so the + header and the hero title sit in the same place when you switch between the two sites (#100). */ + --gutter: 16px; + --header-h: 0px; /* the header scrolls away on phones */ + --text-display-s: clamp(2.25rem, 2.6vw + 1.2rem, 3.75rem); + --text-section: clamp(2rem, 2.5vw + 1rem, 3.25rem); + --text-lead: clamp(1.125rem, 0.35vw + 1rem, 1.3125rem); +} + +@media (min-width: 768px) { + :root { + --gutter: 24px; + --header-h: 64px; + } +} + +@media (min-width: 1024px) { + :root { + --gutter: 32px; + } } @media (prefers-color-scheme: light) { @@ -52,25 +73,43 @@ html { background: var(--bg); color: var(--ink); font-family: var(--font); + overflow-x: clip; -webkit-text-size-adjust: 100%; - scroll-behavior: smooth; + text-size-adjust: 100%; + /* A focused link scrolled into view stays clear of the sticky header (0 on phones, where it scrolls away). */ + scroll-padding-top: calc(var(--header-h) + 16px); } -@media (prefers-reduced-motion: reduce) { +@media (prefers-reduced-motion: no-preference) { html { - scroll-behavior: auto; + scroll-behavior: smooth; } } +/* The type scale is showrecorder.app's: 17 px body, 18 px from 1024 px, and the same headings. */ body { margin: 0; - line-height: 1.55; + overflow-x: clip; + font-size: 17px; + line-height: 1.5; + overflow-wrap: break-word; -webkit-font-smoothing: antialiased; } +@media (min-width: 1024px) { + body { + font-size: 18px; + } +} + a { color: var(--link); - text-underline-offset: 2px; + text-underline-offset: 0.18em; + text-decoration-thickness: 1px; +} + +a:hover { + text-decoration-thickness: 2px; } a:focus-visible, @@ -87,38 +126,46 @@ main:focus { h1, h2, h3 { - line-height: 1.15; - letter-spacing: -0.01em; + color: var(--ink); + text-wrap: balance; margin: 0 0 0.6em; } h1 { - font-size: clamp(2.1rem, 7vw, 3.4rem); - font-weight: 800; + font-size: clamp(34px, 3.2vw + 22px, 56px); + font-weight: 700; + line-height: 1.1; + letter-spacing: -0.02em; } h2 { - font-size: clamp(1.5rem, 4.5vw, 2.1rem); - font-weight: 750; + font-size: var(--text-section); + font-weight: 700; + line-height: 1.05; + letter-spacing: -0.025em; + max-width: 22ch; } h3 { - font-size: 1.1rem; + font-size: clamp(19px, 0.3vw + 18px, 21px); font-weight: 700; + line-height: 1.3; } p { margin: 0 0 1em; + text-wrap: pretty; } .wrap { - max-width: 1080px; - margin: 0 auto; - padding: 0 16px; + width: 100%; + max-width: calc(1120px + 2 * var(--gutter)); + margin-inline: auto; + padding-inline: var(--gutter); } .narrow { - max-width: 640px; + max-width: calc(640px + 2 * var(--gutter)); } .skip-link { @@ -128,51 +175,74 @@ p { padding: 8px 12px; background: var(--bg-raised); color: var(--ink); - z-index: 10; + z-index: 100; } .skip-link:focus { top: 8px; } -/* Header */ +/* Header: showrecorder.app's geometry. Phones: the wordmark row at 8 px from the top, scrolling away. 768 px and up: + one 64 px row that stays at the top. */ .site-header { + background: var(--bg); border-bottom: 1px solid var(--hairline); } +@media (min-width: 768px) { + .site-header { + position: sticky; + top: 0; + z-index: 50; + } +} + .header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; - min-height: 60px; + padding-block: 8px; +} + +@media (min-width: 768px) { + .header-inner { + min-height: var(--header-h); + padding-block: 0; + } } .brand { display: inline-flex; align-items: center; - gap: 10px; + gap: 8px; + min-height: 44px; color: var(--ink); - font-weight: 700; - font-size: 1.05rem; + font-weight: 600; + font-size: 19px; + letter-spacing: -0.01em; text-decoration: none; } .brand img { - border-radius: 8px; + border-radius: 22.37%; + box-shadow: 0 0 0 1px var(--hairline); + flex: none; } -/* Buttons */ +/* Buttons: showrecorder.app's filled button (its live store slot), in SoundcheckPlayer's green. */ .button { display: inline-flex; align-items: center; justify-content: center; - min-height: 48px; - padding: 0 22px; - border-radius: 999px; + min-height: 52px; + padding: 8px 20px; + border-radius: 12px; background: var(--button-bg); color: var(--button-ink); - font-weight: 700; + font-size: 17px; + font-weight: 500; + line-height: 1.2; text-decoration: none; white-space: nowrap; } @@ -181,34 +251,83 @@ p { filter: brightness(1.08); } +/* The header button is as tall as showrecorder.app's header controls (44 px). */ .button--small { - min-height: 40px; + min-height: 44px; padding: 0 16px; - font-size: 0.95rem; + border-radius: 10px; + font-size: 16px; } -/* Hero */ +/* Hero: showrecorder.app's. Under 1024 px, 40 px above and 64 below, one column. From 1024 px the hero fills the + first screen, two equal columns centered in it. */ .hero { background: var(--bg-hero); - padding: 40px 0 48px; + padding-block: 40px 64px; + overflow: hidden; +} + +/* On phones showrecorder.app's header has a second row, its section links (44 px; 97 px in all). This header has one + row (61 px), so the hero starts 36 px lower inside it and the title lands at the same height (137 px). */ +@media (max-width: 767.98px) { + .hero { + padding-top: 76px; + } } .hero-grid { display: grid; - gap: 32px; + gap: 48px; align-items: center; } +@media (min-width: 1024px) { + .hero { + display: grid; + align-items: center; + min-height: calc(100svh - var(--header-h)); + padding-block: 40px; + } + + /* showrecorder.app centers its hero block in the first screen, so its title's height on the screen follows that + block's height: 606 px at 1024 px wide, 643 px at 1440, 661 px from 1600 (measured 2026-12-03). This block gets + the same height, with the title at its top, so the title lands in the same place at any window height. Measure + again if showrecorder.app's hero changes. */ + .hero-grid { + grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); + gap: 64px; + min-height: clamp(606px, 513.9px + 8.99vw, 661px); + } + + .hero-copy { + align-self: start; + } + + .hero .device { + width: 260px; + } +} + +.hero h1 { + font-size: var(--text-display-s); + line-height: 1.02; + max-width: 17ch; + margin: 0; +} + +/* The small line under the title: showrecorder.app's eyebrow type, in green. */ .eyebrow { + margin: 16px 0 0; color: var(--accent-text); - font-weight: 700; - font-size: 0.9rem; - letter-spacing: 0.04em; - text-transform: uppercase; + font-size: 15px; + font-weight: 600; + letter-spacing: 0.02em; } -.lede { - font-size: 1.15rem; +.lede, +.hero .lede { + margin-top: 24px; + font-size: var(--text-lead); color: var(--muted); max-width: 34em; } @@ -218,12 +337,12 @@ p { flex-wrap: wrap; align-items: center; gap: 12px 16px; - margin-top: 24px; + margin-top: 40px; } .hero-note { color: var(--muted); - font-size: 0.95rem; + font-size: 15px; } .hero-shot { @@ -246,13 +365,15 @@ p { box-shadow: var(--shadow); } -/* Sections */ +/* Sections: showrecorder.app's spacing, 64 px above and below, 96 px from 1024 px. */ section { - padding: 56px 0; + padding-block: 64px; } -.hero { - padding-top: 40px; +@media (min-width: 1024px) { + section { + padding-block: 96px; + } } .band { @@ -313,7 +434,7 @@ section { .signup input[type="email"] { flex: 1 1 220px; min-width: 0; - min-height: 48px; + min-height: 52px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--hairline); @@ -323,62 +444,68 @@ section { } .signup button { - min-height: 48px; - padding: 0 22px; + min-height: 52px; + padding: 8px 20px; border: 0; - border-radius: 999px; + border-radius: 12px; background: var(--button-bg); color: var(--button-ink); font: inherit; - font-weight: 700; + font-size: 17px; + font-weight: 500; cursor: pointer; } .signup-note { margin-top: 12px; - font-size: 0.9rem; + font-size: 15px; } .privacy { background: var(--bg-band); - font-size: 0.95rem; } -/* Footer */ +/* Footer: showrecorder.app's type and spacing (14 px, 15 px links at a 44 px tap height). */ .site-footer { border-top: 1px solid var(--hairline); - padding: 32px 0 40px; + background: var(--bg); + padding-block: 40px; color: var(--muted); - font-size: 0.95rem; + font-size: 14px; + line-height: 1.45; +} + +.site-footer p { + margin: 0; } .footer-links { display: flex; flex-wrap: wrap; - gap: 8px 20px; + column-gap: 24px; list-style: none; - margin: 0 0 16px; + margin: 12px 0 0; padding: 0; } .footer-links a { - display: inline-block; - padding: 6px 0; + display: inline-flex; + align-items: center; + min-height: 44px; + color: var(--ink); + font-size: 15px; } -.legal { - font-size: 0.8rem; +.site-footer .legal { + margin-top: 16px; + max-width: 66ch; } -@media (min-width: 768px) { - .hero { - padding: 72px 0 80px; - } - - .hero-grid { - grid-template-columns: 1.2fr 1fr; - } +.site-footer .legal + .legal { + margin-top: 8px; +} +@media (min-width: 768px) { .split { grid-template-columns: 1.4fr 1fr; gap: 56px; @@ -391,8 +518,4 @@ section { .cards--two { grid-template-columns: 1fr 1fr; } - - section { - padding: 80px 0; - } } diff --git a/website/app/page.tsx b/website/app/page.tsx index 544670d..0623bd7 100644 --- a/website/app/page.tsx +++ b/website/app/page.tsx @@ -26,8 +26,9 @@ export default function Home() {
-

Virtual soundcheck for iPhone, iPad and Mac

Play your Stems back into the Mixer.

+ {/* Under the title, so the title starts where showrecorder.app's does (#100). */} +

Virtual soundcheck for iPhone, iPad and Mac

SoundcheckPlayer plays a band's multitrack Stems from an iPhone, iPad and Mac back into the Mixer over USB, each Stem on its own channel. Mix the band without the band. diff --git a/website/tests/layout.test.tsx b/website/tests/layout.test.tsx new file mode 100644 index 0000000..0672789 --- /dev/null +++ b/website/tests/layout.test.tsx @@ -0,0 +1,35 @@ +import { readFileSync } from "node:fs"; +import path from "node:path"; +import { renderToStaticMarkup } from "react-dom/server"; +import Home from "@/app/page"; + +// The header and the hero title sit where showrecorder.app's do (#100): its layout values, copied from its +// website/app/globals.css and home.css. A change here should be a change there first. +const css = readFileSync(path.resolve(__dirname, "../app/globals.css"), "utf8"); +const html = renderToStaticMarkup(); + +describe("the layout matches showrecorder.app", () => { + it("uses its content width and side padding (16, 24 and 32 px)", () => { + expect(css).toContain("max-width: calc(1120px + 2 * var(--gutter));"); + expect(css).toMatch(/--gutter: 16px;[\s\S]*--gutter: 24px;[\s\S]*--gutter: 32px;/); + }); + + it("has its 64 px header, sticky from 768 px", () => { + expect(css).toContain("--header-h: 64px;"); + expect(css).toMatch(/@media \(min-width: 768px\) \{\s*\.site-header \{\s*position: sticky;/); + }); + + it("uses its type scale", () => { + expect(css).toContain("--text-display-s: clamp(2.25rem, 2.6vw + 1.2rem, 3.75rem);"); + expect(css).toContain("--text-section: clamp(2rem, 2.5vw + 1rem, 3.25rem);"); + expect(css).toContain("--text-lead: clamp(1.125rem, 0.35vw + 1rem, 1.3125rem);"); + expect(css).toMatch(/body \{[^}]*font-size: 17px;/); + }); + + it("starts the hero with the title, and the line under it is not a heading", () => { + const hero = html.slice(html.indexOf('class="hero-copy"')); + expect(hero.indexOf("/); + expect(html.match(/