Skip to content

Design audit + landing page tightening: accessibility, mobile, performance, typography, conversion - #43

Merged
lmammino merged 28 commits into
mainfrom
fix/design-audit
Nov 8, 2026
Merged

lmammino merged 28 commits into
mainfrom
fix/design-audit

Conversation

@lmammino

@lmammino lmammino commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes everything from a design/technical audit of the landing page, blog index and articles (accessibility, mobile, motion, performance, typography), plus a PRODUCT.md with product context.

 Layout
+  <a href="#main-content">Skip to content</a>
+  <script is:inline> apply saved theme before first paint
   <Navigation aria-label="Main">        # rendered once (was twice on home), reveals itself on focus
     #mobile-menu                         # inert while collapsed
 index.astro
-  <Navigation />
+  <main id="main-content">
-    <ParallaxBackground client:load />  # React + framer-motion, re-rendered on every scroll
+    <HeroBackdrop />                     # CSS-only, transform drift, still under reduced motion
-    <AnimatedCounter client:load /> x4  # rendered "0" in HTML
+    <Counters />                         # real values in HTML + ~1KB count-up script
-    <Star /> x5 per review (184 SVGs)
+    <StarRating rating={4.6} />          # one masked element, aria-label
     Chapters / FAQ                       # heading > button[aria-expanded] (were div / h5-in-button)
     TrustQuote (Swiper)                  # pause button, no autoplay with reduced motion
 BlogCard
-  <article role="link" tabindex={i}> + 3 links
+  <article> + 1 stretched title link
 Markdown
+  remark-table-scroll                    # tables in a focusable scroll region

Theme tokens (light only; dark unchanged):

-  --color-primary: oklch(62.7% 0.194 149);   # 2.5–3.1:1 as text / behind white
+  --color-primary: oklch(50% 0.16 149);      # ~5:1 both ways
+  --color-caution-ink / --color-danger-ink   # callout titles (were 1.55 / 2.4:1)
+  @custom-variant dark → [data-theme=dark]   # dark: followed the OS, not the toggle

Typography: real 700 weights for Hanuman / Atkinson / Cascadia (headings were faux-bold), Cascadia in code blocks, Hanuman article headings, text capped at ~70 chars/line.

Landing page tightening (from two design critiques)

 index.astro
   <Hero>                                # mobile: headline + buy buttons before the cover (Buy print y=870 -> 381 @390x844)
     <BuyButtons>
+      "Fourth Edition, October 2025 · Print and Kindle on Amazon · also from Packt"
   <ProblemStatement>
-    CTA band + buy buttons
   <WhatsInside> / <ActionPlan> / <WhyChoose>
-    13 / 170 / 54 / 732 restated        # numbers live in <Counters> only
   <Quotes>
-    3 quotes already in the carousel, CTA band + buy buttons
   <Reviews>
-    52 reviews at once
+    first 12 + "Show all 52 reviews" (all visible without JS)
   <FreeChapter form>
-    target="_blank" to Kit, no confirmation
+    fetch to Kit (CORS ok) -> "Check your inbox" in place; errors inline; native fallback
 Navigation
-  orange "Get the book" (desktop only)
+  green "Get the book" on desktop and mobile header
  • Every book number comes from src/lib/const.ts (was 660 vs 732 pages, "thousands" vs 30k+, SEO description 660+/150+).
  • Section headings unified (Hanuman); chapter rows use one chevron that flips; code card, screenshot crop, breadcrumb wrap, dark-mode secondary button, 404 aria-hidden polish.

Evidence

Measured against pnpm build && pnpm preview with Playwright + axe-core 4.10 (WCAG 2.0–2.2 A/AA + best-practice) and the Impeccable detector.

Check Before After
axe violations (5 pages × light/dark) 40+ rules failing, up to 204 nodes/page 0
Light-mode contrast failures up to 23 / page 0
Pages with horizontal scroll at 320px home + articles (532px wide @390) 0 (all 14 articles checked)
Hidden-but-focusable links 18 (duplicated nav) 0
Chapters operable by keyboard no yes
Article line length (median / max chars) 86 / 92 71 / 75
Homepage own JS ~470KB ~92KB (+479KB gtag, unchanged)
Homepage HTML 441KB ~330KB (52KB gz)
Detector findings, home @1280 38 0 (CLI + in-page overlay)
Homepage length (desktop / mobile) ~19.9k / ~38.3k px 17.1k / 29.4k px
First buy button on 390×844 y=870 (below fold) y=381
Buy button pairs on home 5 3
Design critique (Nielsen, /40) 26 25 (fresh reviewer, found new issues; P1s from that run fixed in 23b1699)

pnpm lint, pnpm typecheck, pnpm format:check pass.

Merge Danger

Door: two-way

Static site, no data or URL changes; revert restores the previous build.

Blast Radius: sitewide-visual

  • Light-mode brand green is visibly deeper everywhere (buttons, links, accents); dark-mode primary buttons now use dark text.
  • Hero "The Add js #1 Node.js Book" pill removed; gradient text and grid background removed.
  • Landing copy trimmed: ProblemStatement/Quotes CTA bands removed, WhatsInside/ActionPlan reworded without numbers, 3 duplicate quotes hidden from the wall, reviews collapsed behind "Show all".
  • Free chapter form now submits via fetch: tested against a mocked Kit (success / rejected / network fallback / empty); do one real signup after deploy.
  • Callout titles keep authored casing (previously auto-capitalized).
  • Content-collection cache: after pulling, run rm -rf node_modules/.astro locally if tables don't show the scroll wrapper (CI builds clean).
  • Not tested with real screen readers or physical touch devices (emulated viewports only).

🤖 Generated with Claude Code

- Load real 700 weights for Hanuman, Atkinson Hyperlegible and Cascadia Mono
  (headings were faux-bolded), with metric-matched fallbacks
- Preload only body 400 and heading 700
- Use Cascadia Mono in Expressive Code blocks
- Article prose: Hanuman headings with clearer scale, tighter leading,
  balanced/pretty wrapping, themed selection, underline offsets
- Admonitions: hairline border instead of thick left stripe
- Add PRODUCT.md with confirmed product context
- Light theme primary deepened to oklch(50% 0.16 149): ~5:1 as text on
  light surfaces and behind white button labels (was 2.5-3.1:1)
- New caution/danger ink tokens for callout titles (were 1.55-2.4:1)
- Footer credits and GitHub link raised above 4.5:1
- Callout titles keep authored casing (.env was rendered as .Env)
- Wrap markdown tables in a focusable, labelled horizontal scroll region
- Long inline code, link text and callout titles wrap instead of overflowing
- Single-column grids use minmax(0,1fr) so images cannot widen them (320px)
- Sidebar promo card is one large link instead of card + 20px inner link
- Mobile menu links are 44px tall
- Homepage rendered <Navigation /> twice (duplicate ids); render it once
- Hidden top bar reveals itself while focus is inside it; collapsed mobile
  menu is inert; toggle exposes aria-expanded/aria-controls and a label
- Skip-to-content link and a <main id=main-content> on every page
- Blog cards: drop positive tabindex and role=link; one stretched title
  link per card instead of three
- FAQ accordion: heading > button pattern with aria-expanded (was h5
  inside button)
- Footer column titles h3 -> h2; article share block is a <footer>;
  labelled breadcrumb, related-articles nav and numbered table regions
- Hero particles: CSS-only backdrop (build-time positions, transform-only
  drift) instead of framer-motion re-rendering 25 nodes on every scroll
- Counters: final values rendered in HTML (was 0 for crawlers/no-JS),
  count-up via a ~1KB IntersectionObserver script, tabular figures,
  semantic <dl>, '30k' instead of '30.0k'
- Star ratings: one masked element with an accessible label instead of
  five SVGs each (184 inline SVGs, ~118KB of HTML); hero shows 4.6 stars
- Remove framer-motion and the unused components/hooks

Homepage JS 947KB -> 571KB (479KB is gtag); HTML 441KB -> 322KB
- Hover lift/scale effects use motion-safe: (color/shadow feedback stays)
- Smooth scrolling only without a reduced-motion preference
- Testimonial carousel: no autoplay with reduced motion; otherwise a
  visible pause/play button (WCAG 2.2.2), pause on hover and on keyboard
  focus, Swiper A11y module for slide labels
Text blocks in .prose max out at 39rem (measured median 71 / max 75 chars,
was 86 / 92). Code blocks and tables keep the full column width.
- Remove the shimmering 'The #1 Node.js Book' pill above the hero h1
- 'hard' in the problem statement: solid text with a secondary underline
  instead of gradient-clipped text
- Remove the hairline grid overlay behind the Opinions section
Also add rel=noopener to external review links.
- dark: variant follows the theme toggle (data-theme) instead of only the
  OS preference; hero no longer goes dark when light is chosen
- Apply the saved theme in an inline head script (no wrong-theme flash)
- Primary button text uses primary-content: white-on-green failed AA in
  dark mode (~2.7:1)
- Replace nonexistent classes (primary-focus, primary-foreground,
  -sm:left-6 quote mark offsets)
- Trim legacy .content CSS to what the FAQ answers use (renamed
  .faq-answer); drop hard-coded #eee/#ccc/#fa6432 rules
- Chapter list: a real <button aria-expanded> in each title (stretched over
  the header) instead of a clickable <div>; chapters were mouse-only
- Chapter titles are h3 with snug leading (was leading-none when wrapping)
- Carousel dots: 24px hit area around the 8px dot (WCAG 2.5.8)
- Email placeholder and nav links raised above 4.5:1
- WhyChoose said 660 pages, SITE_DESCRIPTION said 660+/150+ (canonical: 732/170)
- 'Join thousands' -> READERS count; drop '+'/'more than' on exact counts
- Sidebar promo copy: drop 'become a PRO'
- Hero on phones: headline + buy buttons first, smaller cover after
  (Buy print at y=381 on 390x844, was 870). Desktop unchanged
- Mobile header shows 'Get the book' next to the menu toggle; drop the
  now-duplicate CTA inside the menu; short 'Node.js DP' brand under 380px
'Fourth Edition, October 2025 · Print and Kindle on Amazon · also from
Packt' (edition, date and links from const.ts). BuyButtons gains an
align prop for centered placements.
- Buy button pairs 5 -> 3 (hero, after the action plan, after reviews);
  drop the ProblemStatement and Quotes CTA bands
- Book numbers live in the counters; WhatsInside/ActionPlan/WhyChoose
  keep their own angle instead of restating 13/170/54/732
- Quote wall skips the three people already in the opening carousel
- Reviews: first 12 shown, 'Show all 52 reviews' reveals the rest in place
  (all reviews visible without JS; focus moves to the first new review)

Page height: desktop ~19.9k -> 17.1k px, mobile ~38.3k -> 29.4k px
- Chapters, Quotes, Reviews and WhyChoose section titles use the same
  Hanuman 4xl/5xl heading as every other section (were sans or 4xl/semi)
- Chapter rows: one chevron that flips when expanded instead of a '›'
  that suggested navigation
- WhyChoose code card: smaller code size so the visible lines fit
- GitHub Discussions screenshot: cropped edge fades into its own
  background instead of cutting titles mid-word
- Breadcrumb crumbs wrap as whole units; aria-current on the last one
- Dark mode: secondary 'Buy e-book' uses neutral so it no longer
  outweighs the primary green button
- 404: decorative ASCII layer is aria-hidden
- Header 'Get the book' (desktop + mobile) uses the primary green like
  every other buy button (was orange secondary)
- Free chapter form submits to Kit in place (Kit allows CORS, answers
  JSON) and shows 'Check your inbox' with the address; Kit errors show
  inline; network failure falls back to the native new-tab submit;
  works unchanged without JS
@lmammino lmammino changed the title Design audit fixes: accessibility, mobile, motion, performance, typography Design audit + landing page tightening: accessibility, mobile, performance, typography, conversion Nov 8, 2026
Spacer | dots | toggle grid so the dots sit on the page centre whether
or not the pause button is shown; dots and icon share a vertical centre.
Landing
- Hanuman 700 for every heading-like role: section h2 (line-height 1.1),
  card titles (WhyChoose now h3 like ActionPlan/WhatsInside), chapter and
  FAQ accordion titles, counters (was Cascadia Mono as decoration)
- ProblemStatement statement one step below the hero h1; its card is a
  ~42rem reading column (paragraphs ran ~128 chars/line)
- One lede style for section subtitles (1.375rem, /75, max 40rem)
- Pull quote leading-snug; no faux italic on Hanuman quote marks;
  attributions in sans
- Small buttons use the 14px label size (nav CTA was 12px)

Articles
- Lede distinct from body (1.375rem) and aligned to the 39rem text column
- 17px body on phones; 15px code on desktop (was 14px next to 20px body)
- Lighter inline-code chip; no chip inside headings; callout body 0.9em

System
- Only 400/700 are loaded: font-medium/semibold/extrabold classes and
  prose strong/a weights now say what actually renders
- Preload the Hanuman variable font (the 700-only filter stopped matching)
- Compact nav (brand, Get the book, menu with theme toggle) up to lg; full
  link bar from 1024px (it collided at 768px); phones previously had no
  theme toggle at all
Landing
- Two-step section rhythm: funnel stages py-16/lg:py-24, tight joins
  py-10/lg:py-12 for counters + trust quote, WhatsInside -> Chapters and
  Quotes -> Reviews (one proof zone). Removes mt-16 + sm:py-32 stacking
  that left 192-320px voids
- Every section uses the max-w-7xl frame and px-4/sm:px-6/lg:px-8 gutter:
  left-aligned content starts on one edge (was 104/112/168)
- FAQ: questions take the wider column; the photo stays in view (sticky)
- Bigger hit areas: review source links, Packt link, footer links,
  article share icons

Blog
- Sidebar from lg instead of md: at 768px articles get 720px (was 432)
  and cards 344px (was 212)
- Below lg the book promo sits inline (after the article; after the
  first row of cards on the index) instead of the bottom of the page.
  BookPromo supports multiple copies with cta_position sidebar/inline
- Article meta grouped under the author; ToC matches the text measure;
  tablet text measure ~72 chars at 17px
A paragraph holding only an image (or a linked image) uses the full
article column (48rem desktop, 720px at 768) instead of the 39rem text
measure. Small images keep their natural size.
…ss burst

- The free chapter section becomes the page's one dark band (ink in both
  themes), with the book cover's flowing line ribbon redrawn as build-time
  SVG behind the form and the Chapter 6 photo. A few lines carry 'chunks'
  streaming along them (Chapter 6 is Coding with Streams); the flow runs
  only while on screen and never with reduced motion
- Solid card instead of translucent blur; FREE in the cover amber
- On a successful signup: the stream flushes brighter, a one-shot canvas
  burst of stream chunks pops from the button (self-removing, no
  dependency), and the confirmation rises in with a self-drawing mail
  icon and a chapter6.pipe(yourInbox) wink. Reduced motion: no burst or
  flow, the confirmation just fades in
The chapter photo duplicated the card heading and hid most of the cover
ribbon. Drop it and center the form card (max-w-2xl) in the band: the
ribbon runs behind it, visible on both sides on wide screens and flowing
out beneath it on phones. The image asset stays in the repo, unused.
Each blog post now gets its own 1200x630 Open Graph image, built at
/og/<slug>.png with Satori and sharp, instead of the site-wide book photo.
The card shows the title, description and byline next to the book cover,
so links read as the article (even as a small LinkedIn thumbnail).

The layout also takes an ogImageAlt prop so share images get a matching
description instead of always saying "book cover".
@lmammino
lmammino merged commit 14eb466 into main Nov 8, 2026
1 check passed
@lmammino
lmammino deleted the fix/design-audit branch November 8, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant