Skip to content

fix(landing): keep the hero CTA inside the first fold on laptop viewports - #2732

Open
0xkkonrad wants to merge 2 commits into
devfrom
fix/lp-hero-cta-fold
Open

fix(landing): keep the hero CTA inside the first fold on laptop viewports#2732
0xkkonrad wants to merge 2 commits into
devfrom
fix/lp-hero-cta-fold

Conversation

@0xkkonrad

@0xkkonrad 0xkkonrad commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

What

Slava flagged on Discord that the homepage shows no CTA without scrolling on his MacBook (Notion TASK-21626). Measured on prod today — it's not one machine, it's every common laptop:

Viewport (inner) Device SIGN UP on prod
1280×689 MacBook 13" below fold
1366×657 Windows laptop below fold
1536×753 Windows @125% below fold
1440×760 MacBook Air 13" + bookmarks bar 27% visible
1440×789 MacBook Air 13" 71% visible
1920×969 FHD desktop fits, 2px to spare
375×553 iPhone SE 56% visible
390×664 / 360×700 phones fits

Why

hero.tsx: the headline artwork is md:w-[50%] with no height cap, so its height tracks viewport width (412px at 1280w → 623px at 1920w), while the stack under it (mt-18 + h2 + tagline + md:mt-12 + 66px button) is 344px of fixed height. Nothing in the fold responds to viewport height.

Change (4 classes)

  • artwork: + max-h-[calc(100svh-23rem)] — 23rem = fixed stack below it + 3rem slack
  • h2: mt-18mt-18 md:mt-12
  • CTA container: mt-8 md:mt-12mt-8
  • mascot (follow-up commit): + md:max-h-[min(40vh,calc(100svh-28rem))] — keeps the peanut ~0.7× the artwork on short laptops so "LOCAL FEEL" stays legible; ≥789px-tall viewports unchanged. Note for feat(mascot): move the mascot to Lottie and drop 6 MB of rasters #2728: that PR replaces this <Image> with a h-[40vh] host div — carry the cap over as md:h-[min(40vh,calc(100svh-28rem))] on the host when resolving the conflict.

Result: CTA bottom lands ~64px above the fold at every desktop viewport ≥ ~600px tall; tall screens barely change (FHD artwork 623 → 601px). Mobile only changes on SE-class heights (cap doesn't bite at 664+). Mascot (max-h-[40vh], anchored to the h2 by JS) and stars untouched — deliberately stays clear of #2728's mascot rewrite.

Verify

Vercel preview at 1366×657, 1280×689, 1440×789, 1536×753, 1920×969, 390×664, 375×553 — SIGN UP fully visible without scrolling on all; compare against peanut.me at the same sizes.

…orts

The hero artwork was sized purely by viewport width (50vw, no height cap), and
the stack under it (mt-18 + tagline + mt-12 + button) is 344px of fixed height.
On 16:9/16:10 laptops the SIGN UP button ends up at or below the fold:
1366x657 and 1280x689 -> below fold, 1440x789 (MacBook Air 13") -> clipped,
1536x753 -> below fold. Even 1920x969 fits with 2px to spare.

Cap the artwork at 100svh minus the fixed stack (+3rem slack) and tighten the
two desktop gaps (h2 mt-18 -> md:mt-12, CTA md:mt-12 -> mt-8). The button is now
inside the fold at every measured viewport; tall screens are near-unchanged.

Reported by Slava (Discord), Notion TASK-21626.
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
peanut-wallet Ready Ready Preview Aug 18, 2026 3:56pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 90d68c9c-8a18-46f8-8ec0-3a0af7d2e625

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 7167.28 → 7167.52 (+0.24)
Findings: 0 net (+6 new, -6 resolved)

🆕 New findings (6)

  • high hotspot — src/components/LandingPage/hero.tsx — 34 commits, +260/-169 lines since 6 months ago
  • medium high-mdd — src/components/LandingPage/hero.tsx:116 — Hero: MDD 90.3 (uses across many lines from declarations)
  • low structural-dup — app/quests/[questId]/page.tsx:116 — 15 duplicate lines / 141 tokens with components/LandingPage/hero.tsx:226
  • low structural-dup — components/LandingPage/hero.tsx:191 — 9 duplicate lines / 57 tokens with components/LandingPage/hero.tsx:236
  • low structural-dup — app/quests/[questId]/page.tsx:125 — 8 duplicate lines / 67 tokens with components/LandingPage/hero.tsx:189
  • low structural-dup — app/quests/[questId]/page.tsx:117 — 7 duplicate lines / 63 tokens with components/LandingPage/hero.tsx:182

✅ Resolved (6)

  • src/components/LandingPage/hero.tsx — 32 commits, +255/-165 lines since 6 months ago
  • src/components/LandingPage/hero.tsx:116 — Hero: MDD 89.3 (uses across many lines from declarations)
  • app/quests/[questId]/page.tsx:116 — 15 duplicate lines / 141 tokens with components/LandingPage/hero.tsx:225
  • components/LandingPage/hero.tsx:190 — 9 duplicate lines / 57 tokens with components/LandingPage/hero.tsx:235
  • app/quests/[questId]/page.tsx:125 — 8 duplicate lines / 67 tokens with components/LandingPage/hero.tsx:188
  • app/quests/[questId]/page.tsx:117 — 7 duplicate lines / 63 tokens with components/LandingPage/hero.tsx:181

@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 3172 ran, 0 failed, 0 skipped, 53.2s

📊 Coverage (unit)

metric %
statements 67.4%
branches 52.3%
functions 57.9%
lines 68.2%
⏱ 10 slowest test cases
time test
3.5s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
0.9s src/utils/__tests__/demo-api.test.ts › isDemoMode() is false when not running under Capacitor
0.5s src/components/Marketing/__tests__/html-lang.test.tsx › keeps the page locale when AppIntlProvider is mounted above it
0.3s src/app/actions/__tests__/api-headers.test.ts › should include Content-Type in validateInviteCode
0.3s src/utils/__tests__/sentry.utils.test.ts › defaults to the client budget under a browser global
0.3s src/app/(mobile-ui)/withdraw/__tests__/withdraw-states.test.tsx › Bank withdrawal keeps the $1 minimum for sub-$1 amounts
0.3s src/utils/__tests__/auth-token.test.ts › ignores the guarded marker and falls back to the plain token
0.3s src/hooks/__tests__/useCrispTokenId.test.ts › retries then stays undefined when the endpoint keeps failing (no fallback token)
0.3s src/utils/__tests__/sentry.utils.test.ts › still lets a per-call timeoutMs win over the default
0.3s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › every sticker stays within canvas at any count
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

With the artwork now capped by viewport height, a 40vh mascot on a 1366x657
laptop was almost as tall as the artwork and hid "LOCAL FEEL". Cap it at
100svh-28rem too (md+ only) so it keeps the ~0.7x artwork proportion of the
1440x789 layout; viewports >= 789px tall are unchanged.
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