PageSourceSearch

https://colorcheck.dev/assets/ScannerPage-CyYU8IGc.js

js colorcheck.dev collected 2026-10-02 01:01:03 UTC 10,208 bytes, 11 lines download raw bytes

1import{c as E,F as I,h as o,H as R,k as A,G,j as L,l as e,A as s,M as w,X as O,N as T}from"./index-CuhXhId9.js";import{S as M}from"./ScanAnimation-eXLhMCoW.js";import{u as X}from"./useSubscription-D-lKfDgL.js";import{S as W}from"./search-BjTCo8pF.js";import{G as Y}from"./globe-BuEXUrkd.js";import{S}from"./shield-Drki3Z6T.js";import"./index-Btn3xdqw.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const $=E("FileImage",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const B=E("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]),k=i=>{let n=i.trim();/^https?:\/\//i.test(n)||(n=`https://${n}`);try{const l=new URL(n);return l.protocol="https:",l.toString().replace(/\/+$/,"")}catch{return""}},C=i=>{try{const n=new URL(i.trim());return/^[a-z0-9][a-z0-9.-]+\.[a-z]{2,}/i.test(n.hostname)}catch{return!1}},H=["image/png","image/jpeg","image/webp","image/gif","image/bmp"],_=["application/pdf","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/msword"],g=[...H,..._],ae=()=>{I({title:"Scan Your Site | ColorCheck Color Blind Accessibility Scanner",description:"Enter any URL or upload a screenshot to test for color blind accessibility issues. Get instant WCAG contrast scores and fix suggestions."});const[i,n]=o.useState(""),[l,c]=o.useState(""),[b,x]=o.useState(!1),[r,f]=o.useState(null),p=o.useRef(null),{isScanning:m,scanError:y,scanProgress:F,scanFromUrl:h,scanFromFile:v}=R(),d=A(),[j]=G();X(),L();const N=o.useRef(!1);o.useEffect(()=>{const a=j.get("url");if(a&&!N.current&&!m){N.current=!0,n(a);const t=k(a);C(t)&&h(t).then(()=>d("/scan"))}},[j,m,h,d]);const P=async a=>{if(a.preventDefault(),r){await v(r),d("/scan");return}const t=k(i);if(!C(t)){c("Please enter a valid domain (e.g. example.com)");return}c(""),await h(t),d("/scan")},D=a=>{var u;a.preventDefault(),x(!1);const t=(u=a.dataTransfer.files)==null?void 0:u[0];t&&g.includes(t.type)&&(f(t),n(""),c(""))},U=a=>{var u;const t=(u=a.target.files)==null?void 0:u[0];t&&g.includes(t.type)&&(f(t),n(""),c(""))},z=()=>{f(null),p.current&&(p.current.value="")};return e.jsxs("div",{className:"min-h-screen bg-background flex flex-col relative overflow-hidden",children:[e.jsxs("div",{className:"pointer-events-none absolute inset-0",children:[e.jsx(s.div,{className:"absolute top-20 left-[-60px] w-[120px] h-[120px] sm:w-[200px] sm:h-[200px] rounded-full bg-bauhaus-blue opacity-[0.07]",animate:{scale:[1,1.08,1]},transition:{duration:8,repeat:1/0,ease:"easeInOut"}}),e.jsx(s.div,{className:"absolute bottom-10 right-[-40px] w-[100px] h-[100px] sm:w-[160px] sm:h-[160px] rounded-full bg-bauhaus-red opacity-[0.07]",animate:{scale:[1,1.1,1]},transition:{duration:10,repeat:1/0,ease:"easeInOut"}}),e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 h-[4px] flex",children:[e.jsx("div",{className:"flex-1 bg-bauhaus-red"}),e.jsx("div",{className:"flex-1 bg-bauhaus-blue"}),e.jsx("div",{className:"flex-1 bg-bauhaus-yellow"}),e.jsx("div",{className:"flex-1 bg-foreground"})]})]}),e.jsx("div",{className:"relative flex-1 flex items-start justify-center sm:items-center px-4 sm:px-5 pt-32 sm:pt-24 pb-10",children:m?e.jsx(s.div,{initial:{opacity:0}
11,animate:{opacity:1},className:"w-full max-w-2xl text-center space-y-4",children:e.jsx(M,{progress:F})}):e.jsxs(s.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"w-full max-w-2xl space-y-6 sm:space-y-8 text-center",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs(s.div,{className:"flex items-center justify-center gap-2 mb-3",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.1,duration:.4},children:[e.jsx("div",{className:"bauhaus-dot-red"}),e.jsx("div",{className:"bauhaus-dot-yellow"}),e.jsx("div",{className:"bauhaus-dot-blue"})]}),e.jsx(s.h1,{className:"text-2xl sm:text-3xl lg:text-5xl font-bold tracking-tight text-foreground leading-none",initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.15,duration:.5},children:"Test any website"}),e.jsx(s.p,{className:"text-xs sm:text-sm text-muted-foreground max-w-md mx-auto leading-relaxed font-sans",initial:{opacity:0},animate:{opacity:1},transition:{delay:.3},children:"Enter a URL to scan up to 5 pages for color accessibility issues, or upload an image. Score 90 or above and you'll earn a ColorCheck Certified badge to embed on your site valid for 120 days."})]}),!r&&e.jsxs(s.form,{onSubmit:P,className:"space-y-3",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.35},children:[e.jsxs("div",{className:"flex items-center w-full rounded-full border-2 border-foreground bg-background focus-within:border-bauhaus-blue transition-all overflow-hidden",children:[e.jsxs("label",{htmlFor:"scanner-url",className:"flex items-center shrink-0 pl-4 pr-1 sm:px-5",children:[e.jsx(W,{className:"h-4 w-4 sm:h-5 sm:w-5 text-muted-foreground shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"sr-only",children:"Website URL"})]}),e.jsx("input",{id:"scanner-url",type:"text",value:i,onChange:a=>{n(a.target.value),c("")},placeholder:"example.com",className:"flex-1 min-w-0 bg-transparent px-2 py-3 sm:py-4 text-sm sm:text-base font-mono text-foreground placeholder:text-muted-foreground outline-none ring-0 focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0 border-none",inputMode:"url",autoCapitalize:"none",autoCorrect:"off",spellCheck:!1}),e.jsxs("button",{type:"submit",disabled:!i.trim()||m,className:"tap group flex items-center justify-center gap-1.5 sm:gap-2 shrink-0 px-4 sm:px-8 py-2 sm:py-3 m-1 bg-foreground text-background text-xs font-bold uppercase tracking-wider rounded-full disabled:opacity-30 transition-all hover:bg-bauhaus-blue",children:["Scan",e.jsx(w,{className:"h-4 w-4 transition-transform group-hover:translate-x-0.5","aria-hidden":"true"})]})]}),(l||y)&&e.jsx("p",{className:"text-xs text-bauhaus-red font-bold",children:l||y})]}),!r&&e.jsxs(s.div,{className:"flex items-center gap-4",initial:{opacity:0}
11,animate:{opacity:1},transition:{delay:.5},children:[e.jsx("div",{className:"flex-1 h-[2px] bg-border"}),e.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-muted-foreground",children:"or"}),e.jsx("div",{className:"flex-1 h-[2px] bg-border"})]}),r?e.jsxs(s.div,{className:"space-y-3",initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},children:[e.jsxs("div",{className:"flex items-center gap-3 border-2 border-foreground bg-background p-3 sm:p-4",children:[e.jsx($,{className:"h-6 w-6 sm:h-8 sm:w-8 shrink-0 text-bauhaus-blue"}),e.jsxs("div",{className:"flex-1 min-w-0 text-left",children:[e.jsx("p",{className:"truncate font-mono text-xs sm:text-sm text-foreground",children:r.name}),e.jsxs("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider font-mono",children:[(r.size/1024).toFixed(0)," KB · ",r.type.split("/")[1]]})]}),e.jsx("button",{onClick:z,className:"p-1 text-muted-foreground hover:text-foreground transition-colors",children:e.jsx(O,{className:"h-4 w-4"})})]}),e.jsxs("button",{onClick:async()=>{await v(r),d("/scan")},className:"tap group flex items-center justify-center gap-2 w-full px-6 py-3 sm:py-4 bg-foreground text-background text-xs font-bold uppercase tracking-wider rounded-full transition-all hover:bg-bauhaus-blue min-h-[48px]",children:["Analyze File",e.jsx(w,{className:"h-4 w-4 transition-transform group-hover:translate-x-0.5"})]})]}):e.jsxs(s.div,{onDragOver:a=>{a.preventDefault(),x(!0)},onDragLeave:()=>x(!1),onDrop:D,onClick:()=>{var a;return(a=p.current)==null?void 0:a.click()},className:`group cursor-pointer border-2 border-dashed p-5 sm:p-8 transition-all ${b?"border-bauhaus-blue bg-background":"border-border hover:border-foreground hover:bg-muted"}`,initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.55},children:[e.jsx("input",{ref:p,type:"file",accept:[...g,".pdf",".pptx",".ppt",".xlsx",".xls",".docx",".doc"].join(","),onChange:U,className:"hidden"}),e.jsxs("div",{className:"flex flex-col items-center gap-2 sm:gap-3",children:[e.jsx(B,{className:`h-6 w-6 sm:h-8 sm:w-8 transition-colors ${b?"text-bauhaus-blue":"text-muted-foreground group-hover:text-foreground"}`}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-xs sm:text-sm font-bold text-foreground",children:["Drop an image here or ",e.jsx("span",{className:"text-bauhaus-blue",children:"browse"})]}),e.jsx("p",{className:"mt-1 text-[10px] font-mono uppercase tracking-wider text-muted-foreground",children:"PNG, JPG, WEBP, GIF, PDF, PPTX, XLSX, DOCX"})]})]})]}),e.jsx(s.div,{className:"flex flex-wrap items-center justify-center gap-x-4 gap-y-2 sm:gap-8",initial:{opacity:0}
11,animate:{opacity:1},transition:{delay:.65},children:[{icon:T,label:"3 CVD types"},{icon:Y,label:"Scans up to 5 pages"},{icon:S,label:"Full-site analysis"}].map(a=>e.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-mono uppercase tracking-wider text-muted-foreground",children:[e.jsx(a.icon,{className:"h-3 w-3 shrink-0"}),a.label]},a.label))}),e.jsxs(s.div,{className:"flex items-center justify-center gap-2 text-[10px] text-muted-foreground font-mono uppercase tracking-wider",initial:{opacity:0},animate:{opacity:1},transition:{delay:.7},children:[e.jsx(S,{className:"h-3 w-3 shrink-0"}),e.jsx("span",{children:"We never share your data. Scans stay yours."})]})]})})]})};export{ae as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.