diff --git a/README.md b/README.md index e01d43e..8054479 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Open [KindPath locally](http://127.0.0.1:5173/). The API listens on `127.0.0.1:3 `npm run dev` builds the current scanner and firewall runtime images before starting the API and Vite. The first build can download public packages and images; subsequent builds reuse Docker's cache. Browser QA images are only needed for the browser checks, not normal development. If Docker is unavailable, setup stops with an explanation; Chromium never runs directly on the host as a fallback. Ctrl+C stops the dev processes. -Website scanning and capture are **enabled by default for local use**. Enter a URL, select **Scan website**, and download the JSON report or open **Visual preview**. Addresses without a scheme default to HTTPS. The URL scan button waits for the bounded capability check before accepting a submission. Ordinary URL submissions never silently become sample findings. The explicitly labelled example and built-in pages remain available separately. +Website scanning and capture are **enabled by default for local use**. Enter a URL, select **Scan website**, and download the JSON report or open **Visual preview**. Addresses without a scheme default to HTTPS. The URL scan button waits for the bounded capability check before accepting a submission. Ordinary URL submissions never silently become sample findings. The landing page includes a static side-by-side illustration of blur and a red–green colour vision simulation. To disable real scanning or capture in a local process: @@ -50,7 +50,7 @@ Real-page previews use a JPEG rendered in the same isolated visit as the report. - Captures are bounded to the scan viewport's width (up to 1,280 pixels), the first 6,000 pixels of height, and 1.5 MB of JPEG data. Long-page truncation is labelled. Horizontal overflow outside the scan viewport, content requiring interaction, and resources not loaded by the source browser are not included. - A screenshot is an image rather than a semantic, responsive or interactive replica. Changing the panel width scales the captured desktop page; it does not rerun its responsive layout. Live content can change between scans. -Images are independently validated and embedded in sandboxed, opaque-origin iframes. The image document permits only embedded image data and trusted styling; scripts, external connections, frames, forms and navigation targets are absent. No third-party page markup or resource URL is copied into it. Legacy controlled DOM previews remain for the built-in illustration checks. +Images are independently validated and embedded in sandboxed, opaque-origin iframes. The image document permits only embedded image data and trusted styling; scripts, external connections, frames, forms and navigation targets are absent. No third-party page markup or resource URL is copied into it. Controlled DOM previews are also exercised by the automated browser checks. ## API @@ -59,8 +59,8 @@ Images are independently validated and embedded in sandboxed, opaque-origin ifra | GET | `/api/health` | Local API status | | GET | `/api/scanning-capabilities` | Current scanning/capture flags and URL policy | | POST | `/api/scan-public` | One `{ "url": "https://example.com/" }` request; real report and optional image preview | -| POST | `/api/scan-fixture` | Scan a fixed built-in page | -| POST | `/api/analyze` | Explicit illustrative example; never fetches its URL | +| POST | `/api/scan-fixture` | Scan a fixed fixture for controlled checks | +| POST | `/api/analyze` | Return an illustrative report without fetching the URL | For successful scans, KindPath labels clearly identifiable browser verification and sign-in screens in the report and preview. The API and JSON download include an optional `pageNotice` code and a plain-language limitation. Detection uses the rendered page and can miss unfamiliar screens. Findings and previews describe the page KindPath received. diff --git a/scripts/preview-browser.mjs b/scripts/preview-browser.mjs index 7a34891..104c047 100644 --- a/scripts/preview-browser.mjs +++ b/scripts/preview-browser.mjs @@ -58,15 +58,14 @@ try { } const page = await browser.newPage({ viewport: { width: 1280, height: 900 }, serviceWorkers: 'block', acceptDownloads: true }); page.setDefaultTimeout(10000); - let previews = 0; const unexpected = []; - let activeReport = data.report; + const unexpected = []; let apiRequests = 0; - let publicCapabilities = false, publicCalls = 0, captureCapabilities = false; + let publicCapabilities = true, publicCalls = 0, captureCapabilities = false; const publicReport = { ...data.report, mode: 'public', scanId:data.sitePreview.scanId, requestedUrl: 'https://example.com/start', url: 'https://www.example.com/en/start?locale=en', coverage: {blockedRequests:2,failedRequests:3,omittedRules:1,omittedNodes:4}, scanner: { ...data.report.scanner, fixture: 'public' }, limitations: ['Controlled URL-report UI response; no public site fetched.'] }; let publicResponse = publicReport, publicStatus = 200; - let demoFailure = false; const demoRequests = []; + let publicResponseOverride; let delayCapabilities=false,capabilitiesHeld=false,releaseCapabilities; let delayPublic = false, releasePublic, publicHeld = false, notifyPublic; async function assertDownload(expected, coverage = expected.mode === 'public' ? expected.coverage : undefined) { @@ -91,7 +90,7 @@ try { assert.deepEqual(exported.report.scanner, expected.scanner); assert.deepEqual(exported.report.manualChecks, expected.manualChecks); for (const limitation of expected.limitations ?? []) assert.ok(exported.report.limitations.includes(limitation)); - assert.equal(exported.source.label, expected.mode === 'demo' ? 'Illustrative report' : expected.mode === 'fixture' ? 'Real fixture scan' : 'Automated page scan'); + assert.equal(exported.source.label, 'Automated page scan'); assert.ok(exported.report.limitations.some(text => text.includes('do not establish accessibility conformance'))); assert.equal('html' in exported.report, false); assert.equal('sitePreview' in exported.report, false); assert.equal('scanId' in exported.report, false); @@ -134,12 +133,6 @@ try { assert.equal(await printed.isVisible(), false); return pdf?.toString('base64') ?? null; } - let delayScan = false, releaseScan, scanHeld = false; - let fixtureResponseOverride; - let delayPreview = false, releasePreview, previewHeld = false; - let wrongPreview = false; - const capturedFixtures = []; - const snapshots = new Map([['garden', data.snapshot], ['barriers', data.barriersSnapshot], ['clear', data.clearSnapshot]]); await page.route('**/*', async route => { const url = new URL(route.request().url()); // WebKit routes revoked Blob fetches through this handler; let the browser resolve its own local Blob store. @@ -147,39 +140,16 @@ try { if (url.pathname.startsWith('/api/')) apiRequests++; if (url.hostname !== 'kindpath-ui.invalid') { unexpected.push(url.hostname); await route.abort(); return; } if (url.pathname === '/api/scanning-capabilities') { if(delayCapabilities){capabilitiesHeld=true;await new Promise(resolve=>releaseCapabilities=resolve);} await route.fulfill({ json: { publicScanningEnabled: publicCapabilities, publicCaptureEnabled: captureCapabilities, urlPolicy: 'public-http-https' } }); return; } - if (url.pathname === '/api/analyze') { - demoRequests.push(route.request().postDataJSON()); - await route.fulfill(demoFailure?{status:503,json:{error:'Controlled failure'}}:{json:data.demoReport});return; - } if (url.pathname === '/api/scan-public') { publicCalls++; assert.deepEqual(route.request().postDataJSON(), { url: publicReport.requestedUrl }); - const response = publicResponse, status = publicStatus, delayed = delayPublic; + const response = publicResponseOverride ?? { status: publicStatus, json: publicResponse }; + const delayed = delayPublic; if (delayed) { publicHeld = true; notifyPublic?.(); await new Promise(resolve => { releasePublic = resolve; }); } - try { await route.fulfill({ status, json: response }); } catch (error) { if (!delayed) throw error; } - return; - } - if (url.pathname === '/api/scan-fixture') { - assert.ok(['barriers', 'clear'].includes(route.request().postDataJSON().fixture)); - const response = fixtureResponseOverride ?? { json: activeReport }; - const delayed = delayScan; - if (delayed) { scanHeld = true; await new Promise(resolve => { releaseScan = resolve; }); } - try { await route.fulfill(response); } catch (error) { if (!delayed) throw error; } // The delayed request is deliberately cancelled below. - return; - } - if (url.pathname === '/api/preview-fixture') { - previews++; - const { fixture } = route.request().postDataJSON(); - assert.deepEqual(Object.keys(route.request().postDataJSON()), ['fixture']); - assert.ok(snapshots.has(fixture)); capturedFixtures.push(fixture); - const snapshot = wrongPreview ? data.clearSnapshot : snapshots.get(fixture); - wrongPreview = false; - const delayed = delayPreview; - if (delayed) { previewHeld = true; await new Promise(resolve => { releasePreview = resolve; }); } - await new Promise(done => setTimeout(done, 300)); - try { await route.fulfill(previews === 1 ? { status: 503, json: { error: 'Fixture preview is temporarily unavailable. Try again.' } } : { json: snapshot }); } catch (error) { if (!delayed) throw error; } + try { await route.fulfill(response); } catch (error) { if (!delayed) throw error; } return; } + if (url.pathname.startsWith('/api/')) unexpected.push(url.pathname); const asset = data.assets[url.pathname]; await route.fulfill(asset ? { body: asset.body, contentType: asset.type } : { status: 404, body: '' }); }); @@ -188,23 +158,61 @@ try { assert.equal(await websiteEntry.getAttribute('type'),'text'); assert.equal(await websiteEntry.getAttribute('inputmode'),'url'); assert.match(await websiteEntry.getAttribute('aria-describedby'),/website-entry-note/); - await page.getByText('Enter a website address. HTTPS is added if you leave it out.',{exact:true}).waitFor(); - demoFailure=true; - await websiteEntry.fill(' Example.com ');await page.getByRole('button',{name:'Just exploring? Try an example',exact:true}).click(); - await page.getByRole('alert').waitFor(); - assert.equal(await websiteEntry.inputValue(),'https://example.com/'); - assert.deepEqual(demoRequests.at(-1),{url:'https://example.com/'}); - demoFailure=false; - const demoRetry=page.getByRole('button',{name:'Try again',exact:true}); - assert.equal(await demoRetry.evaluate(node=>node===document.activeElement),true); - await demoRetry.click(); - await page.getByRole('region',{name:'Example issues to explore',exact:true}).waitFor(); - assert.deepEqual(demoRequests.slice(-2),[{url:'https://example.com/'},{url:'https://example.com/'}]); - assert.equal(publicCalls,0,'Disabled mode must not submit a public scan'); - const demosBeforeDisabled=demoRequests.length; - await websiteEntry.fill('example.com');await websiteEntry.press('Enter'); + await page.getByText('One public page per scan. HTTPS is added if you leave it out.', {exact:true}).waitFor(); + assert.equal(await page.getByText(/How it works|Local Preview|Design mockups|Try an example|Scan built-in page/i).count(), 0); + await page.getByRole('button', {name:'Scan website',exact:true}).waitFor(); + await page.getByRole('link', {name:'Skip to content',exact:true}).focus(); + await page.keyboard.press('Enter'); + assert.equal(await page.evaluate(() => document.activeElement?.id), 'main'); + await page.keyboard.press('Tab'); + assert.equal(await websiteEntry.evaluate(node => node === document.activeElement), true); + await websiteEntry.blur(); + const landing = page.locator('.hero'); + const panes = landing.locator('.landing-comparison-page'); + assert.equal(await panes.count(), 2); + const filterId = await panes.nth(1).locator('filter').getAttribute('id'); + assert.equal(await panes.nth(0).locator('filter').count(), 0); + assert.equal(await panes.nth(1).locator('svg > g').getAttribute('filter'), `url(#${filterId})`); + assert.equal(await panes.nth(1).locator('feColorMatrix').count(), 1); + assert.equal(await panes.nth(1).locator('feGaussianBlur').count(), 1); + const landingImages = {}; + for (const [size, width, height] of [['desktop', 1200, 720], ['mobile', 390, 740]]) { + await page.setViewportSize({width, height}); + const [left, right] = await panes.evaluateAll(nodes => nodes.map(node => node.getBoundingClientRect().toJSON())); + const form = await landing.locator('form').boundingBox(); + assert.equal(left.top, right.top); + assert.ok(left.right < right.left); + if (size === 'mobile') assert.ok(left.top > form.y + form.height); + else { + const heading = await landing.getByRole('heading', {level:1}).boundingBox(); + const instructions = await landing.getByText('Scan a public webpage', {exact:false}).boundingBox(); + const comparison = await landing.locator('figure').boundingBox(); + const footer = await page.getByRole('contentinfo').boundingBox(); + assert.ok(comparison.y >= heading.y + heading.height); + assert.ok(comparison.y + comparison.height <= instructions.y); + assert.ok(instructions.y + instructions.height <= form.y); + assert.ok(footer.height <= 38, 'The desktop footer must remain a compact row'); + assert.ok(footer.y + footer.height <= height, 'The compact landing page must fit the desktop viewport'); + } + assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)); + landingImages[size] = (await page.screenshot({fullPage:true})).toString('base64'); + } + for (const width of [760, 761]) { + await page.setViewportSize({width,height:800}); + const comparison = await landing.locator('figure').boundingBox(); + const form = await landing.locator('form').boundingBox(); + assert.equal(comparison.y < form.y, width > 760); + } + await page.setViewportSize({width:320,height:740}); + assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)); + assert.ok((await landing.getByRole('button', {name:'Scan website',exact:true}).boundingBox()).height >= 44); + await page.setViewportSize({width:1280,height:900}); + publicCapabilities = false; + await page.reload(); + await page.getByRole('button', {name:'Scan website',exact:true}).waitFor(); + await websiteEntry.fill('example.com'); await websiteEntry.press('Enter'); await page.getByRole('alert').filter({hasText:'Website scanning is unavailable'}).waitFor(); - assert.equal(demoRequests.length,demosBeforeDisabled,'Normal URL submission must never become demo findings'); + assert.equal(publicCalls, 0); for(const entry of ['javascript:alert(1)','https:/example.com','https:///example.com','user@example.com','https://user:pass@example.com']) { const before=apiRequests;await websiteEntry.fill(entry);await websiteEntry.press('Enter'); await page.getByRole('alert').waitFor();assert.equal(apiRequests,before); @@ -213,343 +221,6 @@ try { await websiteEntry.fill(''); await page.getByRole('button',{name:'Scan website',exact:true}).click(); assert.equal(await websiteEntry.evaluate(node=>node.validity.valueMissing),true); - await page.getByRole('button', { name: 'Scan built-in page' }).click(); - // First exercise the actual bounded report returned by the fixture scanner. - const violations = page.getByRole('region', { name: 'Confirmed automated violations', exact: true }); - await violations.waitFor(); - assert.equal(await violations.locator('article').count(), data.report.findings.length); - const firstWithElements = data.report.findings.find(finding => finding.elements.length > 0); - if (firstWithElements) { - const card = violations.locator('article').filter({ has: page.getByRole('heading', { name: firstWithElements.title, exact: true }) }); - await card.locator('summary').click(); - assert.equal(await card.locator('.element-target code').first().textContent(), firstWithElements.elements[0].targets.join(' → ') || 'Page (no selector provided)'); - assert.equal(await card.locator('.element-summary').first().textContent(), firstWithElements.elements[0].guidance); - } - await page.getByRole('button', { name: 'Just exploring? Try an example', exact: true }).click(); - await page.getByRole('region', { name: 'Example issues to explore', exact: true }).waitFor(); - await page.getByRole('button', { name: /Visual preview/ }).click(); - assert.equal(await page.locator('iframe').count(), 0); - await page.getByRole('button', { name: 'Generate fixture snapshot' }).click(); - await page.getByRole('button', { name: 'Generating snapshot…' }).waitFor(); - await page.getByRole('alert').filter({ hasText: 'temporarily unavailable' }).waitFor(); - await page.getByRole('button', { name: 'Generate fixture snapshot' }).click(); - const original = page.frameLocator('iframe').first(); - await original.locator('.cta').waitFor(); - assert.equal(await page.locator('iframe').count(), 2); - for (const frame of await page.locator('iframe').all()) assert.equal(await frame.getAttribute('sandbox'), ''); - assert.equal(await page.evaluate(() => document.querySelector('iframe').contentDocument), null); - assert.equal(await original.locator('script, form, [href], [src], [onclick]').count(), 0); - assert.equal(await original.locator('input').isDisabled(), true); - assert.equal(await original.locator('button').isDisabled(), true); - assert.equal(await original.locator('html').getAttribute('lang'), 'en'); - const before = await original.locator('.cta').evaluate(element => getComputedStyle(element).backgroundColor); - await original.locator('.cta').hover(); await page.waitForTimeout(200); - assert.notEqual(await original.locator('.cta').evaluate(element => getComputedStyle(element).backgroundColor), before); - const addresses = page.frames().map(frame => frame.url()); - await original.locator('.cta').click(); - assert.deepEqual(page.frames().map(frame => frame.url()), addresses); - assert.equal(page.context().pages().length, 1); - await original.locator('.ad').scrollIntoViewIfNeeded(); assert.equal(await original.locator('.ad').isVisible(), true); - const modified = page.locator('iframe').nth(1); - const slider = name => page.getByRole('slider', { name, exact: true }); - const names = ['Colour strength', 'Contrast reduction', 'Blur strength', 'Peripheral restriction']; - assert.equal(await page.getByRole('slider').count(), 4); - assert.equal(await slider('Colour strength').inputValue(), '100'); - for (const name of names.slice(1)) assert.equal(await slider(name).inputValue(), '0'); - const modifiedBody = page.frameLocator('iframe').nth(1).locator('body'); - const matrix = page.frameLocator('iframe').nth(1).locator('feColorMatrix'); - const waitForModifiedDocument=async()=>{ - const source=await modified.getAttribute('srcdoc'); - const expectedFilter=source.match(/{const element=document.createElement('div');element.style.filter=value;return element.style.filter;},expectedFilter); - let last; - const expectedMatrix=source.match(/({filter:body.style.filter,matrix:body.ownerDocument.querySelector('feColorMatrix')?.getAttribute('values')??null})); - last=actual; - if(actual.filter===normalizedFilter&&actual.matrix===expectedMatrix)return actual.filter; - }catch{/* A preset replaces srcdoc; wait for the new opaque document. */} - await page.waitForTimeout(20); - } - throw new Error('The modified preview did not finish loading its current effects: '+JSON.stringify({expected:normalizedFilter,expectedMatrix,actual:last})); - }; - const matrixValues=async()=>{await waitForModifiedDocument();return matrix.getAttribute('values');}; - - const presets = page.getByRole('group', {name:'Vision presets',exact:true}); - const selectedPreset = () => presets.getByRole('button', {pressed:true}); - const presetCases = [ - ['Original',[0,0,0,0]], ['Protanopia',[100,0,0,0]], - ['Deuteranopia',[100,0,0,0]], ['Tritanopia',[100,0,0,0]], ['Blurred vision',[0,0,50,0]], - ['Reduced peripheral vision',[0,0,0,65]], - ]; - assert.equal(await presets.getByRole('button').count(),6); - assert.equal(await selectedPreset().innerText(),'Deuteranopia'); - const callsBeforePresets = apiRequests; - const frameAddressesBeforePresets = page.frames().map(frame=>frame.url()); - for (const [name,strengths] of presetCases) { - const button = presets.getByRole('button',{name,exact:true}); - await button.focus(); await button.press('Enter'); - assert.equal(await button.evaluate(element=>element===document.activeElement),true); - assert.equal(await selectedPreset().count(),1);assert.equal(await selectedPreset().innerText(),name); - for (let index=0;indexelement.style.filter),''); - if(name==='Original') { - assert.equal(await waitForModifiedDocument(),'');assert.equal(await page.locator('.field-mask').count(),0); - } else if(name==='Blurred vision') { - assert.equal(await waitForModifiedDocument(),'blur(2px)');assert.equal(await page.locator('.field-mask').count(),0); - } else if(name==='Reduced peripheral vision') { - assert.equal(await waitForModifiedDocument(),'');assert.equal(await page.locator('.field-mask').evaluate(element=>element.style.opacity),'0.65'); - } else { - assert.match(await waitForModifiedDocument(),/url\(/); - assert.equal(await page.getByLabel('Colour preset',{exact:true}).inputValue(),name.toLowerCase()); - } - } - await page.getByRole('button',{name:'Apply visual effects',exact:true}).press('Space'); - assert.equal(await selectedPreset().count(),0);assert.equal(await page.locator('.field-mask').count(),0); - await presets.getByRole('button',{name:'Blurred vision',exact:true}).press('Space'); - assert.equal(await selectedPreset().innerText(),'Blurred vision');assert.equal(await waitForModifiedDocument(),'blur(2px)'); - await slider('Blur strength').press('ArrowRight'); - assert.equal(await selectedPreset().count(),0); - await page.getByText('Custom visual settings are applied to the modified snapshot only.',{exact:true}).waitFor(); - assert.equal(apiRequests,callsBeforePresets,'Preset changes must not fetch or recapture a page'); - assert.deepEqual(page.frames().map(frame=>frame.url()),frameAddressesBeforePresets); - await page.getByRole('button',{name:'Reset effects',exact:true}).press('Enter'); - assert.equal(await selectedPreset().innerText(),'Deuteranopia'); - await slider('Colour strength').press('ArrowLeft'); - assert.equal(await slider('Colour strength').inputValue(), '99'); - assert.equal((await matrixValues()).split(' ')[0], '0.369885'); - assert.equal(await selectedPreset().count(),0); - await slider('Colour strength').press('End'); - const deuteranopia = await matrixValues(); - await page.getByLabel('Colour preset', { exact: true }).selectOption('tritanopia'); - assert.notEqual(await matrixValues(), deuteranopia); - await page.getByLabel('Colour preset', { exact: true }).selectOption('grayscale'); - await slider('Colour strength').press('End'); - const gray = (await matrixValues()).split(' ').map(Number); - assert.deepEqual(gray.slice(0,3), gray.slice(5,8)); assert.deepEqual(gray.slice(0,3), gray.slice(10,13)); - await slider('Blur strength').press('End'); - await slider('Contrast reduction').press('End'); - await slider('Peripheral restriction').press('End'); - assert.match(await waitForModifiedDocument(), /url\(["']?#vision-.*contrast\(.*blur\(4px\)/); - assert.equal(await page.locator('.field-mask').evaluate(element => element.style.opacity), '1'); - assert.equal(await page.locator('iframe').first().evaluate(element => element.style.filter), ''); - const toggle = page.getByRole('button', { name: 'Apply visual effects', exact: true }); - await toggle.press('Space'); - assert.equal(await toggle.getAttribute('aria-pressed'), 'false'); - assert.equal(await waitForModifiedDocument(), ''); - assert.equal(await page.locator('.field-mask').count(), 0); - for (const name of names) assert.equal(await slider(name).inputValue(), '100'); - await slider('Blur strength').press('Home'); await slider('Blur strength').press('ArrowRight'); - assert.equal(await slider('Blur strength').inputValue(), '1'); - assert.equal(await waitForModifiedDocument(), ''); - await toggle.press('Space'); - assert.match(await waitForModifiedDocument(), /blur\(0.04px\)/); - for (const [name, value] of [['Mild',25], ['Moderate',50], ['Strong',80]]) { - await page.getByRole('button', { name, exact: true }).press('Enter'); - for (const label of names) assert.equal(await slider(label).inputValue(), String(value)); - assert.equal(await page.getByRole('button', { name, exact: true }).getAttribute('aria-pressed'), 'true'); - assert.equal(await page.getByLabel('Colour preset', { exact: true }).inputValue(), 'grayscale'); - } - await page.getByRole('button', { name: 'Reset effects' }).press('Enter'); - assert.equal(await page.getByLabel('Colour preset', { exact: true }).inputValue(), 'deuteranopia'); - assert.equal(await slider('Colour strength').inputValue(), '100'); - for (const name of names.slice(1)) assert.equal(await slider(name).inputValue(), '0'); - assert.equal(await toggle.getAttribute('aria-pressed'), 'true'); - for (const name of names) await slider(name).press('Home'); - assert.equal(await waitForModifiedDocument(), ''); - assert.equal(await page.locator('.field-mask').count(), 0); - await page.getByText('All strengths are zero. Both snapshots show the original appearance.', { exact: true }).waitFor(); - const neutralPixels = await modified.screenshot(); - await slider('Blur strength').press('End'); - const blurPixels = await modified.screenshot(); - assert.notDeepEqual(blurPixels, neutralPixels, 'Blur must change rendered pixels, not just the style attribute'); - await slider('Colour strength').press('End'); - const combinedPixels = await modified.screenshot(); - assert.notDeepEqual(combinedPixels, neutralPixels, 'Combined colour and blur must change the rendered snapshot'); - assert.notDeepEqual(combinedPixels, blurPixels, 'Colour must still affect pixels when combined with blur'); - - await page.getByRole('button', { name: 'Mild', exact: true }).click(); - await page.getByLabel('Colour preset', { exact: true }).selectOption('tritanopia'); - await page.getByRole('button', { name: /Accessibility findings/ }).click(); - await page.getByRole('button', { name: /Visual preview/ }).click(); - assert.equal(previews, 2, 'Tab switches must retain the snapshot'); - assert.equal(await page.getByLabel('Colour preset', { exact: true }).inputValue(), 'tritanopia'); - for (const name of names) assert.equal(await slider(name).inputValue(), '25'); - await page.getByRole('button', { name: 'Refresh fixture snapshot' }).click(); - await page.getByRole('button', { name: 'Refresh fixture snapshot' }).waitFor(); - assert.equal(previews, 3); - for (const name of names) assert.equal(await slider(name).inputValue(), '25'); - await page.setViewportSize({ width: 1280, height: 2200 }); - await page.locator('.results').scrollIntoViewIfNeeded(); - for (const frame of page.frames().slice(1)) await frame.evaluate(() => scrollTo(0, 0)); - const desktop = (await page.locator('.results').screenshot()).toString('base64'); - await page.setViewportSize({ width: 390, height: 844 }); - assert.equal(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth), true); - await page.locator('iframe').first().scrollIntoViewIfNeeded(); - await original.locator('.cta').scrollIntoViewIfNeeded(); - assert.equal(await original.locator('.cta').isVisible(), true); - // Paint both opaque frames in-view before taking the complete narrow-layout figure. - await page.setViewportSize({ width: 390, height: 3600 }); - await page.locator('.results').scrollIntoViewIfNeeded(); - for (const frame of page.frames().slice(1)) await frame.evaluate(() => scrollTo(0, 0)); - await page.evaluate(() => new Promise(done => requestAnimationFrame(() => requestAnimationFrame(done)))); - const mobile = (await page.locator('.results').screenshot()).toString('base64'); - // Controlled UI responses cover severity ordering and review/empty states without scanning a public URL. - const makeFinding = (severity, index) => ({ id: `controlled-${index}`, severity, - title: `${severity} controlled rule`, impact: 'Controlled explanation', elements: [ - { targets: ['#first'], guidance: 'Repair the first element' }, - { targets: ['#second', '#nested'], guidance: '\nRepair the second element' }, - ] }); - activeReport = { ...data.report, generatedAt: '2026-11-08T00:00:00.000Z', findings: - ['Minor', 'Unknown', 'Moderate', 'Critical', 'Serious'].map(makeFinding), - scanner: { ...data.report.scanner, incomplete: [{ ...makeFinding('Serious', 8), title: 'Controlled inconclusive check', elements: [] }] }, limitations: ['Controlled coverage limitation'] }; - await page.getByRole('button', { name: 'Scan built-in page' }).click(); - const filter = page.getByLabel('Filter violations by severity', { exact: true }); - await violations.getByRole('heading', { name: 'Critical controlled rule', exact: true }).waitFor(); - // Keep named role queries in Playwright's utility world: Firefox 159 crashes when - // aria-labelledby reflection crosses worlds (microsoft/playwright#43967). - assert.deepEqual(await Promise.all((await violations.getByRole('heading', { level: 4 }).all()).map(heading => heading.textContent())), - ['Critical', 'Serious', 'Moderate', 'Minor', 'Unknown'].map(level => `${level} controlled rule`)); - const reviews = page.getByRole('region', { name: 'Checks needing manual review (1)', exact: true }); - await reviews.getByText('Controlled inconclusive check', { exact: true }).waitFor(); - for (const item of await page.getByRole('list', { name: 'Violation counts by severity' }).getByRole('listitem').all()) { - assert.equal(await item.locator('strong').textContent(), '1'); - } - // Report completion schedules focus in requestAnimationFrame; observe it before sending keys. - await page.waitForFunction(() => document.activeElement?.matches('.results')); - await filter.focus(); await filter.press('Home'); await filter.press('ArrowDown'); - assert.equal(await filter.inputValue(), 'Critical'); - assert.equal(await violations.locator('article').count(), 1); - assert.equal(await reviews.locator('article').count(), 1); - assert.equal(await page.locator('.finding-status').textContent(), 'Showing 1 of 5 rules with violations.'); - const exportedUrl = await assertDownload(activeReport); - await page.evaluate(() => { window.__kindpathPrintCalls = 0; window.print = () => { window.__kindpathPrintCalls++; }; }); - await page.getByRole('button', { name: 'Print / save as PDF', exact: true }).press('Enter'); - assert.equal(await page.evaluate(() => window.__kindpathPrintCalls), 1); - const fixturePdf = await printablePdf(activeReport); - assert.equal(await filter.inputValue(), 'Critical', 'Printing does not change the on-screen filter'); - await page.getByRole('button', { name: /Visual preview/ }).click(); - await page.getByRole('button', { name: /Accessibility findings/ }).click(); - assert.equal(await filter.inputValue(), 'Critical', 'Tab switches retain the severity filter'); - await page.getByRole('button', { name: 'Clear severity filter' }).press('Enter'); - assert.equal(await filter.evaluate(element => element === document.activeElement), true); - assert.equal(await violations.locator('article').count(), 5); - const firstCard = violations.locator('article').first(); - await firstCard.locator('summary').press('Enter'); - assert.deepEqual(await Promise.all((await firstCard.locator('.element-target code').all()).map(target => target.textContent())), ['#first', '#second → #nested']); - assert.equal(await firstCard.locator('.element-summary').nth(1).textContent(), '\nRepair the second element'); - assert.equal(await firstCard.locator('img').count(), 0, 'Guidance must be displayed as text'); - await reviews.locator('summary').click(); - await reviews.getByText('No element details were returned. Review this rule manually.', { exact: true }).waitFor(); - await page.setViewportSize({ width: 1280, height: 1800 }); - const findingsDesktop = (await page.locator('.results').screenshot()).toString('base64'); - await page.setViewportSize({ width: 390, height: 844 }); - assert.equal(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth), true); - const findingsMobile = (await page.locator('.results').screenshot()).toString('base64'); - // A new report resets filters; a severity with no matches differs from an empty report. - await filter.selectOption('Minor'); - activeReport = { ...activeReport, generatedAt: '2026-11-08T00:00:01.000Z', findings: [makeFinding('Serious', 0)] }; - await page.getByRole('button', { name: 'Scan built-in page' }).click(); - await page.getByRole('heading', { name: 'Serious controlled rule', exact: true }).waitFor(); - assert.equal(await page.evaluate(async url => { try { await fetch(url); return false; } catch { return true; } }, exportedUrl), true, 'The old export Blob URL must be revoked'); - assert.equal(await filter.inputValue(), 'All'); - await filter.selectOption('Critical'); - await page.getByText('No violations match this severity. Other findings are still in this report.', { exact: true }).waitFor(); - assert.equal(await reviews.locator('article').count(), 1); - await page.getByLabel('Built-in page', { exact: true }).selectOption('clear'); - activeReport = { ...data.clearReport, generatedAt: '2026-11-08T00:00:02.000Z' }; - await page.getByRole('button', { name: 'Scan built-in page' }).click(); - await page.getByText('No automated violations were reported. This does not establish accessibility conformance; review the checks below and test manually.', { exact: true }).waitFor(); - assert.equal(await filter.inputValue(), 'All'); - if (!data.clearReport.scanner.incomplete.length) await page.getByText('No inconclusive checks were returned. Keyboard, screen reader, and usability review are still needed.', { exact: true }).waitFor(); - await assertDownload(activeReport); - await page.getByRole('button', { name: 'Just exploring? Try an example', exact: true }).click(); - const examples = page.getByRole('region', { name: 'Example issues to explore', exact: true }); - await examples.waitFor(); - assert.equal(await examples.locator('article').count(), 3); - assert.equal(await page.getByRole('region', { name: /Checks needing manual review/ }).count(), 0); - await page.getByText('Illustrative report', { exact: true }).waitFor(); - await examples.locator('article').first().locator('summary').click(); - assert.equal(await examples.locator('article').first().locator('.element-summary').textContent(), data.demoReport.findings[0].elements[0].guidance); - // Match real scanning fixtures to their own previews and discard old work on selection changes. - const fixtureChoice = page.getByLabel('Built-in page', { exact: true }); - const scanButton = page.getByRole('button', { name: 'Scan built-in page', exact: true }); - const results = page.locator('.results'); - await fixtureChoice.selectOption('barriers'); - assert.equal(await results.count(), 0); - activeReport = data.report; - await scanButton.click(); await violations.waitFor(); - await page.getByText('Scanned fixture: Garden form with barriers', { exact: true }).waitFor(); - await page.getByRole('button', { name: /Visual preview/ }).click(); - assert.equal(await page.locator('iframe').count(), 0, 'The previous demo snapshot must not appear for a scanned page'); - wrongPreview = true; - await page.getByRole('button', { name: 'Generate fixture snapshot', exact: true }).click(); - await page.getByRole('alert').filter({ hasText: 'preview response was invalid' }).waitFor(); - assert.equal(await page.locator('iframe').count(), 0); - await page.getByRole('button', { name: 'Generate fixture snapshot', exact: true }).click(); - await page.getByRole('button', { name: 'Refresh fixture snapshot', exact: true }).waitFor(); - assert.equal(capturedFixtures.at(-1), 'barriers'); - await page.getByRole('heading', { name: 'Built-in Garden form with barriers snapshot', exact: true }).waitFor(); - assert.equal(await page.locator('iframe').first().getAttribute('title'), 'Original Garden form with barriers fixture snapshot'); - assert.equal(await page.frameLocator('iframe').first().locator('.kindpath-image-placeholder').count(), 1); - for (const frame of await page.locator('iframe').all()) assert.equal(await frame.getAttribute('sandbox'), ''); - assert.equal(await page.evaluate(() => document.querySelector('iframe').contentDocument), null); - assert.equal(await page.frameLocator('iframe').first().locator('input').isDisabled(), true); - assert.equal(await page.frameLocator('iframe').first().locator('button').isDisabled(), true); - await page.setViewportSize({ width: 1280, height: 2200 }); - await results.scrollIntoViewIfNeeded(); - const matchingDesktop = (await results.screenshot()).toString('base64'); - await page.emulateMedia({ media: 'print' }); - assert.equal(await page.locator('.print-report').isVisible(), true); - for (const frame of await page.locator('iframe').all()) assert.equal(await frame.isVisible(), false, 'Loaded preview frames must not appear in print'); - await page.emulateMedia({ media: 'screen' }); - - await page.setViewportSize({ width: 390, height: 844 }); - assert.equal(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth), true); - await page.setViewportSize({ width: 390, height: 3600 }); - await results.scrollIntoViewIfNeeded(); - const matchingMobile = (await results.screenshot()).toString('base64'); - delayPreview = true; - const heldPreviewRequest = page.waitForRequest(request => request.url().endsWith('/api/preview-fixture')); - await page.getByRole('button', { name: 'Refresh fixture snapshot', exact: true }).click(); await heldPreviewRequest; - assert.equal(previewHeld, true); - await fixtureChoice.selectOption('clear'); - assert.equal(await results.count(), 0); - assert.equal(await page.locator('iframe').count(), 0); - delayPreview = false; releasePreview(); - activeReport = data.clearReport; - await scanButton.click(); - await page.getByText('Scanned fixture: Labelled garden form', { exact: true }).waitFor(); - await page.getByRole('button', { name: /Visual preview/ }).click(); - assert.equal(await page.locator('iframe').count(), 0); - await page.getByRole('button', { name: 'Generate fixture snapshot', exact: true }).click(); - await page.getByRole('button', { name: 'Refresh fixture snapshot', exact: true }).waitFor(); - assert.equal(capturedFixtures.at(-1), 'clear'); - assert.equal(await page.locator('iframe').first().getAttribute('title'), 'Original Labelled garden form fixture snapshot'); - await page.frameLocator('iframe').first().getByText('Email address', { exact: true }).waitFor(); - assert.equal(await page.frameLocator('iframe').first().locator('.kindpath-image-placeholder').count(), 0); - // A delayed scan response for clear must not replace a newly selected barriers page. - delayScan = true; - const heldScanRequest = page.waitForRequest(request => request.url().endsWith('/api/scan-fixture')); - await scanButton.click(); await heldScanRequest; - assert.equal(scanHeld, true); - assert.equal(await results.count(), 0, 'Starting another scan clears its old report and snapshot'); - await fixtureChoice.selectOption('barriers'); - delayScan = false; releaseScan(); - activeReport = data.clearReport; // Deliberate mismatched response. - await scanButton.click(); - await page.getByRole('alert').filter({ hasText: 'report did not match' }).waitFor(); - assert.equal(await results.count(), 0); - activeReport = data.report; - await scanButton.click(); await violations.waitFor(); - assert.equal(await page.locator('iframe').count(), 0); - await page.getByText('Scanned fixture: Garden form with barriers', { exact: true }).waitFor(); - await page.getByRole('button', { name: 'Just exploring? Try an example', exact: true }).click(); - await page.getByRole('region', { name: 'Example issues to explore', exact: true }).waitFor(); - await page.waitForFunction(() => document.activeElement?.matches('.results')); - await assertDownload(data.demoReport); - const demoPdf = await printablePdf(data.demoReport); // Mock capability/HTTP responses inside network-none only. The actual app/API gates stay disabled. publicCapabilities = true;delayCapabilities=true; await page.reload(); @@ -607,15 +278,12 @@ try { await printablePdf(publicResponse); } publicResponse=publicReport; + await publicButton.click(); + await page.locator('.results').waitFor(); await page.getByRole('button', { name: /Visual preview/ }).click(); assert.equal(await page.locator('iframe').count(), 0); - await page.getByText('This built-in illustration is separate from the website report. Public websites are not captured.', { exact: true }).waitFor(); - // Example exploration must remain a demo even when URL scanning is available. - const scansBeforeExample = publicCalls; - await page.getByRole('button', { name: 'Just exploring? Try an example', exact: true }).click(); - await page.getByRole('region', { name: 'Example issues to explore', exact: true }).waitFor(); - assert.equal(publicCalls, scansBeforeExample); - assert.equal(await page.locator('.results .scan-coverage').count(),0,'Demo reports do not inherit public coverage'); + await page.getByText('Website image capture is disabled. Your accessibility report and JSON download are still available.', {exact:true}).waitFor(); + await assertDownload(publicResponse); await page.getByLabel('Your website URL').fill(publicReport.requestedUrl); for(const scanId of [undefined,'old']){ publicResponse={...publicReport,scanId};await publicButton.click(); @@ -630,7 +298,7 @@ try { { ...publicReport, url: 'http://example.com/start' }, { ...publicReport, url: 'http://printer.local/' }, { ...publicReport, url: 'https://user:pass@example.org/' }, - { ...publicReport, url: 'https://example.org:8443/' }, data.demoReport]) { + { ...publicReport, url: 'https://example.org:8443/' }, { ...publicReport, mode: 'demo' }]) { publicResponse = wrong; await publicButton.click(); await page.getByRole('alert').filter({ hasText: 'report did not match' }).waitFor(); @@ -669,20 +337,6 @@ try { assert.deepEqual((await retryRequest).postDataJSON(), { url: publicReport.requestedUrl }); await page.locator('.results').waitFor(); assert.equal(await scanRetry.count(), 0); - delayPublic = true; - const publicStarted = new Promise(resolve => { notifyPublic = resolve; }); - await publicButton.click(); - await page.waitForFunction(() => document.querySelector('form').getAttribute('aria-busy') === 'true'); - let heldTimer; - try { await Promise.race([publicStarted, new Promise((_, reject) => { heldTimer = setTimeout(() => reject(new Error('Controlled URL request was not intercepted')), 10000); })]); } - finally { clearTimeout(heldTimer); } - assert.equal(publicHeld, true); - await page.getByLabel('Built-in page').selectOption('clear'); - activeReport = data.clearReport; - delayPublic = false; releasePublic(); - await page.getByRole('button', { name: 'Scan built-in page' }).click(); - await page.getByText('Scanned fixture: Labelled garden form', { exact: true }).waitFor(); - assert.equal(await page.locator('.results').getByText('Scanned page: ' + publicReport.url, { exact: true }).count(), 0); // The capture-enabled test response still never fetches an external page or enables the real API. captureCapabilities = true; publicResponse = { ...publicReport, scanId:data.sitePreview.scanId, sitePreview:data.sitePreview }; @@ -760,6 +414,23 @@ try { assert.equal(await frame.locator('script,form,iframe,a[href]').count(),0); assert.equal(await frame.locator('body').evaluate(()=>{try{void parent.document;return false;}catch{return true;}}),true); } + const slider = name => page.getByRole('slider', { name, exact: true }); + const waitForModifiedDocument=async()=>{ + const source=await page.locator('iframe').nth(1).getAttribute('srcdoc'); + const expectedFilter=source.match(/{const element=document.createElement('div');element.style.filter=value;return element.style.filter;},expectedFilter); + let last; + const expectedMatrix=source.match(/({filter:body.style.filter,matrix:body.ownerDocument.querySelector('feColorMatrix')?.getAttribute('values')??null})); + last=actual; + if(actual.filter===normalizedFilter&&actual.matrix===expectedMatrix)return actual.filter; + }catch{/* A preset replaces srcdoc; wait for the new opaque document. */} + await page.waitForTimeout(20); + } + throw new Error('The modified preview did not finish loading its current effects: '+JSON.stringify({expected:normalizedFilter,expectedMatrix,actual:last})); + }; const imageOriginalStyle=await imageFrames.first().getAttribute('style'); for(const name of ['Original','Protanopia','Deuteranopia','Tritanopia','Blurred vision','Reduced peripheral vision']){ await page.getByRole('group',{name:'Vision presets',exact:true}).getByRole('button',{name,exact:true}).click(); @@ -885,38 +556,102 @@ try { assert.equal(await page.getByRole('region',{name:'Confirmed automated violations',exact:true}).locator('article').count(),publicReport.findings.length); await page.getByRole('link',{name:'Download report JSON',exact:true}).waitFor(); } - // Cancellation and retry preserve the selected action and reject late responses. - publicCapabilities=false; captureCapabilities=false; - await page.reload(); - activeReport=data.clearReport; delayScan=true; scanHeld=false; - const heldCancellation=page.waitForRequest(request=>request.url().endsWith('/api/scan-fixture')); - await page.getByRole('button',{name:'Scan built-in page',exact:true}).click(); await heldCancellation; - assert.equal(await page.getByLabel('Your website URL').isDisabled(),true); - await page.getByRole('button',{name:'Cancel request',exact:true}).click(); - await page.getByRole('status').filter({hasText:'Request cancelled'}).waitFor(); - assert.equal(await page.locator('.results').count(),0); - assert.equal(await page.getByRole('button',{name:'Try again',exact:true}).evaluate(node=>node===document.activeElement),true); - delayScan=false; activeReport=data.report; releaseScan(); - // Malformed proxy/error bodies must not become UI diagnostics, and a failed retry keeps usable focus. - const retryButton=page.getByRole('button',{name:'Try again',exact:true}); - for (const response of [ - {status:503,contentType:'text/html',body:'private-response-marker: invalid response'}, - {json:null}, - ]) { - fixtureResponseOverride=response; - await retryButton.click(); - await page.getByRole('alert').filter({hasText: response.status ? 'The response could not be read.' : 'The report did not match the requested scan.'}).waitFor(); - assert.equal(await page.locator('.results').count(),0); - assert.equal(await page.getByText(/private-response-marker/).count(),0); - assert.equal(await retryButton.evaluate(node=>node===document.activeElement),true); + // Controlled UI responses cover severity ordering and review/empty states without scanning a public URL. + const violations = page.getByRole('region', { name: 'Confirmed automated violations', exact: true }); + const makeFinding = (severity, index) => ({ id: `controlled-${index}`, severity, + title: `${severity} controlled rule`, impact: 'Controlled explanation', elements: [ + { targets: ['#first'], guidance: 'Repair the first element' }, + { targets: ['#second', '#nested'], guidance: '\nRepair the second element' }, + ] }); + publicResponse = { ...publicReport, previewUnavailable: true, generatedAt: '2026-11-08T00:00:00.000Z', findings: + ['Minor', 'Unknown', 'Moderate', 'Critical', 'Serious'].map(makeFinding), + scanner: { ...publicReport.scanner, incomplete: [{ ...makeFinding('Serious', 8), title: 'Controlled inconclusive check', elements: [] }] }, limitations: ['Controlled coverage limitation'] }; + await publicButton.click(); + const filter = page.getByLabel('Filter violations by severity', { exact: true }); + await violations.getByRole('heading', { name: 'Critical controlled rule', exact: true }).waitFor(); + // Keep named role queries in Playwright's utility world: Firefox 159 crashes when + // aria-labelledby reflection crosses worlds (microsoft/playwright#43967). + assert.deepEqual(await Promise.all((await violations.getByRole('heading', { level: 4 }).all()).map(heading => heading.textContent())), + ['Critical', 'Serious', 'Moderate', 'Minor', 'Unknown'].map(level => `${level} controlled rule`)); + const reviews = page.getByRole('region', { name: 'Checks needing manual review (1)', exact: true }); + await reviews.getByText('Controlled inconclusive check', { exact: true }).waitFor(); + for (const item of await page.getByRole('list', { name: 'Violation counts by severity' }).getByRole('listitem').all()) { + assert.equal(await item.locator('strong').textContent(), '1'); } - fixtureResponseOverride=undefined; - await retryButton.click(); - await page.getByText('Scanned fixture: Garden form with barriers',{exact:true}).waitFor(); - assert.equal(await page.getByText('Scanned fixture: Labelled garden form',{exact:true}).count(),0); + // Report completion schedules focus in requestAnimationFrame; observe it before sending keys. + await page.waitForFunction(() => document.activeElement?.matches('.results')); + await filter.focus(); await filter.press('Home'); await filter.press('ArrowDown'); + assert.equal(await filter.inputValue(), 'Critical'); + assert.equal(await violations.locator('article').count(), 1); + assert.equal(await reviews.locator('article').count(), 1); + assert.equal(await page.locator('.finding-status').textContent(), 'Showing 1 of 5 rules with violations.'); + const exportedUrl = await assertDownload(publicResponse); + await page.evaluate(() => { window.__kindpathPrintCalls = 0; window.print = () => { window.__kindpathPrintCalls++; }; }); + await page.getByRole('button', { name: 'Print / save as PDF', exact: true }).press('Enter'); + assert.equal(await page.evaluate(() => window.__kindpathPrintCalls), 1); + const reportPdf = await printablePdf(publicResponse); + assert.equal(await filter.inputValue(), 'Critical', 'Printing does not change the on-screen filter'); + await page.getByRole('button', { name: /Visual preview/ }).click(); + await page.getByRole('button', { name: /Accessibility findings/ }).click(); + assert.equal(await filter.inputValue(), 'Critical', 'Tab switches retain the severity filter'); + await page.getByRole('button', { name: 'Clear severity filter' }).press('Enter'); + assert.equal(await filter.evaluate(element => element === document.activeElement), true); + assert.equal(await violations.locator('article').count(), 5); + const firstCard = violations.locator('article').first(); + await firstCard.locator('summary').press('Enter'); + assert.deepEqual(await Promise.all((await firstCard.locator('.element-target code').all()).map(target => target.textContent())), ['#first', '#second → #nested']); + assert.equal(await firstCard.locator('.element-summary').nth(1).textContent(), '\nRepair the second element'); + assert.equal(await firstCard.locator('img').count(), 0, 'Guidance must be displayed as text'); + await reviews.locator('summary').click(); + await reviews.getByText('No element details were returned. Review this rule manually.', { exact: true }).waitFor(); + await page.setViewportSize({ width: 1280, height: 1800 }); + const findingsDesktop = (await page.locator('.results').screenshot()).toString('base64'); + await page.setViewportSize({ width: 390, height: 844 }); + assert.equal(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth), true); + const findingsMobile = (await page.locator('.results').screenshot()).toString('base64'); + // A new report resets filters; a severity with no matches differs from an empty report. + await filter.selectOption('Minor'); + publicResponse = { ...publicResponse, generatedAt: '2026-11-08T00:00:01.000Z', findings: [makeFinding('Serious', 0)] }; + await publicButton.click(); + await page.getByRole('heading', { name: 'Serious controlled rule', exact: true }).waitFor(); + assert.equal(await page.evaluate(async url => { try { await fetch(url); return false; } catch { return true; } }, exportedUrl), true, 'The old export Blob URL must be revoked'); + assert.equal(await filter.inputValue(), 'All'); + await filter.selectOption('Critical'); + await page.getByText('No violations match this severity. Other findings are still in this report.', { exact: true }).waitFor(); + assert.equal(await reviews.locator('article').count(), 1); + publicResponse = { ...publicReport, previewUnavailable: true, findings: [], scanner: {...publicReport.scanner, incomplete: []}, generatedAt: '2026-11-08T00:00:02.000Z' }; + await publicButton.click(); + await page.getByText('No automated violations were reported. This does not establish accessibility conformance; review the checks below and test manually.', { exact: true }).waitFor(); + assert.equal(await filter.inputValue(), 'All'); + await page.getByText('No inconclusive checks were returned. Keyboard, screen reader, and usability review are still needed.', { exact: true }).waitFor(); + await assertDownload(publicResponse); + // Cancel a held URL scan and retry without accepting its late response. + publicResponse = {...publicReport, previewUnavailable: true, generatedAt: '2026-11-08T01:00:00.000Z'}; + delayPublic = true; + const heldCancellation = new Promise(resolve => { notifyPublic = resolve; }); + await publicButton.click(); + await heldCancellation; + assert.equal(publicHeld, true); + assert.equal(await websiteEntry.isDisabled(), true); + await page.getByRole('button', {name:'Cancel request',exact:true}).click(); + await page.getByRole('status').filter({hasText:'Request cancelled'}).waitFor(); + assert.equal(await page.locator('.results').count(), 0); + assert.equal(await scanRetry.evaluate(node => node === document.activeElement), true); + delayPublic = false; + releasePublic(); + publicResponseOverride = {status:503,contentType:'text/html',body:'private-response-marker: invalid response'}; + await scanRetry.click(); + await page.getByRole('alert').filter({hasText:'The response could not be read.'}).waitFor(); + assert.equal(await page.locator('.results').count(), 0); + assert.equal(await page.getByText(/private-response-marker/).count(), 0); + assert.equal(await scanRetry.evaluate(node => node === document.activeElement), true); + publicResponseOverride = undefined; + await scanRetry.click(); + await page.locator('.results').waitFor(); + await assertDownload(publicResponse); // Editing a URL clears the prior report instead of showing it under a new address. await page.getByLabel('Your website URL').fill('https://example.com/new-request'); assert.equal(await page.locator('.results').count(),0); assert.deepEqual(unexpected, []); - process.stdout.write(JSON.stringify({ passed: true, engine, version: browser.version(), desktop, mobile, findingsDesktop, findingsMobile, matchingDesktop, matchingMobile, coverageDesktop, coverageMobile, qualityEmpty, qualitySparse, fixturePdf, demoPdf })); + process.stdout.write(JSON.stringify({ passed: true, engine, version: browser.version(), landingDesktop: landingImages.desktop, landingMobile: landingImages.mobile, findingsDesktop, findingsMobile, coverageDesktop, coverageMobile, qualityEmpty, qualitySparse, reportPdf })); } finally { await browser.close(); } diff --git a/server/preview.integration.ts b/server/preview.integration.ts index bc4f754..ff2d50f 100644 --- a/server/preview.integration.ts +++ b/server/preview.integration.ts @@ -6,21 +6,14 @@ import { homedir, tmpdir } from 'node:os'; import { join } from 'node:path'; import { fileURLToPath } from 'node:url'; import { randomUUID } from 'node:crypto'; -import { captureFixturePreview } from './scanner/fixturePreview.js'; import { scanFixture } from './scanner/fixtureScanner.js'; import { mapSitePreview } from './scanner/sitePreview.js'; -import { createDemoReport } from './services/analyze.js'; import { openLocalDockerSession, removeAndConfirm } from './scanner/dockerWorker.js'; import { assertContainerIsolation, containerArguments, IMAGE, QA_IMAGE } from './scanner/containerPolicy.js'; // Fulfill the app's requests from the built assets and real fixture responses, entirely inside network none. test('reports, exports and isolated previews work in Chromium, Firefox and WebKit', { timeout: 240000 }, async () => { - const snapshot = await captureFixturePreview(); - const barriersSnapshot = await captureFixturePreview('barriers'); - const clearSnapshot = await captureFixturePreview('clear'); const report = await scanFixture('barriers'); - const clearReport = await scanFixture('clear'); - const demoReport = createDemoReport(new URL('https://example.com')); const sitePreview = mapSitePreview({url:'https://www.example.com/en/start?locale=en',capturedAt:new Date().toISOString(),omittedSubtrees:0,omittedText:0,omittedStyles:0,nodes:[ {tag:'h1',attributes:{},style:{},hover:{},children:[{text:'Captured website marker'}]}, {tag:'a',attributes:{},style:{color:'rgb(0, 0, 0)'},hover:{color:'rgb(255, 0, 0)'},children:[{text:'Captured link'}]}, @@ -72,14 +65,14 @@ test('reports, exports and isolated previews work in Chromium, Firefox and WebKi { env: { PATH: '/usr/bin:/bin', LANG: 'C.UTF-8' }, timeout: 90000, maxBuffer: 5 * 1024 * 1024 }, (error, output) => error ? reject(error) : resolve(output)); child.stdin!.on('error', () => {}); - child.stdin!.end(JSON.stringify({ browser, snapshot, barriersSnapshot, clearSnapshot, report, clearReport, demoReport, sitePreview, imagePreview, qualityPreviews, assets })); + child.stdin!.end(JSON.stringify({ browser, report, sitePreview, imagePreview, qualityPreviews, assets })); }); const result = JSON.parse(stdout); assert.equal(result.passed, true); assert.equal(result.engine, browser); console.info(`${browser} ${result.version}: controlled browser checks passed`); - for (const kind of browser === 'chromium' ? ['fixture', 'demo'] : []) { - await writeFile(join(outputRoot, `kindpath-report-export-${kind}.pdf`), Buffer.from(result[`${kind}Pdf`], 'base64')); + if (browser === 'chromium') { + await writeFile(join(outputRoot, 'kindpath-report-export-public.pdf'), Buffer.from(result.reportPdf, 'base64')); } - for (const size of ['desktop', 'mobile', 'findingsDesktop', 'findingsMobile', 'matchingDesktop', 'matchingMobile', 'coverageDesktop', 'coverageMobile', 'qualityEmpty', 'qualitySparse']) { + for (const size of ['landingDesktop', 'landingMobile', 'findingsDesktop', 'findingsMobile', 'coverageDesktop', 'coverageMobile', 'qualityEmpty', 'qualitySparse']) { await writeFile(join(outputRoot, `kindpath-${browser}-static-preview-${size}.png`), Buffer.from(result[size], 'base64')); } } finally { diff --git a/src/App.tsx b/src/App.tsx index ffeaa3f..ae1fac2 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,8 +2,6 @@ import { useEffect, useLayoutEffect, useRef, useState } from 'react'; import type { FormEvent } from 'react'; import { navigationRejection } from '../scanner/gateway/navigation.mjs'; import { websiteUrl } from '../scanner/gateway/url.mjs'; -import { fixtureTitle, isFixture } from '../shared/fixtures'; -import type { FixtureId } from '../shared/fixtures'; import { scanPageNoticeText } from '../shared/scanPageNotice'; import type { Report } from '../shared/types'; import { normalizeWebsiteEntry } from './components/websiteEntry'; @@ -14,16 +12,13 @@ import { ReportExports } from './components/ReportExports'; import { ScanCoverageNotice } from './components/ScanCoverageNotice'; import { PrintableReport } from './components/PrintableReport'; import { FindingsReport } from './components/FindingsReport'; +import { LandingComparison } from './components/LandingComparison'; import { SiteVisualPreview } from './components/SiteVisualPreview'; import { hasMatchingCaptureResult } from './components/sitePreview'; -import { VisualPreview } from './components/VisualPreview'; -import { SampleSite } from './components/SampleSite'; -type AnalysisMode = 'demo' | 'fixture' | 'public'; export function App() { const [url, setUrl] = useState(''); - const [selectedFixture, setSelectedFixture] = useState('barriers'); const [capabilitiesReady,setCapabilitiesReady]=useState(false); const [publicEnabled, setPublicEnabled] = useState(false); const [publicCaptureEnabled,setPublicCaptureEnabled] = useState(false); @@ -43,7 +38,7 @@ export function App() { }, []); const [report, setReport] = useState(null); const [busy, setBusy] = useState(false); - const [lastAttempt,setLastAttempt] = useState<{value:string;mode:AnalysisMode}|null>(null); + const [lastAttempt,setLastAttempt] = useState(null); const [cancelled,setCancelled] = useState(false); const [failure, setFailure] = useState(null); const [view, setView] = useState<'findings' | 'preview'>('findings'); @@ -65,30 +60,20 @@ export function App() { function changeUrl(value: string) { setUrl(value); setReport(null); setFailure(null); setCancelled(false); setLastAttempt(null); setView('findings'); } - function changeFixture(fixture: FixtureId) { - if (!isFixture(fixture) || fixture === selectedFixture) return; - analysisRequest.current?.abort(); analysisRequest.current = null; - setSelectedFixture(fixture); setReport(null); setFailure(null); setBusy(false); setView('findings'); - setLastAttempt(null); setCancelled(false); - } - async function analyze(value: string, mode: AnalysisMode = 'public') { - if (analysisRequest.current || (mode==='public'&&!capabilitiesReady)) return; - const abort = new AbortController(); analysisRequest.current = abort; + async function analyze(value: string) { + if (analysisRequest.current || !capabilitiesReady) return; + const abort = new AbortController(); + analysisRequest.current = abort; setBusy(true); setFailure(null); setReport(null); setView('findings'); setCancelled(false); - setLastAttempt({value,mode}); - const fixture = mode === 'fixture'; + setLastAttempt(value); let timeout: AbortSignal | undefined; try { - if (!fixture) { - value = normalizeWebsiteEntry(value); - if (mode === 'public') value = websiteUrl(value).href; - if (mode === 'demo') setUrl(value); - setLastAttempt({value,mode}); - } - if(mode==='public'&&!publicEnabled)throw new Error('Website scanning is unavailable. Start the local API or use the explicitly labelled example.'); - timeout = AbortSignal.timeout(mode === 'demo' ? 10000 : 90000); - const response = await fetch(mode === 'fixture' ? '/api/scan-fixture' : mode === 'public' ? '/api/scan-public' : '/api/analyze', { - method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(fixture ? { fixture: value } : { url: value }), + value = websiteUrl(normalizeWebsiteEntry(value)).href; + setLastAttempt(value); + if (!publicEnabled) throw new Error('Website scanning is unavailable.'); + timeout = AbortSignal.timeout(90000); + const response = await fetch('/api/scan-public', { + method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ url: value }), signal: AbortSignal.any([abort.signal, timeout]), }); let data; @@ -105,26 +90,21 @@ export function App() { setFailure(scanFailureFeedback(data, response.status)); return; } - if (!data || typeof data !== 'object' || Array.isArray(data) || data.mode !== mode) { + if (!data || typeof data !== 'object' || Array.isArray(data) || data.mode !== 'public') { throw new Error('The report did not match the requested scan.'); } - if (mode === 'public') { - let matches = false; - try { - // Bind the request and allow only the agreed single-page URL changes. - const requested = websiteUrl(value), scanned = websiteUrl(data.url); - matches = data.requestedUrl === requested.href && data.url === scanned.href - && !navigationRejection(requested.href, scanned.href); - } catch { /* Reject missing or malformed report URLs without displaying their contents. */ } - if (!matches) throw new Error('The report did not match the requested website.'); - if (!hasMatchingCaptureResult(data,publicCaptureEnabled)) { - throw new Error('The website snapshot did not match this scan.'); - } - } - if (fixture && (data.mode !== 'fixture' || data.scanner?.fixture !== value || data.url !== `fixture:${value}`)) { - throw new Error('The report did not match the requested built-in page.'); + let matches = false; + try { + // Bind the result to the submitted URL and the allowed single-page navigation. + const scanned = websiteUrl(data.url); + matches = data.requestedUrl === value && data.url === scanned.href + && !navigationRejection(value, scanned.href); + } catch { /* Reject malformed report URLs without displaying their contents. */ } + if (!matches) throw new Error('The report did not match the requested website.'); + if (!hasMatchingCaptureResult(data, publicCaptureEnabled)) { + throw new Error('The website snapshot did not match this scan.'); } - if (mode === 'public') setUrl(value); + setUrl(value); setReport(data); setView('findings'); } catch (cause) { if (abort.signal.aborted || analysisRequest.current !== abort) return; @@ -135,7 +115,7 @@ export function App() { } else { setFailure({ message: cause instanceof Error ? cause.message : 'The scan could not finish. No report was created.', - retryable: timeout !== undefined && mode !== 'public', + retryable: false, }); } } finally { @@ -149,19 +129,50 @@ export function App() { return <> {report && } Skip to content -
KindPath{import.meta.env.DEV && LOCAL PREVIEW}
-
-
A MORE INCLUSIVE INTERNET STARTS HERE

A clearer web.
For everyone.

See your website from a different perspective.
Find accessibility barriers, understand their impact,
and take the next step toward a more welcoming web.

- { if (lastAttempt) void analyze(lastAttempt.value,lastAttempt.mode); }} capabilitiesLoading={!capabilitiesReady} publicScanningEnabled={publicEnabled} url={url} busy={busy} error={failure?.message ?? ''} onUrlChange={changeUrl} onSubmit={submit} - onExample={() => { setUrl('https://example.com'); void analyze('https://example.com', 'demo'); }} - fixture={selectedFixture} onFixtureChange={changeFixture} onFixtureScan={() => { void analyze(selectedFixture, 'fixture'); }}/>
-
A DIFFERENT PERSPECTIVE↗
Same website. Different experience.
Design with more people in mind.
-
01 / DISCOVER

Find the barriers.

Explore clear findings with context about who they affect and why they matter.

02 / SEE DIFFERENTLY

Change your perspective.

Compare the captured page with visual effects that illustrate potential challenges.

03 / MAKE PROGRESS

Know your next step.

Turn findings into practical improvements, one thoughtful change at a time.

- {report &&
YOUR EXPLORATION

Small changes. Meaningful impact.

{report.mode === 'fixture' ? 'Scanned fixture' : report.mode === 'public' ? 'Scanned page' : 'Submitted URL'}: {report.mode === 'fixture' && isFixture(report.scanner?.fixture) ? fixtureTitle(report.scanner.fixture) : report.url}

{report.mode === 'public' && report.requestedUrl &&

Requested URL: {report.requestedUrl}

}
{report.mode === 'demo' ? 'Illustrative report' : report.mode === 'fixture' ? 'Real fixture scan' : 'Automated page scan'}
{report.mode === 'fixture' ? 'These are real automated results for the selected built-in page. The visual preview uses that same page. No public website was fetched.' : report.mode === 'demo' ? `This is demo data, not an assessment of ${new URL(report.url).hostname}.` : 'Automated results for the final scanned page only. Manual review is still required.'}{report.mode === 'demo' && !report.sitePreview && ' The visual preview uses a separate built-in fixture, not the submitted URL.'}
{pageNotice &&

{pageNotice}

}
-
} -

Accessibility is a practice.
Every step makes a difference.

-
KindPathA more accessible web starts with a clearer perspective.Built with intention.
+
+ KindPath +
+
+
+

A clearer web.
For everyone.

+
+

Scan a public webpage for accessibility issues and see how it looks with different vision settings.

+ { if (lastAttempt) void analyze(lastAttempt); }} + capabilitiesLoading={!capabilitiesReady} publicScanningEnabled={publicEnabled} + url={url} busy={busy} error={failure?.message ?? ''} onUrlChange={changeUrl} onSubmit={submit} + /> +
+ +
+ {report &&
+
+
+

Accessibility report

+

Scanned page: {report.url}

+ {report.requestedUrl &&

Requested URL: {report.requestedUrl}

} +
+ Automated page scan +
+
Automated results for the final scanned page only. Manual review is still required.
+ {pageNotice &&

{pageNotice}

} + + +
+ + +
+ + +
} +
+
KindPath
; } diff --git a/src/components/LandingComparison.tsx b/src/components/LandingComparison.tsx new file mode 100644 index 0000000..faaaeee --- /dev/null +++ b/src/components/LandingComparison.tsx @@ -0,0 +1,52 @@ +import { useId } from 'react'; +import { colourMatrix } from './visualEffects'; + +const deuteranopiaMatrix = colourMatrix('deuteranopia', 100).join(' '); + +function SampleArtwork({ filterId }: { filterId?: string }) { + return ; +} + +export function LandingComparison() { + const filterId = useId(); + return
+
+
+
Original
+
+
+
+
Simulated vision
+
+
+
+
Same page, with blur and a red–green colour vision simulation on the right.
+
; +} diff --git a/src/components/SampleSite.tsx b/src/components/SampleSite.tsx deleted file mode 100644 index d0f9920..0000000 --- a/src/components/SampleSite.tsx +++ /dev/null @@ -1,22 +0,0 @@ -export function SampleSite() { - return
-
-
- fern & form● - Objects for everyday living -
-
- A LITTLE ROOM TO GROW -

Good things.
Growing slowly.

-

Bring a little of the outside in.
Thoughtful objects for a greener home.

- e.preventDefault()}> - Explore the collection ↗ - - -
Made with care. Made to last.01 — 03
- -
- -
; -} diff --git a/src/components/VisualPreview.tsx b/src/components/VisualPreview.tsx deleted file mode 100644 index ba78734..0000000 --- a/src/components/VisualPreview.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { fixtureTitle } from '../../shared/fixtures'; -import type { PreviewFixtureId } from '../../shared/fixtures'; -import { useEffect, useRef, useState } from 'react'; -import type { FixturePreview } from '../../shared/types'; -import { SnapshotFrame } from './SnapshotFrame'; -import { defaultVisionSettings } from './visualEffects'; -import { VisionControls } from './VisionControls'; - -export function VisualPreview({ fixture }: { fixture: PreviewFixtureId }) { - const title = fixtureTitle(fixture); - const [settings, setSettings] = useState(defaultVisionSettings); - const [snapshot, setSnapshot] = useState(null); - const [busy, setBusy] = useState(false); - const [error, setError] = useState(''); - const request = useRef(null); - useEffect(() => () => request.current?.abort(), []); - async function generate() { - if (request.current) return; - const abort = new AbortController(); request.current = abort; - setBusy(true); setError(''); - try { - const response = await fetch('/api/preview-fixture', { - method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ fixture }), - signal: AbortSignal.any([abort.signal, AbortSignal.timeout(90000)]), - }); - const data = await response.json(); - if (!response.ok) throw new Error(data.error || 'Unable to generate the fixture snapshot.'); - if (data.mode !== 'fixture' || data.fixture !== fixture || data.title !== title - || typeof data.html !== 'string' || data.html.length > 100000 || typeof data.capturedAt !== 'string' - || !Number.isFinite(Date.parse(data.capturedAt))) throw new Error('The preview response was invalid. Try generating it again.'); - if (!abort.signal.aborted) setSnapshot(data); - } catch (cause) { - if (!abort.signal.aborted) setError(cause instanceof Error && cause.name !== 'TimeoutError' ? cause.message : 'Snapshot generation timed out. Try again.'); - } finally { - request.current = null; - if (!abort.signal.aborted) setBusy(false); - } - } - return
-
-

Built-in {title} snapshot

{fixture === 'garden' ? 'This built-in illustration is separate from the website report.' : 'This preview uses the same built-in page as the fixture findings above.'} Public websites are not captured.

- {snapshot &&

Captured at . Scroll within each preview to explore the whole page.

}
- -
-
{busy ? 'Capturing the built-in fixture in the isolated worker…' : snapshot ? 'Fixture snapshot ready.' : ''}
- {error &&

{error}

} - {snapshot ? <> - -
-

Original snapshot

-

{settings.enabled ? 'With visual effects' : 'Effects paused — original appearance'}

-
-

{fixture === 'garden' ? 'Hover over “Explore the garden” to see its style change. The advertisement is a static placeholder. ' : ''}Links and form controls are inactive. Images, when present, are static placeholders.

- :

A page you can explore without leaving KindPath.

Generate the built-in fixture snapshot to compare its appearance with a visual effect.

} -
Educational approximations. Vision varies between people; these effects do not reproduce a medical condition or replace accessibility testing.
-
; -} diff --git a/src/components/WebsiteForm.tsx b/src/components/WebsiteForm.tsx index 4df733c..d5e4e4f 100644 --- a/src/components/WebsiteForm.tsx +++ b/src/components/WebsiteForm.tsx @@ -1,5 +1,3 @@ -import { FIXTURES, fixtureTitle } from '../../shared/fixtures'; -import type { FixtureId } from '../../shared/fixtures'; import { useLayoutEffect, useRef } from 'react'; import type { FormEvent } from 'react'; @@ -16,51 +14,35 @@ interface WebsiteFormProps { error: string; onUrlChange: (url: string) => void; onSubmit: (event: FormEvent) => void; - onExample: () => void; - fixture: FixtureId; - onFixtureChange: (fixture: FixtureId) => void; - onFixtureScan: () => void; } -export function WebsiteForm({ url, activity, onCancel, onRetry, canRetry, cancelled, busy, error, onUrlChange, onSubmit, onExample, onFixtureScan, fixture, onFixtureChange, publicScanningEnabled, capabilitiesLoading }: WebsiteFormProps) { +export function WebsiteForm({ url, activity, onCancel, onRetry, canRetry, cancelled, busy, error, onUrlChange, onSubmit, publicScanningEnabled, capabilitiesLoading }: WebsiteFormProps) { const retryButton=useRef(null); const errorMessage = useRef(null); useLayoutEffect(() => { if ((cancelled || error) && canRetry) retryButton.current?.focus(); else if (error) errorMessage.current?.focus(); }, [cancelled, error, canRetry]); - return <> -
- -
- - onUrlChange(e.target.value)} required maxLength={2048} - aria-describedby={error ? 'url-error website-entry-note demo-note' : 'website-entry-note demo-note'} - /> - -
-

Enter a website address. HTTPS is added if you leave it out.

-

{capabilitiesLoading ? 'Checking local scanner availability…' : publicScanningEnabled ? 'Public HTTP/HTTPS pages only. Private networks and sign-in-protected pages are unsupported. Automated single-page checks only.' : 'Website scanning is unavailable. Start the local API or use the explicitly labelled example.'}

-

{activity}

- {busy && } - {canRetry && } - {error && } -
- -
- - - -

Scan this built-in page, then preview the same page. Changing the selection clears current results.{!publicScanningEnabled && ' Public URL scanning is disabled.'}

+ return
+ +
+ onUrlChange(e.target.value)} required maxLength={2048} + aria-describedby={['website-entry-note', !publicScanningEnabled && 'scanner-note', error && 'url-error'].filter(Boolean).join(' ')} + /> +
- ; +

One public page per scan. HTTPS is added if you leave it out.

+ +

{activity}

+ {busy && } + {canRetry && } + {error && } +
; } diff --git a/src/components/scanFeedback.test.ts b/src/components/scanFeedback.test.ts index e9bbc86..2cbdb52 100644 --- a/src/components/scanFeedback.test.ts +++ b/src/components/scanFeedback.test.ts @@ -6,9 +6,9 @@ const scanErrorMessage = (value: unknown, status: number) => scanFailureFeedback test('scan failures give bounded guidance without exposing internal diagnostics',()=>{ assert.match(scanErrorMessage({code:'SCANNER_BUSY',error:'private diagnostic'},429),/finishing/); assert.match(scanErrorMessage({code:'SCANNER_CLEANUP_FAILED'},503),/safely/); - assert.match(scanErrorMessage({code:'PUBLIC_SCANNING_DISABLED'},503),/built-in page/); + assert.match(scanErrorMessage({code:'PUBLIC_SCANNING_DISABLED'},503),/unavailable/); assert.deepEqual(scanFailureFeedback({error:'PRIVATE_SENTINEL'},400), { - message: 'The scan request was rejected. Check the address or built-in page selection.', retryable: false, + message: 'The scan request was rejected. Check the website address.', retryable: false, }); for(const value of [{code:'constructor',error:'private diagnostic'}, {code:'__proto__'}, {error:'private diagnostic'}, null]) { assert.equal(scanErrorMessage(value,503),'The request could not finish. No report was created.'); diff --git a/src/components/scanFeedback.ts b/src/components/scanFeedback.ts index e2bf405..8ffdb96 100644 --- a/src/components/scanFeedback.ts +++ b/src/components/scanFeedback.ts @@ -13,7 +13,7 @@ const failures = new Map([ ['SCANNER_BUSY', { message: 'Another scan is still finishing. Try again shortly.', retryable: true }], ['SCANNER_CLEANUP_FAILED', { message: 'The previous scan could not finish safely. Scanning is unavailable until cleanup is verified.', retryable: false }], ['SCANNER_UNAVAILABLE', { message: 'The scanner is currently unavailable.', retryable: false }], - ['PUBLIC_SCANNING_DISABLED', { message: 'Website scanning is not available yet. Scan a built-in page or explore an example.', retryable: false }], + ['PUBLIC_SCANNING_DISABLED', { message: 'Website scanning is currently unavailable.', retryable: false }], ['SCAN_FAILED', { message: 'The scan could not finish. No report was created.', retryable: false }], ]); @@ -45,7 +45,7 @@ export function scanFailureFeedback(value: unknown, status: number): ScanFailure const known = typeof data.code === 'string' ? failures.get(data.code) : undefined; if (known) return known; if (status === 400) { - return { message: 'The scan request was rejected. Check the address or built-in page selection.', retryable: false }; + return { message: 'The scan request was rejected. Check the website address.', retryable: false }; } return { message: 'The request could not finish. No report was created.', retryable: temporaryHttpStatuses.has(status) }; } diff --git a/src/styles.css b/src/styles.css index a08e867..3674e89 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1,6 +1,4 @@ -:root{font-family:Arial,Helvetica,sans-serif;color:#173e38;background:#fafaf6;font-synthesis:none;--green:#173e38;--muted:#56665f;--line:#dce1d8}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}a{color:inherit}button,a,input,select,summary{touch-action:manipulation}button{cursor:pointer}button:disabled{cursor:wait;opacity:.65}:focus-visible{outline:3px solid #8b4d17;outline-offset:5px}.skip-link{position:absolute;top:-60px;left:20px;background:white;padding:12px;z-index:10}.skip-link:focus{top:12px}.filter-defs{position:absolute}.site-header,main,footer{max-width:1440px;margin:auto}.site-header{padding:30px 6%;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.brand{font-size:24px;font-weight:750;text-decoration:none;display:flex;align-items:center;gap:10px;letter-spacing:-1px}.brand-icon{display:inline-flex;align-items:center;position:relative;font-size:34px}.brand-icon span{font-size:20px;position:absolute;left:12px;top:-2px}.beta{font-size:9px;letter-spacing:1px;border:1px solid #b8c7b5;padding:5px 7px;border-radius:4px;margin-left:12px}.site-header nav{display:flex;gap:30px;font-size:13px}.site-header nav a{text-decoration:none}.site-header nav a:hover{text-decoration:underline}.hero{padding:90px 6% 85px;display:grid;grid-template-columns:1.16fr 1fr;gap:58px;align-items:center}.eyebrow{font-size:10px;font-weight:700;letter-spacing:1.6px;display:block}.tiny-sun{font-size:20px;margin-right:8px;vertical-align:middle}h1{font-family:Georgia,serif;font-size:clamp(48px,5.1vw,76px);font-weight:400;line-height:1.08;letter-spacing:-3px;margin:27px 0}h1 em{font-weight:400;color:#526b4d}.hero-copy>p{color:var(--muted);font-size:16px;line-height:1.8;margin:0 0 30px}form label,.preview-controls label{display:block;font-size:12px;font-weight:700;margin-bottom:10px}.url-field{border:1px solid #bdc8bd;background:#fff;border-radius:7px;padding:6px;display:flex;gap:8px;align-items:center}.url-field>span{padding-left:8px;color:#697b6c}.url-field input{min-width:0;width:100%;border:0;padding:12px 0;font-size:13px;background:transparent}.url-field button{white-space:nowrap;border:0;border-radius:4px;background:var(--green);color:white;font-size:12px;padding:15px}.url-field button span{margin-left:8px}.form-note{font-size:11px;color:#5d6b63;margin:11px 0}.text-button{background:none;border:0;border-bottom:1px solid #8e9c8e;padding:0 0 5px;margin-top:12px;font-size:12px;color:var(--green)}.text-button span{margin-left:10px}.error{color:#9b2828;font-size:13px}.hero-visual{background:#e8eddf;border-radius:12px;padding:22px;position:relative;transform:rotate(2deg);border:1px solid #d8dfcd}.visual-top,.visual-bottom{display:flex;align-items:center;justify-content:space-between;font-size:10px;color:#405e43}.visual-top{letter-spacing:1px;font-size:9px;font-weight:bold;margin-bottom:18px}.visual-top i{display:inline-block;width:6px;height:6px;background:#496948;border-radius:50%;margin-right:7px}.hero-sample{position:relative;border-radius:5px;overflow:hidden}.comparison-slice{position:absolute;inset:0 0 0 52%;background:#829d5730;backdrop-filter:blur(1px) saturate(.2);border-left:2px solid white;pointer-events:none}.visual-bottom{margin-top:18px}.visual-toggle{background:#496948;border-radius:20px;color:white;padding:2px 4px 2px 15px}.floating-note{position:absolute;bottom:-20px;right:20px;background:#fff;padding:14px 18px;border:1px solid var(--line);border-radius:6px;box-shadow:0 5px 15px #173e3809;font-size:11px;transform:rotate(-4deg)}.floating-note span{margin-right:7px}.principles{margin:0 6%;padding:34px 0 45px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);display:grid;grid-template-columns:repeat(3,1fr);gap:45px}.step{font-size:9px;letter-spacing:1.6px;color:#5c6b5c}.principles h2{font-family:Georgia,serif;font-size:24px;font-weight:400;margin:16px 0 10px}.principles p{color:var(--muted);font-size:13px;line-height:1.8;max-width:290px;margin:0}.results{scroll-margin-top:24px;padding:65px 6%}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:20px}.section-heading h2{font:400 35px/1.2 Georgia,serif;letter-spacing:-1px;margin:12px 0}.report-url{color:var(--muted);font-size:12px;overflow-wrap:anywhere}.demo-badge{border:1px solid #b7c4af;border-radius:30px;padding:8px 12px;white-space:nowrap;font-size:11px}.notice{padding:14px 18px;border:1px solid #ddd8be;background:#f6f3e7;font-size:12px;line-height:1.7;color:#5d5333;border-radius:5px;margin:22px 0}.view-switch{display:flex;gap:25px;border-bottom:1px solid var(--line);margin:30px 0}.view-switch button{padding:14px 0;border:0;border-bottom:2px solid transparent;background:none;color:#57695e;font-size:13px}.view-switch button[aria-pressed=true]{color:var(--green);border-color:var(--green);font-weight:bold}.view-switch button span{margin-left:7px}.findings-layout{display:grid;grid-template-columns:2fr 1fr;gap:44px}.finding-intro h3{font-size:17px;margin:0 0 8px}.finding-intro p{font-size:12px;color:var(--muted);margin-bottom:25px}.finding{display:flex;gap:20px;background:white;border:1px solid var(--line);border-radius:7px;padding:24px;margin:14px 0}.finding-number{font-family:Georgia,serif;color:#687a67;font-size:21px}.severity{font-size:9px;text-transform:uppercase;letter-spacing:1px;border-radius:4px;padding:4px 7px;display:inline-block}.serious{background:#f4e8df;color:#854122}.moderate{background:#f0edcf;color:#675719}.finding h3{font-size:16px;line-height:1.5;margin:10px 0 6px}.finding p{color:var(--muted);font-size:13px;line-height:1.7}.finding .location{font-size:11px;color:#69776d}summary{font-size:12px;cursor:pointer;font-weight:bold}.manual-card{align-self:start;background:#e9eedf;padding:32px;border-radius:7px}.manual-card>span{font-size:30px}.manual-card h3{font:400 29px/1.25 Georgia,serif;margin:15px 0}.manual-card p,.manual-card li{color:#435845;font-size:13px;line-height:1.8}.manual-card h4{font-size:12px;margin:27px 0 12px}.manual-card ul{padding-left:17px}.manual-card li{margin:10px 0}.preview-controls{display:flex;gap:30px;align-items:end;padding:20px;background:#f0f2e9;border-radius:6px}.preview-controls select{padding:10px;border:1px solid #b9c5b4;border-radius:4px;background:white;color:var(--green);max-width:100%}.strength{flex:1}.strength label{display:flex;justify-content:space-between;gap:20px}.strength input{width:100%;accent-color:var(--green);height:35px}.secondary{background:white;border:1px solid #aebdaa;border-radius:4px;padding:12px;color:var(--green);font-size:12px}.effect-description,.preview-caption{font-size:12px;color:var(--muted);line-height:1.8}.comparison{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:28px}.comparison h3{font-size:12px;font-weight:400;display:flex;align-items:center;gap:8px}.status-dot{display:inline-block;border:1px solid var(--green);border-radius:50%;width:7px;height:7px}.status-dot.altered{background:var(--green)}.sample-window{position:relative;overflow:hidden;border:1px solid #dddcd1;border-radius:5px;background:#f7f3e9}.sample{color:#293c2c;background:#f7f3e9;min-height:350px}.sample-nav{padding:19px 20px;display:flex;justify-content:space-between;align-items:center;border-bottom:1px solid #dadaca}.sample-nav strong{font-family:Georgia,serif;font-size:18px;font-weight:400}.sample-nav strong span{color:#9e5d33;margin-left:4px;font-size:7px}.sample-nav>span{font-size:7px}.sample-content{padding:29px 20px 30px;position:relative;overflow:hidden;min-height:235px}.sample-content .eyebrow{font-size:7px;letter-spacing:1.2px}.sample-content h3{font:400 35px/1.1 Georgia,serif;letter-spacing:-1px;margin:16px 0 12px;position:relative;z-index:1}.sample-content p{font-size:9px;line-height:1.7;position:relative;z-index:1}.sample-content a{display:inline-block;background:#314e37;color:white;text-decoration:none;font-size:8px;padding:11px 12px;margin-top:7px;position:relative;z-index:1;transition:background .15s}.sample-content a:hover{background:#8c4d2b;text-decoration:underline}.sample-content a span{margin-left:10px}.plant-art{position:absolute;width:145px;height:210px;right:8px;bottom:0;background:radial-gradient(ellipse at center,#d8d9b9 0,transparent 70%)}.pot{position:absolute;bottom:15px;left:38px;width:80px;height:72px;background:linear-gradient(100deg,#bd7650,#b26b45 65%,#965936);clip-path:polygon(0 0,100% 0,85% 100%,15% 100%);border-top:6px solid #925331}.plant-art i{position:absolute;bottom:82px;left:70px;width:37px;height:100px;border-radius:90% 0 90% 0;background:linear-gradient(90deg,#446b36,#789153);transform:rotate(-38deg);transform-origin:bottom center}.plant-art i:nth-child(2){transform:rotate(34deg);height:120px;background:#526f3c}.plant-art i:nth-child(3){transform:rotate(-65deg);height:85px;background:#75914f}.plant-art i:nth-child(4){transform:rotate(65deg);height:75px;background:#54733e}.sample-bottom{display:flex;justify-content:space-between;padding:14px 20px;border-top:1px solid #dadaca;font-size:7px}.sample-ad{display:flex;justify-content:space-between;background:#e9e5d7;padding:10px 20px;font-size:8px;gap:10px}.sample-ad small{font-size:6px;letter-spacing:1px}.field-mask{position:absolute;inset:0;pointer-events:none}.closing{padding:65px 6%;display:flex;align-items:center;justify-content:center;gap:25px;text-align:left}.closing>span{font-size:44px;color:#72845a}.closing p{font:400 25px/1.5 Georgia,serif}.closing strong{font-weight:400;color:#5b7052}footer{margin:0 auto;padding:25px 6%;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:20px;font-size:10px;color:#526558}footer .brand{font-size:20px}@media(min-width:1400px){.hero{gap:90px}}@media(max-width:1000px){.hero{gap:30px;padding-top:60px}.hero-copy>p{font-size:14px}.desktop-break{display:none}.url-field{flex-wrap:wrap}.url-field input{width:80%;flex:1}.url-field button{width:100%}.hero-visual{padding:15px}.sample-nav>span{display:none}.preview-controls{flex-wrap:wrap}.findings-layout{gap:24px}.sample-content h3{font-size:30px}.plant-art{right:-30px;opacity:.8}}@media(max-width:700px){.site-header{padding:22px 6%;align-items:flex-start}.site-header nav{flex-direction:column;gap:10px;font-size:11px}.beta{display:none}.hero{grid-template-columns:1fr;gap:45px;padding:45px 6% 60px}h1{font-size:59px}.hero-visual{max-width:470px;width:100%;margin:auto}.principles{grid-template-columns:1fr;gap:30px}.principles p{max-width:none}.findings-layout,.comparison{grid-template-columns:1fr}.section-heading{align-items:flex-start;flex-direction:column}.section-heading h2{font-size:30px}.results{padding-top:45px}.preview-controls{gap:20px}.preview-controls>div{width:100%}.strength{flex:auto}.view-switch{gap:18px}.view-switch button{font-size:12px}.sample-nav>span{display:block}.sample-content h3{font-size:35px}.plant-art{right:10px;opacity:1}.closing{padding:40px 6%;gap:16px}.closing p{font-size:21px}footer{flex-wrap:wrap}footer>span:last-child{display:none}.finding{padding:19px;gap:14px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}} - -.fixture-scan{margin-top:20px}.critical{background:#f6dfdf;color:#842626}.minor{background:#e7edde;color:#415d37}.unknown{background:#e8e8e8;color:#444} +:root{font-family:Arial,Helvetica,sans-serif;color:#173e38;background:#fafaf6;font-synthesis:none;--green:#173e38;--muted:#56665f;--line:#dce1d8}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}a{color:inherit}button,a,input,select,summary{touch-action:manipulation}button{cursor:pointer}button:disabled{cursor:wait;opacity:.65}:focus-visible{outline:3px solid #8b4d17;outline-offset:5px}.skip-link{position:absolute;top:-60px;left:20px;background:white;padding:12px;z-index:10}.skip-link:focus{top:12px}.filter-defs{position:absolute}.site-header,main,footer{max-width:1440px;margin-inline:auto}.brand{font-size:24px;font-weight:750;text-decoration:none;display:flex;align-items:center;gap:10px;letter-spacing:-1px}.brand-icon{display:inline-flex;align-items:center;position:relative;font-size:34px}.brand-icon span{font-size:20px;position:absolute;left:12px;top:-2px}.eyebrow{font-size:10px;font-weight:700;letter-spacing:1.6px;display:block}h1{font-family:Georgia,serif;font-size:clamp(48px,5.1vw,76px);font-weight:400;line-height:1.08;letter-spacing:-3px;margin:27px 0}h1 em{font-weight:400;color:#526b4d}form label,.preview-controls label{display:block;font-size:12px;font-weight:700;margin-bottom:10px}.form-note{font-size:11px;color:#5d6b63;margin:11px 0}.error{color:#9b2828;font-size:13px}.comparison-slice{position:absolute;inset:0 0 0 52%;background:#829d5730;backdrop-filter:blur(1px) saturate(.2);border-left:2px solid white;pointer-events:none}.step{font-size:9px;letter-spacing:1.6px;color:#5c6b5c}.results{scroll-margin-top:24px;padding:65px 6%}.section-heading{display:flex;justify-content:space-between;align-items:center;gap:20px}.section-heading h2{font:400 35px/1.2 Georgia,serif;letter-spacing:-1px;margin:12px 0}.report-url{color:var(--muted);font-size:12px;overflow-wrap:anywhere}.demo-badge{border:1px solid #b7c4af;border-radius:30px;padding:8px 12px;white-space:nowrap;font-size:11px}.notice{padding:14px 18px;border:1px solid #ddd8be;background:#f6f3e7;font-size:12px;line-height:1.7;color:#5d5333;border-radius:5px;margin:22px 0}.view-switch{display:flex;gap:25px;border-bottom:1px solid var(--line);margin:30px 0}.view-switch button{padding:14px 0;border:0;border-bottom:2px solid transparent;background:none;color:#57695e;font-size:13px}.view-switch button[aria-pressed=true]{color:var(--green);border-color:var(--green);font-weight:bold}.view-switch button span{margin-left:7px}.findings-layout{display:grid;grid-template-columns:2fr 1fr;gap:44px}.finding-intro h3{font-size:17px;margin:0 0 8px}.finding-intro p{font-size:12px;color:var(--muted);margin-bottom:25px}.finding{display:flex;gap:20px;background:white;border:1px solid var(--line);border-radius:7px;padding:24px;margin:14px 0}.finding-number{font-family:Georgia,serif;color:#687a67;font-size:21px}.severity{font-size:9px;text-transform:uppercase;letter-spacing:1px;border-radius:4px;padding:4px 7px;display:inline-block}.serious{background:#f4e8df;color:#854122}.moderate{background:#f0edcf;color:#675719}.finding h3{font-size:16px;line-height:1.5;margin:10px 0 6px}.finding p{color:var(--muted);font-size:13px;line-height:1.7}.finding .location{font-size:11px;color:#69776d}summary{font-size:12px;cursor:pointer;font-weight:bold}.manual-card{align-self:start;background:#e9eedf;padding:32px;border-radius:7px}.manual-card>span{font-size:30px}.manual-card h3{font:400 29px/1.25 Georgia,serif;margin:15px 0}.manual-card p,.manual-card li{color:#435845;font-size:13px;line-height:1.8}.manual-card h4{font-size:12px;margin:27px 0 12px}.manual-card ul{padding-left:17px}.manual-card li{margin:10px 0}.preview-controls{display:flex;gap:30px;align-items:end;padding:20px;background:#f0f2e9;border-radius:6px}.preview-controls select{padding:10px;border:1px solid #b9c5b4;border-radius:4px;background:white;color:var(--green);max-width:100%}.strength{flex:1}.strength label{display:flex;justify-content:space-between;gap:20px}.strength input{width:100%;accent-color:var(--green);height:35px}.secondary{background:white;border:1px solid #aebdaa;border-radius:4px;padding:12px;color:var(--green);font-size:12px}.effect-description,.preview-caption{font-size:12px;color:var(--muted);line-height:1.8}.comparison{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:28px}.comparison h3{font-size:12px;font-weight:400;display:flex;align-items:center;gap:8px}.status-dot{display:inline-block;border:1px solid var(--green);border-radius:50%;width:7px;height:7px}.status-dot.altered{background:var(--green)}.field-mask{position:absolute;inset:0;pointer-events:none}@media(min-width:1400px){}@media(max-width:1000px){.preview-controls{flex-wrap:wrap}.findings-layout{gap:24px}}@media(max-width:700px){h1{font-size:59px}.findings-layout,.comparison{grid-template-columns:1fr}.section-heading{align-items:flex-start;flex-direction:column}.section-heading h2{font-size:30px}.results{padding-top:45px}.preview-controls{gap:20px}.preview-controls>div{width:100%}.strength{flex:auto}.view-switch{gap:18px}.view-switch button{font-size:12px}.finding{padding:19px;gap:14px}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}}.critical{background:#f6dfdf;color:#842626}.minor{background:#e7edde;color:#415d37}.unknown{background:#e8e8e8;color:#444} /* Fixture snapshots retain their own styles inside opaque, script-free frames. */ .snapshot-source{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:12px}.snapshot-source h3{font-size:17px;margin:0 0 8px}.snapshot-source p{font-size:12px;color:var(--muted);line-height:1.7;margin:5px 0}.snapshot-source button{flex-shrink:0}.snapshot-status{font-size:12px;color:var(--muted);min-height:20px;margin-bottom:14px}.snapshot-placeholder{border:1px dashed #b9c5b4;background:#f0f2e9;border-radius:7px;padding:36px 24px;text-align:center}.snapshot-placeholder h3{font:400 25px/1.3 Georgia,serif;margin:0 0 12px}.snapshot-placeholder p{font-size:13px;line-height:1.8;color:var(--muted)}.snapshot-window{position:relative;border:1px solid #bdc8b6;border-radius:6px;overflow:hidden;background:#f5f2e8;min-width:0}.snapshot-frame{display:block;width:100%;height:560px;border:0;background:#f5f2e8}.snapshot-window:focus-within{outline:3px solid #8b4d17;outline-offset:3px}.comparison>div{min-width:0}@media(max-width:700px){.snapshot-source{align-items:stretch;flex-direction:column;gap:12px}.snapshot-source button{align-self:flex-start}.snapshot-frame{height:500px}} @@ -13,8 +11,6 @@ /* Findings keep each element's location next to its own repair guidance. */ .findings-main{min-width:0}.severity-counts{display:flex;flex-wrap:wrap;gap:10px;list-style:none;padding:0;margin:20px 0}.severity-counts li{padding:8px 12px;border:1px solid var(--line);border-radius:4px;font-size:12px;background:#f0f2e9}.severity-counts strong{margin-left:8px}.finding-filter{display:flex;align-items:center;flex-wrap:wrap;gap:12px}.finding-filter label{font-size:13px;font-weight:bold}.finding-filter select{max-width:100%;padding:10px;border:1px solid #b9c5b4;border-radius:4px;background:white;color:var(--green)}.finding-status{font-size:12px;color:var(--muted);margin:14px 0}.finding h4,.review-finding h4{font-size:17px;line-height:1.5;margin:12px 0 8px}.finding>div:last-child{min-width:0}.findings-empty{padding:20px;border:1px dashed #b9c5b4;border-radius:5px;line-height:1.8;font-size:14px}.element-guidance ol{padding-left:22px}.element-guidance li{padding:4px 0 12px}.element-target strong{display:block}.element-target code{display:block;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;margin-top:6px}.element-summary{white-space:pre-wrap;overflow-wrap:anywhere}.finding p,.review-finding p{overflow-wrap:anywhere}.review-findings{margin-top:32px;border-top:1px solid var(--line);padding-top:20px}.review-findings>p,.review-finding p{font-size:13px;line-height:1.8;color:var(--muted)}.review-finding{padding:20px;border:1px solid var(--line);border-radius:5px;margin-top:16px;min-width:0}.review-label{font-size:11px;font-weight:bold;letter-spacing:.5px;color:#654b20}.review-finding summary{font-size:12px;cursor:pointer;text-decoration:underline}.severity.critical{background:#f2dcd8;color:#792f28}.severity.minor{background:#e7ebdf;color:#415433}.severity.unknown{background:#e8e8e8;color:#414141} -.fixture-scan label{display:block;font-size:12px;font-weight:bold;margin:16px 0 8px}.fixture-scan select{display:block;max-width:100%;width:100%;padding:10px;border:1px solid #b9c5b4;border-radius:4px;background:white;color:var(--green);margin-bottom:12px} - .print-report{display:none}.report-exports{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:20px;border:1px solid var(--line);border-radius:6px;padding:20px;margin:22px 0;background:#f0f2e9}.report-exports h3{font-size:16px;margin:0 0 8px}.report-exports p{font-size:12px;line-height:1.7;color:var(--muted);margin:4px 0}.report-export-actions{display:flex;gap:12px;flex-wrap:wrap}.report-export-actions a{display:inline-block;text-decoration:none}.report-exports>p[role=alert]{color:#9b2828;width:100%} @media print{ @page{margin:16mm} @@ -42,3 +38,39 @@ .vision-presets h4{font-size:14px;margin:0 0 12px} .vision-preset-buttons{display:flex;flex-wrap:wrap;gap:10px} .vision-preset-buttons button{min-height:44px;max-width:100%;white-space:normal} + +/* Landing page */ +.site-header{height:64px;padding-inline:6%;display:flex;align-items:center;border-bottom:1px solid var(--line)} +.hero{display:grid;grid-template-columns:minmax(0,560px);justify-content:center;padding:28px 6% 18px} +.hero h1{font:400 clamp(44px,5.2vw,64px)/1.04 Georgia,serif;letter-spacing:-3px;margin:0 0 20px} +.hero-copy>p{max-width:55ch;margin:0 0 15px;color:#52635b;line-height:1.6} +.hero form label{font-size:13px;margin-bottom:9px} +.url-field{display:flex;align-items:center;gap:8px;border:1px solid #7b897d;border-radius:7px;padding:6px;background:white} +.url-field input{width:100%;min-width:0;padding:10px;border:0;background:transparent;color:var(--green);font-size:14px} +.url-field button{min-height:44px;padding:13px 15px;white-space:nowrap;border:0;border-radius:4px;background:var(--green);color:white;font-size:14px} +.hero .form-note{font-size:12px;line-height:1.6;margin:10px 0 0} +.hero [role="status"]:empty{margin:0} +.landing-comparison{min-width:0;margin:0;background:#e8eddf;border:1px solid var(--line);padding:16px;border-radius:12px} +.landing-comparison-panes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px} +.landing-comparison-label{font-size:12px;font-weight:700;margin-bottom:8px} +.landing-comparison-page{overflow:hidden;border-radius:6px;border:1px solid #cdd5c6} +.landing-comparison svg{display:block;width:100%;height:auto} +.landing-comparison figcaption{margin-top:12px;font-size:12px;line-height:1.5;color:#52635b} +footer{border-top:1px solid var(--line);padding:9px 6%;font-size:12px;color:#52635b} +.hero .landing-comparison{grid-row:2;margin-bottom:18px;padding:12px} +.hero .landing-comparison svg{max-height:155px} +.hero .landing-comparison figcaption{margin-top:8px} +.hero .form-note{margin-top:8px} +@media(max-width:760px){ + .site-header{height:60px} + .hero{grid-template-columns:minmax(0,1fr);gap:0;padding-block:35px} + .hero h1{font-size:clamp(48px,5.6vw,76px);letter-spacing:-2px;margin-bottom:14px} + .hero-copy>p{max-width:37ch;margin-bottom:20px} + .hero .landing-comparison{grid-row:auto;max-width:480px;margin:28px 0 0} + .hero .landing-comparison svg{max-height:none} + .hero .landing-comparison figcaption{margin-top:12px} + .hero .form-note{margin-top:10px} + .landing-comparison-panes{gap:8px} + footer{padding-block:20px} +} +@media(max-width:380px){.url-field{display:grid}.url-field button{width:100%}}