From 2beb599793a8268345e8ff34cc33a8d17468b8f0 Mon Sep 17 00:00:00 2001 From: AJith Elumalai Date: Sat, 3 Oct 2026 18:34:44 -0700 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20craft=20pass=20=E2=80=94=20focus,?= =?UTF-8?q?=20contrast,=20press=20feedback,=20reduced=20motion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Seven findings from the site audit, none of which were costing a lead today but all of which read as carelessness to anyone who notices them. Focus. Nothing defined a focus style, so Tailwind's preflight left keyboard users with no visible focus anywhere — outline-style computed to `none` on all 38 tabbable elements. A single :focus-visible rule now covers the site. The ring colour is a CSS variable because a green ring on the brand-900 security band would have been the same bug wearing a different hat; .on-dark flips it to a light tone. Contrast. Body copy ran at text-brand-800/60 (3.3:1) and /50 (2.6:1) against a 4.5:1 requirement. Rather than guess, the threshold was computed against every surface the text actually sits on: /75 is the first value that clears 4.5 on cream, white, cream-50 and cream-100 (worst case 4.65). Dark sections move to cream/70. 33 replacements. The +18% spike badge needed its own fix — amber-600 on amber-50 is 3.07:1, amber-800 is 6.84:1. Measured after: 182 text elements checked, 0 failures. Was 21. Press feedback. No button had an :active state, so a tap on a phone gave no acknowledgement at all until the next paint. A .press utility now scales to 0.97 on pointer-down, and degrades to an opacity shift under reduced motion. Reduced motion. 35 elements travelled 24px on scroll and scroll-behavior was globally smooth, with no escape hatch. The reveal now cross-fades without travelling — gentler, not absent. Also handles prefers-reduced-transparency. Mobile menu. Added a dimming scrim, background scroll lock, Escape to close, and aria-expanded/controls. It is kept mounted and toggled by class so it animates closed as well as open; it used to vanish instantly. Mobile product demo. The invoice card was `hidden lg:block`, so phone visitors never saw the product — the most persuasive element on the page was desktop only. Verified no horizontal overflow at 375px. Loading spinner. Was orange on slate, left over from an older theme. The first thing any visitor saw was the wrong brand. Co-Authored-By: Claude Opus 5 --- src/Router.tsx | 6 +-- src/components/landing/Features.tsx | 4 +- src/components/landing/FinalCTA.tsx | 8 ++-- src/components/landing/Footer.tsx | 8 ++-- src/components/landing/Hero.tsx | 15 ++++--- src/components/landing/HowItWorks.tsx | 4 +- src/components/landing/InvoiceDemo.tsx | 10 ++--- src/components/landing/Navbar.tsx | 55 +++++++++++++++++++++----- src/components/landing/PainPoints.tsx | 4 +- src/components/landing/Pricing.tsx | 16 ++++---- src/components/landing/Security.tsx | 6 +-- src/components/landing/Stats.tsx | 2 +- src/index.css | 54 +++++++++++++++++++++++++ src/pages/SetupGuide.tsx | 12 +++--- 14 files changed, 149 insertions(+), 55 deletions(-) diff --git a/src/Router.tsx b/src/Router.tsx index 58a8e33..5fcbc25 100644 --- a/src/Router.tsx +++ b/src/Router.tsx @@ -72,10 +72,10 @@ export default function Router() { function LoadingScreen() { return ( -
+
-
-

Loading...

+
+

Loading…

); diff --git a/src/components/landing/Features.tsx b/src/components/landing/Features.tsx index 2040167..07d2754 100644 --- a/src/components/landing/Features.tsx +++ b/src/components/landing/Features.tsx @@ -66,7 +66,7 @@ export default function Features() {

{f.title}

-

{f.desc}

+

{f.desc}

))}
@@ -100,7 +100,7 @@ export default function Features() { {v.points.map((pt, j) => (
  • - {pt} + {pt}
  • ))} diff --git a/src/components/landing/FinalCTA.tsx b/src/components/landing/FinalCTA.tsx index f42e724..7cb03be 100644 --- a/src/components/landing/FinalCTA.tsx +++ b/src/components/landing/FinalCTA.tsx @@ -8,7 +8,7 @@ export default function FinalCTA() { return (
    -
    +
    @@ -25,14 +25,14 @@ export default function FinalCTA() { Did you catch it? -

    +

    Start your free trial — upload your first invoice in 60 seconds. No credit card. No setup fee. No commitment.

    Start Free Trial @@ -41,7 +41,7 @@ export default function FinalCTA() { href={DEMO_BOOKING_URL} target="_blank" rel="noopener noreferrer" - className="inline-flex items-center justify-center gap-2 px-8 py-4 rounded-xl bg-white/[0.08] border border-cream/20 text-cream font-medium text-base hover:bg-white/[0.14] transition-all" + className="press inline-flex items-center justify-center gap-2 px-8 py-4 rounded-xl bg-white/[0.08] border border-cream/20 text-cream font-medium text-base hover:bg-white/[0.14]" > Book a 30-Min Demo diff --git a/src/components/landing/Footer.tsx b/src/components/landing/Footer.tsx index 7b2843d..a9337eb 100644 --- a/src/components/landing/Footer.tsx +++ b/src/components/landing/Footer.tsx @@ -57,7 +57,7 @@ export default function Footer() { ChefCode.ai -

    +

    AI-powered invoice intelligence for food service teams. Save time, catch overcharges, export clean data.

    @@ -65,7 +65,7 @@ export default function Footer() { {/* Link columns */} {columns.map((col, i) => (
    -

    {col.title}

    +

    {col.title}

      {col.links.map((link, j) => (
    • @@ -84,7 +84,7 @@ export default function Footer() {
    -

    © {new Date().getFullYear()} ChefCode.ai. All rights reserved.

    +

    © {new Date().getFullYear()} ChefCode.ai. All rights reserved.

    {[ { label: 'Privacy', href: '/privacy' }, @@ -94,7 +94,7 @@ export default function Footer() { {l.label} diff --git a/src/components/landing/Hero.tsx b/src/components/landing/Hero.tsx index 93aab59..8177746 100644 --- a/src/components/landing/Hero.tsx +++ b/src/components/landing/Hero.tsx @@ -27,7 +27,7 @@ export default function Hero() { in seconds. -

    +

    ChefCode reads your supplier invoices, assigns the right GL codes, and flags vendor overcharges — automatically. In under 60 seconds, not 24 hours. @@ -37,21 +37,21 @@ export default function Hero() {

    -

    15-day free trial · no credit card

    +

    15-day free trial · no credit card

    {/* Origin story, not invented logos. This replaced a stack of four fake monograms (UC/HG/DM/RK) over @@ -67,8 +67,11 @@ export default function Hero() {
    - {/* ── Right: Invoice demo ── */} -
    + {/* ── Right: Invoice demo ── + Was `hidden lg:block`, so phone visitors never saw the product at + all — the single most persuasive element on the page was desktop + only. It stacks under the copy on small screens. */} +
    diff --git a/src/components/landing/HowItWorks.tsx b/src/components/landing/HowItWorks.tsx index 17759dd..dabe750 100644 --- a/src/components/landing/HowItWorks.tsx +++ b/src/components/landing/HowItWorks.tsx @@ -18,7 +18,7 @@ export default function HowItWorks() {

    Three steps. Under a minute.

    -

    +

    No training required. If your team can take a photo, they can use ChefCode.

    @@ -38,7 +38,7 @@ export default function HowItWorks() {

    {s.title}

    -

    {s.desc}

    +

    {s.desc}

    {i < steps.length - 1 && ( diff --git a/src/components/landing/InvoiceDemo.tsx b/src/components/landing/InvoiceDemo.tsx index 7155bea..e262a9e 100644 --- a/src/components/landing/InvoiceDemo.tsx +++ b/src/components/landing/InvoiceDemo.tsx @@ -22,12 +22,12 @@ export default function InvoiceDemo() { Invoice #INV-2847
    - Sysco Foods + Sysco Foods
    {/* ── Body ── */}
    -
    +
    Item Qty Price @@ -50,10 +50,10 @@ export default function InvoiceDemo() { )} {item.name}
    - {item.qty} + {item.qty}
    {item.price} - {item.spike && {item.spike}} + {item.spike && {item.spike}}
    {item.gl}
    @@ -76,7 +76,7 @@ export default function InvoiceDemo() { {/* ── Footer ── */}
    - Processed in 47 seconds + Processed in 47 seconds 98% confidence
    diff --git a/src/components/landing/Navbar.tsx b/src/components/landing/Navbar.tsx index 75dcad7..85633d6 100644 --- a/src/components/landing/Navbar.tsx +++ b/src/components/landing/Navbar.tsx @@ -18,6 +18,21 @@ export default function Navbar() { return () => window.removeEventListener('scroll', onScroll); }, []); + // While the sheet is open the page behind it must not scroll — otherwise + // the content slides around under a menu that looks fixed. Escape closes it, + // because a panel you can open from the keyboard you must be able to leave. + useEffect(() => { + if (!mobileOpen) return; + const prev = document.body.style.overflow; + document.body.style.overflow = 'hidden'; + const onKey = (e: KeyboardEvent) => { if (e.key === 'Escape') setMobileOpen(false); }; + window.addEventListener('keydown', onKey); + return () => { + document.body.style.overflow = prev; + window.removeEventListener('keydown', onKey); + }; + }, [mobileOpen]); + return (
    - {/* ── Mobile menu ── */} - {mobileOpen && ( -
    + {/* ── Mobile menu ── + Kept mounted and toggled with classes rather than conditionally + rendered, so it animates on the way out as well as in — a panel that + slides open and then vanishes reads as broken. The scrim dims the page + behind it and closes on tap. */} +
    setMobileOpen(false)} + aria-hidden="true" + className={`md:hidden fixed inset-0 top-[72px] bg-brand-900/20 transition-opacity duration-200 ${ + mobileOpen ? 'opacity-100' : 'opacity-0 pointer-events-none' + }`} + /> +
    {links.map((l) => (
    -
    - )} +
    ); } diff --git a/src/components/landing/PainPoints.tsx b/src/components/landing/PainPoints.tsx index 324bcb5..6592c66 100644 --- a/src/components/landing/PainPoints.tsx +++ b/src/components/landing/PainPoints.tsx @@ -30,7 +30,7 @@ export default function PainPoints() {

    Your invoices are costing you more than you think

    -

    +

    Food service teams lose thousands every month to invisible inefficiencies.

    @@ -45,7 +45,7 @@ export default function PainPoints() {

    {p.title}

    -

    {p.desc}

    +

    {p.desc}

    ))} diff --git a/src/components/landing/Pricing.tsx b/src/components/landing/Pricing.tsx index 7c78df4..5712757 100644 --- a/src/components/landing/Pricing.tsx +++ b/src/components/landing/Pricing.tsx @@ -43,19 +43,19 @@ export default function Pricing() {

    Pricing

    Simple pricing. No surprises.

    -

    Start free for 15 days. No credit card required.

    +

    Start free for 15 days. No credit card required.

    - Monthly + Monthly - + YearlySave 20%
    @@ -78,13 +78,13 @@ export default function Pricing() {

    {p.name}

    -

    {p.desc}

    +

    {p.desc}

    {p.price.monthly !== null ? (
    ${yearly ? p.price.yearly : p.price.monthly} - /month + /month
    ) : (
    Custom
    @@ -96,7 +96,7 @@ export default function Pricing() { {...(p.href.startsWith('http') ? { target: '_blank', rel: 'noopener noreferrer' } : {})} - className={`block w-full text-center py-3 rounded-xl text-sm font-semibold transition-all ${ + className={`press block w-full text-center py-3 rounded-xl text-sm font-semibold ${ p.featured ? 'bg-brand-600 text-cream hover:bg-brand-700 shadow-lg shadow-brand-600/25' : 'bg-brand-900 text-cream hover:bg-brand-800' }`} > @@ -107,7 +107,7 @@ export default function Pricing() { {p.items.map((item, j) => (
  • - {item} + {item}
  • ))} diff --git a/src/components/landing/Security.tsx b/src/components/landing/Security.tsx index 931e4d5..954cc60 100644 --- a/src/components/landing/Security.tsx +++ b/src/components/landing/Security.tsx @@ -19,7 +19,7 @@ export default function Security() { const ref = useReveal(); return ( -
    +
    @@ -34,7 +34,7 @@ export default function Security() {

    Your data is safer here than in a filing cabinet

    -

    +

    Built from day one for multi-tenant food service organizations that answer to auditors, controllers, and compliance teams.

    @@ -50,7 +50,7 @@ export default function Security() {

    {b.label}

    -

    {b.desc}

    +

    {b.desc}

    ))} diff --git a/src/components/landing/Stats.tsx b/src/components/landing/Stats.tsx index daa4a21..0456d78 100644 --- a/src/components/landing/Stats.tsx +++ b/src/components/landing/Stats.tsx @@ -17,7 +17,7 @@ export default function Stats() { {stats.map((s, i) => (

    {s.value}

    -

    {s.label}

    +

    {s.label}

    ))}
    diff --git a/src/index.css b/src/index.css index 3b4dc5d..40f04a6 100644 --- a/src/index.css +++ b/src/index.css @@ -75,6 +75,60 @@ body { ::-webkit-scrollbar-thumb { background: #c7bb91; border-radius: 4px; } ::-webkit-scrollbar-thumb:hover { background: #157559; } +/* ── Focus visibility ────────────────────────────── */ +/* Nothing in the site defined a focus style, so Tailwind's preflight reset + left keyboard users with no visible focus at all (outline-style computed to + `none` on every button and link). The ring colour is a variable so dark + sections can flip it to a light tone — a green ring on brand-900 is + invisible, which would have been the same bug in a different costume. */ +:root { --focus-ring: #0e4a39; } + +:focus-visible { + outline: 2px solid var(--focus-ring); + outline-offset: 2px; + border-radius: 2px; +} + +/* Dark regions: the security band and the final CTA card. */ +.on-dark { --focus-ring: #d6ebe0; } + +/* ── Press feedback ──────────────────────────────── */ +/* Feedback belongs on pointer-down, not on release. Without this a tap on a + phone gives no acknowledgement at all until the next page paints. */ +.press { + transition: transform 100ms ease-out, background-color 150ms ease-out, + border-color 150ms ease-out, color 150ms ease-out; +} +.press:active { transform: scale(0.97); } + +/* ── Reduced motion ──────────────────────────────── */ +/* Reduced motion means a gentler equivalent, not nothing: the reveal still + cross-fades so content arrival stays legible, it just stops travelling. */ +@media (prefers-reduced-motion: reduce) { + html { scroll-behavior: auto; } + + .reveal { transition: opacity 200ms ease !important; } + .reveal.reveal-ready { transform: none !important; } + + .press:active { transform: none; opacity: 0.85; } + + /* Kill decorative looping animations and any transform-based movement, + while leaving colour and opacity transitions that aid comprehension. */ + .scan-line, .animate-float, .animate-pulse-slow, .animate-scan { animation: none !important; } + .animate-fade-in-down, .animate-fade-in-up, .animate-fade-in, + .animate-slide-in-left, .animate-slide-in-right, .animate-scale-in { + animation-duration: 0.01ms !important; + animation-iteration-count: 1 !important; + } + *, *::before, *::after { scroll-behavior: auto !important; } +} + +/* ── Reduced transparency ────────────────────────── */ +@media (prefers-reduced-transparency: reduce) { + .backdrop-blur-lg, .backdrop-blur { backdrop-filter: none !important; } + nav.bg-cream\/85 { background-color: #faf6e8 !important; } +} + /* ── Policy pages: printing / "Save as PDF" ──────── */ /* Reviewers attach these to a vendor file, so the printed copy drops the site chrome, prints black-on-white, and shows link targets inline. */ diff --git a/src/pages/SetupGuide.tsx b/src/pages/SetupGuide.tsx index b7c182f..03fd6b7 100644 --- a/src/pages/SetupGuide.tsx +++ b/src/pages/SetupGuide.tsx @@ -35,14 +35,14 @@ export default function SetupGuide() { {/* Header */}

    Getting started

    Setup guide

    -

    +

    From sign-up to your first coded invoice in about 20 minutes. Do the steps in order — each one builds on the last.

    {/* Gather first */}
    -

    Gather these first

    +

    Gather these first

    @@ -79,7 +79,7 @@ export default function SetupGuide() {

    {s.title}

    -

    {s.body}

    +

    {s.body}

    ))} @@ -104,7 +104,7 @@ export default function SetupGuide() { {faqs.map((f) => (

    {f.q}

    -

    {f.a}

    +

    {f.a}

    ))} From 4a64f44e506901ebcbc2168bdd700ce25ac4d160 Mon Sep 17 00:00:00 2001 From: AJith Elumalai Date: Sat, 3 Oct 2026 19:20:03 -0700 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20site=20audit=20=E2=80=94=20false=20f?= =?UTF-8?q?eature=20claims,=20broken=20navigation,=20soft=20404s,=20securi?= =?UTF-8?q?ty=20headers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A full audit of chefcode.cc, looking at what earlier passes had not: server behaviour on the real domain, navigation between pages, and whether the features the site sells actually exist in the code. THE SITE WAS SELLING FEATURES THAT DO NOT EXIST Checked every claim against the application source: QuickBooks integration no code Pricing (Pro), How It Works Approval workflows no code Pricing (Pro), Features — and the app never sets an 'approved' status SSO / SAML no code Pricing (Enterprise), login screen API access no code Pricing (Enterprise) Vendor EDI connections no code Pricing (Enterprise), login screen "alerts above your detection is real but fixed at 10%; nothing is threshold" sent anywhere "notifications keep the the only outbound call is the team invite email right people in the loop" 98% accuracy, 10+ hrs never measured "Full audit trail" a second copy survived the earlier fix Professional at $199 was being sold on QuickBooks and approval workflows. A customer upgrading for either would have got nothing. Replaced with features verified in code before they were named: duplicate invoice detection (checkForDuplicate, scoped per location), per-location access control (access_location_ids), spend analytics by GL category and month. Enterprise now offers "custom integrations, scoped with you" — true of a negotiated contract, without claiming anything is already built. The stats row now carries only checkable facts, including "0 invoice images stored". NAVIGATION - Navbar links were bare "#features" hashes. On /privacy, /terms, /security, /dpa and /setup every one pointed at an anchor that does not exist there and did nothing — including "Security" on the Security page. Rooted at "/". - Arriving at /#pricing landed at the top of the page: the landing page is lazy-loaded, so the browser's native jump runs before the section exists. LandingPage now jumps on mount. Two traps avoided: an implicit smooth scroll (inherited from CSS) needs animation frames to advance, and so does requestAnimationFrame — both are suspended in a tab opened in the background, the normal way people open links from email. The jump is synchronous and instant, re-aligns after web fonts land, and backs off the moment the visitor scrolls themselves. Verified with real link clicks from several pages: target lands exactly at the 80px scroll-padding. - Every route shared one browser-tab title. Each page now names itself. SERVER BEHAVIOUR - Every unknown URL returned 200 with the homepage — /blog, /careers, typos, all of it. Search engines saw unlimited duplicate homepages and a lost visitor never learned they were lost. vercel.json now rewrites only the real routes; anything else gets a real HTTP 404 with a branded page. The router matches exactly too, so /setupfoo no longer renders a page the server 404s. - robots.txt and sitemap.xml were served as the HTML app shell. Both are now real files; /app is excluded from indexing. - Security headers: only HSTS was present. Adds X-Frame-Options (the /app login could be framed — a clickjacking surface), nosniff, Referrer-Policy and Permissions-Policy. CSP ships as Report-Only: tested ENFORCING against a local emulation of Vercel's routing, with zero violations on every page including the login screen and its live Supabase query — but the signed-in invoice flow (Gemini, a Web Worker) cannot be exercised without an account, so it reports rather than blocks until that is confirmed. SMALLER - "See How It Works" had a play icon; there is no video. Now a down arrow. - apple-touch-icon was an SVG, which iOS ignores — saving the site to a home screen produced a screenshot. Now a 180px PNG from the logo geometry. - Removed a dead esm.sh importmap: zero references in any built chunk, and as an inline script it would block an enforcing CSP. - The page painted grey (bg-slate-50) before the stylesheet arrived; it is now cream from the first frame. - Privacy Policy and DPA said they listed every third party and omitted Unsplash, which serves the sign-in photo and receives each visitor's IP. Verified: 23/23 routes return the right status, 0 dead links, 0 of the false claims remain in the build, all 19 chunks parse, 0 type errors. Co-Authored-By: Claude Opus 5.5 --- components/Login.tsx | 2 +- index.html | 29 +++-------- public/apple-touch-icon.png | Bin 0 -> 6221 bytes public/robots.txt | 8 +++ public/sitemap.xml | 9 ++++ src/Router.tsx | 35 +++++++++---- src/components/landing/Features.tsx | 18 +++---- src/components/landing/Hero.tsx | 7 ++- src/components/landing/HowItWorks.tsx | 4 +- src/components/landing/Navbar.tsx | 12 +++-- src/components/landing/Pricing.tsx | 6 +-- src/components/landing/Stats.tsx | 10 ++-- src/components/legal/LegalLayout.tsx | 3 ++ src/hooks/useDocumentTitle.ts | 20 +++++++ src/pages/DataProcessing.tsx | 1 + src/pages/LandingPage.tsx | 49 ++++++++++++++++++ src/pages/NotFound.tsx | 72 ++++++++++++++++++++++++++ src/pages/Privacy.tsx | 1 + src/pages/SetupGuide.tsx | 3 ++ vercel.json | 20 ++++++- vite.config.ts | 23 +++++++- 21 files changed, 272 insertions(+), 60 deletions(-) create mode 100644 public/apple-touch-icon.png create mode 100644 public/robots.txt create mode 100644 public/sitemap.xml create mode 100644 src/hooks/useDocumentTitle.ts create mode 100644 src/pages/NotFound.tsx diff --git a/components/Login.tsx b/components/Login.tsx index 0e4afba..ec3b1b7 100644 --- a/components/Login.tsx +++ b/components/Login.tsx @@ -436,7 +436,7 @@ export const Login: React.FC = ({ onLogin }) => {

    Need Enterprise?

    -

    Unlimited locations + SSO + EDI

    +

    Unlimited locations + custom integrations

    diff --git a/index.html b/index.html index 67e2f00..4d3f1a4 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ - + ChefCode.ai — AI Invoice Coding - - +
    diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..0e8285c68fd049459664a0746d8174df2997a8e9 GIT binary patch literal 6221 zcmaKxcQ71YyT_LhD}vQmw@N|~1hEKViC$NtwZGUD?TZ-`HA4cOLT81KG<(>YNOqOyFTu{TP829DiHvtnAIP zH9B5mybJBzs?PB&S}`s4-_K75=~C|0(}>eT>Bsf5gcx)9n9c-$Vkt0Sc8VlE;1b`t? zpaMp55)26h`e*i=#GeQ(j{uM)N^c@sSy(5%w&oTqag%|W- zF`Ft9upEnW)ts7CF48G0Q79@5*lELOGF=YH2bReM`AbV(bS1-XgiFd*B@_wHifqfhMyq4VfCQ)l>sVn8m~+G`w!Q3xfOke zHW>=D?^{ah0z)QF43)vJoICI_No-;YAcVtUgo`=g=UUGGgX(~>%q|Zud(93aWiLAew_5x#s?V2NYul}R_JRF4icg`dYi210i=+f#J4MmDs8oe?Qo| zE_6G|%-5CT35DLRb2UZ|Sq6sLd-jS{T-J?SxzfVZyE^eq9Zx%#!K!GiRgx7~g4l<= zPy)tGZj581FkKMp19}RGpwo7DcQvg(Dls{cVziLR0Wk-OBr$hRZZyqQ7EzZrZj1`w z9wVXxnK3XKlj5;T1j^{ZV$pUG>R45LZ|P5I>jX0pFEp8TvatKqcU0 z4MIRq77eej0AzT)`gIGjrxffrzm0s-*(3aM&Qy?eDlw~2E z_JhOq2KKzrE6={o(m@D{xS#`MGpbBOI^OM@bTMQff__GJXv8u#dW|JaJUA7E36`_R zs9y&l@G;nj*?&(zEYmY<-D@ZBrn}ejH>-$6G`L~1`UX!A^kOL{`HRk3(%~~3h1~}W zhp^yh__uuaQ%1X9RF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2c1$Jg;uCeL6L5;ZwsK?bgbNwkc^zSbU5XoXNeUjOa|&tJvL%H>p9xC~ z3QPgei!Hl>^x>$uiSh=g!50DYMs}Uzu%(lGWcCopH2bvf<%BJ#1u1)+o^*E&ADyH6 zwWN;;5U`tZ(}B{VRVhwv>ZouSRq67!g7=kZ-d+G_PBMyNsKI_bds=xcGPSpb?g`~} z+1AG8D2oP4Y|C`TZnvB9$Eo^6Z9|7EP6L5eeqbZ9#S~x_%2hz++_LLm&ZY=kT>$%} z{Z|^Cjqk|1DH;ZKsFYfo4s+th%gqUOgZ3gW>2i?M{dbBDFmk?C-`t;;(W7V65;DW- z{_{NqlH_eU+5HA1M9AZCMjnTBX5hhDZmdnYO|9L``nX@;8>vEevbRl!uN?tK0GHKjgZ%Jx__ zYM8edyDARL&@GTf91g<*V8EA>Vz!nq@}DMsV3P{{-6LD1pYAh_7?gtiuv*wB?1hnc zcgH_MV;SvrWg?Q>Dr>oBFN2I$+;kHyXqzsrP1L)51ps(cKGhDiEhadNLGdFe{FwPY zMHEH0F9f7CE3Pjp#4i6GTOwVvK_n(|LQOy0wV@V+b$}fB$#*}Npwr1f%B#%@k#Nwv z+o{uY0nUdP>p7wn0W~!{+dIy>Cr5SV-BA&Tt!(su=?Q#=Fut#E%u`&9Z@q}c;u4FC z+03M!|154@v4j`Pnr&b(6=@!2Bvt!kMn#V9NqV$W2ikyIaPa_zRf$s-rxFvwJVDpitwm!Jc! z*gp_jfb1U#{dWEpuir(pZ}H-1=*2fv;*G--x3?=Mh`?#{8{zrgeVLC^m;sQxed{|?)sSgd04CBUwM0)XZtJ=JoUZPb4N-6P}0 literal 0 HcmV?d00001 diff --git a/public/robots.txt b/public/robots.txt new file mode 100644 index 0000000..2cf23f0 --- /dev/null +++ b/public/robots.txt @@ -0,0 +1,8 @@ +User-agent: * +Allow: / + +# The signed-in product. To a crawler it is only a login screen, and indexing +# it would put a sign-in form in search results instead of the landing page. +Disallow: /app + +Sitemap: https://www.chefcode.cc/sitemap.xml diff --git a/public/sitemap.xml b/public/sitemap.xml new file mode 100644 index 0000000..cbcff60 --- /dev/null +++ b/public/sitemap.xml @@ -0,0 +1,9 @@ + + + https://www.chefcode.cc/weekly1.0 + https://www.chefcode.cc/setupmonthly0.6 + https://www.chefcode.cc/securitymonthly0.6 + https://www.chefcode.cc/privacyyearly0.3 + https://www.chefcode.cc/termsyearly0.3 + https://www.chefcode.cc/dpayearly0.3 + diff --git a/src/Router.tsx b/src/Router.tsx index 5fcbc25..84ee7d0 100644 --- a/src/Router.tsx +++ b/src/Router.tsx @@ -8,10 +8,11 @@ const Privacy = lazy(() => import('./pages/Privacy')); const Terms = lazy(() => import('./pages/Terms')); const SecurityOverview = lazy(() => import('./pages/SecurityOverview')); const DataProcessing = lazy(() => import('./pages/DataProcessing')); +const NotFound = lazy(() => import('./pages/NotFound')); -// Policy pages. Longest-prefix-free: none of these is a prefix of another, and -// none collides with the landing page's #security anchor (that's a hash, not a -// path). Kept in one table so adding a page is a single line. +// Policy pages, matched exactly. None collides with the landing page's +// #security anchor — that's a hash, not a path. Kept in one table so adding a +// page is one line here plus one entry in vercel.json's rewrites. const LEGAL_ROUTES: Array<[string, React.LazyExoticComponent<() => JSX.Element>]> = [ ['/privacy', Privacy], ['/terms', Terms], @@ -33,8 +34,14 @@ export default function Router() { return () => window.removeEventListener('popstate', onNav); }, []); - // Any path starting with /app loads the existing product - if (path.startsWith('/app')) { + // Matching is exact, not prefix. With startsWith, /setupfoo or + // /security-team rendered a real page while the server (vercel.json) answered + // the same URL with a 404 — two halves of the site disagreeing about which + // pages exist. These rules must stay in step with the rewrites there. + const clean = path.length > 1 ? path.replace(/\/+$/, '') : path; + + // The product: /app, plus anything beneath it (auth redirects land on /app). + if (clean === '/app' || clean.startsWith('/app/')) { return ( }> @@ -42,8 +49,7 @@ export default function Router() { ); } - // Setup guide page - if (path.startsWith('/setup')) { + if (clean === '/setup') { return ( }> @@ -51,8 +57,7 @@ export default function Router() { ); } - // Policy pages - const legal = LEGAL_ROUTES.find(([prefix]) => path.startsWith(prefix)); + const legal = LEGAL_ROUTES.find(([route]) => clean === route); if (legal) { const Page = legal[1]; return ( @@ -62,10 +67,18 @@ export default function Router() { ); } - // Everything else shows the landing page + if (clean === '/' || clean === '/index.html') { + return ( + }> + + + ); + } + + // Anything else is not a page. return ( }> - + ); } diff --git a/src/components/landing/Features.tsx b/src/components/landing/Features.tsx index 07d2754..adcc69a 100644 --- a/src/components/landing/Features.tsx +++ b/src/components/landing/Features.tsx @@ -1,16 +1,16 @@ import { - Scan, TrendingUp, BookOpen, Users, Bell, BarChart3, + Scan, TrendingUp, BookOpen, Users, CopyCheck, BarChart3, GraduationCap, Hotel, Check, } from 'lucide-react'; import { useReveal } from '../../hooks/useReveal'; const features = [ - { icon: Scan, title: 'AI invoice extraction', desc: 'Upload any format — PDF, photo, email attachment. Line items extracted in seconds with 98% accuracy.' }, - { icon: TrendingUp, title: 'Price spike detection', desc: 'Automatic alerts when a vendor raises prices above your threshold. Catch overcharges before they hit your P&L.' }, + { icon: Scan, title: 'AI invoice extraction', desc: 'Upload a PDF or snap a photo on your phone. Every line item is read and structured in seconds, ready for you to review.' }, + { icon: TrendingUp, title: 'Price change detection', desc: 'Every line is checked against what you last paid for that item. Anything more than 10% higher is flagged while you review.' }, { icon: BookOpen, title: 'Auto GL coding', desc: 'Every line item auto-categorized to your chart of accounts. No more back-and-forth with accounting.' }, { icon: Users, title: 'Role-based access', desc: 'Owner, Manager, Chef, Viewer — each role sees exactly what they need. Nothing more, nothing less.' }, - { icon: Bell, title: 'Approval workflow', desc: 'Invoices flow from upload to review to approval. Notifications keep the right people in the loop.' }, - { icon: BarChart3, title: 'Spend analytics', desc: 'Monthly spend by category, vendor, and location. Spot trends. Make data-driven purchasing decisions.' }, + { icon: CopyCheck, title: 'Duplicate detection', desc: 'Upload the same invoice twice and ChefCode catches it, so nothing gets coded — or paid — twice.' }, + { icon: BarChart3, title: 'Spend analytics', desc: 'Monthly spend broken down by GL category, with every flagged price change on one screen.' }, ]; const verticals = [ @@ -23,7 +23,7 @@ const verticals = [ 'GL code mapping for institutional accounting', 'Works alongside CBORD & Computrition', 'FERPA-safe — zero student data touched', - 'Full audit trail for compliance reviews', + 'Every invoice traceable to who processed it', ], }, { @@ -31,9 +31,9 @@ const verticals = [ title: 'Hotels & Hospitality', color: 'from-brand-600 to-brand-400', points: [ - 'Multi-property invoice consolidation', - 'Role-based access (GM, Chef, Controller)', - 'Price spike alerts across all vendors', + 'Invoices tracked per property', + 'Role-based access for GMs, chefs and controllers', + 'Price change flags across every vendor', 'Sysco, US Foods, Freshpoint pre-loaded', 'Encrypted data with SOC 2 compliant hosting', ], diff --git a/src/components/landing/Hero.tsx b/src/components/landing/Hero.tsx index 8177746..343f0fd 100644 --- a/src/components/landing/Hero.tsx +++ b/src/components/landing/Hero.tsx @@ -1,4 +1,4 @@ -import { ArrowRight, Play, GraduationCap } from 'lucide-react'; +import { ArrowRight, ArrowDown, GraduationCap } from 'lucide-react'; import InvoiceDemo from './InvoiceDemo'; export default function Hero() { @@ -46,7 +46,10 @@ export default function Hero() { href="#how-it-works" className="press group inline-flex items-center justify-center gap-2 px-7 py-3.5 rounded-xl bg-white border border-cream-300 text-brand-800 font-medium text-base hover:border-brand-300" > - + {/* Was a play triangle, which promises a video. There is no + video — this scrolls to the three-step explainer — so the + icon now says what the button actually does. */} + See How It Works
    diff --git a/src/components/landing/HowItWorks.tsx b/src/components/landing/HowItWorks.tsx index dabe750..3f307b4 100644 --- a/src/components/landing/HowItWorks.tsx +++ b/src/components/landing/HowItWorks.tsx @@ -2,9 +2,9 @@ import { Upload, Cpu, CheckCircle, ArrowRight } from 'lucide-react'; import { useReveal } from '../../hooks/useReveal'; const steps = [ - { num: '01', icon: Upload, title: 'Upload', desc: 'Snap a photo with your phone or drop a PDF. We accept any invoice format from any vendor.' }, + { num: '01', icon: Upload, title: 'Upload', desc: 'Snap a photo with your phone or drop in a PDF, from any vendor.' }, { num: '02', icon: Cpu, title: 'AI extracts', desc: 'Line items, GL codes, vendor match, product identification — all extracted in under 60 seconds.' }, - { num: '03', icon: CheckCircle, title: 'Review & export', desc: 'Approve invoices, catch price spikes, and export to QuickBooks or CSV in one click.' }, + { num: '03', icon: CheckCircle, title: 'Review & export', desc: 'Check the coded lines, catch price changes, and export a PDF summary or CSV in one click.' }, ]; export default function HowItWorks() { diff --git a/src/components/landing/Navbar.tsx b/src/components/landing/Navbar.tsx index 85633d6..8d480f3 100644 --- a/src/components/landing/Navbar.tsx +++ b/src/components/landing/Navbar.tsx @@ -1,11 +1,15 @@ import { useState, useEffect } from 'react'; import { Menu, X } from 'lucide-react'; +// Rooted at "/" so they work from every page. As bare "#features" they only +// resolved on the homepage: on /privacy, /terms, /security, /dpa and /setup +// every one pointed at an anchor that doesn't exist there, and clicking them +// did nothing at all — including "Security" while on the Security page. const links = [ - { label: 'Features', href: '#features' }, - { label: 'How It Works', href: '#how-it-works' }, - { label: 'Security', href: '#security' }, - { label: 'Pricing', href: '#pricing' }, + { label: 'Features', href: '/#features' }, + { label: 'How It Works', href: '/#how-it-works' }, + { label: 'Security', href: '/#security' }, + { label: 'Pricing', href: '/#pricing' }, ]; export default function Navbar() { diff --git a/src/components/landing/Pricing.tsx b/src/components/landing/Pricing.tsx index 5712757..977e367 100644 --- a/src/components/landing/Pricing.tsx +++ b/src/components/landing/Pricing.tsx @@ -11,7 +11,7 @@ const plans = [ cta: 'Start Free Trial', href: '/app', featured: false, - items: ['1 location', '3 team members', '200 invoices / month', 'AI extraction + GL coding', 'Price spike alerts', 'CSV export', 'Email support'], + items: ['1 location', '3 team members', '200 invoices / month', 'AI extraction + GL coding', 'Price change detection', 'PDF + CSV export', 'Email support'], }, { name: 'Professional', @@ -20,7 +20,7 @@ const plans = [ cta: 'Start Free Trial', href: '/app', featured: true, - items: ['Up to 5 locations', '15 team members', '1,000 invoices / month', 'Everything in Starter', 'QuickBooks integration', 'Spend analytics dashboard', 'Approval workflows', 'Priority support'], + items: ['Up to 5 locations', '15 team members', '1,000 invoices / month', 'Everything in Starter', 'Spend analytics dashboard', 'Duplicate invoice detection', 'Per-location access control', 'Priority support'], }, { name: 'Enterprise', @@ -29,7 +29,7 @@ const plans = [ cta: 'Book a Demo', href: DEMO_BOOKING_URL, featured: false, - items: ['Unlimited locations', 'Unlimited team members', 'Unlimited invoices', 'Everything in Professional', 'SSO / SAML integration', 'API access', 'Vendor EDI connections', 'Dedicated account manager', 'Custom onboarding'], + items: ['Unlimited locations', 'Unlimited team members', 'Unlimited invoices', 'Everything in Professional', 'Custom integrations, scoped with you', 'Signed DPA + security review support', 'Dedicated account manager', 'Custom onboarding'], }, ]; diff --git a/src/components/landing/Stats.tsx b/src/components/landing/Stats.tsx index 0456d78..548fb7a 100644 --- a/src/components/landing/Stats.tsx +++ b/src/components/landing/Stats.tsx @@ -1,9 +1,13 @@ import { useReveal } from '../../hooks/useReveal'; +// Each of these is a fact a buyer can check, not a figure they have to trust. +// This row used to claim "98% AI extraction accuracy" and "10+ hrs saved per +// week, per team" — neither was measured, and an unsourced number is the first +// thing a careful buyer asks about and the last thing you want to defend. const stats = [ - { value: '< 60s', label: 'Invoice processing time' }, - { value: '98%', label: 'AI extraction accuracy' }, - { value: '10+ hrs', label: 'Saved per week, per team' }, + { value: '< 60s', label: 'To code a typical invoice' }, + { value: '0', label: 'Invoice images stored' }, + { value: '15 days', label: 'Free trial, no card' }, { value: '$0', label: 'Setup fee' }, ]; diff --git a/src/components/legal/LegalLayout.tsx b/src/components/legal/LegalLayout.tsx index 1235cbf..06d9e3a 100644 --- a/src/components/legal/LegalLayout.tsx +++ b/src/components/legal/LegalLayout.tsx @@ -2,6 +2,7 @@ import { ReactNode } from 'react'; import { Printer } from 'lucide-react'; import Navbar from '../landing/Navbar'; import Footer from '../landing/Footer'; +import { useDocumentTitle } from '../../hooks/useDocumentTitle'; // Shared chrome for the policy pages (/privacy, /terms, /security, /dpa). // One place for the measure, the type scale and the "last updated" stamp, so @@ -18,6 +19,8 @@ interface Props { } export default function LegalLayout({ eyebrow, title, updated, summary, children }: Props) { + useDocumentTitle(title); + return ( <>
    diff --git a/src/hooks/useDocumentTitle.ts b/src/hooks/useDocumentTitle.ts new file mode 100644 index 0000000..9f6c601 --- /dev/null +++ b/src/hooks/useDocumentTitle.ts @@ -0,0 +1,20 @@ +import { useEffect } from 'react'; + +const SITE = 'ChefCode.ai'; + +/** + * Sets the browser tab title for a page, and restores the previous one on + * unmount. Every route used to share index.html's title, so a reviewer with + * Privacy, Terms and the Security Overview open in three tabs saw three + * identical tabs — and a bookmark or history entry could not say which page it + * was. Pass the page name only; the site name is appended. + */ +export function useDocumentTitle(page?: string) { + useEffect(() => { + const previous = document.title; + document.title = page ? `${page} — ${SITE}` : `${SITE} — AI Invoice Coding`; + return () => { + document.title = previous; + }; + }, [page]); +} diff --git a/src/pages/DataProcessing.tsx b/src/pages/DataProcessing.tsx index d80fc60..62216be 100644 --- a/src/pages/DataProcessing.tsx +++ b/src/pages/DataProcessing.tsx @@ -59,6 +59,7 @@ export default function DataProcessing() { ['Google LLC', 'Invoice text extraction (Gemini API)', 'The uploaded invoice document only', 'United States'], ['Vercel', 'Application hosting and CDN', 'Request metadata including IP address', 'Global edge, United States origin'], ['Google LLC', 'Web font delivery', 'IP address at page load', 'Global edge'], + ['Unsplash', 'Image delivery on the sign-in screen', 'IP address when the sign-in screen loads', 'Global edge'], ]} /> diff --git a/src/pages/LandingPage.tsx b/src/pages/LandingPage.tsx index e2a430a..818f774 100644 --- a/src/pages/LandingPage.tsx +++ b/src/pages/LandingPage.tsx @@ -1,3 +1,4 @@ +import { useEffect } from 'react'; import Navbar from '../components/landing/Navbar'; import Hero from '../components/landing/Hero'; import PainPoints from '../components/landing/PainPoints'; @@ -8,8 +9,56 @@ import Security from '../components/landing/Security'; import Pricing from '../components/landing/Pricing'; import FinalCTA from '../components/landing/FinalCTA'; import Footer from '../components/landing/Footer'; +import { useDocumentTitle } from '../hooks/useDocumentTitle'; export default function LandingPage() { + useDocumentTitle(); + + // Honour the #anchor on arrival. This page is lazy-loaded, so when a visitor + // lands on /#pricing the browser attempts its native jump before the section + // exists, finds nothing, and leaves them at the top. That broke every + // "/#features"-style link from the other pages, the footer, and any link to + // a section pasted into an email. Runs once, after the sections are in the + // DOM; an instant jump is right for arrival — smooth-scrolling down from the + // hero on page load would just be motion for its own sake. + // + // Two details that matter: + // - behavior is explicit. Left out, scrollIntoView inherits the page's + // `scroll-behavior: smooth`, and a 4,700px glide needs animation frames to + // advance — so in a tab that isn't painting yet (opened in the background + // from an email) it simply never moves. + // - the jump is synchronous, not deferred to a requestAnimationFrame, for + // the same reason: frames are suspended until a tab is visible. An instant + // scroll forces layout itself and needs no frame. + // + // Web fonts can land after the jump and reflow the hero above the target, + // nudging it off position, so it re-aligns once they are ready — unless the + // visitor has started scrolling, in which case they are in control and the + // page must not be yanked out from under them. + useEffect(() => { + const id = decodeURIComponent(window.location.hash.slice(1)); + if (!id) return; + + const jump = () => + document.getElementById(id)?.scrollIntoView({ block: 'start', behavior: 'instant' }); + jump(); + + let userTookOver = false; + const takeOver = () => { userTookOver = true; }; + const intents = ['wheel', 'touchmove', 'keydown', 'pointerdown'] as const; + intents.forEach((e) => window.addEventListener(e, takeOver, { passive: true })); + + let cancelled = false; + document.fonts?.ready.then(() => { + if (!cancelled && !userTookOver) jump(); + }); + + return () => { + cancelled = true; + intents.forEach((e) => window.removeEventListener(e, takeOver)); + }; + }, []); + return ( <> diff --git a/src/pages/NotFound.tsx b/src/pages/NotFound.tsx new file mode 100644 index 0000000..39f77e0 --- /dev/null +++ b/src/pages/NotFound.tsx @@ -0,0 +1,72 @@ +import { useEffect } from 'react'; +import { ArrowLeft } from 'lucide-react'; +import Navbar from '../components/landing/Navbar'; +import Footer from '../components/landing/Footer'; +import { useDocumentTitle } from '../hooks/useDocumentTitle'; + +// Shown for any path that is not a real page. Vercel serves this with an HTTP +// 404 status (see vercel.json and the emit-404 plugin in vite.config.ts); the +// noindex tag below is a second line of defence for anything that reaches it +// with a 200. Previously every unknown URL rendered the full landing page, +// which told a mistyped visitor nothing and gave search engines an unbounded +// number of duplicate homepages. + +const destinations = [ + { label: 'Home', href: '/', note: 'What ChefCode does' }, + { label: 'Pricing', href: '/#pricing', note: 'Plans and the free trial' }, + { label: 'Setup guide', href: '/setup', note: 'From sign-up to first invoice' }, + { label: 'Security Overview', href: '/security', note: 'For your IT or compliance review' }, +]; + +export default function NotFound() { + useDocumentTitle('Page not found'); + + useEffect(() => { + const meta = document.createElement('meta'); + meta.name = 'robots'; + meta.content = 'noindex'; + document.head.appendChild(meta); + return () => meta.remove(); + }, []); + + return ( + <> + +
    +
    +

    404

    +

    + This page doesn’t exist. +

    +

    + The address {window.location.pathname}{' '} + isn’t a page on this site. It may have been mistyped, or the link that sent you here is out of date. +

    + + + + + + Back to the homepage + +
    +
    +