diff --git a/README.md b/README.md index 8054479..4bcb326 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ KindPath follows at most ten main-document requests and analyzes only the final Each destination independently passes public DNS/address validation, destination pinning, verified firewall approval and HTTPS certificate validation. Loading assets is separate from crawling. Source scripts run only in the isolated browser to render the submitted page; captured scripts are never replayed in the app. -The API returns JSON; **Download report JSON** exports the findings, incomplete checks, coverage and limitations without embedding the preview image. Automated results do not establish accessibility conformance. Manual keyboard, screen-reader and usability review is still necessary. +When a scan finishes, select **View report** to move to the results. The API returns JSON. **Download report JSON** near the report heading exports the findings, incomplete checks, coverage and limitations without embedding the preview image. Automated results do not establish accessibility conformance. Manual keyboard, screen-reader and usability review is still necessary. After five seconds, KindPath can stop unfinished resource loads when the successful main document has fully arrived, its HTML is parsed, and the page has rendered text. Other pages keep the full 15-second loading window. The report is explicitly marked `pageLoadIncomplete: true`, with a partial-coverage notice in the interface and JSON export. An unfinished main document or rejected navigation still fails. @@ -43,7 +43,8 @@ A site may return an error, a login/consent page, or different content to the an Real-page previews use a JPEG rendered in the same isolated visit as the report. This preserves the loaded page's layout, images, fonts, colours and rendered component content without rebuilding its HTML/CSS. -- **Fit width** shows the desktop-width image inside each comparison panel. **Actual size** supports scrolling to inspect small details. Both panels can scroll vertically. +- The vision presets sit above the snapshots. Open **Fine-tune effects** for intensity, colour and individual strengths. +- **Fit width** shows the desktop-width image inside each comparison panel. **Actual size** supports scrolling to inspect small details. Desktop shows both panels. On phones, switch between **Original** and **Simulated** to compare the same scroll position in the captured image. - The vision buttons offer **Original**, **Protanopia**, **Deuteranopia**, **Tritanopia**, **Blurred vision**, and **Reduced peripheral vision**. The colour dropdown also offers **Grayscale**. The named colour buttons start at 100% strength, and lower settings interpolate between the [Machado model’s published severity matrices](https://pubmed.ncbi.nlm.nih.gov/19834201/). The previews illustrate possible colour differences. Individual vision varies. - Effects render inside the sandboxed preview document, alongside its image. Changing effects refreshes only the modified document from the stored capture and can reset its scroll position; it does not rescan the website. - The original panel stays unchanged. Link areas highlight on hover; navigation and form interaction are disabled. Hover highlights do not reproduce a source site's scripted hover behavior. Visible ads are part of the static image. diff --git a/scripts/preview-browser.mjs b/scripts/preview-browser.mjs index 0b0dd2f..46eca15 100644 --- a/scripts/preview-browser.mjs +++ b/scripts/preview-browser.mjs @@ -166,7 +166,11 @@ try { 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 urlField = page.locator('.url-field'); + const focusedBorder = await urlField.evaluate(node => getComputedStyle(node).borderColor); + await page.getByRole('heading', { name: 'A clearer web. For everyone.' }).click(); + assert.equal(await websiteEntry.evaluate(node => node === document.activeElement), false); + assert.notEqual(await urlField.evaluate(node => getComputedStyle(node).borderColor), focusedBorder); const landing = page.locator('.hero'); const panes = landing.locator('.landing-comparison-page'); assert.equal(await panes.count(), 2); @@ -201,8 +205,8 @@ try { 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(comparison.x >= form.x + form.width); + assert.ok(heading.y + heading.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'); @@ -210,11 +214,12 @@ try { assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)); landingImages[size] = (await page.screenshot({fullPage:true})).toString('base64'); } - for (const width of [760, 761]) { + for (const width of [899, 900]) { 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); + if (width < 900) assert.ok(comparison.y >= form.y + form.height); + else assert.ok(comparison.x >= form.x + form.width); } await page.setViewportSize({width:320,height:740}); assert.ok(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)); @@ -229,6 +234,7 @@ try { 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); + assert.equal(await websiteEntry.getAttribute('aria-invalid'), 'true'); assert.equal(await page.locator('.results').count(),0); } await websiteEntry.fill(''); @@ -249,14 +255,59 @@ try { for(const entry of ['127.0.0.1','printer.local','example.com:8443','https://example.com/#section']) { const before=apiRequests;await websiteEntry.fill(entry);await publicButton.click(); await page.getByRole('alert').waitFor();assert.equal(apiRequests,before); + assert.equal(await websiteEntry.getAttribute('aria-invalid'), 'true'); assert.equal(await page.locator('.results').count(),0); } await websiteEntry.fill(' example.com/start '); + const landingPositions = () => page.evaluate(() => [ + ...Array.from(document.querySelectorAll('.hero h1, .url-field, .url-field button, .landing-comparison'), node => { + const {x, y, width, height} = node.getBoundingClientRect(); + return [x, y, width, height]; + }), + scrollY, + ]); + const beforeScan = await landingPositions(); + delayPublic = true; + const heldScan = new Promise(resolve => { notifyPublic = resolve; }); await publicButton.click(); + await heldScan; + await page.getByRole('button', {name: 'Cancel request'}).waitFor(); + assert.deepEqual(await landingPositions(), beforeScan, 'Starting a scan must keep the landing controls in place'); + delayPublic = false; + releasePublic(); await page.locator('.results').getByText('Scanned page: ' + publicReport.url, { exact: true }).waitFor(); assert.equal(await websiteEntry.inputValue(),publicReport.requestedUrl); await page.locator('.results').getByText('Requested URL: ' + publicReport.requestedUrl, { exact: true }).waitFor(); - await page.waitForFunction(() => document.activeElement?.matches('.results')); + const viewReport = page.getByRole('button', {name: 'View report'}); + assert.deepEqual(await landingPositions(), beforeScan, 'Receiving a report must keep the viewport and landing controls in place'); + assert.equal(await viewReport.evaluate(node => node === document.activeElement), true); + await page.emulateMedia({reducedMotion:'no-preference'}); + await page.locator('.results').evaluate(node => { + const scroll = node.scrollIntoView.bind(node); + node.scrollIntoView = options => { + node.dataset.scrollBehavior = options.behavior; + scroll(options); + }; + }); + await viewReport.press('Enter'); + await page.waitForFunction(() => document.activeElement?.matches('.results') && window.scrollY > 0); + assert.equal(await page.locator('.results').getAttribute('data-scroll-behavior'), 'smooth'); + await page.emulateMedia({reducedMotion:'reduce'}); + await viewReport.press('Enter'); + assert.equal(await page.locator('.results').getAttribute('data-scroll-behavior'), 'instant'); + await page.emulateMedia({reducedMotion:'no-preference'}); + assert.equal(await page.locator('.results .manual-card').getByText(/axe-core/).count(), 0); + const reportSupportFollows = async content => { + const bottom = await content.evaluate(node => node.getBoundingClientRect().bottom); + const top = await content.evaluate(node => node.getBoundingClientRect().top); + assert.ok(await page.locator('.results .report-exports').evaluate(node => node.getBoundingClientRect().bottom) <= top); + for (const block of [ + page.locator('.results').getByText('Automated results for the final scanned page only. Manual review is still required.', {exact:true}), + page.locator('.results .scan-coverage'), + ]) assert.ok(await block.evaluate(node => node.getBoundingClientRect().top) >= bottom); + }; + await reportSupportFollows(page.locator('.results .findings-layout')); + assert.equal(await page.getByText('Automated page scan', { exact: true }).count(), 1); const coverageNotice=page.locator('.results').getByRole('region',{name:'Scan coverage',exact:true}); await coverageNotice.getByText('Scan coverage is limited',{exact:true}).waitFor(); @@ -357,11 +408,17 @@ try { await page.getByLabel('Your website URL').fill(publicReport.requestedUrl); await publicButton.click(); await page.locator('.results').getByText('Requested URL: ' + publicReport.requestedUrl, {exact:true}).waitFor(); - await page.waitForFunction(() => document.activeElement?.matches('.results')); + await viewReport.waitFor(); await assertDownload(publicResponse); await printablePdf(publicResponse); await page.getByRole('button', {name:/Visual preview/}).click(); - await page.getByRole('heading', {name:'Scanned website snapshot',exact:true}).waitFor(); + const captureTime = page.locator('.snapshot-captured time'); + await captureTime.waitFor(); + assert.equal(await captureTime.getAttribute('datetime'), data.sitePreview.capturedAt); + assert.equal(await page.locator('.snapshot-captured').textContent(), 'Captured at ' + await captureTime.textContent()); + await page.getByText('Educational approximations. Individual experiences vary.', {exact:true}).waitFor(); + assert.equal(await page.getByRole('button',{name:'Apply visual effects',exact:true}).count(), 0); + await reportSupportFollows(page.locator('.preview-workspace')); const captured = page.frameLocator('iframe').first(); await captured.getByText('Captured website marker',{exact:true}).waitFor(); assert.equal(await page.locator('iframe').count(),2); @@ -376,8 +433,6 @@ try { await capturedLink.dispatchEvent('click'); assert.equal(page.frames().slice(1).every(frame=>frame.url()==='about:srcdoc'),true); await captured.getByText('Static captured advertisement',{exact:true}).waitFor(); - await page.getByRole('button',{name:'Apply visual effects',exact:true}).click(); - assert.equal(await page.getByRole('heading',{name:'Effects paused — original appearance',exact:true}).count(),1); const oldFrame = await page.locator('iframe').first().elementHandle(); const nextId='22222222-2222-4222-8222-222222222222'; publicResponse={...publicResponse,scanId:nextId,sitePreview:{...data.sitePreview,scanId:nextId,html:data.sitePreview.html.replace('Captured website marker','New captured page marker')}}; @@ -386,7 +441,7 @@ try { await page.getByRole('button',{name:/Visual preview/}).click(); await page.frameLocator('iframe').first().getByText('New captured page marker',{exact:true}).waitFor(); assert.equal(await oldFrame.evaluate(node=>node.isConnected),false); - assert.equal(await page.getByRole('heading',{name:'With visual effects',exact:true}).count(),1); + assert.equal(await page.getByRole('heading',{name:/Simulated preview/}).count(),1); for(const bad of [undefined,{...data.sitePreview,scanId:nextId},{...data.sitePreview,url:'https://example.com/old'}]) { publicResponse={...publicReport,scanId:data.sitePreview.scanId,sitePreview:bad}; await publicButton.click(); @@ -476,6 +531,9 @@ try { assertPixel(await visiblePixel(0),[192,32,64]); assert.equal(await imageFrames.nth(1).evaluate(el=>el.style.filter),'','No parent filter may cross the opaque iframe boundary'); } + const fineTuning = page.getByText('Fine-tune effects', {exact:true}); + assert.equal(await slider('Colour strength').isVisible(), false); + await fineTuning.press('Enter'); await page.getByLabel('Colour preset',{exact:true}).selectOption('grayscale'); assertPixel(await visiblePixel(1),[68,68,68]); await slider('Colour strength').press('Home'); @@ -483,6 +541,11 @@ try { await imagePresets.getByRole('button',{name:'Blurred vision',exact:true}).click(); assert.notDeepEqual(await imageFrames.nth(1).screenshot(),unfilteredPixels,'Blur must change the raster preview'); assert.deepEqual(await imageFrames.first().screenshot(),originalPixels,'The original image must remain visually unchanged'); + await page.getByRole('button',{name:'Reset effects',exact:true}).click(); + assert.equal(await slider('Blur strength').inputValue(), '0'); + assert.equal(await slider('Colour strength').inputValue(), '100'); + assertPixel(await visiblePixel(1),[122,111,59]); + assertPixel(await visiblePixel(0),[192,32,64]); const hotspot=page.frameLocator('iframe').first().locator('.kp-link').first();await hotspot.hover(); assert.equal(await hotspot.evaluate(node=>getComputedStyle(node).outlineStyle),'solid');await hotspot.dispatchEvent('click'); assert.equal(page.frames().slice(1).every(frame=>frame.url()==='about:srcdoc'),true);assert.equal(page.context().pages().length,1); @@ -493,8 +556,21 @@ try { assert.ok(scroll.x>0&&scroll.y>0,'Actual size must allow access to the right and lower image'); await page.getByLabel('Preview size',{exact:true}).selectOption('fit'); await page.setViewportSize({width:390,height:844}); - await page.frameLocator('iframe').first().locator('img').evaluate(img=>img.decode()); - assert.ok(await page.frameLocator('iframe').first().locator('img').evaluate(img=>img.getBoundingClientRect().width<=innerWidth)); + const mobileViews = page.getByRole('group', {name:'Snapshot view'}); + const mobileOriginal = mobileViews.getByRole('button', {name:'Original',exact:true}); + const mobileSimulated = mobileViews.getByRole('button', {name:'Simulated',exact:true}); + assert.equal(await imageFrames.first().isVisible(), false); + await page.getByLabel('Preview size',{exact:true}).selectOption('actual'); + const scroller = page.getByRole('region', {name:'Snapshot images'}); + await scroller.evaluate(node => { node.scrollLeft = 150; node.scrollTop = 300; }); + await mobileOriginal.press('Enter'); + assert.equal(await imageFrames.first().isVisible(), true); + assert.equal(await imageFrames.nth(1).isVisible(), false); + assert.deepEqual(await scroller.evaluate(node => [node.scrollLeft, node.scrollTop]), [150, 300]); + await mobileSimulated.press('Enter'); + assert.deepEqual(await scroller.evaluate(node => [node.scrollLeft, node.scrollTop]), [150, 300]); + await page.getByLabel('Preview size',{exact:true}).selectOption('fit'); + assert.ok(await page.frameLocator('iframe').nth(1).locator('img').evaluate(img=>img.getBoundingClientRect().width<=innerWidth)); assert.ok(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth)); await page.setViewportSize({width:1280,height:900});await assertDownload(publicResponse); publicResponse={...publicReport,scanId:data.imagePreview.scanId,previewUnavailable:true}; @@ -525,7 +601,7 @@ try { await feedback.getByRole('heading',{name:'Website preview unavailable',exact:true}).waitFor(); assert.match(await feedback.textContent(),/findings and report exports are still available/); assert.equal(await page.locator('iframe').count(),0); - assert.equal(await page.getByRole('button',{name:'Apply visual effects',exact:true}).count(),0); + assert.equal(await page.getByRole('button',{name:'Reset effects',exact:true}).count(),0); if(kind==='empty') { await page.setViewportSize({width:390,height:844}); assert.ok(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth)); @@ -535,7 +611,7 @@ try { } }else { assert.equal(await page.locator('iframe').count(),2); - assert.equal(await page.getByRole('button',{name:'Apply visual effects',exact:true}).count(),1); + assert.equal(await page.getByRole('button',{name:'Reset effects',exact:true}).count(),1); if(kind==='sparse') { await page.frameLocator('iframe').first().getByText('Short page',{exact:true}).waitFor(); await feedback.getByRole('heading',{name:'Limited preview detail',exact:true}).waitFor(); @@ -591,8 +667,7 @@ try { 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 viewReport.waitFor(); 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); @@ -642,10 +717,13 @@ try { publicResponse = {...publicReport, previewUnavailable: true, generatedAt: '2026-11-08T01:00:00.000Z'}; delayPublic = true; const heldCancellation = new Promise(resolve => { notifyPublic = resolve; }); + await publicButton.scrollIntoViewIfNeeded(); + const beforeMobileScan = await landingPositions(); await publicButton.click(); await heldCancellation; assert.equal(publicHeld, true); - assert.equal(await websiteEntry.isDisabled(), true); + assert.equal(await websiteEntry.getAttribute('readonly'), ''); + assert.deepEqual(await landingPositions(), beforeMobileScan, 'A pending scan must also keep the mobile landing controls in place'); 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); @@ -662,9 +740,14 @@ try { 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); + // The draft URL and the already-completed report are independent. + await page.getByRole('button', { name: /Visual preview/ }).click(); + const callsBeforeEdit = publicCalls; + await websiteEntry.fill('https://example.com/new-request'); + assert.equal(publicCalls, callsBeforeEdit); + await page.locator('.results').getByText('Requested URL: ' + publicResponse.requestedUrl, { exact: true }).waitFor(); + assert.equal(await page.getByRole('button', { name: /Visual preview/ }).getAttribute('aria-pressed'), 'true'); + await assertDownload(publicResponse); assert.deepEqual(unexpected, []); 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/scripts/validate-chrome.mjs b/scripts/validate-chrome.mjs index a5ea9e4..36c2b17 100644 --- a/scripts/validate-chrome.mjs +++ b/scripts/validate-chrome.mjs @@ -96,9 +96,9 @@ try { const before = requests; const input = page.getByLabel("Your website URL"); const entered = args[index + 1]; - const previous = await input.inputValue(); + const reportsBeforeEdit = await page.locator(".results").count(); await input.fill(entered); - if (previous !== entered) assert.equal(await page.locator(".results").count(), 0); + assert.equal(await page.locator(".results").count(), reportsBeforeEdit); if (index === 0) await input.press("Enter"); else await page.getByRole("button", { name: "Scan website", exact: true }).click(); await page.locator(".results").waitFor({ state: "detached" }); diff --git a/src/App.tsx b/src/App.tsx index 3db1d1e..12ea850 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,4 +1,4 @@ -import { useEffect, useLayoutEffect, useRef, useState } from 'react'; +import { useEffect, useRef, useState } from 'react'; import type { FormEvent } from 'react'; import { navigationRejection } from '../scanner/gateway/navigation.mjs'; import { websiteUrl } from '../scanner/gateway/url.mjs'; @@ -40,15 +40,15 @@ export function App() { const [busy, setBusy] = useState(false); const [lastAttempt,setLastAttempt] = useState(null); const [cancelled,setCancelled] = useState(false); + const [fieldError, setFieldError] = useState(''); const [failure, setFailure] = useState(null); const [view, setView] = useState<'findings' | 'preview'>('findings'); const results = useRef(null); - // Focus only after React has committed the new report and its result element exists. - useLayoutEffect(() => { - if (!report) return; - results.current?.focus(); - results.current?.scrollIntoView({ behavior: 'instant', block: 'start' }); - }, [report]); + function viewReport() { + results.current?.focus({ preventScroll: true }); + const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches; + results.current?.scrollIntoView({ behavior: reduceMotion ? 'instant' : 'smooth', block: 'start' }); + } const analysisRequest = useRef(null); useEffect(() => () => analysisRequest.current?.abort(), []); @@ -58,18 +58,24 @@ export function App() { setBusy(false); setReport(null); setFailure(null); setCancelled(true); } function changeUrl(value: string) { - setUrl(value); setReport(null); setFailure(null); setCancelled(false); setLastAttempt(null); setView('findings'); + setUrl(value); setFailure(null); setFieldError(''); setCancelled(false); setLastAttempt(null); } async function analyze(value: string) { if (analysisRequest.current || !capabilitiesReady) return; + setFieldError(''); + try { + value = websiteUrl(normalizeWebsiteEntry(value)).href; + } catch (cause) { + setFailure(null); setCancelled(false); setLastAttempt(null); + setFieldError(cause instanceof Error ? cause.message : 'Enter a valid public website URL.'); + return; + } const abort = new AbortController(); analysisRequest.current = abort; setBusy(true); setFailure(null); setReport(null); setView('findings'); setCancelled(false); setLastAttempt(value); let timeout: AbortSignal | undefined; try { - 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', { @@ -134,15 +140,16 @@ export function App() {
-

A clearer web.
For everyone.

+

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} + url={url} busy={busy} fieldError={fieldError} scanError={failure?.message ?? ''} onUrlChange={changeUrl} onSubmit={submit} />
@@ -156,9 +163,7 @@ export function App() { Automated page scan -
Automated results for the final scanned page only. Manual review is still required.
{pageNotice &&

{pageNotice}

} -
@@ -171,11 +176,13 @@ export function App() { {report.previewUnavailable ? 'The website image could not be captured.' : 'Website image capture is disabled.'} Your accessibility report and JSON download are still available.
} +
Automated results for the final scanned page only. Manual review is still required.
+
}
; } diff --git a/src/components/FindingsReport.tsx b/src/components/FindingsReport.tsx index 021ee25..5a281bf 100644 --- a/src/components/FindingsReport.tsx +++ b/src/components/FindingsReport.tsx @@ -40,8 +40,7 @@ export function FindingsReport({ report }: { report: Report }) {

Showing {visible.length} of {report.findings.length} {report.mode === 'demo' ? 'example rules' : 'rules with violations'}.

{report.findings.length === 0 ?

No automated violations were reported. This does not establish accessibility conformance; review the checks below and test manually.

: visible.length === 0 ?

No violations match this severity. Other findings are still in this report.

- : visible.map((finding, index) =>
- + : visible.map(finding =>
{finding.severity}

{finding.title}

@@ -64,7 +63,6 @@ export function FindingsReport({ report }: { report: Report }) {

People complete
the picture.

Automated checks are a starting point. Make room for manual review and feedback from disabled people.

- {report.scanner &&

axe-core {report.scanner.engineVersion} · {report.scanner.passedChecks} checks passed. Zero findings would not establish accessibility conformance.

} {report.limitations && <>

Scan limitations

    {report.limitations.map(limit =>
  • {limit}
  • )}
}

Try these checks

    {report.manualChecks.map(check =>
  • {check}
  • )}
diff --git a/src/components/ReportExports.tsx b/src/components/ReportExports.tsx index b37312b..c2d7779 100644 --- a/src/components/ReportExports.tsx +++ b/src/components/ReportExports.tsx @@ -16,14 +16,13 @@ export function ReportExports({ report }: { report: Report }) { return () => { if (url) URL.revokeObjectURL(url); }; }, [report]); return
-

Take your report with you

-

Both exports include the full report, regardless of the severity filter. Website previews and visual effects are not included.

-

To save a PDF, choose the PDF destination in your browser’s print dialog. PDF accessibility tagging depends on your browser; JSON preserves the structured report data.

+

Export report

{download ? Download report JSON : }
+

Exports include all findings and exclude website previews. For PDF, choose a PDF destination in the print dialog. PDF accessibility tagging varies by browser.

{error &&

{error}

}
; } diff --git a/src/components/SiteVisualPreview.tsx b/src/components/SiteVisualPreview.tsx index a6d57af..e4f2562 100644 --- a/src/components/SiteVisualPreview.tsx +++ b/src/components/SiteVisualPreview.tsx @@ -1,30 +1,56 @@ import { useState } from 'react'; +import type { CSSProperties } from 'react'; import type { SitePreview } from '../../shared/types'; import { SnapshotFrame } from './SnapshotFrame'; -import { VisionControls } from './VisionControls'; +import { VisionFineTuning, VisionPresetControls } from './VisionControls'; import { previewTextFeedback } from './sitePreview'; -import { defaultVisionSettings } from './visualEffects'; +import { activeVisionPreset, defaultVisionSettings, peripheralMask, visionPresets } from './visualEffects'; export function SiteVisualPreview({ snapshot }: { snapshot: SitePreview }) { - const [settings,setSettings] = useState(defaultVisionSettings); - const [actualSize,setActualSize]=useState(false); - const image=snapshot.kind==='image'; - const feedback=image?undefined:previewTextFeedback(snapshot.capturedTextCharacters); - const empty=feedback?.kind==='empty'; + const [settings, setSettings] = useState(defaultVisionSettings); + const [actualSize, setActualSize] = useState(false); + const [mobileView, setMobileView] = useState<'original' | 'simulated'>('simulated'); + const image = snapshot.kind === 'image'; + const feedback = image ? undefined : previewTextFeedback(snapshot.capturedTextCharacters); + const empty = feedback?.kind === 'empty'; + const preset = activeVisionPreset(settings); + const presetLabel = preset ? visionPresets[preset].name : 'Custom effects'; + const {width, height} = snapshot; + const imageDimensions = image && width && height ? { + '--snapshot-width': `${width}px`, + '--snapshot-height': `${height}px`, + '--snapshot-ratio': height / width, + } as CSSProperties : undefined; + const mobileMask = image && mobileView === 'simulated' ? peripheralMask(settings) : undefined; + return
-

Scanned website snapshot

-

{empty ? 'This capture is linked to the same browser visit as the report for ' : 'This snapshot was captured in the same browser visit as this report. It is a limited visual approximation of '}{snapshot.url}.

-

Captured at .{!empty && <> Scroll within each preview to explore the page. This reflects the scan viewport, not a responsive device preview. Run another scan to update both the report and snapshot.}

-
+

Captured at

{feedback &&

{feedback.title}

{feedback.message}

} - {image&&

{snapshot.truncated&&' · Long page: first 6,000 pixels shown.'}

} - {!empty && <> -
-

Original snapshot

-

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

-
-

{image?'This is a static image. Links highlight on hover, but navigation and forms are inactive. Visible advertisements are part of the image.':'Links and form controls are inactive. Visible advertisement text is static; embedded advertisements and tracking are omitted.'}

} -
    {snapshot.limitations.map(text=>
  • {text}
  • )}
- {!empty &&
Educational approximations. Vision varies between people; these effects do not reproduce a medical condition or replace accessibility testing.
} + {!empty && <> + { setSettings(value); setMobileView('simulated'); }}/> +
+
+ + +
+ {image &&
+ + +
} +
+ {image && snapshot.truncated &&

Long page: first 6,000 pixels shown.

} +
+
+

Original snapshot

+

Simulated preview · {presetLabel}

+
+ {mobileMask && + { setSettings(value); setMobileView('simulated'); }}/> +

{image ? 'This is a static image. Links highlight on hover, but navigation and forms are inactive. Visible advertisements are part of the image.' : 'Links and form controls are inactive. Visible advertisement text is static; embedded advertisements and tracking are omitted.'}

+ } +
    {snapshot.limitations.map(text =>
  • {text}
  • )}
; } diff --git a/src/components/VisionControls.tsx b/src/components/VisionControls.tsx index cf1a0bf..cf451b1 100644 --- a/src/components/VisionControls.tsx +++ b/src/components/VisionControls.tsx @@ -4,18 +4,14 @@ import type { ColourPreset, Effect, IntensityPreset, VisionPreset, VisionSetting const sliderLabels: Record = { colour: 'Colour strength', contrast: 'Contrast reduction', blur: 'Blur strength', peripheral: 'Peripheral restriction', }; -export function VisionControls({ settings, onChange }: { settings: VisionSettings; onChange: (value: VisionSettings) => void }) { +interface VisionControlsProps { + settings: VisionSettings; + onChange: (value: VisionSettings) => void; +} + +export function VisionPresetControls({ settings, onChange }: VisionControlsProps) { const activePreset = activeVisionPreset(settings); - const hasEffects = Object.values(settings.strengths).some(value => value > 0); - return
-
-

Adjust the modified preview

Combine effects or explore one at a time. The original snapshot stays unchanged.

-
- - - -
-
+ return

Choose a vision preset

@@ -23,15 +19,22 @@ export function VisionControls({ settings, onChange }: { settings: VisionSetting )}
-

Selecting a preset turns effects on and sets the sliders below.

+

Educational approximations. Individual experiences vary.

+ +
; +} + +export function VisionFineTuning({ settings, onChange }: VisionControlsProps) { + return
+ Fine-tune effects
Starting points {(Object.entries(intensityPresets) as [IntensityPreset, { name: string; strength: number }][]).map(([key, value]) => - )}
-

Intensity presets turn effects on and set all four strengths.

+

Intensity presets set all four strengths.

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

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

- -

{activity}

- {busy && } - {canRetry && } - {error && } +
+
+ {fieldError && } + {!publicScanningEnabled &&

+ {capabilitiesLoading ? 'Checking scanner availability…' : 'Website scanning is currently unavailable.'} +

} +

{activity}

+ {scanError && } +
+ {busy && } + {canRetry && } + {reportReady && } +
; } diff --git a/src/components/visualEffects.test.ts b/src/components/visualEffects.test.ts index 0dbc73f..2e552f9 100644 --- a/src/components/visualEffects.test.ts +++ b/src/components/visualEffects.test.ts @@ -29,33 +29,30 @@ test('Machado presets use distinct published endpoints and interpolate nearby se } }); -test('effects compose independently and pause removes every visible transformation', () => { +test('effects compose independently and zero strengths remove every visible transformation', () => { const settings = defaultVisionSettings(); settings.strengths = { colour: 40, blur: 50, contrast: 75, peripheral: 60 }; assert.equal(snapshotFilter(settings, 'local-colour'), 'url(#local-colour) contrast(0.5) blur(2px)'); assert.equal(peripheralMask(settings)?.opacity, 0.6); - assert.equal(snapshotFilter({ ...settings, enabled: false }, 'local-colour'), undefined); - assert.equal(peripheralMask({ ...settings, enabled: false }), undefined); assert.deepEqual(settings.strengths, { colour: 40, blur: 50, contrast: 75, peripheral: 60 }); - assert.equal(snapshotFilter({ ...settings, strengths: { colour: 0, blur: 0, contrast: 0, peripheral: 0 } }, 'local-colour'), undefined); + const original = applyVisionPreset('original'); + assert.equal(snapshotFilter(original, 'local-colour'), undefined); + assert.equal(peripheralMask(original), undefined); }); -test('intensity presets enable all sliders without changing the colour choice or mutating prior settings', () => { - const initial = defaultVisionSettings(); initial.enabled = false; initial.colourPreset = 'tritanopia'; +test('intensity presets set all sliders without changing the colour choice or mutating prior settings', () => { + const initial = defaultVisionSettings(); initial.colourPreset = 'tritanopia'; const preset = applyIntensity(initial, 'strong'); - assert.equal(preset.enabled, true); assert.equal(preset.colourPreset, 'tritanopia'); + assert.equal(preset.colourPreset, 'tritanopia'); assert.deepEqual(Object.values(preset.strengths), [80,80,80,80]); - assert.equal(initial.strengths.blur, 0); assert.equal(initial.enabled, false); + assert.equal(initial.strengths.blur, 0); initial.strengths.blur = 99; assert.equal(defaultVisionSettings().strengths.blur, 0); }); test('vision presets replace mixed effects and return independent editable settings', () => { const combined = applyIntensity(defaultVisionSettings(), 'strong'); - combined.enabled = false; const blur = applyVisionPreset('blurred'); - assert.equal(blur.enabled, true); assert.equal(snapshotFilter(blur, 'colour'), 'blur(2px)'); assert.equal(peripheralMask(blur), undefined); - assert.equal(combined.enabled, false); assert.equal(combined.strengths.colour, 80); const original = applyVisionPreset('original'); assert.equal(snapshotFilter(original, 'colour'), undefined); @@ -66,11 +63,10 @@ test('vision presets replace mixed effects and return independent editable setti assert.equal(snapshotFilter(applyVisionPreset('peripheral'), 'colour'), undefined); assert.equal(peripheralMask(applyVisionPreset('peripheral'))?.opacity, 0.65); }); -test('active preset follows visible settings, custom adjustments and pause state', () => { +test('active preset follows visible settings and custom adjustments', () => { assert.equal(activeVisionPreset(defaultVisionSettings()), 'deuteranopia'); const blue = applyVisionPreset('tritanopia'); assert.equal(activeVisionPreset(blue), 'tritanopia'); - assert.equal(activeVisionPreset({...blue,enabled:false}), undefined); assert.equal(activeVisionPreset({...blue,strengths:{...blue.strengths,blur:1}}), undefined); assert.equal(activeVisionPreset(applyIntensity(blue, 'mild')), undefined); assert.equal(activeVisionPreset({...applyVisionPreset('blurred'),colourPreset:'grayscale'}), 'blurred'); diff --git a/src/components/visualEffects.ts b/src/components/visualEffects.ts index af319e5..6682ceb 100644 --- a/src/components/visualEffects.ts +++ b/src/components/visualEffects.ts @@ -10,7 +10,7 @@ export const effects: Record = { type MachadoPreset = keyof typeof machadoMatrices; export type ColourPreset = MachadoPreset | 'grayscale'; -export type VisionSettings = { enabled: boolean; colourPreset: ColourPreset; strengths: Record }; +export type VisionSettings = { colourPreset: ColourPreset; strengths: Record }; export type IntensityPreset = 'mild' | 'moderate' | 'strong'; export const colourPresets: Record = { protanopia: 'Protanopia', deuteranopia: 'Deuteranopia', tritanopia: 'Tritanopia', grayscale: 'Grayscale', @@ -29,10 +29,9 @@ export const visionPresets: Record { const value = visionPresets[key]; return (Object.keys(effects) as Effect[]).every(effect => settings.strengths[effect] === value.strengths[effect]) @@ -46,7 +45,7 @@ export function defaultVisionSettings(): VisionSettings { } export function applyIntensity(settings: VisionSettings, preset: IntensityPreset): VisionSettings { const strength = intensityPresets[preset].strength; - return { enabled: true, colourPreset: settings.colourPreset, strengths: { colour: strength, contrast: strength, blur: strength, peripheral: strength } }; + return { colourPreset: settings.colourPreset, strengths: { colour: strength, contrast: strength, blur: strength, peripheral: strength } }; } const identity = [1, 0, 0, 0, 1, 0, 0, 0, 1]; @@ -74,7 +73,6 @@ export function colourMatrix(preset: ColourPreset, strength: number): number[] { return [...values, 0, 0, 0, 1, 0]; } export function snapshotFilter(settings: VisionSettings, colourId: string): string | undefined { - if (!settings.enabled) return undefined; const { colour, contrast, blur } = settings.strengths; const filters = [ clampStrength(colour) > 0 ? `url(#${colourId})` : '', @@ -85,7 +83,7 @@ export function snapshotFilter(settings: VisionSettings, colourId: string): stri } export function peripheralMask(settings: VisionSettings) { const strength = clampStrength(settings.strengths.peripheral); - if (!settings.enabled || strength === 0) return undefined; + if (strength === 0) return undefined; return { opacity: strength / 100, background: `radial-gradient(ellipse at center, transparent ${48 - strength * .35}%, rgba(12,20,16,.96) ${85 - strength * .35}%)` }; } diff --git a/src/styles.css b/src/styles.css index bf43382..63be33c 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1,12 +1,13 @@ -: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} +html{scrollbar-gutter:stable} +: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}.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}} +.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-frame{height:500px}} /* Vision settings are native controls; effects stay outside the isolated snapshot document. */ -.vision-controls{background:#f0f2e9;border:1px solid var(--line);border-radius:7px;padding:24px;margin-top:12px}.vision-toolbar{display:flex;align-items:flex-start;justify-content:space-between;gap:20px}.vision-toolbar h3{font-size:16px;margin:0 0 8px}.vision-toolbar p,.vision-note,.colour-choice p,.effect-control p,.vision-application-status{font-size:12px;line-height:1.7;color:var(--muted)}.vision-toolbar p{margin:0}.vision-actions,.intensity-presets{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.vision-actions{flex-shrink:0}.vision-controls button[aria-pressed=true]{background:var(--green);color:white;border-color:var(--green)}.intensity-presets{margin-top:22px}.intensity-presets>span{font-size:12px;font-weight:bold;margin-right:5px}.vision-note{margin:10px 0 18px}.colour-choice{display:grid;grid-template-columns:auto minmax(150px,230px) 1fr;align-items:center;gap:14px;margin-bottom:20px}.colour-choice label,.effect-label label{font-size:12px;font-weight:bold}.colour-choice select{width:100%;padding:10px;border:1px solid #b9c5b4;border-radius:4px;background:white;color:var(--green)}.colour-choice p{margin:0}.effect-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.effect-control{background:#fff;border:1px solid var(--line);border-radius:5px;padding:16px;min-width:0}.effect-label{display:flex;justify-content:space-between;gap:14px}.effect-label output{font-size:12px;color:var(--green)}.effect-control input{width:100%;accent-color:var(--green);height:32px;margin:8px 0}.effect-control p{margin:0}.vision-application-status{margin:16px 0 0}@media(max-width:900px){.vision-toolbar{flex-direction:column}.colour-choice{grid-template-columns:1fr 1fr}.colour-choice p{grid-column:1/-1}}@media(max-width:700px){.vision-controls{padding:18px}.effect-grid,.colour-choice{grid-template-columns:1fr}.colour-choice{gap:8px}.vision-actions{width:100%}.intensity-presets>span{width:100%}.vision-toolbar{gap:14px}} +.vision-controls{background:#f0f2e9;border:1px solid var(--line);border-radius:7px;padding:24px;margin-top:12px}.vision-note,.colour-choice p,.effect-control p{font-size:12px;line-height:1.7;color:var(--muted)}.intensity-presets{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.vision-controls button[aria-pressed=true]{background:var(--green);color:white;border-color:var(--green)}.intensity-presets{margin-top:22px}.intensity-presets>span{font-size:12px;font-weight:bold;margin-right:5px}.vision-note{margin:10px 0 18px}.colour-choice{display:grid;grid-template-columns:auto minmax(150px,230px) 1fr;align-items:center;gap:14px;margin-bottom:20px}.colour-choice label,.effect-label label{font-size:12px;font-weight:bold}.colour-choice select{width:100%;padding:10px;border:1px solid #b9c5b4;border-radius:4px;background:white;color:var(--green)}.colour-choice p{margin:0}.effect-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.effect-control{background:#fff;border:1px solid var(--line);border-radius:5px;padding:16px;min-width:0}.effect-label{display:flex;justify-content:space-between;gap:14px}.effect-label output{font-size:12px;color:var(--green)}.effect-control input{width:100%;accent-color:var(--green);height:32px;margin:8px 0}.effect-control p{margin:0}@media(max-width:900px){.colour-choice{grid-template-columns:1fr 1fr}.colour-choice p{grid-column:1/-1}}@media(max-width:700px){.vision-controls{padding:18px}.effect-grid,.colour-choice{grid-template-columns:1fr}.colour-choice{gap:8px}.intensity-presets>span{width:100%}} + -.vision-toggle-status{font-size:12px;font-weight:bold;color:var(--green);min-width:20px} /* 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} @@ -34,22 +35,28 @@ .preview-quality h4{font-size:15px;margin:0 0 8px}.preview-quality p{margin:0;line-height:1.7} /* Preset choices stay outside the altered snapshot and wrap on narrow screens. */ -.vision-presets{margin-top:22px} +.vision-presets{min-width:0} .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{display:grid;grid-template-columns:minmax(0,560px);justify-content:center;align-items:center;padding:40px 6%} .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} +.url-field{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px;border:1px solid #7b897d;border-radius:12px;padding:5px;background:#fff;box-shadow:0 2px 5px #173e3810} +.url-field:has(input:focus){border-color:#286456;box-shadow:0 0 0 1px #286456} +.url-field input{width:100%;min-width:0;padding:12px;border:0;border-radius:7px;background:transparent;color:var(--green);font-size:16px;outline:none} +.url-field input::placeholder{color:var(--muted);opacity:1} +.url-field button{min-height:44px;min-width:154px;padding:12px;white-space:nowrap;border:0;border-radius:7px;background:var(--green);color:#fff;font-size:14px;font-weight:700} +.url-field button:focus-visible{outline:2px solid #286456;outline-offset:2px} +@media (forced-colors:active){ + .url-field input:focus{outline:2px solid Highlight;outline-offset:-2px} +} .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} @@ -57,9 +64,12 @@ .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{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px 20px;border-top:1px solid var(--line);padding:3px 6%;font-size:12px;line-height:1.25;color:#52635b} -footer a{display:inline-flex;align-items:center;gap:4px;min-height:24px;margin-inline-start:auto;color:var(--green);text-underline-offset:3px} -.hero .landing-comparison{grid-row:2;margin-bottom:18px;padding:12px} -.hero .landing-comparison svg{max-height:155px} +footer a{display:inline-flex;align-items:center;min-height:24px;margin-inline-start:auto;color:var(--green);text-underline-offset:3px;text-decoration-skip-ink:none} +.hero .landing-comparison{margin-top:28px;padding:12px} +@media (min-width: 900px) { + .hero {grid-template-columns:minmax(0,510px) minmax(0,580px);gap:clamp(28px,5vw,80px);align-items:start;padding-block:clamp(48px,8vw,115px)} + .hero .landing-comparison {margin-top:36px;padding:16px} +} .hero .landing-comparison figcaption{margin-top:8px} .hero .form-note{margin-top:8px} @media(max-width:760px){ @@ -75,4 +85,69 @@ footer a{display:inline-flex;align-items:center;gap:4px;min-height:24px;margin-i footer{padding-block:5px} footer a{min-height:44px} } -@media(max-width:380px){.url-field{display:grid}.url-field button{width:100%}} +@media(max-width:380px){.url-field{grid-template-columns:1fr}.url-field button{width:100%}} + +.snapshot-captured{font-size:12px;color:var(--muted);line-height:1.7;margin:5px 0 12px} + +.visually-hidden{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap} +.url-field-invalid,.url-field-invalid:has(input:focus){border-color:#9b2828;box-shadow:0 0 0 1px #9b2828} +.scan-feedback{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:start;gap:10px;min-height:66px;margin-top:6px;padding:8px;border:1px solid transparent;border-radius:8px} +.scan-feedback p{margin:0;color:var(--muted);font-size:13px;line-height:1.5} +.scan-feedback p:empty{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)} +.scan-feedback .error{color:#9b2828;font-weight:700} +.scan-feedback-error{border-color:#ddd8be;background:#f6f3e7} +.scan-feedback-error p{color:#5d5333} +.scan-feedback .secondary{min-height:44px;white-space:nowrap;padding:8px 10px} +@media (max-width:420px){ + .scan-feedback{min-height:80px} +} +@media (hover:hover){ + .url-field button:enabled:hover{background:#24584c} +} +.url-field button:enabled:active{box-shadow:inset 0 2px 5px #0b2723} +@media (prefers-reduced-motion:no-preference){ + .url-field button{transition:background-color 140ms ease,box-shadow 140ms ease} +} + +.report-exports{display:grid;gap:8px;padding:14px 16px;margin:18px 0} +.report-exports p{font-size:13px} +.severity-counts{gap:8px 16px} +.severity-counts li{padding:0;border:0;background:transparent;font-size:13px;color:var(--muted)} +.severity-counts strong{margin-left:3px;color:var(--green)} +.finding .severity{font-size:11px} +.finding p,.review-finding p,.element-target code,.finding summary,.review-finding summary{font-size:14px} + +.vision-preset-controls{display:flex;justify-content:space-between;align-items:flex-start;flex-wrap:wrap;gap:12px;padding:14px 16px} +.vision-preset-controls .vision-note{margin:8px 0 0;font-size:13px} +.vision-fine-tuning{margin-top:16px;padding:12px 16px} +.vision-fine-tuning>summary{padding-block:8px;font-size:14px} +.preview-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-top:12px} +.preview-size{display:flex;align-items:center;gap:10px;font-size:14px;font-weight:700} +.preview-size select{min-height:44px;padding:8px;border:1px solid #aebdaa;border-radius:4px;background:#fff;color:var(--green)} +.mobile-view-switch,.mobile-field-mask{display:none} +.snapshot-comparison{position:relative} +.snapshot-comparison .comparison{margin-top:12px} +.comparison h3{font-size:14px;flex-wrap:wrap} +.active-preset{color:var(--muted)} +.snapshot-limitations{font-size:13px;line-height:1.6;color:var(--muted)} + +@media (max-width:700px){ + .vision-preset-controls{gap:8px} + .vision-preset-buttons{gap:6px} + .vision-preset-buttons button{padding-inline:8px} + .mobile-view-switch{display:flex;gap:4px} + .mobile-view-switch button{min-height:44px;min-width:80px} + .mobile-view-switch button[aria-pressed=true]{background:var(--green);border-color:var(--green);color:#fff;font-weight:700} + .snapshot-comparison .comparison{display:block} + .snapshot-comparison[data-mobile-view=original] .simulated-pane, + .snapshot-comparison[data-mobile-view=simulated] .original-pane{display:none} + /* One scroll position serves both equally sized raster panes. The opaque frame + still owns image rendering, link highlights and filters. */ + .image-comparison .comparison{container-type:inline-size;max-height:500px;overflow:auto;overflow-anchor:none;border:1px solid #bdc8b6;border-radius:6px;background:#f5f2e8} + .image-comparison .comparison h3{position:sticky;top:0;left:0;z-index:1;margin:0;padding:8px;background:#f5f2e8} + .image-comparison .snapshot-window{border:0;border-radius:0;overflow:visible} + .image-comparison .snapshot-frame{height:calc(100cqw * var(--snapshot-ratio))} + .image-comparison[data-actual-size=true] .snapshot-frame{width:var(--snapshot-width);height:var(--snapshot-height)} + .image-comparison .snapshot-window .field-mask{display:none} + .mobile-field-mask{display:block;inset:38px 1px 1px;border-radius:0 0 6px 6px} +}