diff --git a/tools/build_site.py b/tools/build_site.py index 88f72f8..d92ad5d 100644 --- a/tools/build_site.py +++ b/tools/build_site.py @@ -374,7 +374,7 @@ def render(page: Page, pages: list[Page]) -> str:
- Which board? + Hardware Support me! ❤️ diff --git a/tools/test_site_browser.cjs b/tools/test_site_browser.cjs index 3301aa9..0c8544a 100644 --- a/tools/test_site_browser.cjs +++ b/tools/test_site_browser.cjs @@ -27,7 +27,7 @@ const server = http.createServer((req, res) => { fs.createReadStream(file).pipe(res); }); -const viewports = [[320, 640], [360, 740], [390, 844], [430, 932], [768, 1024], [1024, 768], [1440, 900], [1920, 1080], [844, 390]]; +const viewports = [[320, 640], [360, 740], [390, 844], [430, 932], [768, 1024], [820, 1180], [1024, 768], [1180, 820], [1440, 900], [1920, 1080], [844, 390]]; const pages = fs.readdirSync(root, { withFileTypes: true }).filter(d => d.isDirectory() && fs.existsSync(path.join(root, d.name, 'index.html')) && !/noindex/.test(fs.readFileSync(path.join(root, d.name, 'index.html'), 'utf8'))).map(d => d.name + '/'); pages.unshift(''); @@ -108,6 +108,15 @@ pages.unshift(''); } await page.goto(base, { waitUntil: 'load' }); if (width > 760 && await page.isVisible('.menu')) failures.push(`${width}: mobile menu button visible on a wide screen`); + // Tablets (iPad) and desktops: the name, the links and the icons never overlap. + if (width > 760 && await page.evaluate(() => { + const r = s => document.querySelector(s).getBoundingClientRect(); + const name = r('.brand > span'), nav = r('.site-nav'), tools = r('.tools'); + return name.right > nav.left + 1 || nav.right > tools.left + 1; + })) failures.push(`${width}: header name, links or icons overlap`); + // The chip icon opens the hardware diagram, fully below the header. + if (!(await page.getAttribute('.tools .buy', 'href') || '').endsWith('hardware/#hw-diagram')) + failures.push(`${width}: chip icon does not open the hardware diagram`); if (width > 760 && !(await page.isVisible('#site-nav'))) failures.push(`${width}: main navigation hidden on a wide screen`); await page.click('.search-open'); await page.fill('#search-input', 'headscale'); diff --git a/website/assets/site.css b/website/assets/site.css index 93194f3..d86283d 100644 --- a/website/assets/site.css +++ b/website/assets/site.css @@ -49,7 +49,7 @@ p, li { max-width: 72ch; } .top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); } .top-inner { max-width: var(--max); margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; } -.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; white-space: nowrap; min-height: 44px; } +.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 650; white-space: nowrap; min-height: 44px; flex-shrink: 0; } .site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 0; padding: 0; } .site-nav a { color: var(--muted); text-decoration: none; font-size: 15px; padding: 6px 2px; display: inline-block; } .site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); } @@ -236,7 +236,9 @@ summary { cursor: pointer; font-weight: 600; } } /* Phones: the name stacks as "Recovery / Gateway" (like the compact logo) so the * header icons stay on one row; below 344 px only the logo mark remains. */ -@media (max-width: 440px) { .brand > span { display: flex; flex-direction: column; line-height: 1.1; } } +/* Phones and tablets (iPad): the name stacks as "Recovery / Gateway" so it never runs + * into the navigation or the header icons. */ +@media (max-width: 1199px) { .brand > span { display: flex; flex-direction: column; line-height: 1.1; } } @media (max-width: 343px) { .brand > span { display: none; } } @media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } } .release-note { margin: 0 0 2rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-left: 3px solid #1FC97A; border-radius: 12px; font-size: .94rem; line-height: 1.65; } @@ -245,6 +247,8 @@ summary { cursor: pointer; font-weight: 600; } @media print { .top, .sidebar, .foot, .copy { display: none; } } /* Interactive hardware diagram (07-hardware, generated by tools/make_hardware_diagram.py). */ svg.hw { display: block; width: 100%; height: auto; font-family: var(--font); } +#hw-diagram { scroll-margin-top: 130px; } /* the header's chip icon lands here, with room above */ +@media (max-width: 760px) { #hw-diagram { scroll-margin-top: 96px; } } svg.hw .hw-bg { fill: var(--surface); } svg.hw .hw-box, svg.hw .hw-board { fill: var(--card); stroke: var(--line); stroke-width: 1.5; } svg.hw .hw-opt { fill: var(--card); stroke: var(--muted); stroke-width: 1.2; stroke-dasharray: 5 4; }